qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] hw/i386/pc: Trivial cleanups
@ 2024-03-01 18:59 Philippe Mathieu-Daudé
  2024-03-01 18:59 ` [PATCH 1/4] hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations Philippe Mathieu-Daudé
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-03-01 18:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bernhard Beschow, Eduardo Habkost, Michael S. Tsirkin,
	Richard Henderson, Marcel Apfelbaum, Paolo Bonzini,
	Philippe Mathieu-Daudé, Michael Tokarev, Laurent Vivier,
	qemu-trivial

Trivial cleanups, mostly around the 'isapc' machine.

Philippe Mathieu-Daudé (4):
  hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations
  hw/i386/pc: Use generated NotifyVmexitOption_str()
  hw/i386/pc: Remove 'host_type' argument from pc_init1()
  hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument

 include/hw/i386/pc.h | 12 ------------
 hw/i386/pc_piix.c    | 18 ++++++------------
 2 files changed, 6 insertions(+), 24 deletions(-)

-- 
2.41.0



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/4] hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations
  2024-03-01 18:59 [PATCH 0/4] hw/i386/pc: Trivial cleanups Philippe Mathieu-Daudé
@ 2024-03-01 18:59 ` Philippe Mathieu-Daudé
  2024-03-01 20:11   ` Richard Henderson
  2024-03-01 18:59 ` [PATCH 2/4] hw/i386/pc: Use generated NotifyVmexitOption_str() Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-03-01 18:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bernhard Beschow, Eduardo Habkost, Michael S. Tsirkin,
	Richard Henderson, Marcel Apfelbaum, Paolo Bonzini,
	Philippe Mathieu-Daudé

These definitions were removed in commit ea985d235b
("pc_piix: remove pc-i440fx-1.4 up to pc-i440fx-1.7").

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/i386/pc.h | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 5065590281..b958023187 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -288,18 +288,6 @@ extern const size_t pc_compat_2_1_len;
 extern GlobalProperty pc_compat_2_0[];
 extern const size_t pc_compat_2_0_len;
 
-extern GlobalProperty pc_compat_1_7[];
-extern const size_t pc_compat_1_7_len;
-
-extern GlobalProperty pc_compat_1_6[];
-extern const size_t pc_compat_1_6_len;
-
-extern GlobalProperty pc_compat_1_5[];
-extern const size_t pc_compat_1_5_len;
-
-extern GlobalProperty pc_compat_1_4[];
-extern const size_t pc_compat_1_4_len;
-
 #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
     static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
     { \
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/4] hw/i386/pc: Use generated NotifyVmexitOption_str()
  2024-03-01 18:59 [PATCH 0/4] hw/i386/pc: Trivial cleanups Philippe Mathieu-Daudé
  2024-03-01 18:59 ` [PATCH 1/4] hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations Philippe Mathieu-Daudé
@ 2024-03-01 18:59 ` Philippe Mathieu-Daudé
  2024-03-01 20:13   ` Richard Henderson
  2024-03-01 18:59 ` [PATCH 3/4] hw/i386/pc: Remove 'host_type' argument from pc_init1() Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-03-01 18:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bernhard Beschow, Eduardo Habkost, Michael S. Tsirkin,
	Richard Henderson, Marcel Apfelbaum, Paolo Bonzini,
	Philippe Mathieu-Daudé

NotifyVmexitOption_str() is QAPI-generated in
"qapi/qapi-types-run-state.h", which "sysemu/runstate.h"
already includes.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/i386/pc_piix.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index ce6aad758d..0e688ed655 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -60,6 +60,7 @@
 #include "hw/xen/xen.h"
 #include "migration/global_state.h"
 #include "migration/misc.h"
+#include "sysemu/runstate.h"
 #include "sysemu/numa.h"
 #include "hw/hyperv/vmbus-bridge.h"
 #include "hw/mem/nvdimm.h"
@@ -382,9 +383,6 @@ static const QEnumLookup PCSouthBridgeOption_lookup = {
     .size = PC_SOUTH_BRIDGE_OPTION_MAX
 };
 
-#define NotifyVmexitOption_str(val) \
-    qapi_enum_lookup(&NotifyVmexitOption_lookup, (val))
-
 static int pc_get_south_bridge(Object *obj, Error **errp)
 {
     PCMachineState *pcms = PC_MACHINE(obj);
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/4] hw/i386/pc: Remove 'host_type' argument from pc_init1()
  2024-03-01 18:59 [PATCH 0/4] hw/i386/pc: Trivial cleanups Philippe Mathieu-Daudé
  2024-03-01 18:59 ` [PATCH 1/4] hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations Philippe Mathieu-Daudé
  2024-03-01 18:59 ` [PATCH 2/4] hw/i386/pc: Use generated NotifyVmexitOption_str() Philippe Mathieu-Daudé
@ 2024-03-01 18:59 ` Philippe Mathieu-Daudé
  2024-03-01 20:34   ` Richard Henderson
  2024-03-01 18:59 ` [PATCH 4/4] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument Philippe Mathieu-Daudé
  2024-03-07 18:57 ` [PATCH 0/4] hw/i386/pc: Trivial cleanups Bernhard Beschow
  4 siblings, 1 reply; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-03-01 18:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bernhard Beschow, Eduardo Habkost, Michael S. Tsirkin,
	Richard Henderson, Marcel Apfelbaum, Paolo Bonzini,
	Philippe Mathieu-Daudé

All callers use host_type=TYPE_I440FX_PCI_HOST_BRIDGE.
Directly use this definition within pc_init1().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/i386/pc_piix.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 0e688ed655..400b1c1e15 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -100,8 +100,7 @@ static void piix_intx_routing_notifier_xen(PCIDevice *dev)
 }
 
 /* PC hardware initialisation */
-static void pc_init1(MachineState *machine,
-                     const char *host_type, const char *pci_type)
+static void pc_init1(MachineState *machine, const char *pci_type)
 {
     PCMachineState *pcms = PC_MACHINE(machine);
     PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
@@ -193,7 +192,7 @@ static void pc_init1(MachineState *machine,
         memory_region_init(pci_memory, NULL, "pci", UINT64_MAX);
         rom_memory = pci_memory;
 
-        phb = OBJECT(qdev_new(host_type));
+        phb = OBJECT(qdev_new(TYPE_I440FX_PCI_HOST_BRIDGE));
         object_property_add_child(OBJECT(machine), "i440fx", phb);
         object_property_set_link(phb, PCI_HOST_PROP_RAM_MEM,
                                  OBJECT(ram_memory), &error_fatal);
@@ -450,7 +449,7 @@ static void pc_compat_2_0_fn(MachineState *machine)
 #ifdef CONFIG_ISAPC
 static void pc_init_isa(MachineState *machine)
 {
-    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, TYPE_I440FX_PCI_DEVICE);
+    pc_init1(machine, TYPE_I440FX_PCI_DEVICE);
 }
 #endif
 
@@ -460,9 +459,7 @@ static void pc_xen_hvm_init_pci(MachineState *machine)
     const char *pci_type = xen_igd_gfx_pt_enabled() ?
                 TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE : TYPE_I440FX_PCI_DEVICE;
 
-    pc_init1(machine,
-             TYPE_I440FX_PCI_HOST_BRIDGE,
-             pci_type);
+    pc_init1(machine, pci_type);
 }
 
 static void pc_xen_hvm_init(MachineState *machine)
@@ -487,8 +484,7 @@ static void pc_xen_hvm_init(MachineState *machine)
         if (compat) { \
             compat(machine); \
         } \
-        pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \
-                 TYPE_I440FX_PCI_DEVICE); \
+        pc_init1(machine, TYPE_I440FX_PCI_DEVICE); \
     } \
     DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn)
 
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/4] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument
  2024-03-01 18:59 [PATCH 0/4] hw/i386/pc: Trivial cleanups Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2024-03-01 18:59 ` [PATCH 3/4] hw/i386/pc: Remove 'host_type' argument from pc_init1() Philippe Mathieu-Daudé
@ 2024-03-01 18:59 ` Philippe Mathieu-Daudé
  2024-03-02 10:03   ` Bernhard Beschow
  2024-03-07 18:57 ` [PATCH 0/4] hw/i386/pc: Trivial cleanups Bernhard Beschow
  4 siblings, 1 reply; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-03-01 18:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Bernhard Beschow, Eduardo Habkost, Michael S. Tsirkin,
	Richard Henderson, Marcel Apfelbaum, Paolo Bonzini,
	Philippe Mathieu-Daudé

The "isapc" machine only provides an ISA bus, not a PCI one,
and doesn't instanciate any i440FX south bridge.
Its machine class defines PCMachineClass::pci_enabled = false,
and pc_init1() only uses the pci_type argument when pci_enabled
is true. Since for this machine the argument is not used,
passing NULL makes more sense.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/i386/pc_piix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 400b1c1e15..fa5f93f99f 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -449,7 +449,7 @@ static void pc_compat_2_0_fn(MachineState *machine)
 #ifdef CONFIG_ISAPC
 static void pc_init_isa(MachineState *machine)
 {
-    pc_init1(machine, TYPE_I440FX_PCI_DEVICE);
+    pc_init1(machine, NULL);
 }
 #endif
 
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/4] hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations
  2024-03-01 18:59 ` [PATCH 1/4] hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations Philippe Mathieu-Daudé
@ 2024-03-01 20:11   ` Richard Henderson
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Henderson @ 2024-03-01 20:11 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Bernhard Beschow, Eduardo Habkost, Michael S. Tsirkin,
	Marcel Apfelbaum, Paolo Bonzini

On 3/1/24 08:59, Philippe Mathieu-Daudé wrote:
> These definitions were removed in commit ea985d235b
> ("pc_piix: remove pc-i440fx-1.4 up to pc-i440fx-1.7").
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   include/hw/i386/pc.h | 12 ------------
>   1 file changed, 12 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/4] hw/i386/pc: Use generated NotifyVmexitOption_str()
  2024-03-01 18:59 ` [PATCH 2/4] hw/i386/pc: Use generated NotifyVmexitOption_str() Philippe Mathieu-Daudé
@ 2024-03-01 20:13   ` Richard Henderson
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Henderson @ 2024-03-01 20:13 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Bernhard Beschow, Eduardo Habkost, Michael S. Tsirkin,
	Marcel Apfelbaum, Paolo Bonzini

On 3/1/24 08:59, Philippe Mathieu-Daudé wrote:
> NotifyVmexitOption_str() is QAPI-generated in
> "qapi/qapi-types-run-state.h", which "sysemu/runstate.h"
> already includes.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   hw/i386/pc_piix.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/4] hw/i386/pc: Remove 'host_type' argument from pc_init1()
  2024-03-01 18:59 ` [PATCH 3/4] hw/i386/pc: Remove 'host_type' argument from pc_init1() Philippe Mathieu-Daudé
@ 2024-03-01 20:34   ` Richard Henderson
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Henderson @ 2024-03-01 20:34 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Bernhard Beschow, Eduardo Habkost, Michael S. Tsirkin,
	Marcel Apfelbaum, Paolo Bonzini

On 3/1/24 08:59, Philippe Mathieu-Daudé wrote:
> All callers use host_type=TYPE_I440FX_PCI_HOST_BRIDGE.
> Directly use this definition within pc_init1().
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   hw/i386/pc_piix.c | 14 +++++---------
>   1 file changed, 5 insertions(+), 9 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument
  2024-03-01 18:59 ` [PATCH 4/4] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument Philippe Mathieu-Daudé
@ 2024-03-02 10:03   ` Bernhard Beschow
  0 siblings, 0 replies; 12+ messages in thread
From: Bernhard Beschow @ 2024-03-02 10:03 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Eduardo Habkost, Michael S. Tsirkin, Richard Henderson,
	Marcel Apfelbaum, Paolo Bonzini



Am 1. März 2024 18:59:36 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>The "isapc" machine only provides an ISA bus, not a PCI one,
>and doesn't instanciate any i440FX south bridge.
>Its machine class defines PCMachineClass::pci_enabled = false,
>and pc_init1() only uses the pci_type argument when pci_enabled
>is true. Since for this machine the argument is not used,
>passing NULL makes more sense.
>
>Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Bernhard Beschow <shentey@gmail.com>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/4] hw/i386/pc: Trivial cleanups
  2024-03-01 18:59 [PATCH 0/4] hw/i386/pc: Trivial cleanups Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2024-03-01 18:59 ` [PATCH 4/4] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument Philippe Mathieu-Daudé
@ 2024-03-07 18:57 ` Bernhard Beschow
  2024-03-08  6:05   ` Michael Tokarev
  4 siblings, 1 reply; 12+ messages in thread
From: Bernhard Beschow @ 2024-03-07 18:57 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Eduardo Habkost, Michael S. Tsirkin, Richard Henderson,
	Marcel Apfelbaum, Paolo Bonzini, Michael Tokarev, Laurent Vivier,
	qemu-trivial



Am 1. März 2024 18:59:32 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>Trivial cleanups, mostly around the 'isapc' machine.
>
>Philippe Mathieu-Daudé (4):
>  hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations
>  hw/i386/pc: Use generated NotifyVmexitOption_str()
>  hw/i386/pc: Remove 'host_type' argument from pc_init1()
>  hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument

Ping. Will this series make it into 9.0? AFAICS all patches are reviewed.

>
> include/hw/i386/pc.h | 12 ------------
> hw/i386/pc_piix.c    | 18 ++++++------------
> 2 files changed, 6 insertions(+), 24 deletions(-)
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/4] hw/i386/pc: Trivial cleanups
  2024-03-07 18:57 ` [PATCH 0/4] hw/i386/pc: Trivial cleanups Bernhard Beschow
@ 2024-03-08  6:05   ` Michael Tokarev
  2024-03-08  8:12     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Tokarev @ 2024-03-08  6:05 UTC (permalink / raw)
  To: Bernhard Beschow, Philippe Mathieu-Daudé, qemu-devel; +Cc: qemu-trivial

07.03.2024 21:57, Bernhard Beschow :
> Am 1. März 2024 18:59:32 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>> Trivial cleanups, mostly around the 'isapc' machine.
>>
>> Philippe Mathieu-Daudé (4):
>>   hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations
>>   hw/i386/pc: Use generated NotifyVmexitOption_str()
>>   hw/i386/pc: Remove 'host_type' argument from pc_init1()
>>   hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument
> 
> Ping. Will this series make it into 9.0? AFAICS all patches are reviewed.

Philippe, are you submitting this through you misc tree, or should I
pick it for trivial-patches?  I'm often a bit in doubt about patches
you Cc to qemu-trivial@, - a few times we both tried to submit them.

/mjt


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/4] hw/i386/pc: Trivial cleanups
  2024-03-08  6:05   ` Michael Tokarev
@ 2024-03-08  8:12     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-03-08  8:12 UTC (permalink / raw)
  To: Michael Tokarev, Bernhard Beschow, qemu-devel; +Cc: qemu-trivial

On 8/3/24 07:05, Michael Tokarev wrote:
> 07.03.2024 21:57, Bernhard Beschow :
>> Am 1. März 2024 18:59:32 UTC schrieb "Philippe Mathieu-Daudé" 
>> <philmd@linaro.org>:
>>> Trivial cleanups, mostly around the 'isapc' machine.
>>>
>>> Philippe Mathieu-Daudé (4):
>>>   hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations
>>>   hw/i386/pc: Use generated NotifyVmexitOption_str()
>>>   hw/i386/pc: Remove 'host_type' argument from pc_init1()
>>>   hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument
>>
>> Ping. Will this series make it into 9.0? AFAICS all patches are reviewed.
> 
> Philippe, are you submitting this through you misc tree, or should I
> pick it for trivial-patches?  I'm often a bit in doubt about patches
> you Cc to qemu-trivial@, - a few times we both tried to submit them.

Yes, series queued, thanks!



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-03-08  8:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-01 18:59 [PATCH 0/4] hw/i386/pc: Trivial cleanups Philippe Mathieu-Daudé
2024-03-01 18:59 ` [PATCH 1/4] hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations Philippe Mathieu-Daudé
2024-03-01 20:11   ` Richard Henderson
2024-03-01 18:59 ` [PATCH 2/4] hw/i386/pc: Use generated NotifyVmexitOption_str() Philippe Mathieu-Daudé
2024-03-01 20:13   ` Richard Henderson
2024-03-01 18:59 ` [PATCH 3/4] hw/i386/pc: Remove 'host_type' argument from pc_init1() Philippe Mathieu-Daudé
2024-03-01 20:34   ` Richard Henderson
2024-03-01 18:59 ` [PATCH 4/4] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument Philippe Mathieu-Daudé
2024-03-02 10:03   ` Bernhard Beschow
2024-03-07 18:57 ` [PATCH 0/4] hw/i386/pc: Trivial cleanups Bernhard Beschow
2024-03-08  6:05   ` Michael Tokarev
2024-03-08  8:12     ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).