Skip to contentSkip to conversation

PCMachineState: introduce acpi_build_enabled field

PATCH In review Wei Liu 4 participants 12 messages Nov 1, 2016 – Nov 3, 2016

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH v2 1/1 PCMachineState: introduce acpi_build_enabled field

Introduce this field to control whether ACPI build is enabled by a particular machine or accelerator.

It defaults to true if the machine itself supports ACPI build. Xen accelerator will disable it because Xen is in charge of building ACPI tables for the guest.

---
Cc: Igor Mammedov <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: Anthony PERARD <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Sander Eikelenboom <[email protected]>

v2:
1. drop acpi-build property
2. set acpi_build_enabled to acpi_has_build
3. replace acpi_has_build check in acpi_build()

---
 hw/i386/acpi-build.c | 2 +-
 hw/i386/pc.c         | 2 ++
 include/hw/i386/pc.h | 2 ++
 xen-common.c         | 6 ++++++
 4 files changed, 11 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +1 -1
index 5cd1da9..13cbbde 100644
@@ -2953,7 +2953,7 @@ void acpi_setup(void)
         return;
     }
 
-    if (!pcmc->has_acpi_build) {
+    if (!pcms->acpi_build_enabled) {
         ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
         return;
     }
hw/i386/pc.c +2 -0
index f56ea0f..fbd9aed 100644
@@ -2159,6 +2159,8 @@ static void pc_machine_initfn(Object *obj)
     pcms->vmport = ON_OFF_AUTO_AUTO;
     /* nvdimm is disabled on default. */
     pcms->acpi_nvdimm_state.is_enabled = false;
+    /* acpi build is enabled by default if machine supports it */
+    pcms->acpi_build_enabled = PC_MACHINE_GET_CLASS(pcms)->has_acpi_build;
 }
 
 static void pc_machine_reset(void)
include/hw/i386/pc.h +2 -0
index 98dc772..8eb517f 100644
@@ -62,6 +62,8 @@ struct PCMachineState {
 
     AcpiNVDIMMState acpi_nvdimm_state;
 
+    bool acpi_build_enabled;
+
     /* RAM information (sizes, addresses, configuration): */
     ram_addr_t below_4g_mem_size, above_4g_mem_size;
 
xen-common.c +6 -0
index 9099760..bacf962 100644
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/i386/pc.h"
 #include "hw/xen/xen_backend.h"
 #include "qmp-commands.h"
 #include "sysemu/char.h"
@@ -114,6 +115,11 @@ static void xen_change_state_handler(void *opaque, int running,
 
 static int xen_init(MachineState *ms)
 {
+    PCMachineState *pcms = PC_MACHINE(ms);
+
+    /* Disable ACPI build because Xen handles it */
+    pcms->acpi_build_enabled = false;
+
     xen_xc = xc_interface_open(0, 0, 0);
     if (xen_xc == NULL) {
         xen_pv_printf(NULL, 0, "can't open xen interface\n");
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 8 lines · Wei Liu

Introduce this field to control whether ACPI build is enabled by a particular machine or accelerator.

It defaults to true if the machine itself supports ACPI build. Xen accelerator will disable it because Xen is in charge of building ACPI tables for the guest.

Hi Wei,

Just gave it a spin (backporting for xen-unstable wasn't too hard), and this also works for me !

--
Sander

Quoted 82 lines

---
Cc: Igor Mammedov <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: Anthony PERARD <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Sander Eikelenboom <[email protected]>

v2:
1. drop acpi-build property
2. set acpi_build_enabled to acpi_has_build
3. replace acpi_has_build check in acpi_build()

---
 hw/i386/acpi-build.c | 2 +-
 hw/i386/pc.c         | 2 ++
 include/hw/i386/pc.h | 2 ++
 xen-common.c         | 6 ++++++
 4 files changed, 11 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +1 -1
index 5cd1da9..13cbbde 100644
@@ -2953,7 +2953,7 @@ void acpi_setup(void)
         return;
     }
 
-    if (!pcmc->has_acpi_build) {
+    if (!pcms->acpi_build_enabled) {
         ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
         return;
     }
hw/i386/pc.c +2 -0
index f56ea0f..fbd9aed 100644
@@ -2159,6 +2159,8 @@ static void pc_machine_initfn(Object *obj)
     pcms->vmport = ON_OFF_AUTO_AUTO;
     /* nvdimm is disabled on default. */
     pcms->acpi_nvdimm_state.is_enabled = false;
+    /* acpi build is enabled by default if machine supports it */
+    pcms->acpi_build_enabled = 
 PC_MACHINE_GET_CLASS(pcms)->has_acpi_build;
 }
 

static void pc_machine_reset(void)

include/hw/i386/pc.h +2 -0
index 98dc772..8eb517f 100644
@@ -62,6 +62,8 @@ struct PCMachineState {
 
     AcpiNVDIMMState acpi_nvdimm_state;
 
+    bool acpi_build_enabled;
+
     /* RAM information (sizes, addresses, configuration): */
     ram_addr_t below_4g_mem_size, above_4g_mem_size;
 
xen-common.c +6 -0
index 9099760..bacf962 100644
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/i386/pc.h"
 #include "hw/xen/xen_backend.h"
 #include "qmp-commands.h"
 #include "sysemu/char.h"
@@ -114,6 +115,11 @@ static void xen_change_state_handler(void
 *opaque, int running,
 
 static int xen_init(MachineState *ms)
 {
+    PCMachineState *pcms = PC_MACHINE(ms);
+
+    /* Disable ACPI build because Xen handles it */
+    pcms->acpi_build_enabled = false;
+
     xen_xc = xc_interface_open(0, 0, 0);
     if (xen_xc == NULL) {
Quoted 1 line
         xen_pv_printf(NULL, 0, "can't open xen interface\n");

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
In reply to Wei Liu
Quoted 8 lines · Wei Liu

Introduce this field to control whether ACPI build is enabled by a particular machine or accelerator.

It defaults to true if the machine itself supports ACPI build. Xen accelerator will disable it because Xen is in charge of building ACPI tables for the guest.

Hi Wei,

Just gave it a spin (backporting for xen-unstable wasn't too hard), and this also works for me !

--
Sander

Quoted 83 lines

---
Cc: Igor Mammedov <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: Anthony PERARD <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Sander Eikelenboom <[email protected]>

v2:
1. drop acpi-build property
2. set acpi_build_enabled to acpi_has_build
3. replace acpi_has_build check in acpi_build()

---
 hw/i386/acpi-build.c | 2 +-
 hw/i386/pc.c         | 2 ++
 include/hw/i386/pc.h | 2 ++
 xen-common.c         | 6 ++++++
 4 files changed, 11 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +1 -1
index 5cd1da9..13cbbde 100644
@@ -2953,7 +2953,7 @@ void acpi_setup(void)
         return;
     }
 
-    if (!pcmc->has_acpi_build) {
+    if (!pcms->acpi_build_enabled) {
         ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
         return;
     }
hw/i386/pc.c +2 -0
index f56ea0f..fbd9aed 100644
@@ -2159,6 +2159,8 @@ static void pc_machine_initfn(Object *obj)
     pcms->vmport = ON_OFF_AUTO_AUTO;
     /* nvdimm is disabled on default. */
     pcms->acpi_nvdimm_state.is_enabled = false;
+    /* acpi build is enabled by default if machine supports it */
+    pcms->acpi_build_enabled = 
 PC_MACHINE_GET_CLASS(pcms)->has_acpi_build;
 }
 

static void pc_machine_reset(void)

include/hw/i386/pc.h +2 -0
index 98dc772..8eb517f 100644
@@ -62,6 +62,8 @@ struct PCMachineState {
 
     AcpiNVDIMMState acpi_nvdimm_state;
 
+    bool acpi_build_enabled;
+
     /* RAM information (sizes, addresses, configuration): */
     ram_addr_t below_4g_mem_size, above_4g_mem_size;
 
xen-common.c +6 -0
index 9099760..bacf962 100644
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/i386/pc.h"
 #include "hw/xen/xen_backend.h"
 #include "qmp-commands.h"
 #include "sysemu/char.h"
@@ -114,6 +115,11 @@ static void xen_change_state_handler(void
 *opaque, int running,
 
 static int xen_init(MachineState *ms)
 {
+    PCMachineState *pcms = PC_MACHINE(ms);
+
+    /* Disable ACPI build because Xen handles it */
+    pcms->acpi_build_enabled = false;
+
     xen_xc = xc_interface_open(0, 0, 0);
     if (xen_xc == NULL) {
         xen_pv_printf(NULL, 0, "can't open xen interface\n");
Reviewed-by on v2 1/1
#3 lore raw
In reply to Wei Liu
Quoted 8 lines · Wei Liu

Introduce this field to control whether ACPI build is enabled by a particular machine or accelerator.

It defaults to true if the machine itself supports ACPI build. Xen accelerator will disable it because Xen is in charge of building ACPI tables for the guest.

Quoted 83 lines
Cc Igor Mammedov <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc Anthony PERARD <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Sander Eikelenboom <[email protected]>

v2:
1. drop acpi-build property
2. set acpi_build_enabled to acpi_has_build
3. replace acpi_has_build check in acpi_build()

---
 hw/i386/acpi-build.c | 2 +-
 hw/i386/pc.c         | 2 ++
 include/hw/i386/pc.h | 2 ++
 xen-common.c         | 6 ++++++
 4 files changed, 11 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +1 -1
index 5cd1da9..13cbbde 100644
@@ -2953,7 +2953,7 @@ void acpi_setup(void)
         return;
     }
 
-    if (!pcmc->has_acpi_build) {
+    if (!pcms->acpi_build_enabled) {
         ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
         return;
     }
hw/i386/pc.c +2 -0
index f56ea0f..fbd9aed 100644
@@ -2159,6 +2159,8 @@ static void pc_machine_initfn(Object *obj)
     pcms->vmport = ON_OFF_AUTO_AUTO;
     /* nvdimm is disabled on default. */
     pcms->acpi_nvdimm_state.is_enabled = false;
+    /* acpi build is enabled by default if machine supports it */
+    pcms->acpi_build_enabled = PC_MACHINE_GET_CLASS(pcms)->has_acpi_build;
 }
 
 static void pc_machine_reset(void)
include/hw/i386/pc.h +2 -0
index 98dc772..8eb517f 100644
@@ -62,6 +62,8 @@ struct PCMachineState {
 
     AcpiNVDIMMState acpi_nvdimm_state;
 
+    bool acpi_build_enabled;
+
     /* RAM information (sizes, addresses, configuration): */
     ram_addr_t below_4g_mem_size, above_4g_mem_size;
 
xen-common.c +6 -0
index 9099760..bacf962 100644
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/i386/pc.h"
 #include "hw/xen/xen_backend.h"
 #include "qmp-commands.h"
 #include "sysemu/char.h"
@@ -114,6 +115,11 @@ static void xen_change_state_handler(void *opaque, int running,
 
 static int xen_init(MachineState *ms)
 {
+    PCMachineState *pcms = PC_MACHINE(ms);
+
+    /* Disable ACPI build because Xen handles it */
+    pcms->acpi_build_enabled = false;
+
     xen_xc = xc_interface_open(0, 0, 0);
     if (xen_xc == NULL) {
         xen_pv_printf(NULL, 0, "can't open xen interface\n");
Signature · 1 line
2.1.4

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Reviewed-by on v2 1/1
#4 lore raw
In reply to Wei Liu
Quoted 8 lines · Wei Liu

Introduce this field to control whether ACPI build is enabled by a particular machine or accelerator.

It defaults to true if the machine itself supports ACPI build. Xen accelerator will disable it because Xen is in charge of building ACPI tables for the guest.

Quoted 83 lines
Cc Igor Mammedov <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc Anthony PERARD <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Sander Eikelenboom <[email protected]>

v2:
1. drop acpi-build property
2. set acpi_build_enabled to acpi_has_build
3. replace acpi_has_build check in acpi_build()

---
 hw/i386/acpi-build.c | 2 +-
 hw/i386/pc.c         | 2 ++
 include/hw/i386/pc.h | 2 ++
 xen-common.c         | 6 ++++++
 4 files changed, 11 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +1 -1
index 5cd1da9..13cbbde 100644
@@ -2953,7 +2953,7 @@ void acpi_setup(void)
         return;
     }
 
-    if (!pcmc->has_acpi_build) {
+    if (!pcms->acpi_build_enabled) {
         ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
         return;
     }
hw/i386/pc.c +2 -0
index f56ea0f..fbd9aed 100644
@@ -2159,6 +2159,8 @@ static void pc_machine_initfn(Object *obj)
     pcms->vmport = ON_OFF_AUTO_AUTO;
     /* nvdimm is disabled on default. */
     pcms->acpi_nvdimm_state.is_enabled = false;
+    /* acpi build is enabled by default if machine supports it */
+    pcms->acpi_build_enabled = PC_MACHINE_GET_CLASS(pcms)->has_acpi_build;
 }
 
 static void pc_machine_reset(void)
include/hw/i386/pc.h +2 -0
index 98dc772..8eb517f 100644
@@ -62,6 +62,8 @@ struct PCMachineState {
 
     AcpiNVDIMMState acpi_nvdimm_state;
 
+    bool acpi_build_enabled;
+
     /* RAM information (sizes, addresses, configuration): */
     ram_addr_t below_4g_mem_size, above_4g_mem_size;
 
xen-common.c +6 -0
index 9099760..bacf962 100644
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "hw/i386/pc.h"
 #include "hw/xen/xen_backend.h"
 #include "qmp-commands.h"
 #include "sysemu/char.h"
@@ -114,6 +115,11 @@ static void xen_change_state_handler(void *opaque, int running,
 
 static int xen_init(MachineState *ms)
 {
+    PCMachineState *pcms = PC_MACHINE(ms);
+
+    /* Disable ACPI build because Xen handles it */
+    pcms->acpi_build_enabled = false;
+
     xen_xc = xc_interface_open(0, 0, 0);
     if (xen_xc == NULL) {
         xen_pv_printf(NULL, 0, "can't open xen interface\n");
Signature · 1 line
2.1.4
Reviewed-by on v2 1/1
#5 lore raw
In reply to Wei Liu
Quoted 8 lines · Wei Liu

Introduce this field to control whether ACPI build is enabled by a particular machine or accelerator.

It defaults to true if the machine itself supports ACPI build. Xen accelerator will disable it because Xen is in charge of building ACPI tables for the guest.

Signature · 6 lines
Eduardo

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#7 lore raw
Quoted 11 lines · Eduardo Habkost
Quoted 8 lines · Wei Liu

Introduce this field to control whether ACPI build is enabled by a particular machine or accelerator.

It defaults to true if the machine itself supports ACPI build. Xen accelerator will disable it because Xen is in charge of building ACPI tables for the guest.

Thank you Eduardo. I can queue it up unless you have other stuff in progress.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#8 lore raw
In reply to Eduardo Habkost
Quoted 11 lines · Eduardo Habkost
Quoted 8 lines · Wei Liu

Introduce this field to control whether ACPI build is enabled by a particular machine or accelerator.

It defaults to true if the machine itself supports ACPI build. Xen accelerator will disable it because Xen is in charge of building ACPI tables for the guest.

Thank you Eduardo. I can queue it up unless you have other stuff in progress.

author
#9 lore raw
Quoted 9 lines · Stefano Stabellini
Quoted 8 lines · Eduardo Habkost
Quoted 7 lines · Wei Liu

Introduce this field to control whether ACPI build is enabled by a particular machine or accelerator.

It defaults to true if the machine itself supports ACPI build. Xen accelerator will disable it because Xen is in charge of building ACPI tables for the guest.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Thank you Eduardo. I can queue it up unless you have other stuff in progress.

I would like to backport this to qemu-xen tree, so it would be great if this patch can be merged in the next two weeks. Thanks!

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#10 lore raw
In reply to Stefano Stabellini
Quoted 9 lines · Stefano Stabellini
Quoted 8 lines · Eduardo Habkost
Quoted 7 lines · Wei Liu

Introduce this field to control whether ACPI build is enabled by a particular machine or accelerator.

It defaults to true if the machine itself supports ACPI build. Xen accelerator will disable it because Xen is in charge of building ACPI tables for the guest.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Thank you Eduardo. I can queue it up unless you have other stuff in progress.

In case you didn't queue it yet, please go ahead.

Signature · 6 lines
Eduardo

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#11 lore raw
In reply to Stefano Stabellini
Quoted 9 lines · Stefano Stabellini
Quoted 8 lines · Eduardo Habkost
Quoted 7 lines · Wei Liu

Introduce this field to control whether ACPI build is enabled by a particular machine or accelerator.

It defaults to true if the machine itself supports ACPI build. Xen accelerator will disable it because Xen is in charge of building ACPI tables for the guest.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Thank you Eduardo. I can queue it up unless you have other stuff in progress.

In case you didn't queue it yet, please go ahead.

Signature · 1 line
Eduardo