qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-for-9.0] hw/i386/pc: Restrict CXL to PCI-based machines
@ 2024-03-27 16:16 Philippe Mathieu-Daudé
  2024-04-01 16:02 ` Jonathan Cameron via
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-03-27 16:16 UTC (permalink / raw)
  To: qemu-devel, Jonathan Cameron
  Cc: Marcel Apfelbaum, Paolo Bonzini, Richard Henderson, Fan Ni,
	Michael S. Tsirkin, Eduardo Habkost, Philippe Mathieu-Daudé

CXL is based on PCIe. In is pointless to initialize
its context on non-PCI machines.

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

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index e80f02bef4..5c21b0c4db 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1738,7 +1738,9 @@ static void pc_machine_initfn(Object *obj)
     pcms->pcspk = isa_new(TYPE_PC_SPEAKER);
     object_property_add_alias(OBJECT(pcms), "pcspk-audiodev",
                               OBJECT(pcms->pcspk), "audiodev");
-    cxl_machine_init(obj, &pcms->cxl_devices_state);
+    if (pcmc->pci_enabled) {
+        cxl_machine_init(obj, &pcms->cxl_devices_state);
+    }
 
     pcms->machine_done.notify = pc_machine_done;
     qemu_add_machine_init_done_notifier(&pcms->machine_done);
-- 
2.41.0



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

* Re: [PATCH-for-9.0] hw/i386/pc: Restrict CXL to PCI-based machines
  2024-03-27 16:16 [PATCH-for-9.0] hw/i386/pc: Restrict CXL to PCI-based machines Philippe Mathieu-Daudé
@ 2024-04-01 16:02 ` Jonathan Cameron via
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron via @ 2024-04-01 16:02 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Marcel Apfelbaum, Paolo Bonzini, Richard Henderson,
	Fan Ni, Michael S. Tsirkin, Eduardo Habkost

On Wed, 27 Mar 2024 17:16:42 +0100
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:

> CXL is based on PCIe. In is pointless to initialize
> its context on non-PCI machines.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Seems a reasonable restriction.

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Jonathan

> ---
>  hw/i386/pc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index e80f02bef4..5c21b0c4db 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1738,7 +1738,9 @@ static void pc_machine_initfn(Object *obj)
>      pcms->pcspk = isa_new(TYPE_PC_SPEAKER);
>      object_property_add_alias(OBJECT(pcms), "pcspk-audiodev",
>                                OBJECT(pcms->pcspk), "audiodev");
> -    cxl_machine_init(obj, &pcms->cxl_devices_state);
> +    if (pcmc->pci_enabled) {
> +        cxl_machine_init(obj, &pcms->cxl_devices_state);
> +    }
>  
>      pcms->machine_done.notify = pc_machine_done;
>      qemu_add_machine_init_done_notifier(&pcms->machine_done);



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

end of thread, other threads:[~2024-04-01 16:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27 16:16 [PATCH-for-9.0] hw/i386/pc: Restrict CXL to PCI-based machines Philippe Mathieu-Daudé
2024-04-01 16:02 ` Jonathan Cameron via

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).