mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-17 23:58:25 +00:00
hv: Support HV console for multiple VMs - ACRN partition mode
ACRN in partition mode provides vUART for all VMs. This patch adds support to add console redirection for multiple VMs. Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
This commit is contained in:
parent
b8c1fd6104
commit
b17de6a7e6
@ -723,6 +723,13 @@ static int shell_to_sos_console(__unused int argc, __unused char **argv)
|
|||||||
struct vm *vm;
|
struct vm *vm;
|
||||||
struct vuart *vuart;
|
struct vuart *vuart;
|
||||||
|
|
||||||
|
#ifdef CONFIG_PARTITION_MODE
|
||||||
|
if (argc == 2U) {
|
||||||
|
guest_no = atoi(argv[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
vuart_vmid = guest_no;
|
||||||
|
#endif
|
||||||
/* Get the virtual device node */
|
/* Get the virtual device node */
|
||||||
vm = get_vm_from_vmid(guest_no);
|
vm = get_vm_from_vmid(guest_no);
|
||||||
if (vm == NULL) {
|
if (vm == NULL) {
|
||||||
|
@ -43,6 +43,10 @@
|
|||||||
|
|
||||||
#define vm_vuart(vm) (vm->vuart)
|
#define vm_vuart(vm) (vm->vuart)
|
||||||
|
|
||||||
|
#ifdef CONFIG_PARTITION_MODE
|
||||||
|
int8_t vuart_vmid = - 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
static void fifo_reset(struct fifo *fifo)
|
static void fifo_reset(struct fifo *fifo)
|
||||||
{
|
{
|
||||||
fifo->rindex = 0U;
|
fifo->rindex = 0U;
|
||||||
@ -349,7 +353,17 @@ void vuart_console_rx_chars(struct vuart *vu)
|
|||||||
|
|
||||||
struct vuart *vuart_console_active(void)
|
struct vuart *vuart_console_active(void)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_PARTITION_MODE
|
||||||
|
struct vm *vm;
|
||||||
|
|
||||||
|
if (vuart_vmid == -1) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
vm = get_vm_from_vmid(vuart_vmid);
|
||||||
|
#else
|
||||||
struct vm *vm = get_vm_from_vmid(0U);
|
struct vm *vm = get_vm_from_vmid(0U);
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((vm != NULL) && (vm->vuart != NULL)) {
|
if ((vm != NULL) && (vm->vuart != NULL)) {
|
||||||
struct vuart *vu = vm->vuart;
|
struct vuart *vu = vm->vuart;
|
||||||
|
@ -59,7 +59,9 @@ struct vuart {
|
|||||||
struct vm *vm;
|
struct vm *vm;
|
||||||
spinlock_t lock; /* protects all softc elements */
|
spinlock_t lock; /* protects all softc elements */
|
||||||
};
|
};
|
||||||
|
#ifdef CONFIG_PARTITION_MODE
|
||||||
|
extern int8_t vuart_vmid;
|
||||||
|
#endif
|
||||||
#ifdef HV_DEBUG
|
#ifdef HV_DEBUG
|
||||||
void *vuart_init(struct vm *vm);
|
void *vuart_init(struct vm *vm);
|
||||||
struct vuart *vuart_console_active(void);
|
struct vuart *vuart_console_active(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user