This patch mainly to address the problem of windows 2008 R2 DataCenter can not show all processors within Task Manager when we do hot-add cpus.
Also i found in code, there are places which use magic-number, it is better to use specified macros instead.
zhanghailiang (2): acpi: use specified macro instead of magic-number acpi: Set FORCE_APIC_CLUSTER_MODEL bit of FADT flags
src/fw/acpi.c | 18 ++++++++++++------ src/std/acpi.h | 25 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-)
Instead of magic numbers, use specified macros for FADT Fixed Feature Flags.
Signed-off-by: zhanghailiang zhang.zhanghailiang@huawei.com --- src/fw/acpi.c | 16 ++++++++++------ src/std/acpi.h | 25 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/src/fw/acpi.c b/src/fw/acpi.c index 47e4c07..482e2f9 100644 --- a/src/fw/acpi.c +++ b/src/fw/acpi.c @@ -59,9 +59,11 @@ static void piix4_fadt_setup(struct pci_device *pci, void *arg) fadt->gpe0_blk_len = PIIX_GPE0_BLK_LEN; fadt->plvl2_lat = cpu_to_le16(0xfff); // C2 state not supported fadt->plvl3_lat = cpu_to_le16(0xfff); // C3 state not supported - /* WBINVD + PROC_C1 + SLP_BUTTON + RTC_S4 + USE_PLATFORM_CLOCK */ - fadt->flags = cpu_to_le32((1 << 0) | (1 << 2) | (1 << 5) | (1 << 7) | - (1 << 15)); + fadt->flags = cpu_to_le32(ACPI_FADT_F_WBINVD | + ACPI_FADT_F_PROC_C1 | + ACPI_FADT_F_SLP_BUTTON | + ACPI_FADT_F_RTC_S4 | + ACPI_FADT_F_USE_PLATFORM_CLOCK); }
/* PCI_VENDOR_ID_INTEL && PCI_DEVICE_ID_INTEL_ICH9_LPC */ @@ -85,9 +87,11 @@ static void ich9_lpc_fadt_setup(struct pci_device *dev, void *arg) fadt->gpe0_blk_len = ICH9_PMIO_GPE0_BLK_LEN; fadt->plvl2_lat = cpu_to_le16(0xfff); // C2 state not supported fadt->plvl3_lat = cpu_to_le16(0xfff); // C3 state not supported - /* WBINVD + PROC_C1 + SLP_BUTTON + RTC_S4 + USE_PLATFORM_CLOCK */ - fadt->flags = cpu_to_le32((1 << 0) | (1 << 2) | (1 << 5) | (1 << 7) | - (1 << 15)); + fadt->flags = cpu_to_le32(ACPI_FADT_F_WBINVD | + ACPI_FADT_F_PROC_C1 | + ACPI_FADT_F_SLP_BUTTON | + ACPI_FADT_F_RTC_S4 | + ACPI_FADT_F_USE_PLATFORM_CLOCK); }
static const struct pci_device_id fadt_init_tbl[] = { diff --git a/src/std/acpi.h b/src/std/acpi.h index fad6ac2..e0d9516 100644 --- a/src/std/acpi.h +++ b/src/std/acpi.h @@ -42,6 +42,31 @@ struct rsdp_descriptor { /* Root System Descriptor Pointer */ u8 asl_compiler_id [4]; /* ASL compiler vendor ID */ \ u32 asl_compiler_revision; /* ASL compiler revision number */
+/* + * Fixed ACPI Description Table Fixed Feature Flags + */ +#define ACPI_FADT_F_WBINVD (1 << 0) +#define ACPI_FADT_F_WBINVD_FLUSH (1 << 1) +#define ACPI_FADT_F_PROC_C1 (1 << 2) +#define ACPI_FADT_F_P_LVL2_UP (1 << 3) +#define ACPI_FADT_F_PWR_BUTTON (1 << 4) +#define ACPI_FADT_F_SLP_BUTTON (1 << 5) +#define ACPI_FADT_F_FIX_RTC (1 << 6) +#define ACPI_FADT_F_RTC_S4 (1 << 7) +#define ACPI_FADT_F_TMR_VAL_EXT (1 << 8) +#define ACPI_FADT_F_DCK_CAP (1 << 9) +#define ACPI_FADT_F_RESET_REG_SUP (1 << 10) +#define ACPI_FADT_F_SEALED_CASE (1 << 11) +#define ACPI_FADT_F_HEADLESS (1 << 12) +#define ACPI_FADT_F_CPU_SW_SLP (1 << 13) +#define ACPI_FADT_F_PCI_EXP_WAK (1 << 14) +#define ACPI_FADT_F_USE_PLATFORM_CLOCK (1 << 15) +#define ACPI_FADT_F_S4_RTC_STS_VALID (1 << 16) +#define ACPI_FADT_F_REMOTE_POWER_ON_CAPABLE (1 << 17) +#define ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL (1 << 18) +#define ACPI_FADT_F_FORCE_APIC_PHYSICAL_DESTINATION_MODE (1 << 19) +#define ACPI_FADT_F_HW_REDUCED_ACPI (1 << 20) +#define ACPI_FADT_F_LOW_POWER_S0_IDLE_CAPABLE (1 << 21)
/* * ACPI 1.0 Fixed ACPI Description Table (FADT)
On Thu, Aug 21, 2014 at 05:23:40PM +0800, zhanghailiang wrote:
Instead of magic numbers, use specified macros for FADT Fixed Feature Flags.
FYI, I committed this patch (patch 1 of 2).
-Kevin
If we start Windows 2008 R2 DataCenter with number of cpu less than 8, The system will use APIC Flat Logical destination mode as default configuration, Which has an upper limit of 8 CPUs.
The fault is that VM can not show all processors within Task Manager if we hot-add cpus when the number of cpus in VM extends the limit of 8.
If we use cluster destination model, the problem will be solved.
Signed-off-by: zhanghailiang zhang.zhanghailiang@huawei.com --- src/fw/acpi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/fw/acpi.c b/src/fw/acpi.c index 482e2f9..345227f 100644 --- a/src/fw/acpi.c +++ b/src/fw/acpi.c @@ -63,7 +63,8 @@ static void piix4_fadt_setup(struct pci_device *pci, void *arg) ACPI_FADT_F_PROC_C1 | ACPI_FADT_F_SLP_BUTTON | ACPI_FADT_F_RTC_S4 | - ACPI_FADT_F_USE_PLATFORM_CLOCK); + ACPI_FADT_F_USE_PLATFORM_CLOCK | + ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL); }
/* PCI_VENDOR_ID_INTEL && PCI_DEVICE_ID_INTEL_ICH9_LPC */ @@ -91,7 +92,8 @@ static void ich9_lpc_fadt_setup(struct pci_device *dev, void *arg) ACPI_FADT_F_PROC_C1 | ACPI_FADT_F_SLP_BUTTON | ACPI_FADT_F_RTC_S4 | - ACPI_FADT_F_USE_PLATFORM_CLOCK); + ACPI_FADT_F_USE_PLATFORM_CLOCK | + ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL); }
static const struct pci_device_id fadt_init_tbl[] = {
On Thu, Aug 21, 2014 at 05:23:41PM +0800, zhanghailiang wrote:
If we start Windows 2008 R2 DataCenter with number of cpu less than 8, The system will use APIC Flat Logical destination mode as default configuration, Which has an upper limit of 8 CPUs.
The fault is that VM can not show all processors within Task Manager if we hot-add cpus when the number of cpus in VM extends the limit of 8.
If we use cluster destination model, the problem will be solved.
Thanks. However, recent versions of QEMU provide the ACPI tables to SeaBIOS, and SeaBIOS no longer uses its ACPI generation code on these QEMU versions. Instead of updating SeaBIOS, you should send an equivalent patch to QEMU.
The first patch looks good though.
Cheers, -Kevin
On 2014/8/21 21:42, Kevin O'Connor wrote:
On Thu, Aug 21, 2014 at 05:23:41PM +0800, zhanghailiang wrote:
If we start Windows 2008 R2 DataCenter with number of cpu less than 8, The system will use APIC Flat Logical destination mode as default configuration, Which has an upper limit of 8 CPUs.
The fault is that VM can not show all processors within Task Manager if we hot-add cpus when the number of cpus in VM extends the limit of 8.
If we use cluster destination model, the problem will be solved.
Thanks. However, recent versions of QEMU provide the ACPI tables to SeaBIOS, and SeaBIOS no longer uses its ACPI generation code on these QEMU versions. Instead of updating SeaBIOS, you should send an equivalent patch to QEMU.
Hi,
I have sent such a patch to qemu community.:)
Thanks, zhanghailiang
The first patch looks good though.
Cheers, -Kevin