[PATCH 2/2] qapi: List block-core.json in qapi-schema.json

2024-05-17 Thread Zhao Liu
Currently, block-core.json is not explicitly listed in the qapi-schema.json. To make the dependencies clearer, list block-core.json in section 2. Signed-off-by: Zhao Liu --- qapi/qapi-schema.json | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/qapi/qapi

[PATCH 1/2] qapi: Reorder and categorize json files in qapi-schema.json

2024-05-17 Thread Zhao Liu
on this, the new files should be placed in the corresponding sections according to the dependencies/dependency hierarchy. Signed-off-by: Zhao Liu --- qapi/qapi-schema.json | 100 +- 1 file changed, 69 insertions(+), 31 deletions(-) diff --git a/qapi/qapi

[PATCH 0/2] qapi/qapi-schema: Clarify the dependency relationship

2024-05-17 Thread Zhao Liu
to manually categorize and sort JSON files generation order by dependencies/dependency hierarchy, to improve the readability and maintainability of qapi-schema.json. Welcome your feedback! Thanks and Best Regards, Zhao --- Zhao Liu (2): qapi: Reorder and categorize json files in qapi-schema.json qapi

Re: [PATCH 2/2] tests: add testing of parameter=1 for SMP topology

2024-05-16 Thread Zhao Liu
GY_GENERIC(8, 2, 2, 2, 8), > +.expect_prefer_cores = CPU_TOPOLOGY_GENERIC(8, 2, 2, 2, 8), > }, > }; > As Xiaoyao's suggestion, only the nit in the comment. Others look good to me, so, Reviewed-by: Zhao Liu

Re: [PATCH 1/2] hw/core: allow parameter=1 for SMP topology on any machine

2024-05-16 Thread Zhao Liu
tively reverts > > commit 54c4ea8f3ae614054079395842128a856a73dbf9 > Author: Zhao Liu > Date: Sat Mar 9 00:01:37 2024 +0800 > > hw/core/machine-smp: Deprecate unsupported "parameter=1" SMP > configurations > > but is not done as a 'git revert' since the part of the changes to t

Re: [PATCH 1/2] hw/core: allow parameter=1 for SMP topology on any machine

2024-05-16 Thread Zhao Liu
On Wed, May 15, 2024 at 06:06:56PM +0100, Daniel P. Berrangé wrote: > Date: Wed, 15 May 2024 18:06:56 +0100 > From: "Daniel P. Berrangé" > Subject: Re: [PATCH 1/2] hw/core: allow parameter=1 for SMP topology on any > machine > > On Tue, May 14, 2024 at 11:4

Re: [PATCH v11 00/21] i386: Introduce smp.modules and clean up cache topology

2024-05-15 Thread Zhao Liu
Hi Paolo, I have a question before I do a new v12 rebase: Since patch 5,6,7 fixed CPUID encoding way, should I add the compat options for older machines to be compatible with past encoding behavior? Thanks, Zhao On Wed, Apr 24, 2024 at 11:49:08PM +0800, Zhao Liu wrote: > Date: Wed, 24 Apr 2

Re: [PATCH] scripts/simpletrace: Mark output with unstable timestamp as WARN

2024-05-14 Thread Zhao Liu
Hi Stefan, > QEMU uses clock_gettime(CLOCK_MONOTONIC) on Linux hosts. The man page > says: > > All CLOCK_MONOTONIC variants guarantee that the time returned by > consecutive calls will not go backwards, but successive calls > may—depending on the architecture—return identical

Re: [PATCH 1/2] hw/core: allow parameter=1 for SMP topology on any machine

2024-05-13 Thread Zhao Liu
> I'm failing to see what real world technical problems QEMU faces > with a parameter being set to '1' by a mgmt app, when QEMU itself > treats all omitted values as being '1' anyway. > > If we're trying to faithfully model the real world, then restricting > the topology against machine types

Re: [PATCH 1/2] hw/core: allow parameter=1 for SMP topology on any machine

2024-05-13 Thread Zhao Liu
gt; This effectively reverts > > commit 54c4ea8f3ae614054079395842128a856a73dbf9 > Author: Zhao Liu > Date: Sat Mar 9 00:01:37 2024 +0800 > > hw/core/machine-smp: Deprecate unsupported "parameter=1" SMP > configurations > > but is not done as a

Re: [PATCH v9] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-05-13 Thread Zhao Liu
Hi Daniel, > Please describe it in terms of a QAPI definition, as that's what we're > striving for with all QEMU public interfaces. Once the QAPI design is > agreed, then the -object mapping is trivial, as -object's JSON format > supports arbitrary QAPI structures. Thank you for your guidance!

Re: [PATCH] target/i386: remove PCOMMIT from TCG, deprecate property

2024-05-10 Thread Zhao Liu
ate.c | 12 +--- > 4 files changed, 10 insertions(+), 14 deletions(-) Reviewed-by: Zhao Liu

Re: [PATCH 12/13] i386: select correct components for no-board build

2024-05-10 Thread Zhao Liu
> > Signed-off-by: Paolo Bonzini > --- > hw/intc/ioapic-stub.c | 29 + > .gitlab-ci.d/buildtest.yml | 2 +- > hw/intc/meson.build| 2 +- > target/i386/Kconfig| 1 + > 4 files changed, 32 insertions(+), 2 deletions(-) > create mode 100644 hw/intc/ioapic-stub.c Reviewed-by: Zhao Liu

Re: [PATCH 11/13] hw/i386: move rtc-reset-reinjection command out of hw/rtc

2024-05-10 Thread Zhao Liu
6818rtc.h | 2 +- > hw/i386/monitor.c| 46 > hw/rtc/mc146818rtc.c | 12 ++ > hw/i386/meson.build | 1 + > 4 files changed, 50 insertions(+), 11 deletions(-) > create mode 100644 hw/i386/monitor.c Reviewed-by: Zhao Liu

Re: [PATCH 10/13] hw/i386: split x86.c in multiple parts

2024-05-10 Thread Zhao Liu
> hw/i386/x86-cpu.c | 97 > hw/i386/x86.c | 1052 + > hw/i386/meson.build |4 +- > 5 files changed, 1113 insertions(+), 1053 deletions(-) > create mode 100644 hw/i386/x86-common.c > cre

Re: [PATCH 08/13] i386: correctly select code in hw/i386 that depends on other components

2024-05-10 Thread Zhao Liu
+ > hw/i386/meson.build | 2 +- > 2 files changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Zhao Liu

Re: [PATCH 09/13] i386: pc: remove unnecessary MachineClass overrides

2024-05-10 Thread Zhao Liu
rride these fields of MachineClass because they are > already set to the right value in the superclass. > > Signed-off-by: Paolo Bonzini > --- > include/hw/i386/x86.h | 4 > hw/i386/pc.c | 3 --- > hw/i386/x86.c | 6 +++--- > 3 files changed, 3 insertions(+), 10 deletions(-) Reviewed-by: Zhao Liu

Re: [PATCH] target/i386: fix operand size for DATA16 REX.W POPCNT

2024-05-10 Thread Zhao Liu
f("%x\n", y); > } > > which prints 5//5 on real hardware and 5// > on QEMU. > > Cc: qemu-sta...@nongnu.org > Signed-off-by: Paolo Bonzini > --- > target/i386/tcg/translate.c | 17 + > 1 file changed, 1 insertion(+), 16 deletions(-) Awesome! Reviewed-by: Zhao Liu

Re: [PATCH] tests/tcg: cover lzcnt/tzcnt/popcnt

2024-05-10 Thread Zhao Liu
cg/i386/test-i386.c | 25 + > 1 file changed, 25 insertions(+) Reviewed-by: Zhao Liu

Re: [PATCH] target/i386: move prefetch and multi-byte UD/NOP to new decoder

2024-05-10 Thread Zhao Liu
ini > --- > target/i386/tcg/decode-new.h | 1 + > target/i386/tcg/translate.c | 30 -- > target/i386/tcg/decode-new.c.inc | 24 +--- > target/i386/tcg/emit.c.inc | 5 + > 4 files changed, 27 insertions(+), 33 deletions(-) Reviewed-by: Zhao Liu

Re: [PATCH] target/i386: add feature dependency for XSAVE

2024-05-09 Thread Zhao Liu
ke no sense if you > cannot enable XSAVE in the first place. > > Signed-off-by: Paolo Bonzini > --- > target/i386/cpu.c | 4 > 1 file changed, 4 insertions(+) Reviewed-by: Zhao Liu

Re: [PATCH] target/i386: fix feature dependency for WAITPKG

2024-05-09 Thread Zhao Liu
file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Zhao Liu

Re: [PATCH v9] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-05-09 Thread Zhao Liu
Hi Daniel & Shaoqin, Since x86 also needs to implement PMU filter feature, though it uses the different KVM ioctl, we can still make the QEMU API as general as possible. To move forward with both ARM and x86, I'd like to discuss my API thinking with you. ;-) On Mon, Apr 15, 2024 at 06:29:25PM

Re: [PATCH] scripts/simpletrace: Mark output with unstable timestamp as WARN

2024-05-08 Thread Zhao Liu
On Wed, May 08, 2024 at 04:23:00PM +0200, Philippe Mathieu-Daudé wrote: > Date: Wed, 8 May 2024 16:23:00 +0200 > From: Philippe Mathieu-Daudé > Subject: Re: [PATCH] scripts/simpletrace: Mark output with unstable > timestamp as WARN > > On 8/5/24 15:55, Zhao Liu wrot

Re: [PATCH] scripts/simpletrace: Mark output with unstable timestamp as WARN

2024-05-08 Thread Zhao Liu
On Wed, May 08, 2024 at 02:05:04PM -0400, Stefan Hajnoczi wrote: > Date: Wed, 8 May 2024 14:05:04 -0400 > From: Stefan Hajnoczi > Subject: Re: [PATCH] scripts/simpletrace: Mark output with unstable > timestamp as WARN > > On Wed, 8 May 2024 at 00:19, Zhao Liu wrote: > &g

Re: [PATCH] scripts/simpletrace: Mark output with unstable timestamp as WARN

2024-05-08 Thread Zhao Liu
Hi Philippe, On Wed, May 08, 2024 at 03:09:39PM +0200, Philippe Mathieu-Daudé wrote: > Date: Wed, 8 May 2024 15:09:39 +0200 > From: Philippe Mathieu-Daudé > Subject: Re: [PATCH] scripts/simpletrace: Mark output with unstable > timestamp as WARN > > On 8/5/24 06:32, Zhao Liu

[PATCH] scripts/simpletrace: Mark output with unstable timestamp as WARN

2024-05-07 Thread Zhao Liu
(8497404908625808) pid=3289596 type=0xc008ae67 arg=0x7ffeefb5aa60 This would help to identify unusual events. And skip them without updating Formatter2.last_timestamp_ns to avoid time back. Signed-off-by: Zhao Liu --- scripts/simpletrace.py | 11 +++ 1 file changed, 11

Re: [PATCH V8 3/8] hw/acpi: Update ACPI GED framework to support vCPU Hotplug

2024-05-06 Thread Zhao Liu
Hi Salil, On Fri, May 03, 2024 at 07:59:32PM +, Salil Mehta wrote: > Date: Fri, 3 May 2024 19:59:32 + > From: Salil Mehta > Subject: RE: [PATCH V8 3/8] hw/acpi: Update ACPI GED framework to support > vCPU Hotplug > > Hello, > > Sorry, I missed this earlie

[PATCH v2 4/6] target/i386/kvm: Save/load MSRs of kvmclock2 (KVM_FEATURE_CLOCKSOURCE2)

2024-05-06 Thread Zhao Liu
MSR_KVM_SYSTEM_TIME_NEW and MSR_KVM_WALL_CLOCK_NEW are bound to kvmclock2 (KVM_FEATURE_CLOCKSOURCE2). Add the save/load support for these 2 MSRs just like kvmclock MSRs. Signed-off-by: Zhao Liu --- target/i386/cpu.h | 2 ++ target/i386/kvm/kvm.c | 16 2 files changed, 18

[PATCH v2 5/6] target/i386/kvm: Drop workaround for KVM_X86_DISABLE_EXITS_HTL typo

2024-05-06 Thread Zhao Liu
The KVM_X86_DISABLE_EXITS_HTL typo has been fixed in commit 77d361b13c19 ("linux-headers: Update to kernel mainline commit b357bf602"). Drop the related workaround. Signed-off-by: Zhao Liu --- target/i386/kvm/kvm.c | 4 1 file changed, 4 deletions(-) diff --git a/target/i386/k

[PATCH v2 1/6] target/i386/kvm: Add feature bit definitions for KVM CPUID

2024-05-06 Thread Zhao Liu
Add feature definitions for KVM_CPUID_FEATURES in CPUID ( CPUID[4000_0001].EAX and CPUID[4000_0001].EDX), to get rid of lots of offset calculations. Signed-off-by: Zhao Liu --- v2: Fixed a typo. v1: Changed the prefix from CPUID_FEAT_KVM_* to CPUID_KVM_*. (Xiaoyao) --- hw/i386/kvm/clock.c

[PATCH v2 6/6] target/i386/confidential-guest: Fix comment of x86_confidential_guest_kvm_type()

2024-05-06 Thread Zhao Liu
Update the comment to match the X86ConfidentialGuestClass implementation. Reported-by: Xiaoyao Li Signed-off-by: Zhao Liu Reviewed-by: Pankaj Gupta --- target/i386/confidential-guest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/confidential-guest.h b

[PATCH v2 3/6] target/i386/kvm: Only save/load kvmclock MSRs when kvmclock enabled

2024-05-06 Thread Zhao Liu
MSR_KVM_SYSTEM_TIME and MSR_KVM_WALL_CLOCK are attached with the (old) kvmclock feature (KVM_FEATURE_CLOCKSOURCE). So, just save/load them only when kvmclock (KVM_FEATURE_CLOCKSOURCE) is enabled. Signed-off-by: Zhao Liu --- target/i386/kvm/kvm.c | 12 1 file changed, 8 insertions

[PATCH v2 0/6] target/i386: Misc cleanup on KVM PV defs and outdated comments

2024-05-06 Thread Zhao Liu
://lore.kernel.org/qemu-devel/20240329101954.3954987-1-zhao1@linux.intel.com/ [3]: https://lore.kernel.org/qemu-devel/2815f0f1-9e20-4985-849c-d74c6cdc9...@intel.com/ Thanks and Best Regards, Zhao --- Zhao Liu (6): target/i386/kvm: Add feature bit definitions for KVM CPUID target/i386/kvm: Remove local

[PATCH v2 2/6] target/i386/kvm: Remove local MSR_KVM_WALL_CLOCK and MSR_KVM_SYSTEM_TIME definitions

2024-05-06 Thread Zhao Liu
These 2 MSRs have been already defined in kvm_para.h (standard-headers/ asm-x86/kvm_para.h). Remove QEMU local definitions to avoid duplication. Reviewed-by: Xiaoyao Li Signed-off-by: Zhao Liu --- target/i386/kvm/kvm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/i386/kvm

Re: [PATCH v11 19/21] i386: Add cache topology info in CPUCacheInfo

2024-05-06 Thread Zhao Liu
Hi Tejus, (Also +Paolo/Daniel) On Tue, Apr 30, 2024 at 06:14:52AM +, Tejus GK wrote: > Date: Tue, 30 Apr 2024 06:14:52 + > From: Tejus GK > Subject: Re: [PATCH v11 19/21] i386: Add cache topology info in CPUCacheInfo > > > > On 24 Apr 2024, at 9:1

Re: [PATCH 6/6] target/i386/confidential-guest: Fix comment of x86_confidential_guest_kvm_type()

2024-05-05 Thread Zhao Liu
Hi Xiaoyao, On Sat, Apr 27, 2024 at 07:05:41AM +0800, Xiaoyao Li wrote: > Date: Sat, 27 Apr 2024 07:05:41 +0800 > From: Xiaoyao Li > Subject: Re: [PATCH 6/6] target/i386/confidential-guest: Fix comment of > x86_confidential_guest_kvm_type() > > On 4/26/2024 6:07 PM, Zhao Liu

Re: [PATCH 1/6] target/i386/kvm: Add feature bit definitions for KVM CPUID

2024-05-05 Thread Zhao Liu
Hi Zide, On Fri, Apr 26, 2024 at 10:23:27AM -0700, Chen, Zide wrote: > Date: Fri, 26 Apr 2024 10:23:27 -0700 > From: "Chen, Zide" > Subject: Re: [PATCH 1/6] target/i386/kvm: Add feature bit definitions for > KVM CPUID > > On 4/26/2024 3:07 AM, Zhao Liu wrote:

[PATCH 4/6] target/i386/kvm: Save/load MSRs of new kvmclock (KVM_FEATURE_CLOCKSOURCE2)

2024-04-26 Thread Zhao Liu
MSR_KVM_SYSTEM_TIME_NEW and MSR_KVM_WALL_CLOCK_NEW are bound to new kvmclock (KVM_FEATURE_CLOCKSOURCE2). Add the save/load support for these 2 MSRs. Signed-off-by: Zhao Liu --- target/i386/cpu.h | 2 ++ target/i386/kvm/kvm.c | 16 2 files changed, 18 insertions(+) diff

[PATCH 3/6] target/i386/kvm: Only Save/load kvmclock MSRs when kvmclock enabled

2024-04-26 Thread Zhao Liu
MSR_KVM_SYSTEM_TIME and MSR_KVM_WALL_CLOCK are attached with the (old) kvmclock feature (KVM_FEATURE_CLOCKSOURCE). So, just save/load them only when kvmclock (KVM_FEATURE_CLOCKSOURCE) is enabled. Signed-off-by: Zhao Liu --- target/i386/kvm/kvm.c | 12 1 file changed, 8 insertions

[PATCH 4/6] target/i386/kvm: Save/load MSRs of kvmclock2 (KVM_FEATURE_CLOCKSOURCE2)

2024-04-26 Thread Zhao Liu
MSR_KVM_SYSTEM_TIME_NEW and MSR_KVM_WALL_CLOCK_NEW are bound to kvmclock2 (KVM_FEATURE_CLOCKSOURCE2). Add the save/load support for these 2 MSR just like kvmclock MSRs. Signed-off-by: Zhao Liu --- target/i386/cpu.h | 2 ++ target/i386/kvm/kvm.c | 16 2 files changed, 18

[PATCH 2/6] target/i386/kvm: Remove local MSR_KVM_WALL_CLOCK and MSR_KVM_SYSTEM_TIME definitions

2024-04-26 Thread Zhao Liu
These 2 MSRs have been already defined in the kvm_para header (standard-headers/asm-x86/kvm_para.h). Remove QEMU local definitions to avoid duplication. Reviewed-by: Xiaoyao Li Signed-off-by: Zhao Liu --- target/i386/kvm/kvm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/i386

[PATCH 5/6] target/i386/kvm: Drop workaround for KVM_X86_DISABLE_EXITS_HTL typo

2024-04-26 Thread Zhao Liu
The KVM_X86_DISABLE_EXITS_HTL typo has been fixed in commit 77d361b13c19 ("linux-headers: Update to kernel mainline commit b357bf602"). Drop the related workaround. Signed-off-by: Zhao Liu --- target/i386/kvm/kvm.c | 4 1 file changed, 4 deletions(-) diff --git a/target/i386/k

[PATCH 0/6] target/i386: Misc cleanup on KVM PV defs and outdated comments

2024-04-26 Thread Zhao Liu
consolidated them all in one series and was able to tackle them in one go! [1]: https://lore.kernel.org/qemu-devel/20240329101954.3954987-1-zhao1@linux.intel.com/ [2]: https://lore.kernel.org/qemu-devel/2815f0f1-9e20-4985-849c-d74c6cdc9...@intel.com/ Thanks and Best Regards, Zhao --- Zhao Liu

[PATCH 6/6] target/i386/confidential-guest: Fix comment of x86_confidential_guest_kvm_type()

2024-04-26 Thread Zhao Liu
Update the comment to match the X86ConfidentialGuestClass implementation. Suggested-by: Xiaoyao Li Signed-off-by: Zhao Liu --- target/i386/confidential-guest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/confidential-guest.h b/target/i386/confidential

[PATCH 1/6] target/i386/kvm: Add feature bit definitions for KVM CPUID

2024-04-26 Thread Zhao Liu
Add feature definiations for KVM_CPUID_FEATURES in CPUID ( CPUID[4000_0001].EAX and CPUID[4000_0001].EDX), to get rid of lots of offset calculations. Signed-off-by: Zhao Liu --- v2: Changed the prefix from CPUID_FEAT_KVM_* to CPUID_KVM_*. (Xiaoyao) --- hw/i386/kvm/clock.c | 5 ++--- target

Re: [PULL v2 00/63] First batch of i386 and build system patch for QEMU 9.1

2024-04-26 Thread Zhao Liu
On Fri, Apr 26, 2024 at 03:43:15PM +0800, Zhao Liu wrote: > Date: Fri, 26 Apr 2024 15:43:15 +0800 > From: Zhao Liu > Subject: Re: [PULL v2 00/63] First batch of i386 and build system patch for > QEMU 9.1 > > Hi Paolo, > > On Fri, Apr 26, 2024 at 07:21:12AM +0200, Paolo

Re: [PULL v2 00/63] First batch of i386 and build system patch for QEMU 9.1

2024-04-26 Thread Zhao Liu
Hi Paolo, On Fri, Apr 26, 2024 at 07:21:12AM +0200, Paolo Bonzini wrote: > Date: Fri, 26 Apr 2024 07:21:12 +0200 > From: Paolo Bonzini > Subject: Re: [PULL v2 00/63] First batch of i386 and build system patch for > QEMU 9.1 > > On Wed, Apr 24, 2024 at 8:49 PM Richard Henderson > wrote: > > >

Re: [PATCH for-9.1 09/19] target/i386: move 60-BF opcodes to new decoder

2024-04-25 Thread Zhao Liu
On Wed, Apr 24, 2024 at 01:13:01PM +0200, Paolo Bonzini wrote: > Date: Wed, 24 Apr 2024 13:13:01 +0200 > From: Paolo Bonzini > Subject: Re: [PATCH for-9.1 09/19] target/i386: move 60-BF opcodes to new > decoder > > On Thu, Apr 11, 2024 at 5:05 PM Zhao Liu wrote: > &g

Re: [PATCH for-9.1 0/7] target/i386/kvm: Cleanup the kvmclock feature name

2024-04-25 Thread Zhao Liu
On Thu, Apr 25, 2024 at 08:04:46PM +0800, Xiaoyao Li wrote: > Date: Thu, 25 Apr 2024 20:04:46 +0800 > From: Xiaoyao Li > Subject: Re: [PATCH for-9.1 0/7] target/i386/kvm: Cleanup the kvmclock > feature name > > On 4/25/2024 6:29 PM, Zhao Liu wrote: > > On Thu, Apr 25,

Re: [PATCH v11 00/21] i386: Introduce smp.modules and clean up cache topology

2024-04-25 Thread Zhao Liu
On Thu, Apr 25, 2024 at 10:06:11AM +0200, Philippe Mathieu-Daudé wrote: > Date: Thu, 25 Apr 2024 10:06:11 +0200 > From: Philippe Mathieu-Daudé > Subject: Re: [PATCH v11 00/21] i386: Introduce smp.modules and clean up > cache topology > > Hi Zhao, > > On 24/4/

Re: [PATCH for-9.1 0/7] target/i386/kvm: Cleanup the kvmclock feature name

2024-04-25 Thread Zhao Liu
On Thu, Apr 25, 2024 at 04:40:10PM +0800, Xiaoyao Li wrote: > Date: Thu, 25 Apr 2024 16:40:10 +0800 > From: Xiaoyao Li > Subject: Re: [PATCH for-9.1 0/7] target/i386/kvm: Cleanup the kvmclock > feature name > > On 4/25/2024 3:17 PM, Zhao Liu wrote: > > Hi Xiaoyao, >

Re: [PATCH for-9.1 0/7] target/i386/kvm: Cleanup the kvmclock feature name

2024-04-25 Thread Zhao Liu
Hi Xiaoyao, On Wed, Apr 24, 2024 at 11:57:11PM +0800, Xiaoyao Li wrote: > Date: Wed, 24 Apr 2024 23:57:11 +0800 > From: Xiaoyao Li > Subject: Re: [PATCH for-9.1 0/7] target/i386/kvm: Cleanup the kvmclock > feature name > > On 3/29/2024 6:19 PM, Zhao Liu wrote: > > Fro

[PATCH v2 0/7] s390x/cpu_models: Misc cleanup on returned error code and local @err variables

2024-04-24 Thread Zhao Liu
/ Regards, Zhao --- v1: https://lore.kernel.org/qemu-devel/20240419065712.1225038-1-zhao1@linux.intel.com/ Changes since v1: * Picked Phili's stubs cleanup and rebased on it. * Fixed typos. --- Philippe Mathieu-Daudé (1): target/s390x: Remove KVM stubs in cpu_models.h Zhao Liu (6

[PATCH v2 4/7] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean

2024-04-24 Thread Zhao Liu
As error.h suggested, the best practice for callee is to return something to indicate success / failure. So make kvm_s390_get_host_cpu_model() return boolean and check the returned boolean in get_max_cpu_model() instead of accessing @err. Signed-off-by: Zhao Liu --- target/s390x/cpu_models.c

[PATCH v2 6/7] target/s390x/cpu_models: Make kvm_s390_apply_cpu_model() return boolean

2024-04-24 Thread Zhao Liu
As error.h suggested, the best practice for callee is to return something to indicate success / failure. So make kvm_s390_apply_cpu_model() return boolean and check the returned boolean in apply_cpu_model() instead of accessing @err. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth --- target

[PATCH v2 1/7] target/s390x/cpu_model: Make check_compatibility() return boolean

2024-04-24 Thread Zhao Liu
As error.h suggested, the best practice for callee is to return something to indicate success / failure. With returned boolean, there's no need to check @err. Suggested-by: Thomas Huth Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth --- target/s390x/cpu_models.c | 14 +++--- 1 file

[PATCH v2 7/7] target/s390x/cpu_models_sysemu: Drop local @err in apply_cpu_model()

2024-04-24 Thread Zhao Liu
Use @errp to fetch error information directly and drop the local variable @err. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth --- target/s390x/cpu_models_sysemu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x

[PATCH v2 5/7] target/s390x/cpu_models: Drop local @err in get_max_cpu_model()

2024-04-24 Thread Zhao Liu
Use @errp to fetch error information directly and drop the local variable @err. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth --- target/s390x/cpu_models.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index

[PATCH v2 2/7] target/s390x/cpu_model: Drop local @err in s390_realize_cpu_model()

2024-04-24 Thread Zhao Liu
Use @errp to fetch error information directly and drop the local variable @err. Suggested-by: Thomas Huth Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth --- target/s390x/cpu_models.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/s390x/cpu_models.c b/target

[PATCH v2 3/7] target/s390x: Remove KVM stubs in cpu_models.h

2024-04-24 Thread Zhao Liu
From: Philippe Mathieu-Daudé Since the calls are elided when KVM is not available, we can remove the stubs (which are never compiled). Inspired-by: Thomas Huth > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu Signed-off-by: Zhao Liu --- target/s390x/cpu_models.h |

[PATCH v11 10/21] i386: Split topology types of CPUID[0x1F] from the definitions of CPUID[0xB]

2024-04-24 Thread Zhao Liu
implemented in QEMU, to avoid possible misunderstanding, split topology types of CPUID[0x1F] from the definitions of CPUID[0xB] and introduce CPUID[0x1F]-specific topology types. Signed-off-by: Zhao Liu Tested-by: Yongwei Ma Acked-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé Tested

[PATCH v11 16/21] i386/cpu: Introduce module-id to X86CPU

2024-04-24 Thread Zhao Liu
Introduce module-id to be consistent with the module-id field in CpuInstanceProperties. Following the legacy smp check rules, also add the module_id validity into x86_cpu_pre_plug(). Tested-by: Yongwei Ma Co-developed-by: Zhuocheng Ding Signed-off-by: Zhuocheng Ding Signed-off-by: Zhao Liu

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

2024-04-24 Thread Zhao Liu
structure. Fixes: 7e3482f82480 ("i386: Helpers to encode cache information consistently") Suggested-by: Robert Hoo Signed-off-by: Zhao Liu Reviewed-by: Xiaoyao Li Tested-by: Babu Moger Tested-by: Yongwei Ma Acked-by: Michael S. Tsirkin --- Changes since v3: * Changed the description

[PATCH v11 21/21] i386/cpu: Use CPUCacheInfo.share_level to encode CPUID[0x8000001D].EAX[bits 25:14]

2024-04-24 Thread Zhao Liu
to be encoded into CPUID[0x801D].EAX[bits 25:14]. Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Reviewed-by: Babu Moger --- Changes since v7: * Renamed max_processor_ids_for_cache() to max_thread_ids_for_cache(). * Dropped Michael/Babu's ACKed/Tested tags since the code change

[PATCH v11 17/21] tests: Add test case of APIC ID for module level parsing

2024-04-24 Thread Zhao Liu
From: Zhuocheng Ding After i386 supports module level, it's time to add the test for module level's parsing. Signed-off-by: Zhuocheng Ding Co-developed-by: Zhao Liu Signed-off-by: Zhao Liu Reviewed-by: Yanan Wang Tested-by: Babu Moger Tested-by: Yongwei Ma Acked-by: Michael S. Tsirkin

[PATCH v11 20/21] i386/cpu: Use CPUCacheInfo.share_level to encode CPUID[4]

2024-04-24 Thread Zhao Liu
of CPUID[4].EAX[bits 31:26] into a helper to make the code cleaner. Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger --- Changes since v7: * Renamed max_processor_ids_for_cache() to max_thread_ids_for_cache(). (Xiaoyao) * Dropped Michael/Babu's ACKed/Tested tags since the c

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

2024-04-24 Thread 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 Tested-by: Babu

[PATCH v11 14/21] i386: Expose module level in CPUID[0x1F]

2024-04-24 Thread Zhao Liu
y: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger --- Changes since v7: * Mapped x86 module to smp module instead of cluster. * Dropped Michael/Babu's ACKed/Tested tags since the code change. * Re-added Yongwei's Tested tag For his re-testing. Changes since v3: * New patch to exp

[PATCH v11 15/21] i386: Support module_id in X86CPUTopoIDs

2024-04-24 Thread Zhao Liu
g Ding Co-developed-by: Zhuocheng Ding Signed-off-by: Zhao Liu Tested-by: Babu Moger --- Changes since v7: * Mapped x86 module to the smp module instead of cluster. * Dropped Michael/Babu's ACKed/Tested tags since the code change. * Re-added Yongwei's Tested tag For his re-testing. Changes

[PATCH v11 13/21] i386: Support modules_per_die in X86CPUTopoInfo

2024-04-24 Thread Zhao Liu
by "apicid_bitwidth_for_count(topo_info->modules_per_die)", is always 0 for now, so we can directly add APIC ID related helpers to support module level parsing. In addition, update topology structure in test-x86-topo.c. Tested-by: Yongwei Ma Co-developed-by: Zhuocheng Ding Signed-off-

[PATCH v11 19/21] i386: Add cache topology info in CPUCacheInfo

2024-04-24 Thread Zhao Liu
. Signed-off-by: Zhao Liu Tested-by: Babu Moger Tested-by: Yongwei Ma Acked-by: Michael S. Tsirkin --- Changes since v3: * Fixed cache topology uninitialization bugs for some AMD CPUs. (Babu) * Moved the CPUTopoLevel enumeration definition to the previous 0x1f rework patch. Changes since v1

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

2024-04-24 Thread Zhao Liu
l topology example in description of "-smp". Additionally, add the missed drawers and books options in previous example. Tested-by: Yongwei Ma Co-developed-by: Zhuocheng Ding Signed-off-by: Zhuocheng Ding Signed-off-by: Zhao Liu Tested-by: Babu Moger Reviewed-by: Babu Moger

[PATCH v11 07/21] i386/cpu: Use APIC ID info get NumSharingCache for CPUID[0x8000001D].EAX[bits 25:14]

2024-04-24 Thread Zhao Liu
pendix.E.4.15 Function 8000_001Dh--Cache Topology Information Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Reviewed-by: Babu Moger Tested-by: Babu Moger Reviewed-by: Xiaoyao Li --- Changes since v7: * Moved this patch after CPUID[4]'s similar change ("i386/cpu: Use APIC ID offset to e

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

2024-04-24 Thread Zhao Liu
Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Reviewed-by: Xiaoyao Li Reviewed-by: Philippe Mathieu-Daudé Tested-by: Babu Moger --- Changes since v9: * Polished the commit message. ( Xiaoyao) Changes since v8: * Added Philippe's reviewed-by tag. Changes since v7: * Renamed cpus_per_p

[PATCH v11 11/21] i386/cpu: Decouple CPUID[0x1F] subleaf with specific topology level

2024-04-24 Thread Zhao Liu
th specific topology level. Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Reviewed-by: Xiaoyao Li --- Changes since v10: * Combined ecx and edx encoding into the single line. (Xiaoyao) * Fixed the comment in encode_topo_cpuid1f(). (Xiaoyao) Changes sin

[PATCH v11 12/21] i386: Introduce module level cpu topology to CPUX86State

2024-04-24 Thread Zhao Liu
-by: Zhuocheng Ding Signed-off-by: Zhao Liu Tested-by: Babu Moger --- Changes since v7: * Mapped x86 module to smp module instead of cluster. * Re-wrote the commit message to explain the reason why we needs module level. * Dropped Michael/Babu's ACKed/Tested tags since the code change

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

2024-04-24 Thread Zhao Liu
dressable IDs for logical processors sharing cache") [3]: d65af288a84d ("i386: Update new x86_apicid parsing rules with die_offset support") Fixes: 7e3482f82480 ("i386: Helpers to encode cache information consistently") Suggested-by: Robert Hoo Tested-by: Yo

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

2024-04-24 Thread Zhao Liu
. This is also in preparation for the follow-up to decouple CPUID[0x1F] subleaf with specific topology level. Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Reviewed-by: Xiaoyao Li --- Changes since v10: * Rebased on commit 88daa112d4eda. Changes since v7: * New commit

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

2024-04-24 Thread Zhao Liu
Suggested-by: Xiaoyao Li Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger --- Changes since v8: * Add the reason of why a new module level is needed in commit message. (Markus). * Add the description about how Linux kernel supports x86 module level. (Daniel) Changes

[PATCH v11 00/21] i386: Introduce smp.modules and clean up cache topology

2024-04-24 Thread Zhao Liu
el's l1 cache topology fix into a new separate patch. (Yanan) * Combined module_id and APIC ID for module level support into one patch. (Yanan) * Made cache_into_passthrough case of cpuid 0x04 leaf also encode via APICID way. (Yanan) * cpu_x86_cpuid() used max_processor_ids_for_cache()

[PATCH v11 02/21] hw/core/machine: Support modules in -smp

2024-04-24 Thread Zhao Liu
Add "modules" parameter parsing support in -smp. Suggested-by: Xiaoyao Li Tested-by: Yongwei Ma Signed-off-by: Zhao Liu Tested-by: Babu Moger Acked-by: Markus Armbruster --- Changes since v9: * Rebased on the SMP changes about unsupported "parameter=1" configurations.

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

2024-04-24 Thread 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 Tested-by: Babu Moger Acked-by: Markus Armbruster --- Changes since v10: * Rebased on commit 88daa112d4eda. Changes since v7: * New commit

Re: [PATCH for-9.1 0/7] target/i386/kvm: Cleanup the kvmclock feature name

2024-04-24 Thread Zhao Liu
Hi maintainers, Ping. Do you like this diea? Thanks, Zhao On Fri, Mar 29, 2024 at 06:19:47PM +0800, Zhao Liu wrote: > Date: Fri, 29 Mar 2024 18:19:47 +0800 > From: Zhao Liu > Subject: [PATCH for-9.1 0/7] target/i386/kvm: Cleanup the kvmclock feature > name > X-Mailer: git-se

Re: [PATCH] target/i386: Introduce SapphireRapids-v3 to add missing features

2024-04-24 Thread Zhao Liu
Hi Lei, On Wed, Apr 24, 2024 at 03:29:12AM -0400, Lei Wang wrote: > Date: Wed, 24 Apr 2024 03:29:12 -0400 > From: Lei Wang > Subject: [PATCH] target/i386: Introduce SapphireRapids-v3 to add missing > features > X-Mailer: git-send-email 2.39.3 > > Add the missing features(ss, tsc-adjust,

Re: [PATCH-for-9.1 03/21] target/i386: Move APIC related code to cpu-apic.c

2024-04-24 Thread Zhao Liu
c > --- /dev/null > +++ b/target/i386/cpu-apic.c Nit: New file needs a MAINTAINER entry ;-). Others LGTM, Reviewed-by: Zhao Liu

Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean

2024-04-22 Thread Zhao Liu
On Fri, Apr 19, 2024 at 11:08:22AM +0200, Philippe Mathieu-Daudé wrote: > Date: Fri, 19 Apr 2024 11:08:22 +0200 > From: Philippe Mathieu-Daudé > Subject: Re: [PATCH 3/6] target/s390x/cpu_models: Make > kvm_s390_get_host_cpu_model() return boolean > > On 19/4/24 10:44, Zhao

Re: [PATCH v5 3/3] Add support for RAPL MSRs in KVM/Qemu

2024-04-19 Thread Zhao Liu
Hi Anthony, On Thu, Apr 18, 2024 at 12:52:14PM +0200, Anthony Harivel wrote: > Date: Thu, 18 Apr 2024 12:52:14 +0200 > From: Anthony Harivel > Subject: Re: [PATCH v5 3/3] Add support for RAPL MSRs in KVM/Qemu > > > The package energy consumption includes core part and uncore part, where > >

Re: [PATCH 2/6] target/s390x/cpu_model: Drop local @err in s390_realize_cpu_model()

2024-04-19 Thread Zhao Liu
On Fri, Apr 19, 2024 at 09:39:53AM +0200, Thomas Huth wrote: > Date: Fri, 19 Apr 2024 09:39:53 +0200 > From: Thomas Huth > Subject: Re: [PATCH 2/6] target/s390x/cpu_model: Drop local @err in > s390_realize_cpu_model() > > On 19/04/2024 08.57, Zhao Liu wrote: > > From

Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean

2024-04-19 Thread Zhao Liu
Hi Thomas, On Fri, Apr 19, 2024 at 09:50:46AM +0200, Thomas Huth wrote: > Date: Fri, 19 Apr 2024 09:50:46 +0200 > From: Thomas Huth > Subject: Re: [PATCH 3/6] target/s390x/cpu_models: Make > kvm_s390_get_host_cpu_model() return boolean > > On 19/04/2024 08.57, Zhao Liu wro

Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean

2024-04-19 Thread Zhao Liu
> > diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c > > index 052540a866ac..a0e4acb707d7 100644 > > --- a/target/s390x/cpu_models.c > > +++ b/target/s390x/cpu_models.c > > @@ -560,16 +560,15 @@ S390CPUModel *get_max_cpu_model(Error **errp) > > } > > if

[PATCH 0/6] s390x/cpu_models: Misc cleanup on returned error code and local @err variables

2024-04-19 Thread Zhao Liu
From: Zhao Liu Hi list, This series is the followup of Thomas' suggestion in previous ERRP_GUARD() cleanup[1]. And based on Thomas' thoughts, I tried to clean up as many of the other related places (in s390x/cpu_models.c). [1]: https://lore.kernel.org/qemu-devel/6e7eff95-cfd3-46f9-9937

[PATCH 6/6] target/s390x/cpu_models_sysemu: Drop local @err in apply_cpu_model()

2024-04-19 Thread Zhao Liu
From: Zhao Liu Use @errp to fetech error information directly and drop the local virable @err. Signed-off-by: Zhao Liu --- target/s390x/cpu_models_sysemu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x

[PATCH 2/6] target/s390x/cpu_model: Drop local @err in s390_realize_cpu_model()

2024-04-19 Thread Zhao Liu
From: Zhao Liu Use @errp to fetech error information directly and drop the local virable @err. Suggested-by: Thomas Huth Signed-off-by: Zhao Liu --- target/s390x/cpu_models.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/s390x/cpu_models.c b/target/s390x

[PATCH 4/6] target/s390x/cpu_models: Drop local @err in get_max_cpu_model()

2024-04-19 Thread Zhao Liu
From: Zhao Liu Use @errp to fetech error information directly and drop the local virable @err. Signed-off-by: Zhao Liu --- target/s390x/cpu_models.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index a0e4acb707d7

[PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean

2024-04-19 Thread Zhao Liu
From: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. So make kvm_s390_get_host_cpu_model() return boolean and check the returned boolean in get_max_cpu_model() instead of accessing @err. Additionally, since now

[PATCH 1/6] target/s390x/cpu_model: Make check_compatibility() return boolean

2024-04-19 Thread Zhao Liu
From: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. With returned boolean, there's no need to check @err. Suggested-by: Thomas Huth Signed-off-by: Zhao Liu --- target/s390x/cpu_models.c | 14 +++--- 1 file changed

[PATCH 5/6] target/s390x/cpu_models: Make kvm_s390_apply_cpu_model() return boolean

2024-04-19 Thread Zhao Liu
From: Zhao Liu As error.h suggested, the best practice for callee is to return something to indicate success / failure. So make kvm_s390_apply_cpu_model() return boolean and check the returned boolean in apply_cpu_model() instead of accessing @err. Signed-off-by: Zhao Liu --- target/s390x

Re: [PATCH 3/3] hw/cxl/cxl-cdat: Make cxl_doe_cdat_init() return boolean

2024-04-18 Thread Zhao Liu
Hi Philippe, On Thu, Apr 18, 2024 at 02:06:15PM +0200, Philippe Mathieu-Daudé wrote: [snip] > > diff --git a/include/hw/cxl/cxl_component.h b/include/hw/cxl/cxl_component.h > > index 5012fab6f763..945ee6ffd045 100644 > > --- a/include/hw/cxl/cxl_component.h > > +++

[PATCH] accel/tcg/icount-common: Consolidate the use of warn_report_once()

2024-04-18 Thread Zhao Liu
From: Zhao Liu Use warn_report_once() to get rid of the static local variable "notified". Signed-off-by: Zhao Liu --- Note: After cleaning up similar uses in x86, only icount-common.c and virtio-mem.c still have "only once" usage with static variables. Howeve

  1   2   3   4   5   6   7   8   9   10   >