All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup
@ 2022-07-01 13:22 Jonathan Cameron via
  2022-07-01 13:22 ` [PATCH 1/3] hw/machine: Clear out left over CXL related pointer from move of state handling to machines Jonathan Cameron via
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jonathan Cameron via @ 2022-07-01 13:22 UTC (permalink / raw)
  To: linuxarm, qemu-devel, Michael S . Tsirkin, Igor Mammedov, Peter Maydell
  Cc: Shameerali Kolothum Thodi, Ben Widawsky, Paolo Bonzini

Three more or less less unrelated fixes for recently added CXL code.

Jonathan Cameron (3):
  hw/machine: Clear out left over CXL related pointer from move of state
    handling to machines.
  hw/i386/pc: Always place CXL Memory Regions after device_memory
  hw/cxl: Fix size of constant in interleave granularity function.

 hw/i386/pc.c                   | 6 ++----
 include/hw/boards.h            | 1 -
 include/hw/cxl/cxl_component.h | 2 +-
 3 files changed, 3 insertions(+), 6 deletions(-)

-- 
2.32.0



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

* [PATCH 1/3] hw/machine: Clear out left over CXL related pointer from move of state handling to machines.
  2022-07-01 13:22 [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup Jonathan Cameron via
@ 2022-07-01 13:22 ` Jonathan Cameron via
  2022-07-01 13:22 ` [PATCH 2/3] hw/i386/pc: Always place CXL Memory Regions after device_memory Jonathan Cameron via
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron via @ 2022-07-01 13:22 UTC (permalink / raw)
  To: linuxarm, qemu-devel, Michael S . Tsirkin, Igor Mammedov, Peter Maydell
  Cc: Shameerali Kolothum Thodi, Ben Widawsky, Paolo Bonzini

This got left behind in the move of the CXL setup code from core
files to the machines that support it.

Link: https://gitlab.com/qemu-project/qemu/-/commit/1ebf9001fb2701e3c00b401334c8f3900a46adaa
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 include/hw/boards.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/hw/boards.h b/include/hw/boards.h
index d94edcef28..7b416c9787 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -360,7 +360,6 @@ struct MachineState {
     CpuTopology smp;
     struct NVDIMMState *nvdimms_state;
     struct NumaState *numa_state;
-    CXLFixedMemoryWindowOptionsList *cfmws_list;
 };
 
 #define DEFINE_MACHINE(namestr, machine_initfn) \
-- 
2.32.0



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

* [PATCH 2/3] hw/i386/pc: Always place CXL Memory Regions after device_memory
  2022-07-01 13:22 [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup Jonathan Cameron via
  2022-07-01 13:22 ` [PATCH 1/3] hw/machine: Clear out left over CXL related pointer from move of state handling to machines Jonathan Cameron via
@ 2022-07-01 13:22 ` Jonathan Cameron via
  2022-07-01 13:23 ` [PATCH 3/3] hw/cxl: Fix size of constant in interleave granularity function Jonathan Cameron via
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron via @ 2022-07-01 13:22 UTC (permalink / raw)
  To: linuxarm, qemu-devel, Michael S . Tsirkin, Igor Mammedov, Peter Maydell
  Cc: Shameerali Kolothum Thodi, Ben Widawsky, Paolo Bonzini

Previously broken_reserved_end was taken into account, but Igor Mammedov
identified that this could lead to a clash between potential RAM being
mapped in the region and CXL usage. Hence always add the size of the
device_memory memory region.  This only affects the case where the
broken_reserved_end flag was set.

Fixes: 6e4e3ae936e6 ("hw/cxl/component: Implement host bridge MMIO (8.2.5, table 142)")
Reported-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 hw/i386/pc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 774cb2bf07..8d68295fda 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -922,10 +922,8 @@ void pc_memory_init(PCMachineState *pcms,
         hwaddr cxl_size = MiB;
 
         if (pcmc->has_reserved_memory && machine->device_memory->base) {
-            cxl_base = machine->device_memory->base;
-            if (!pcmc->broken_reserved_end) {
-                cxl_base += memory_region_size(&machine->device_memory->mr);
-            }
+            cxl_base = machine->device_memory->base
+                + memory_region_size(&machine->device_memory->mr);
         } else if (pcms->sgx_epc.size != 0) {
             cxl_base = sgx_epc_above_4g_end(&pcms->sgx_epc);
         } else {
-- 
2.32.0



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

* [PATCH 3/3] hw/cxl: Fix size of constant in interleave granularity function.
  2022-07-01 13:22 [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup Jonathan Cameron via
  2022-07-01 13:22 ` [PATCH 1/3] hw/machine: Clear out left over CXL related pointer from move of state handling to machines Jonathan Cameron via
  2022-07-01 13:22 ` [PATCH 2/3] hw/i386/pc: Always place CXL Memory Regions after device_memory Jonathan Cameron via
@ 2022-07-01 13:23 ` Jonathan Cameron via
  2022-07-11 12:42 ` [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup Igor Mammedov
  2022-07-19 14:09 ` Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron via @ 2022-07-01 13:23 UTC (permalink / raw)
  To: linuxarm, qemu-devel, Michael S . Tsirkin, Igor Mammedov, Peter Maydell
  Cc: Shameerali Kolothum Thodi, Ben Widawsky, Paolo Bonzini

Whilst the interleave granularity is always small enough that this isn't
a real problem (much less than 4GiB) let's change the constant
to ULL to fix the coverity warning.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Fixes: 829de299d1 ("hw/cxl/component: Add utils for interleave parameter encoding/decoding")
Fixes: Coverity CID 1488868
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 include/hw/cxl/cxl_component.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/cxl/cxl_component.h b/include/hw/cxl/cxl_component.h
index 70b5018156..94ec2f07d7 100644
--- a/include/hw/cxl/cxl_component.h
+++ b/include/hw/cxl/cxl_component.h
@@ -215,7 +215,7 @@ uint8_t cxl_interleave_granularity_enc(uint64_t gran, Error **errp);
 
 static inline hwaddr cxl_decode_ig(int ig)
 {
-    return 1 << (ig + 8);
+    return 1ULL << (ig + 8);
 }
 
 CXLComponentState *cxl_get_hb_cstate(PCIHostState *hb);
-- 
2.32.0



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

* Re: [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup
  2022-07-01 13:22 [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup Jonathan Cameron via
                   ` (2 preceding siblings ...)
  2022-07-01 13:23 ` [PATCH 3/3] hw/cxl: Fix size of constant in interleave granularity function Jonathan Cameron via
@ 2022-07-11 12:42 ` Igor Mammedov
  2022-07-19 14:09 ` Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Igor Mammedov @ 2022-07-11 12:42 UTC (permalink / raw)
  To: Jonathan Cameron via
  Cc: Jonathan Cameron, linuxarm, Michael S . Tsirkin, Peter Maydell,
	Shameerali Kolothum Thodi, Ben Widawsky, Paolo Bonzini

On Fri, 1 Jul 2022 14:22:57 +0100
Jonathan Cameron via <qemu-devel@nongnu.org> wrote:

> Three more or less less unrelated fixes for recently added CXL code.
> 
> Jonathan Cameron (3):
>   hw/machine: Clear out left over CXL related pointer from move of state
>     handling to machines.
>   hw/i386/pc: Always place CXL Memory Regions after device_memory
>   hw/cxl: Fix size of constant in interleave granularity function.
> 
>  hw/i386/pc.c                   | 6 ++----
>  include/hw/boards.h            | 1 -
>  include/hw/cxl/cxl_component.h | 2 +-
>  3 files changed, 3 insertions(+), 6 deletions(-)
> 

For whole series:
Acked-by: Igor Mammedov <imammedo@redhat.com>



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

* Re: [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup
  2022-07-01 13:22 [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup Jonathan Cameron via
                   ` (3 preceding siblings ...)
  2022-07-11 12:42 ` [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup Igor Mammedov
@ 2022-07-19 14:09 ` Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2022-07-19 14:09 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linuxarm, qemu-devel, Michael S . Tsirkin, Igor Mammedov,
	Shameerali Kolothum Thodi, Ben Widawsky, Paolo Bonzini

On Fri, 1 Jul 2022 at 14:22, Jonathan Cameron
<Jonathan.Cameron@huawei.com> wrote:
>
> Three more or less less unrelated fixes for recently added CXL code.
>
> Jonathan Cameron (3):
>   hw/machine: Clear out left over CXL related pointer from move of state
>     handling to machines.
>   hw/i386/pc: Always place CXL Memory Regions after device_memory
>   hw/cxl: Fix size of constant in interleave granularity function.

Hi -- did this patch series get lost somewhere? I was going
through old Coverity issues, and noticed the fix in patch 3
is still not upstream.

thanks
-- PMM


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

end of thread, other threads:[~2022-07-19 14:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-01 13:22 [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup Jonathan Cameron via
2022-07-01 13:22 ` [PATCH 1/3] hw/machine: Clear out left over CXL related pointer from move of state handling to machines Jonathan Cameron via
2022-07-01 13:22 ` [PATCH 2/3] hw/i386/pc: Always place CXL Memory Regions after device_memory Jonathan Cameron via
2022-07-01 13:23 ` [PATCH 3/3] hw/cxl: Fix size of constant in interleave granularity function Jonathan Cameron via
2022-07-11 12:42 ` [PATCH 0/3] hw/cxl, hw/machine, hw/i386: Misc minor fixes / cleanup Igor Mammedov
2022-07-19 14:09 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.