Commit 358cd9af authored by Juergen Gross's avatar Juergen Gross Committed by Christoph Hellwig

xen/pci: add flag for PCI passthrough being possible

When running as a Xen PV guests passed through PCI devices only have a
chance to work if the Xen supplied memory map has some PCI space
reserved.

Add a flag xen_pv_pci_possible which will be set in early boot in case
the memory map has at least one area with the type E820_TYPE_RESERVED.
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 5d0c230f
...@@ -44,6 +44,9 @@ struct xen_memory_region xen_extra_mem[XEN_EXTRA_MEM_MAX_REGIONS] __initdata; ...@@ -44,6 +44,9 @@ struct xen_memory_region xen_extra_mem[XEN_EXTRA_MEM_MAX_REGIONS] __initdata;
/* Number of pages released from the initial allocation. */ /* Number of pages released from the initial allocation. */
unsigned long xen_released_pages; unsigned long xen_released_pages;
/* Memory map would allow PCI passthrough. */
bool xen_pv_pci_possible;
/* E820 map used during setting up memory. */ /* E820 map used during setting up memory. */
static struct e820_table xen_e820_table __initdata; static struct e820_table xen_e820_table __initdata;
...@@ -814,6 +817,9 @@ char * __init xen_memory_setup(void) ...@@ -814,6 +817,9 @@ char * __init xen_memory_setup(void)
chunk_size = size; chunk_size = size;
type = xen_e820_table.entries[i].type; type = xen_e820_table.entries[i].type;
if (type == E820_TYPE_RESERVED)
xen_pv_pci_possible = true;
if (type == E820_TYPE_RAM) { if (type == E820_TYPE_RAM) {
if (addr < mem_end) { if (addr < mem_end) {
chunk_size = min(size, mem_end - addr); chunk_size = min(size, mem_end - addr);
......
...@@ -29,6 +29,12 @@ extern bool xen_pvh; ...@@ -29,6 +29,12 @@ extern bool xen_pvh;
extern uint32_t xen_start_flags; extern uint32_t xen_start_flags;
#ifdef CONFIG_XEN_PV
extern bool xen_pv_pci_possible;
#else
#define xen_pv_pci_possible 0
#endif
#include <xen/interface/hvm/start_info.h> #include <xen/interface/hvm/start_info.h>
extern struct hvm_start_info pvh_start_info; extern struct hvm_start_info pvh_start_info;
void xen_prepare_pvh(void); void xen_prepare_pvh(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment