Skip to content

Commit fde0bcc

Browse files
mgcaowenlingz
authored andcommitted
HV: disable vuart when dbg uart is disabled
vuart it used for SOS to output log to HV console, so if dbg uart is disabled, it need be disabled too: just unregister its PIO. Tracked-On: 2170 Signed-off-by: Minggui Cao <minggui.cao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 860c444 commit fde0bcc

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

hypervisor/arch/x86/guest/vm.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,16 @@ int32_t create_vm(struct vm_description *vm_desc, struct acrn_vm **rtn_vm)
149149
register_pm1ab_handler(vm);
150150
}
151151

152-
/* Create virtual uart */
153-
vuart_init(vm);
152+
/* Create virtual uart; just when uart enabled, vuart can work */
153+
if (is_dbg_uart_enabled()) {
154+
vuart_init(vm);
155+
}
154156
}
155157
vpic_init(vm);
156158

157159
#ifdef CONFIG_PARTITION_MODE
158-
/* Create virtual uart */
159-
if (vm_desc->vm_vuart) {
160+
/* Create virtual uart; just when uart enabled, vuart can work */
161+
if (vm_desc->vm_vuart && is_dbg_uart_enabled()) {
160162
vuart_init(vm);
161163
}
162164
vrtc_init(vm);

hypervisor/debug/uart16550.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,8 @@ bool is_pci_dbg_uart(union pci_bdf bdf_value)
235235

236236
return ret;
237237
}
238+
239+
bool is_dbg_uart_enabled(void)
240+
{
241+
return uart_enabled;
242+
}

hypervisor/include/debug/console.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ char console_getc(void);
3838
void console_setup_timer(void);
3939
void uart16550_set_property(bool enabled, bool port_mapped, uint64_t base_addr);
4040
bool is_pci_dbg_uart(union pci_bdf bdf_value);
41+
bool is_dbg_uart_enabled(void);
4142

4243
void shell_init(void);
4344
void shell_kick(void);

hypervisor/release/console.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ void resume_console(void) {}
2626

2727
void uart16550_set_property(__unused bool enabled, __unused bool port_mapped, __unused uint64_t base_addr) {}
2828
bool is_pci_dbg_uart(__unused union pci_bdf bdf_value) { return false; }
29+
bool is_dbg_uart_enabled(void) { return false; }
2930

3031
void shell_init(void) {}
3132
void shell_kick(void) {}

0 commit comments

Comments
 (0)