[PATCH v9 18/21] hw/i386/pc: Support smp.modules for x86 PC machine

2024-02-27 Thread Zhao Liu
From: Zhao Liu As module-level topology support is added to X86CPU, now we can enable the support for the modules parameter on PC machines. With this support, we can define a 5-level x86 CPU topology with "-smp": -smp cpus=*,maxcpus=*,sockets=*,dies=*,modules=*,cores=*,threads=*. Ad

[PATCH v9 06/21] i386/cpu: Use APIC ID info to encode cache topo in CPUID[4]

2024-02-27 Thread Zhao Liu
From: Zhao Liu Refer to the fixes of cache_info_passthrough ([1], [2]) and SDM, the CPUID.04H:EAX[bits 25:14] and CPUID.04H:EAX[bits 31:26] should use the nearest power-of-2 integer. The nearest power-of-2 integer can be calculated by pow2ceil() or by using APIC ID offset/width (like L3

[PATCH v9 09/21] i386/cpu: Introduce bitmap to cache available CPU topology levels

2024-02-27 Thread Zhao Liu
From: Zhao Liu Currently, QEMU checks the specify number of topology domains to detect if there's extended topology levels (e.g., checking nr_dies). With this bitmap, the extended CPU topology (the levels other than SMT, core and package) could be easier to detect without touching the topology

[PATCH v9 08/21] i386/cpu: Consolidate the use of topo_info in cpu_x86_cpuid()

2024-02-27 Thread Zhao Liu
From: Zhao Liu In cpu_x86_cpuid(), there are many variables in representing the cpu topology, e.g., topo_info, cs->nr_cores and cs->nr_threads. Since the names of cs->nr_cores/cs->nr_threads does not accurately represent its meaning, the use of cs->nr_cores/cs->nr_threads is

[PATCH v9 05/21] i386/cpu: Fix i/d-cache topology to core level for Intel CPU

2024-02-27 Thread Zhao Liu
From: Zhao Liu For i-cache and d-cache, current QEMU hardcodes the maximum IDs for CPUs sharing cache (CPUID.04H.00H:EAX[bits 25:14] and CPUID.04H.01H:EAX[bits 25:14]) to 0, and this means i-cache and d-cache are shared in the SMT level. This is correct if there's single thread per core

[PATCH v9 03/21] hw/core: Introduce module-id as the topology subindex

2024-02-27 Thread Zhao Liu
From: Zhao Liu Add module-id in CpuInstanceProperties, to locate the CPU with module level. Suggested-by: Xiaoyao Li Tested-by: Yongwei Ma Signed-off-by: Zhao Liu --- Changes since v7: * New commit to introduce module_id to locate the CPU with module level. --- hw/core/machine-hmp

[PATCH v9 04/21] hw/core: Support module-id in numa configuration

2024-02-27 Thread Zhao Liu
From: Zhao Liu Module is a level above the core, thereby supporting numa configuration on the module level can bring user more numa flexibility. This is the natural further support for module level. Add module level support in numa configuration. Tested-by: Yongwei Ma Signed-off-by: Zhao Liu

[PATCH v9 01/21] hw/core/machine: Introduce the module as a CPU topology level

2024-02-27 Thread Zhao Liu
From: Zhao Liu In x86, module is the topology level above core, which contains a set of cores that share certain resources (in current products, the resource usually includes L2 cache, as well as module scoped features and MSRs). Though smp.clusters could also share the L2 cache resource [1

[PATCH v9 00/21] Introduce smp.modules for x86 in QEMU

2024-02-27 Thread Zhao Liu
From: Zhao Liu Hi list, This is the our v9 patch series, rebased on the master branch at the commit 03d496a992d9 ("Merge tag 'pull-qapi-2024-02-26' of https://repo.or.cz/qemu/armbru into staging"). Compared with v8 [1], v9 mainly added more module description in commit message

Re: [RFC 4/8] hw/core: Add cache topology options in -smp

2024-02-27 Thread Zhao Liu
Hi Jonathan, > Hi Zhao Liu > > I like the scheme. Strikes a good balance between complexity of description > and systems that actually exist. Sure there are systems with more cache > levels etc but they are rare and support can be easily added later > if people want to m

Re: [PATCH 10/10] docs/devel/reset: Update to discuss system reset

2024-02-26 Thread Zhao Liu
merely documents the current situation, and says nothing > about what we might like to do with it in future... > --- > docs/devel/reset.rst | 44 ++-- > 1 file changed, 42 insertions(+), 2 deletions(-) > Reviewed-by: Zhao Liu

Re: [PATCH 09/10] hw/core/machine: Use qemu_register_resettable for sysbus reset

2024-02-26 Thread Zhao Liu
cidental reset-order dependency that is no longer satisfied, > but it's always possible... > --- > hw/core/machine.c | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) > Reviewed-by: Zhao Liu

Re: [PATCH 08/10] hw/core/reset: Implement qemu_register_reset via qemu_register_resettable

2024-02-26 Thread Zhao Liu
/reset.c| 137 +++++++-- > 2 files changed, 110 insertions(+), 34 deletions(-) > Reviewed-by: Zhao Liu

Re: [PATCH 07/10] hw/core/reset: Add qemu_{register, unregister}_resettable()

2024-02-26 Thread Zhao Liu
f-by: Peter Maydell > --- > include/sysemu/reset.h | 37 ++--- > hw/core/reset.c| 31 +-- > 2 files changed, 63 insertions(+), 5 deletions(-) Reviewed-by: Zhao Liu

Re: [PATCH 06/10] hw/core: Add ResetContainer which holds objects implementing Resettable

2024-02-26 Thread Zhao Liu
> include/hw/core/resetcontainer.h | 48 > hw/core/resetcontainer.c | 76 > hw/core/meson.build | 1 + > 4 files changed, 135 insertions(+) > create mode 100644 include/hw/core/resetcontainer.h > create mode 100644 hw/core/resetcontainer.c > Reviewed-by: Zhao Liu

Re: [PATCH 01/10] hw/i386: Store pointers to IDE buses in PCMachineState

2024-02-26 Thread Zhao Liu
| 5 ++--- > hw/i386/pc_piix.c| 16 +++- > hw/i386/pc_q35.c | 9 - > 4 files changed, 16 insertions(+), 18 deletions(-) Reviewed-by: Zhao Liu > > diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h > index ec0e5efcb28..8f8ac894b10 100644 > ---

Re: [PATCH 04/10] include/qom/object.h: New OBJECT_DEFINE_SIMPLE_TYPE{, _WITH_INTERFACES} macros

2024-02-26 Thread Zhao Liu
+++------ > 2 files changed, 117 insertions(+), 31 deletions(-) > Reviewed-by: Zhao Liu

Re: [PATCH 05/10] hw/core: Add documentation and license comments to reset.h

2024-02-26 Thread Zhao Liu
t is better accomplished using the s/for instance device/for instance, device/ > + * methods on DeviceState. > + * > + * It is not permitted to register or unregister reset functions from > + * within the @func callback. > + * > + * We assume that the caller holds the BQL. HMM, what does BQL stand for? Others LGTM. Reviewed-by: Zhao Liu

Re: [PATCH 03/10] system/bootdevice: Don't unregister reset handler in restore_boot_order()

2024-02-26 Thread Zhao Liu
, but I > didn't have a good idea for how to do that. > --- > system/bootdevice.c | 25 ++--- > 1 file changed, 14 insertions(+), 11 deletions(-) Reviewed-by: Zhao Liu

Re: [PATCH 02/10] hw/i386/pc: Do pc_cmos_init_late() from pc_machine_done()

2024-02-26 Thread Zhao Liu
g struct and can just pass the PCMachineState > pointer. > > Signed-off-by: Peter Maydell > --- > hw/i386/pc.c | 39 ++++--- > 1 file changed, 16 insertions(+), 23 deletions(-) Reviewed-by: Zhao Liu

Re: [PATCH v2 4/7] target/i386: use separate MMU indexes for 32-bit accesses

2024-02-26 Thread Zhao Liu
Hi Paolo, On Mon, Feb 26, 2024 at 10:55:14AM +0100, Paolo Bonzini wrote: > Date: Mon, 26 Feb 2024 10:55:14 +0100 > From: Paolo Bonzini > Subject: Re: [PATCH v2 4/7] target/i386: use separate MMU indexes for > 32-bit accesses > > On Mon, Feb 26, 2024 at 9:22 AM Zhao Liu wrot

Re: [PATCH] semihosting/uaccess.c: Replaced a malloc call with g_malloc

2024-02-26 Thread Zhao Liu
t; --- > semihosting/uaccess.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Also cc Michael and qemu-triv...@nongnu.org. I understand the simple cleanup can cc qemu-triv...@nongnu.org. ;-) Reviewed-by: Zhao Liu > > diff --git a/semihosting/uaccess.c b/semihosting/uaccess

Re: [PATCH v2 2/2] hw/i386/q35: Include missing 'hw/acpi/acpi.h' header

2024-02-26 Thread Zhao Liu
> ^ > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/i386/pc_q35.c | 1 + > 1 file changed, 1 insertion(+) Thanks! Reviewed-by: Zhao Liu > > diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c > index e0b3f55a02..45a4102e75

Re: [PATCH v2 1/2] hw/acpi/ich9: Include missing headers

2024-02-26 Thread Zhao Liu
.c > source file where it is used. > > Signed-off-by: Philippe Mathieu-Daudé > --- > include/hw/acpi/ich9.h | 3 ++- > hw/acpi/ich9.c | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) Thanks! Reviewed-by: Zhao Liu > > diff --git a/include/hw/acpi/ich

Re: [PATCH v2 5/6] hw/i386/pc: Populate RTC attribute directly

2024-02-26 Thread Zhao Liu
sirkin > --- > hw/i386/pc.c | 8 > hw/i386/pc_piix.c | 15 +++ > hw/i386/pc_q35.c | 7 +++ > 3 files changed, 10 insertions(+), 20 deletions(-) Reviewed-by: Zhao Liu > > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > index a80f809b83..880e95de2

Re: [PATCH v2 4/6] hw/i386/pc: Remove unneeded class attribute "kvmclock_enabled"

2024-02-26 Thread Zhao Liu
ribute is now unneeded and can be removed. > > Fixes: 30d2a17b46e9 "hw/i386: Remove the deprecated machines 0.12 up to 0.15" > Cc: Thomas Huth > Signed-off-by: Bernhard Beschow > --- > include/hw/i386/pc.h | 1 - > hw/i386/pc.c | 1 - > hw/i386/pc_pii

Re: [PATCH v2 3/6] hw/i386/pc_{piix, q35}: Eliminate local pci_bus/pci_host variables

2024-02-26 Thread Zhao Liu
iix.c | 14 ++ > hw/i386/pc_q35.c | 16 +++- > 2 files changed, 13 insertions(+), 17 deletions(-) Reviewed-by: Zhao Liu > > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c > index 3393b93007..814d24326d 100644 > --- a/hw/i386/pc_piix.c > +++ b/hw/i386

Re: [PATCH v2 2/6] hw/i386/pc: Rename "bus" attribute to "pcibus"

2024-02-26 Thread Zhao Liu
u.c | 2 +- > hw/i386/intel_iommu.c| 2 +- > hw/i386/kvm/xen_evtchn.c | 2 +- > hw/i386/pc.c | 8 > hw/i386/pc_piix.c| 6 +++--- > hw/i386/pc_q35.c | 2 +- > hw/i386/x86-iommu.c | 2 +- > 9 files changed, 14 insertions(+), 14 del

Re: [PATCH v2 1/6] hw/i386/x86: Let ioapic_init_gsi() take parent as pointer

2024-02-26 Thread Zhao Liu
| 7 +++ > hw/i386/pc_q35.c | 2 +- > hw/i386/x86.c | 7 +++ > 5 files changed, 9 insertions(+), 11 deletions(-) Reviewed-by: Zhao Liu > > diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h > index 8e306db7bb..4dc30dcb4d 100644 > --- a/incl

Re: [PATCH] atomic.h: Reword confusing comment for qatomic_cmpxchg

2024-02-26 Thread Zhao Liu
cros in atomics.rst. > > Signed-off-by: Peter Maydell > --- > include/qemu/atomic.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Zhao Liu > > diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h > index f1d3d1702a9..99110abefb3 100644 > --- a/

Re: [PATCH v2 4/7] target/i386: use separate MMU indexes for 32-bit accesses

2024-02-26 Thread Zhao Liu
On Fri, Feb 23, 2024 at 02:09:45PM +0100, Paolo Bonzini wrote: > Date: Fri, 23 Feb 2024 14:09:45 +0100 > From: Paolo Bonzini > Subject: [PATCH v2 4/7] target/i386: use separate MMU indexes for 32-bit > accesses > X-Mailer: git-send-email 2.43.0 > > Accesses from a 32-bit environment (32-bit

Re: [PATCH v2 5/7] target/i386: Fix physical address truncation

2024-02-26 Thread Zhao Liu
;target/i386: Use atomic operations for pte updates", > 2022-10-18) > Co-developed-by: Michael Brown > Signed-off-by: Michael Brown > Signed-off-by: Paolo Bonzini > --- > target/i386/cpu.h| 6 ++ > target/i386/cpu.c| 2

Re: [PATCH v2 3/7] target/i386: introduce function to query MMU indices

2024-02-25 Thread Zhao Liu
lper.c | 4 ++-- > 2 files changed, 12 insertions(+), 2 deletions(-) Reviewed-by: Zhao Liu > > diff --git a/target/i386/cpu.h b/target/i386/cpu.h > index dfe43b82042..8c271ca62e5 100644 > --- a/target/i386/cpu.h > +++ b/target/i386/cpu.h > @@ -2305,6 +2305,16 @@ uint64_t

Re: [PATCH v2 1/7] target/i386: mask high bits of CR3 in 32-bit mode

2024-02-25 Thread Zhao Liu
perations for pte updates", > 2022-10-18) > Signed-off-by: Paolo Bonzini > --- > target/i386/tcg/sysemu/excp_helper.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Zhao Liu > > diff --git a/target/i386/tcg/sysemu/excp_helper.c > b/target

[PATCH v2 1/7] hw/cxl/cxl-host: Fix missing ERRP_GUARD() in cxl_fixed_memory_window_config()

2024-02-23 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. ... * ERRP_GUARD() lifts

[PATCH v2 7/7] hw/intc: Check @errp to handle the error of IOAPICCommonClass.realize()

2024-02-23 Thread Zhao Liu
From: Zhao Liu IOAPICCommonClass implements its own private realize(), and this private realize() allows error. Since IOAPICCommonClass.realize() returns void, to check the error, dereference @errp with ERRP_GUARD(). Signed-off-by: Zhao Liu --- v2: * Add the missing ERRP_GUARD(). (Markus

[PATCH v2 5/7] hw/pci-bridge/cxl_upstream: Fix missing ERRP_GUARD() in cxl_usp_realize()

2024-02-23 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. ... * ERRP_GUARD() lifts

[PATCH v2 6/7] hw/vfio/iommufd: Fix missing ERRP_GUARD() in iommufd_cdev_getfd()

2024-02-23 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. ... * ERRP_GUARD() lifts

[PATCH v2 0/7] Cleanup and fix @errp dereference

2024-02-23 Thread Zhao Liu
From: Zhao Liu Hi all, This is my v2 series to clean and fix @errp dereference. Introduction The patches 1-6 fix the cases that deference @errp without ERRP_GUARD(), and they are based on my previsous v1 [1]. The patch 7 is merged in this series from another single patch [2

[PATCH v2 2/7] hw/display/macfb: Fix missing ERRP_GUARD() in macfb_nubus_realize()

2024-02-23 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. ... * ERRP_GUARD() lifts

[PATCH v2 4/7] hw/misc/xlnx-versal-trng: Check returned bool in trng_prop_fault_event_set()

2024-02-23 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. ... * ERRP_GUARD() lifts

[PATCH v2 3/7] hw/mem/cxl_type3: Fix missing ERRP_GUARD() in ct3_realize()

2024-02-23 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. ... * ERRP_GUARD() lifts

Re: [PATCH v4 2/2] target/i386: add control bits support for LAM

2024-02-22 Thread Zhao Liu
-by: Binbin Wu > Tested-by: Xuelian Guo > --- > target/i386/cpu.h| 7 ++- > target/i386/helper.c | 4 > 2 files changed, 10 insertions(+), 1 deletion(-) Reviewed-by: Zhao Liu > > diff --git a/target/i386/cpu.h b/target/i386/cpu.h > index 18ea755644..598a3fa

Re: [PATCH v4 1/2] target/i386: add support for LAM in CPUID enumeration

2024-02-22 Thread Zhao Liu
f-by: Binbin Wu > Tested-by: Xuelian Guo > Reviewed-by: Xiaoyao Li > --- > target/i386/cpu.c | 2 +- > target/i386/cpu.h | 2 ++ > 2 files changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Zhao Liu > > diff --git a/target/i386/cpu.c b/target/i386/cpu.c

Re: [PATCH 21/21] hw: Add QOM parentship relation with CPUs

2024-02-22 Thread Zhao Liu
s3adsp1800_mmu.c | 1 + > hw/mips/cps.c| 1 + > hw/nios2/10m50_devboard.c| 1 + > hw/ppc/e500.c| 1 + > hw/ppc/spapr.c | 1 + > 7 files changed, 7 insertions(+) Reviewed-by: Zhao Liu &

Re: [PATCH 03/21] hw/ppc/spapr_cpu: Use qdev_is_realized() instead of QOM API

2024-02-22 Thread Zhao Liu
fer QDev API for QDev objects, avoid the underlying QOM layer. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/ppc/spapr_cpu_core.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Reviewed-by: Zhao Liu > > diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr

Re: [PATCH 10/21] hw/usb: Inline usb_new()

2024-02-22 Thread Zhao Liu
Signed-off-by: Philippe Mathieu-Daudé > --- > include/hw/usb.h| 1 - > hw/usb/bus.c| 9 ++--- > hw/usb/dev-serial.c | 2 +- > 3 files changed, 3 insertions(+), 9 deletions(-) Reviewed-by: Zhao Liu > > diff --git a/include/hw/usb.h b/include/hw/usb.h > index

Re: [PATCH 07/21] target: Replace DEVICE(object_new) -> qdev_new()

2024-02-22 Thread Zhao Liu
r QDev objects, avoid the underlying QOM layer. > > Signed-off-by: Philippe Mathieu-Daudé > --- > target/mips/cpu.c | 2 +- > target/xtensa/cpu.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Zhao Liu > > diff --git a/target/mips/cpu.c b/tar

Re: [PATCH 09/21] hw/usb: Inline usb_try_new()

2024-02-22 Thread Zhao Liu
). > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/usb/bus.c | 7 +-- > 1 file changed, 1 insertion(+), 6 deletions(-) Reviewed-by: Zhao Liu > > diff --git a/hw/usb/bus.c b/hw/usb/bus.c > index 59c39945dd..148224f06a 100644 > --- a/hw/usb/bus.c > +++ b/hw/usb

Re: [PATCH 06/21] hw: Replace DEVICE(object_new) -> qdev_new()

2024-02-22 Thread Zhao Liu
r QDev objects, avoid the underlying QOM layer. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/arm/musicpal.c | 2 +- > hw/core/qdev.c| 2 +- > hw/sparc/sun4m.c | 4 ++-- > 3 files changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Zhao Liu > > diff --git

Re: [PATCH 11/21] hw/usb: Add QOM parentship relation with hub devices

2024-02-22 Thread Zhao Liu
Hi Philippe, On Fri, Feb 16, 2024 at 12:03:02PM +0100, Philippe Mathieu-Daudé wrote: > Date: Fri, 16 Feb 2024 12:03:02 +0100 > From: Philippe Mathieu-Daudé > Subject: [PATCH 11/21] hw/usb: Add QOM parentship relation with hub devices > X-Mailer: git-send-email 2.41.0 > > QDev objects created

Re: [PATCH 17/21] hw/i386/iommu: Prefer object_initialize_child over object_initialize

2024-02-22 Thread Zhao Liu
Hi Philippe, On Fri, Feb 16, 2024 at 12:03:08PM +0100, Philippe Mathieu-Daudé wrote: > Date: Fri, 16 Feb 2024 12:03:08 +0100 > From: Philippe Mathieu-Daudé > Subject: [PATCH 17/21] hw/i386/iommu: Prefer object_initialize_child over > object_initialize > X-Mailer: git-send-email 2.41.0 > > When

Re: [PATCH 02/21] hw/i386/pc_sysfw: Use qdev_is_realized() instead of QOM API

2024-02-22 Thread Zhao Liu
fer QDev API for QDev objects, avoid the underlying QOM layer. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/i386/pc_sysfw.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Zhao Liu > > diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sys

Re: [PATCH 01/21] hw/i386/pc: Do not use C99 mixed-declarations style

2024-02-22 Thread Zhao Liu
Hi Philippe, On Fri, Feb 16, 2024 at 12:02:52PM +0100, Philippe Mathieu-Daudé wrote: > Date: Fri, 16 Feb 2024 12:02:52 +0100 > From: Philippe Mathieu-Daudé > Subject: [PATCH 01/21] hw/i386/pc: Do not use C99 mixed-declarations style > X-Mailer: git-send-email 2.41.0 > > QEMU's coding style

Re: [PATCH 0/6] [PATCH 0/6] Fix missing ERRP_GUARD() when dereference @errp

2024-02-21 Thread Zhao Liu
On Thu, Feb 22, 2024 at 09:04:14AM +0300, Michael Tokarev wrote: > Date: Thu, 22 Feb 2024 09:04:14 +0300 > From: Michael Tokarev > Subject: Re: [PATCH 0/6] [PATCH 0/6] Fix missing ERRP_GUARD() when > dereference @errp > > 21.02.2024 12:43, Zhao Liu wrote: > > From: Z

Re: [PATCH 4/6] hw/misc/xlnx-versal-trng: Fix missing ERRP_GUARD() in trng_prop_fault_event_set()

2024-02-21 Thread Zhao Liu
On Wed, Feb 21, 2024 at 12:47:33PM +0100, Markus Armbruster wrote: > Date: Wed, 21 Feb 2024 12:47:33 +0100 > From: Markus Armbruster > Subject: Re: [PATCH 4/6] hw/misc/xlnx-versal-trng: Fix missing ERRP_GUARD() > in trng_prop_fault_event_set() > > Zhao Liu writes: >

Re: [PATCH 6/6] hw/vfio/iommufd: Fix missing ERRP_GUARD() in iommufd_cdev_getfd()

2024-02-21 Thread Zhao Liu
On Wed, Feb 21, 2024 at 12:53:10PM +0100, Markus Armbruster wrote: > Date: Wed, 21 Feb 2024 12:53:10 +0100 > From: Markus Armbruster > Subject: Re: [PATCH 6/6] hw/vfio/iommufd: Fix missing ERRP_GUARD() in > iommufd_cdev_getfd() > > Zhao Liu writes: > > > From: Zhao

Re: [PATCH 1/6] hw/cxl/cxl-host: Fix missing ERRP_GUARD() in cxl_fixed_memory_window_config()

2024-02-21 Thread Zhao Liu
On Wed, Feb 21, 2024 at 12:31:06PM +0100, Markus Armbruster wrote: > Date: Wed, 21 Feb 2024 12:31:06 +0100 > From: Markus Armbruster > Subject: Re: [PATCH 1/6] hw/cxl/cxl-host: Fix missing ERRP_GUARD() in > cxl_fixed_memory_window_config() > > Zhao Liu writes: >

[PATCH 2/6] hw/display/macfb: Fix missing ERRP_GUARD() in macfb_nubus_realize()

2024-02-21 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. * - It should not be passed

Re: [RFC 4/8] hw/core: Add cache topology options in -smp

2024-02-21 Thread Zhao Liu
On Wed, Feb 21, 2024 at 01:46:21PM +0100, Markus Armbruster wrote: > Date: Wed, 21 Feb 2024 13:46:21 +0100 > From: Markus Armbruster > Subject: Re: [RFC 4/8] hw/core: Add cache topology options in -smp > > Zhao Liu writes: > > > From: Zhao Liu > > > > Add

[PATCH 0/6] [PATCH 0/6] Fix missing ERRP_GUARD() when dereference @errp

2024-02-21 Thread Zhao Liu
From: Zhao Liu Hi all, Thanks to Markus's explanation about ERRP_GUARD() on my previsou patch [1], I realize that perhaps more @errp dereference cases need to be double-checked to ensure that ERRP_GUARD() is being used correctly. Therefore, there're the patches to add more missing ERRP_GUARD

[PATCH 4/6] hw/misc/xlnx-versal-trng: Fix missing ERRP_GUARD() in trng_prop_fault_event_set()

2024-02-21 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. * - It should not be passed

Re: [PATCH 2/6] hw/display/macfb: Fix missing ERRP_GUARD() in macfb_nubus_realize()

2024-02-21 Thread Zhao Liu
On Wed, Feb 21, 2024 at 12:32:43PM +0100, Markus Armbruster wrote: > Date: Wed, 21 Feb 2024 12:32:43 +0100 > From: Markus Armbruster > Subject: Re: [PATCH 2/6] hw/display/macfb: Fix missing ERRP_GUARD() in > macfb_nubus_realize() > > Zhao Liu writes: >

[PATCH 6/6] hw/vfio/iommufd: Fix missing ERRP_GUARD() in iommufd_cdev_getfd()

2024-02-21 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. * - It should not be passed

Re: [PATCH 5/6] hw/pci-bridge/cxl_upstream: Fix missing ERRP_GUARD() in cxl_usp_realize()

2024-02-21 Thread Zhao Liu
On Wed, Feb 21, 2024 at 12:49:46PM +0100, Markus Armbruster wrote: > Date: Wed, 21 Feb 2024 12:49:46 +0100 > From: Markus Armbruster > Subject: Re: [PATCH 5/6] hw/pci-bridge/cxl_upstream: Fix missing > ERRP_GUARD() in cxl_usp_realize() > > Zhao Liu writes: >

[PATCH 1/6] hw/cxl/cxl-host: Fix missing ERRP_GUARD() in cxl_fixed_memory_window_config()

2024-02-21 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. * - It should not be passed

Re: [PATCH v8 00/21] Introduce smp.modules for x86 in QEMU

2024-02-21 Thread Zhao Liu
On Wed, Feb 21, 2024 at 01:41:35PM +0100, Markus Armbruster wrote: > Date: Wed, 21 Feb 2024 13:41:35 +0100 > From: Markus Armbruster > Subject: Re: [PATCH v8 00/21] Introduce smp.modules for x86 in QEMU > > Zhao Liu writes: > > > From: Zhao Liu > > > >

Re: [PATCH 3/6] hw/mem/cxl_type3: Fix missing ERRP_GUARD() in ct3_realize()

2024-02-21 Thread Zhao Liu
On Wed, Feb 21, 2024 at 12:35:47PM +0100, Markus Armbruster wrote: > Date: Wed, 21 Feb 2024 12:35:47 +0100 > From: Markus Armbruster > Subject: Re: [PATCH 3/6] hw/mem/cxl_type3: Fix missing ERRP_GUARD() in > ct3_realize() > > Zhao Liu writes: > > > From: Zhao

[PATCH 3/6] hw/mem/cxl_type3: Fix missing ERRP_GUARD() in ct3_realize()

2024-02-21 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. * - It should not be passed

[PATCH 5/6] hw/pci-bridge/cxl_upstream: Fix missing ERRP_GUARD() in cxl_usp_realize()

2024-02-21 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. * - It should not be passed

[PATCH v2] hw/intc: Handle the error of IOAPICCommonClass.realize()

2024-02-20 Thread Zhao Liu
From: Zhao Liu IOAPICCommonClass implements its own private realize(), and this private realize() allows error. Therefore, return directly if IOAPICCommonClass.realize() meets error. Signed-off-by: Zhao Liu --- v2: Add the missing ERRP_GUARD(). (Markus) --- hw/intc/ioapic_common.c | 4

Re: [PATCH 0/8] tests/unit/test-smp-parse.c: Add more CPU topology test cases

2024-02-20 Thread Zhao Liu
, 2024 at 05:38:24PM +0800, Zhao Liu wrote: > Date: Mon, 29 Jan 2024 17:38:24 +0800 > From: Zhao Liu > Subject: Re: [PATCH 0/8] tests/unit/test-smp-parse.c: Add more CPU topology > test cases > > Hi Philippe, > > A kindly ping. > > Thanks, > Zhao > > On Thu,

[RFC 0/8] Introduce SMP Cache Topology

2024-02-20 Thread Zhao Liu
From: Zhao Liu Hi list, This's our proposal for supporting (SMP) cache topology in -smp as the following example: -smp 32,sockets=2,dies=2,modules=2,cores=2,threads=2,maxcpus=32,\ l1d-cache=core,l1i-cache=core,l2-cache=core,l3-cache=die With the new cache topology options ("l1d-

[RFC 3/8] hw/core: Define cache topology for machine

2024-02-20 Thread Zhao Liu
From: Zhao Liu Define the cache topology based on CPU topology level for two reasons: 1. In practice, a cache will always be bound to the CPU container (either private in the CPU container or shared among multiple containers), and CPU container is often expressed in terms of CPU

[RFC 4/8] hw/core: Add cache topology options in -smp

2024-02-20 Thread Zhao Liu
From: Zhao Liu Add "l1d-cache", "l1i-cache". "l2-cache", and "l3-cache" options in -smp to define the cache topology for SMP system. Signed-off-by: Zhao Liu --- hw/core/machine-smp.c | 128 ++ hw/core/machine.c

[RFC 6/8] i386/cpu: Update cache topology with machine's configuration

2024-02-20 Thread Zhao Liu
From: Zhao Liu User will configure SMP cache topology via -smp. For this case, update the x86 CPUs' cache topology with user's configuration in MachineState. Signed-off-by: Zhao Liu --- target/i386/cpu.c | 21 + 1 file changed, 21 insertions(+) diff --git a/target/i386

[RFC 8/8] qemu-options: Add the cache topology description of -smp

2024-02-20 Thread Zhao Liu
From: Zhao Liu Signed-off-by: Zhao Liu --- qemu-options.hx | 54 ++--- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 70eaf3256685..85c78c99a3b0 100644 --- a/qemu-options.hx +++ b/qemu

[RFC 7/8] i386/pc: Support cache topology in -smp for PC machine

2024-02-20 Thread Zhao Liu
From: Zhao Liu Signed-off-by: Zhao Liu --- hw/i386/pc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 25124a077eea..76148c3337cf 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1848,6 +1848,9 @@ static void pc_machine_class_init(ObjectClass *oc, void

[RFC 1/8] hw/core: Rename CpuTopology to CPUTopology

2024-02-20 Thread Zhao Liu
From: Zhao Liu Use CPUTopology to honor the generic style of CPU capitalization abbreviations. Signed-off-by: Zhao Liu --- hw/s390x/cpu-topology.c | 6 +++--- include/hw/boards.h | 8 include/hw/s390x/cpu-topology.h | 6 +++--- tests/unit/test-smp-parse.c

[RFC 5/8] i386/cpu: Support thread and module level cache topology

2024-02-20 Thread Zhao Liu
From: Zhao Liu Allows cache to be defined at the thread and module level. This increases flexibility for x86 users to customize their cache topology. Signed-off-by: Zhao Liu --- target/i386/cpu.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.c

[RFC 2/8] hw/core: Move CPU topology enumeration into arch-agnostic file

2024-02-20 Thread Zhao Liu
From: Zhao Liu Cache topology needs to be defined based on CPU topology levels. Thus, move CPU topology enumeration into a common header. To match the general topology naming style, rename CPU_TOPO_LEVEL_SMT and CPU_TOPO_LEVEL_PACKAGE to CPU_TOPO_LEVEL_THREAD and CPU_TOPO_LEVEL_SOCKET. Also

Re: [PATCH 5/5] hw/i386/q35: Include missing 'hw/acpi/acpi.h' header

2024-02-19 Thread Zhao Liu
Hi Philippe, On Mon, Feb 19, 2024 at 03:14:11PM +0100, Philippe Mathieu-Daudé wrote: > Date: Mon, 19 Feb 2024 15:14:11 +0100 > From: Philippe Mathieu-Daudé > Subject: [PATCH 5/5] hw/i386/q35: Include missing 'hw/acpi/acpi.h' header > X-Mailer: git-send-email 2.41.0 > > "hw/acpi/acpi.h" is

Re: [PATCH 4/5] hw/acpi/ich9_tco: Include missing 'migration/vmstate.h' header

2024-02-19 Thread Zhao Liu
.0 > > We need the VMStateDescription structure definition from > "migration/vmstate.h" in order to declare vmstate_tco_io_sts. > > Signed-off-by: Philippe Mathieu-Daudé > --- > include/hw/acpi/ich9_tco.h | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Zhao Liu > &g

Re: [PATCH 3/5] hw/acpi/ich9: Include missing headers

2024-02-19 Thread Zhao Liu
Hi Philippe, On Mon, Feb 19, 2024 at 03:14:09PM +0100, Philippe Mathieu-Daudé wrote: > Date: Mon, 19 Feb 2024 15:14:09 +0100 > From: Philippe Mathieu-Daudé > Subject: [PATCH 3/5] hw/acpi/ich9: Include missing headers > X-Mailer: git-send-email 2.41.0 > > The ICH9LPCPMRegs structure has

Re: [PATCH 1/5] hw/acpi: Include missing 'qapi/qapi-types-acpi.h' generated header

2024-02-19 Thread Zhao Liu
^ > > Signed-off-by: Philippe Mathieu-Daudé > --- > include/hw/acpi/cpu.h| 1 + > include/hw/acpi/memory_hotplug.h | 1 + > 2 files changed, 2 insertions(+) Reviewed-by: Zhao Liu > > diff --git a/include/hw/

Re: [PATCH v8 00/21] Introduce smp.modules for x86 in QEMU

2024-02-15 Thread Zhao Liu
Hi Daniel, On Thu, Feb 08, 2024 at 04:52:33PM +, Daniel P. Berrangé wrote: > Date: Thu, 8 Feb 2024 16:52:33 + > From: "Daniel P. Berrangé" > Subject: Re: [PATCH v8 00/21] Introduce smp.modules for x86 in QEMU > > On Fri, Feb 02, 2024 at 12:10:58AM +0800, Zhao

Re: [PATCH] hw/intc: Handle the error of IOAPICCommonClass.realize()

2024-02-07 Thread Zhao Liu
Hi Markus, On Wed, Feb 07, 2024 at 07:51:52AM +0100, Markus Armbruster wrote: > Date: Wed, 07 Feb 2024 07:51:52 +0100 > From: Markus Armbruster > Subject: Re: [PATCH] hw/intc: Handle the error of > IOAPICCommonClass.realize() > > Zhao Liu writes: > > > Hi Phili

Re: [PATCH] hw/intc: Handle the error of IOAPICCommonClass.realize()

2024-02-06 Thread Zhao Liu
Ping Philippe & Markus, Do you have furthur comment on such private realize()? ;-) Thanks, Zhao On Thu, Feb 01, 2024 at 11:25:56AM +0800, Zhao Liu wrote: > Date: Thu, 1 Feb 2024 11:25:56 +0800 > From: Zhao Liu > Subject: Re: [PATCH] hw/intc: Handle the error of > IOAPICCom

Re: [RFC 0/6] Intel Thread Director Virtualization Support in QEMU

2024-02-03 Thread Zhao Liu
On Sat, Feb 03, 2024 at 05:30:48PM +0800, Zhao Liu wrote: > Date: Sat, 3 Feb 2024 17:30:48 +0800 > From: Zhao Liu > Subject: [RFC 0/6] Intel Thread Director Virtualization Support in QEMU > X-Mailer: git-send-email 2.34.1 > > From: Zhao Liu > > Hi list, >

[RFC 0/6] Intel Thread Director Virtualization Support in QEMU

2024-02-03 Thread Zhao Liu
From: Zhao Liu Hi list, This is our refreshed RFC to support our ITD virtualization patch series [1] in KVM, and bases on bd2e12310b18 ("Merge tag 'qga-pull-2024-01-30' of https://github.com/kostyanf14/qemu into staging"). ITD is Intel's client specific feature to optimize schedulin

[RFC 3/6] target/i386: Add support for Hardware Feedback Interface feature

2024-02-03 Thread Zhao Liu
THREAD DIRECTOR Tested-by: Yanting Jiang Co-developed-by: Zhuocheng Ding Signed-off-by: Zhuocheng Ding Signed-off-by: Zhao Liu --- target/i386/cpu.c | 49 ++- target/i386/cpu.h | 8 ++- target/i386/kvm/kvm.c | 21 +++ 3 files

[RFC 5/6] target/i386: Add support for HRESET feature

2024-02-03 Thread Zhao Liu
support since it's emulated in KVM. This MSR is used to control the enabling of ITD's history reset. [1]: SDM, vol. 3B, section 15.6.11 Logical Processor Scope History Tested-by: Yanting Jiang Co-developed-by: Zhuocheng Ding Signed-off-by: Zhuocheng Ding Signed-off-by: Zhao Liu --- target/i386

[RFC 4/6] target/i386: Add support for Intel Thread Director feature

2024-02-03 Thread Zhao Liu
From: Zhao Liu Intel Thread Director (ITD) is the extension of HFI, and it extends the HFI to provide performance and energy efficiency data for advanced classes of instructions [1]. >From Alder Lake, Intel's client products support ITD, and this feature can be used in VM to optimize schedul

[RFC 2/6] target/i386: Add support for Package Thermal Management feature

2024-02-03 Thread Zhao Liu
scenario. Additionally, add save/load support for 2 PTS related MSRs. Tested-by: Yanting Jiang Co-developed-by: Zhuocheng Ding Signed-off-by: Zhuocheng Ding Signed-off-by: Zhao Liu --- target/i386/cpu.c | 22 +- target/i386/cpu.h | 13 + target/i386/kvm

[RFC 6/6] i386: Add a new property to set ITD related feature bits for Guest

2024-02-03 Thread Zhao Liu
From: Zhao Liu The property enable-itd will be used to set ITD related feature bits for Guest, which includes PTS, HFI, ITD and HRESET. Now PTS, HFI, ITD and HRESET are marked as no_autoenable_flags, since PTS, HFI and ITD have additional restrictions on CPU topology, and HRESET is only used

[RFC 1/6] target/i386: Add support for save/load of ACPI thermal MSRs

2024-02-03 Thread Zhao Liu
SDM, vol. 3B, section 15.8.4.1, Detection of Software Controlled Clock Modulation Extension. Tested-by: Yanting Jiang Signed-off-by: Zhuocheng Ding Co-developed-by: Zhao Liu Signed-off-by: Zhao Liu --- target/i386/cpu.h | 9 + target/i386/kvm/kvm.c | 25 +

Re: [PATCH v8 00/21] Introduce smp.modules for x86 in QEMU

2024-02-01 Thread Zhao Liu
Hi Daniel, On Thu, Feb 01, 2024 at 09:21:48AM +, Daniel P. Berrangé wrote: > Date: Thu, 1 Feb 2024 09:21:48 + > From: "Daniel P. Berrangé" > Subject: Re: [PATCH v8 00/21] Introduce smp.modules for x86 in QEMU > > On Thu, Feb 01, 2024 at 10:57:32AM +0800, Zhao

[PATCH 4/4] hw/arm/smmuv3: Consolidate the use of device_class_set_parent_realize()

2024-02-01 Thread Zhao Liu
From: Zhao Liu Use device_class_set_parent_realize() to set parent realize() directly. Signed-off-by: Zhao Liu --- hw/arm/smmuv3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 68eeef3e1d4c..b3d8642a4990 100644 --- a/hw/arm

[PATCH 1/4] hw/isa/vt82c686: Consolidate the use of device_class_set_parent_realize()

2024-02-01 Thread Zhao Liu
From: Zhao Liu Use device_class_set_parent_realize() to set parent realize() directly. Signed-off-by: Zhao Liu --- hw/isa/vt82c686.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index d3e0f6d01fb6..a99eae4f6333 100644 --- a/hw

[PATCH 3/4] hw/intc/s390_flic: Consolidate the use of device_class_set_parent_realize()

2024-02-01 Thread Zhao Liu
From: Zhao Liu Use device_class_set_parent_realize() to set parent realize() directly. Signed-off-by: Zhao Liu --- hw/intc/s390_flic_kvm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index 4d5cbb2a2fb6

<    2   3   4   5   6   7   8   9   10   11   >