HV: find and hide serial PCI dev from service OS

serial PCI device is just used for HV/SOS output debug information;
because it is used in hypervisor layer, SOS should not touch it.
so need to check and hide it from SOS.

Tracked-On: #1923
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Minggui Cao 2018-11-29 14:59:10 +08:00 committed by wenlingz
parent 8d08ec30b7
commit db4254e2df
4 changed files with 21 additions and 0 deletions

View File

@ -182,3 +182,16 @@ void uart16550_set_property(bool enabled, bool port_mapped, uint64_t base_addr)
serial_port_mapped = port_mapped; serial_port_mapped = port_mapped;
uart_base_address = base_addr; uart_base_address = base_addr;
} }
bool is_pci_dbg_uart(union pci_bdf bdf_value)
{
bool ret = false;
if (uart_enabled && !serial_port_mapped) {
if (bdf_value.value == serial_pci_bdf.value) {
ret = true;
}
}
return ret;
}

View File

@ -155,6 +155,12 @@ void pci_scan_bus(pci_enumeration_cb cb_func, void *cb_data)
continue; continue;
} }
/* if it is debug uart, hide it from SOS */
if (is_pci_dbg_uart(pbdf)) {
pr_info("hide pci uart dev: (%x:%x:%x)", pbdf.bits.b, pbdf.bits.d, pbdf.bits.f);
continue;
}
if (cb_func != NULL) { if (cb_func != NULL) {
cb_func(pbdf.value, cb_data); cb_func(pbdf.value, cb_data);
} }

View File

@ -37,6 +37,7 @@ char console_getc(void);
void console_setup_timer(void); void console_setup_timer(void);
void uart16550_set_property(bool enabled, bool port_mapped, uint64_t base_addr); void uart16550_set_property(bool enabled, bool port_mapped, uint64_t base_addr);
bool is_pci_dbg_uart(union pci_bdf bdf_value);
void shell_init(void); void shell_init(void);
void shell_kick(void); void shell_kick(void);

View File

@ -25,6 +25,7 @@ void suspend_console(void) {}
void resume_console(void) {} void resume_console(void) {}
void uart16550_set_property(__unused bool enabled, __unused bool port_mapped, __unused uint64_t base_addr) {} void uart16550_set_property(__unused bool enabled, __unused bool port_mapped, __unused uint64_t base_addr) {}
bool is_pci_dbg_uart(__unused union pci_bdf bdf_value) { return false; }
void shell_init(void) {} void shell_init(void) {}
void shell_kick(void) {} void shell_kick(void) {}