[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 02/10] acpi: Define ACPI IO registers for PVH guests
ACPI hotplug-related IO accesses (to GPE0 block) are handled by qemu for HVM guests. Since PVH guests don't have qemu these accesses will need to be procesed by the hypervisor. Because ACPI event model expects pm1a block to be present we need to have the hypervisor emulate it as well. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> --- tools/libacpi/static_tables.c | 28 +++++++++++----------------- xen/include/asm-x86/hvm/domain.h | 6 ++++++ xen/include/public/hvm/ioreq.h | 3 +++ 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/tools/libacpi/static_tables.c b/tools/libacpi/static_tables.c index 617bf68..413abcc 100644 --- a/tools/libacpi/static_tables.c +++ b/tools/libacpi/static_tables.c @@ -20,6 +20,8 @@ * Firmware ACPI Control Structure (FACS). */ +#define ACPI_REG_BIT_OFFSET 0 + struct acpi_20_facs Facs = { .signature = ACPI_2_0_FACS_SIGNATURE, .length = sizeof(struct acpi_20_facs), @@ -30,14 +32,6 @@ struct acpi_20_facs Facs = { /* * Fixed ACPI Description Table (FADT). */ - -#define ACPI_PM1A_EVT_BLK_BIT_WIDTH 0x20 -#define ACPI_PM1A_EVT_BLK_BIT_OFFSET 0x00 -#define ACPI_PM1A_CNT_BLK_BIT_WIDTH 0x10 -#define ACPI_PM1A_CNT_BLK_BIT_OFFSET 0x00 -#define ACPI_PM_TMR_BLK_BIT_WIDTH 0x20 -#define ACPI_PM_TMR_BLK_BIT_OFFSET 0x00 - struct acpi_20_fadt Fadt = { .header = { .signature = ACPI_2_0_FADT_SIGNATURE, @@ -56,9 +50,9 @@ struct acpi_20_fadt Fadt = { .pm1a_cnt_blk = ACPI_PM1A_CNT_BLK_ADDRESS_V1, .pm_tmr_blk = ACPI_PM_TMR_BLK_ADDRESS_V1, .gpe0_blk = ACPI_GPE0_BLK_ADDRESS_V1, - .pm1_evt_len = ACPI_PM1A_EVT_BLK_BIT_WIDTH / 8, - .pm1_cnt_len = ACPI_PM1A_CNT_BLK_BIT_WIDTH / 8, - .pm_tmr_len = ACPI_PM_TMR_BLK_BIT_WIDTH / 8, + .pm1_evt_len = ACPI_PM1A_EVT_BLK_LEN, + .pm1_cnt_len = ACPI_PM1A_CNT_BLK_LEN, + .pm_tmr_len = ACPI_PM_TMR_BLK_LEN, .gpe0_blk_len = ACPI_GPE0_BLK_LEN_V1, .p_lvl2_lat = 0x0fff, /* >100, means we do not support C2 state */ @@ -79,22 +73,22 @@ struct acpi_20_fadt Fadt = { .x_pm1a_evt_blk = { .address_space_id = ACPI_SYSTEM_IO, - .register_bit_width = ACPI_PM1A_EVT_BLK_BIT_WIDTH, - .register_bit_offset = ACPI_PM1A_EVT_BLK_BIT_OFFSET, + .register_bit_width = ACPI_PM1A_EVT_BLK_LEN * 8, + .register_bit_offset = ACPI_REG_BIT_OFFSET, .address = ACPI_PM1A_EVT_BLK_ADDRESS_V1, }, .x_pm1a_cnt_blk = { .address_space_id = ACPI_SYSTEM_IO, - .register_bit_width = ACPI_PM1A_CNT_BLK_BIT_WIDTH, - .register_bit_offset = ACPI_PM1A_CNT_BLK_BIT_OFFSET, + .register_bit_width = ACPI_PM1A_CNT_BLK_LEN * 8, + .register_bit_offset = ACPI_REG_BIT_OFFSET, .address = ACPI_PM1A_CNT_BLK_ADDRESS_V1, }, .x_pm_tmr_blk = { .address_space_id = ACPI_SYSTEM_IO, - .register_bit_width = ACPI_PM_TMR_BLK_BIT_WIDTH, - .register_bit_offset = ACPI_PM_TMR_BLK_BIT_OFFSET, + .register_bit_width = ACPI_PM_TMR_BLK_LEN * 8, + .register_bit_offset = ACPI_REG_BIT_OFFSET, .address = ACPI_PM_TMR_BLK_ADDRESS_V1, } }; diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h index f34d784..f492a2b 100644 --- a/xen/include/asm-x86/hvm/domain.h +++ b/xen/include/asm-x86/hvm/domain.h @@ -87,6 +87,12 @@ struct hvm_domain { } ioreq_server; struct hvm_ioreq_server *default_ioreq_server; + /* PVH guests */ + struct { + uint8_t pm1a[ACPI_PM1A_EVT_BLK_LEN]; + uint8_t gpe[ACPI_GPE0_BLK_LEN_V1]; + } acpi_io; + /* Cached CF8 for guest PCI config cycles */ uint32_t pci_cf8; diff --git a/xen/include/public/hvm/ioreq.h b/xen/include/public/hvm/ioreq.h index 2e5809b..c36dd0f 100644 --- a/xen/include/public/hvm/ioreq.h +++ b/xen/include/public/hvm/ioreq.h @@ -124,6 +124,9 @@ typedef struct buffered_iopage buffered_iopage_t; #define ACPI_GPE0_BLK_ADDRESS ACPI_GPE0_BLK_ADDRESS_V0 #define ACPI_GPE0_BLK_LEN ACPI_GPE0_BLK_LEN_V0 +#define ACPI_PM1A_EVT_BLK_LEN 0x04 +#define ACPI_PM1A_CNT_BLK_LEN 0x02 +#define ACPI_PM_TMR_BLK_LEN 0x04 #endif /* _IOREQ_H_ */ -- 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |