Re: [RFC PATCH v5 1/8] build-sys: Add rust feature option

2024-07-22 Thread Zhao Liu
dd_languages('rust', required: > get_option('have_rust'), native: false) > + rustc = meson.get_compiler('rust') > + have_rust = true > +endif Only a nit, "disable_rust" seems redundant, and "have_rust" is enough. Others LGTM, Reviewed-by: Zhao Liu

[PATCH] MAINTAINERS: Add myself as a reviewer of machine core

2024-07-22 Thread Zhao Liu
While working on a series of CPU/cache topology work, I became interested in the machine core component and would like to help to review more related patches. Signed-off-by: Zhao Liu --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7d9811458cb0

Re: [PATCH 8/8] qemu-options: Add the description of smp-cache object

2024-07-22 Thread Zhao Liu
Hi Markus, On Mon, Jul 22, 2024 at 03:37:43PM +0200, Markus Armbruster wrote: > Date: Mon, 22 Jul 2024 15:37:43 +0200 > From: Markus Armbruster > Subject: Re: [PATCH 8/8] qemu-options: Add the description of smp-cache > object > > Zhao Liu writes: > > > Signed-

Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object

2024-07-22 Thread Zhao Liu
Hi Markus, On Mon, Jul 22, 2024 at 03:33:13PM +0200, Markus Armbruster wrote: > Date: Mon, 22 Jul 2024 15:33:13 +0200 > From: Markus Armbruster > Subject: Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object > > Zhao Liu writes: > > > Introduce smp-cache object so that

Re: [PATCH 1/8] hw/core: Make CPU topology enumeration arch-agnostic

2024-07-22 Thread Zhao Liu
Hi Markus, On Mon, Jul 22, 2024 at 03:24:24PM +0200, Markus Armbruster wrote: > Date: Mon, 22 Jul 2024 15:24:24 +0200 > From: Markus Armbruster > Subject: Re: [PATCH 1/8] hw/core: Make CPU topology enumeration > arch-agnostic > > One little thing... > > Zhao Liu write

Re: [PATCH 0/8] Introduce SMP Cache Topology

2024-07-22 Thread Zhao Liu
Hi Daniel and Markus, A gentle ping. Would you kindly have a look at this version of the API design? If it could meet your satisfaction, I’ll continue iterating. Thanks, Zhao On Thu, Jul 04, 2024 at 11:15:55AM +0800, Zhao Liu wrote: > Date: Thu, 4 Jul 2024 11:15:55 +0800 > From: Zh

Re: [PATCH] hw/x86: add a couple of comments explaining how the kernel image is parsed

2024-07-21 Thread Zhao Liu
nts in x86_load_linux() pointing to the kernel > documentation > so that users can better understand the code. > > CC: qemu-triv...@nongnu.org > Signed-off-by: Ani Sinha > --- > hw/i386/x86-common.c | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) > Reviewed-by: Zhao Liu

Re: [RFC 3/5] i386/kvm: Support event with select&umask format in KVM PMU filter

2024-07-19 Thread Zhao Liu
Hi Dapeng, On Thu, Jul 18, 2024 at 01:28:25PM +0800, Mi, Dapeng wrote: [snip] > > +case KVM_PMU_EVENT_FMT_X86_DEFAULT: { > > +uint64_t select, umask; > > + > > +ret = qemu_strtou64(str_event->u.x86_default.select, NULL, > > +0, &sel

Re: [RFC 0/5] accel/kvm: Support KVM PMU filter

2024-07-19 Thread Zhao Liu
el/kvm: Support KVM PMU filter > > > On 7/10/2024 12:51 PM, Zhao Liu wrote: > > Hi QEMU maintainers, arm and PMU folks, > > > > I picked up Shaoqing's previous work [1] on the KVM PMU filter for arm, > > and now is trying to support this feature for x86 with

Re: Windows 10 and 11 VMs fails to boot with SapphireRapids CPU definition

2024-07-19 Thread Zhao Liu
Hi Manish, (+Paolo and Daniel) On Thu, Jul 18, 2024 at 11:44:28AM +, Manish Mishra wrote: > Date: Thu, 18 Jul 2024 11:44:28 + > From: Manish Mishra > Subject: Windows 10 and 11 VMs fails to boot with SapphireRapids CPU > definition > > Hi Everyone, > > We are facing issues booting win

Re: [PATCH] hw/nubus/nubus-virtio-mmio: Fix missing ERRP_GUARD() in nubus_virtio_mmio_realize()

2024-07-17 Thread Zhao Liu
Hi Philippe, If possible, can this one catch a ride with your PULL too? Many thanks! Zhao On Mon, Jul 15, 2024 at 05:59:37PM +0800, Zhao Liu wrote: > Date: Mon, 15 Jul 2024 17:59:37 +0800 > From: Zhao Liu > Subject: [PATCH] hw/nubus/nubus-virtio-mmio: Fix missing ERRP_G

Re: [PATCH] doc/net/l2tpv3: Update boolean fields' description to avoid short-form use

2024-07-16 Thread Zhao Liu
Hi Jason, Just a kind ping. Does this update satisfy you? Since the original example generates the warning. Thanks, Zhao On Mon, Jul 08, 2024 at 05:26:30PM +0800, Zhao Liu wrote: > Date: Mon, 8 Jul 2024 17:26:30 +0800 > From: Zhao Liu > Subject: [PATCH] doc/net/l2tpv3: Update boole

Re: [PATCH] target/i386: do not crash if microvm guest uses SGX CPUID leaves

2024-07-16 Thread Zhao Liu
Hi Paolo, On Tue, Jul 16, 2024 at 06:55:30PM +0200, Paolo Bonzini wrote: > Date: Tue, 16 Jul 2024 18:55:30 +0200 > From: Paolo Bonzini > Subject: [PATCH] target/i386: do not crash if microvm guest uses SGX CPUID > leaves > X-Mailer: git-send-email 2.45.2 > > sgx_epc_get_section assumes a PC pla

[PATCH v2] hw/virtio/vdpa-dev: Check returned value instead of dereferencing @errp

2024-07-16 Thread Zhao Liu
values directly without dereferencing @errp, which eliminates the need of ERRP_GUARD(). Cc: "Michael S. Tsirkin" Cc: Jason Wang Acked-by: Eugenio Pérez Signed-off-by: Zhao Liu --- v2: * Added a/b from Eugenio. * Deleted unnecessary ERRP_GUARD(). (Eugenio) --- hw/virtio/vdpa-dev.c

[PATCH v2] qga/commands-posix: Make ga_wait_child() return boolean

2024-07-16 Thread Zhao Liu
Make ga_wait_child() return boolean and check the returned boolean in ga_run_command() instead of dereferencing @errp. Cc: Michael Roth Cc: Konstantin Kostiuk Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Zhao Liu --- v2: * Added Phil's r/b. * Used Phil's polished words

[PATCH v4 9/9] target/i386/kvm: Replace ARRAY_SIZE(msr_handlers) with KVM_MSR_FILTER_MAX_RANGES

2024-07-16 Thread Zhao Liu
ways. For the code consistency and to avoid additional computational overhead, use KVM_MSR_FILTER_MAX_RANGES instead of ARRAY_SIZE(msr_handlers). Suggested-by: Zide Chen Signed-off-by: Zhao Liu --- v4: new commit. --- target/i386/kvm/kvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3

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

2024-07-16 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 v4 7/9] target/i386/kvm: Clean up return values of MSR filter related functions

2024-07-16 Thread Zhao Liu
tions return int type and printing such returned value in error_report(). Signed-off-by: Zhao Liu --- v4: Returned kvm_vm_ioctl() directly. (Zide) v3: new commit. --- target/i386/kvm/kvm.c | 34 ++ target/i386/kvm/kvm_i386.h | 4 ++-- 2 files change

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

2024-07-16 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 --- v3: Resolved a rebasing conflict. v2: Changed the prefix from CPUID_FEAT_KVM_* to CPUID_KVM_*. (Xiaoyao) --- hw/i386

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

2024-07-16 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 v4 8/9] target/i386/kvm: Clean up error handling in kvm_arch_init()

2024-07-16 Thread Zhao Liu
_init(). Fix the above cases. Signed-off-by: Zhao Liu --- v3: new commit. --- target/i386/kvm/kvm.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index f68be68eb411..d47476e96813 100644 --- a/target/i386/kvm/kvm.c

[PATCH v4 0/9] target/i386: Misc cleanup on KVM PV defs, outdated comments and error handling

2024-07-16 Thread Zhao Liu
-4985-849c-d74c6cdc9...@intel.com/ Thanks and Best Regards, Zhao --- Zhao Liu (9): target/i386/kvm: Add feature bit definitions for KVM CPUID target/i386/kvm: Remove local MSR_KVM_WALL_CLOCK and MSR_KVM_SYSTEM_TIME definitions target/i386/kvm: Only save/load kvmclock MSRs when kvmclock

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

2024-07-16 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 v4 3/9] target/i386/kvm: Only save/load kvmclock MSRs when kvmclock enabled

2024-07-16 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 v4 2/9] target/i386/kvm: Remove local MSR_KVM_WALL_CLOCK and MSR_KVM_SYSTEM_TIME definitions

2024-07-16 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 v3 7/8] target/i386/kvm: Clean up return values of MSR filter related functions

2024-07-15 Thread Zhao Liu
Hi Zide, On Mon, Jul 15, 2024 at 03:18:07PM -0700, Chen, Zide wrote: > Date: Mon, 15 Jul 2024 15:18:07 -0700 > From: "Chen, Zide" > Subject: Re: [PATCH v3 7/8] target/i386/kvm: Clean up return values of MSR > filter related functions > > On 7/14/2024 9:49 PM, Zha

Re: [PATCH] hw/virtio/vdpa-dev: Check returned value instead of dereferencing @errp

2024-07-15 Thread Zhao Liu
On Mon, Jul 15, 2024 at 11:01:08PM +0200, Eugenio Perez Martin wrote: > Date: Mon, 15 Jul 2024 23:01:08 +0200 > From: Eugenio Perez Martin > Subject: Re: [PATCH] hw/virtio/vdpa-dev: Check returned value instead of > dereferencing @errp > > On Mon, Jul 15, 2024 at 11:45 

Re: [PATCH 0/3] target/i386/cpu: Misc Cleanup on host-cache-info

2024-07-15 Thread Zhao Liu
Hi Igor, Just a friendly ping :-) May I ask if you are satisfied with the clarification in this series? Thanks, Zhao On Mon, Jul 08, 2024 at 10:23:26AM +0800, Zhao Liu wrote: > Date: Mon, 8 Jul 2024 10:23:26 +0800 > From: Zhao Liu > Subject: Re: [PATCH 0/3] target/i386/cpu: Misc C

Re: [PATCH] qga/commands-posix: Make ga_wait_child() return boolean

2024-07-15 Thread Zhao Liu
On Mon, Jul 15, 2024 at 11:59:29AM +0200, Philippe Mathieu-Daudé wrote: > Date: Mon, 15 Jul 2024 11:59:29 +0200 > From: Philippe Mathieu-Daudé > Subject: Re: [PATCH] qga/commands-posix: Make ga_wait_child() return boolean > > On 15/7/24 11:59, Zhao Liu wrote: > > As the

Re: [PATCH] meson: Update meson-buildoptions.sh

2024-07-15 Thread Zhao Liu
Hi Daniel, On Fri, Jul 05, 2024 at 10:20:27AM +0100, Daniel P. Berrangé wrote: > Date: Fri, 5 Jul 2024 10:20:27 +0100 > From: "Daniel P. Berrangé" > Subject: Re: [PATCH] meson: Update meson-buildoptions.sh > > On Fri, Jul 05, 2024 at 01:49:03PM +0800, Zhao Li

Re: [PATCH 7/7] backends/rng-random: Get rid of qemu_open_old()

2024-07-15 Thread Zhao Liu
On Mon, Jul 15, 2024 at 02:07:00PM +0300, Michael Tokarev wrote: > Date: Mon, 15 Jul 2024 14:07:00 +0300 > From: Michael Tokarev > Subject: Re: [PATCH 7/7] backends/rng-random: Get rid of qemu_open_old() > > 15.07.2024 13:10, Zhao Liu wrote: > ... > > Thanks Philippe! I&#

Re: [PATCH 7/7] backends/rng-random: Get rid of qemu_open_old()

2024-07-15 Thread Zhao Liu
On Mon, Jul 15, 2024 at 11:46:54AM +0200, Philippe Mathieu-Daudé wrote: > Date: Mon, 15 Jul 2024 11:46:54 +0200 > From: Philippe Mathieu-Daudé > Subject: Re: [PATCH 7/7] backends/rng-random: Get rid of qemu_open_old() > > On 15/7/24 10:21, Zhao Liu wrote: > > For qemu_ope

[PATCH] hw/nubus/nubus-virtio-mmio: Fix missing ERRP_GUARD() in nubus_virtio_mmio_realize()

2024-07-15 Thread Zhao Liu
o add missing ERRP_GUARD() in nubus_virtio_mmio_realize(). Cc: Laurent Vivier Cc: Philippe Mathieu-Daudé Signed-off-by: Zhao Liu --- hw/nubus/nubus-virtio-mmio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/nubus/nubus-virtio-mmio.c b/hw/nubus/nubus-virtio-mmio.c index 58a63c84d0be..a555

[PATCH] hw/virtio/vdpa-dev: Check returned value instead of dereferencing @errp

2024-07-15 Thread Zhao Liu
values directly without dereferencing @errp, which eliminates the need of ERRP_GUARD(). Cc: "Michael S. Tsirkin" Cc: "Eugenio Pérez" Cc: Jason Wang Signed-off-by: Zhao Liu --- hw/virtio/vdpa-dev.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a

[PATCH] qga/commands-posix: Make ga_wait_child() return boolean

2024-07-15 Thread Zhao Liu
eturned boolean in ga_run_command() instead of dereferencing @errp, which eliminates the need of ERRP_GUARD(). Cc: Michael Roth Cc: Konstantin Kostiuk Signed-off-by: Zhao Liu --- qga/commands-posix.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qga/commands-posix.c b/qga/comm

[PATCH 4/7] hw/vfio/container: Get rid of qemu_open_old()

2024-07-15 Thread Zhao Liu
For qemu_open_old(), osdep.h said: > Don't introduce new usage of this function, prefer the following > qemu_open/qemu_create that take an "Error **errp". So replace qemu_open_old() with qemu_open(). Cc: Alex Williamson Cc: "Cédric Le Goater" Signed-off-by: Zha

[PATCH 7/7] backends/rng-random: Get rid of qemu_open_old()

2024-07-15 Thread Zhao Liu
g case after removing error_setg_file_open(), add comment to remind here. Cc: Laurent Vivier Cc: Amit Shah Signed-off-by: Zhao Liu --- backends/rng-random.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backends/rng-random.c b/backends/rng-random.c index 80eb5be138ce

[PATCH 5/7] backends/hostmem-epc: Get rid of qemu_open_old()

2024-07-15 Thread Zhao Liu
For qemu_open_old(), osdep.h said: > Don't introduce new usage of this function, prefer the following > qemu_open/qemu_create that take an "Error **errp". So replace qemu_open_old() with qemu_open(). Cc: David Hildenbrand Cc: Igor Mammedov Signed-off-by: Zhao Liu --- b

[PATCH 1/7] hw/i386/sgx: Get rid of qemu_open_old()

2024-07-15 Thread Zhao Liu
a error message hint. Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Signed-off-by: Zhao Liu --- hw/i386/sgx.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c index de

[PATCH 3/7] hw/usb/u2f-passthru: Get rid of qemu_open_old()

2024-07-15 Thread Zhao Liu
For qemu_open_old(), osdep.h said: > Don't introduce new usage of this function, prefer the following > qemu_open/qemu_create that take an "Error **errp". So replace qemu_open_old() with qemu_open(). Signed-off-by: Zhao Liu --- hw/usb/u2f-passthru.c | 4 +--- 1 file chang

[PATCH 0/7] trivial: Replace some qemu_open_old() with qemu_open()

2024-07-15 Thread Zhao Liu
There would be more cleanup to help qemu_open_old() retire as early as possible. Thanks and Best Regards, Zhao --- Zhao Liu (7): hw/i386/sgx: Get rid of qemu_open_old() hw/usb/host-libusb: Get rid of qemu_open_old() hw/usb/u2f-passthru: Get rid of qemu_open_old() hw/vfio/container: Get rid o

[PATCH 2/7] hw/usb/host-libusb: Get rid of qemu_open_old()

2024-07-15 Thread Zhao Liu
For qemu_open_old(), osdep.h said: > Don't introduce new usage of this function, prefer the following > qemu_open/qemu_create that take an "Error **errp". So replace qemu_open_old() with qemu_open(). Signed-off-by: Zhao Liu --- hw/usb/host-libusb.c | 3 +-- 1 file chang

[PATCH 6/7] backends/iommufd: Get rid of qemu_open_old()

2024-07-15 Thread Zhao Liu
For qemu_open_old(), osdep.h said: > Don't introduce new usage of this function, prefer the following > qemu_open/qemu_create that take an "Error **errp". So replace qemu_open_old() with qemu_open(). Cc: Yi Liu Cc: Eric Auger Cc: Zhenzhong Duan Signed-off-by: Zh

Re: [PATCH V15 0/7] Add architecture agnostic code to support vCPU Hotplug

2024-07-14 Thread Zhao Liu
d the scope of the kvm_unpark_vcpu so that it can be used by > generic framework > being thought out > Link: > https://lore.kernel.org/qemu-devel/20240519210620.228342-1-salil.me...@huawei.com/ > Link: > https://lore.kernel.org/qemu-devel/e94b0e14-efee-4050-9c9f-08382a36b...@lina

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

2024-07-14 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

[PATCH v3 8/8] target/i386/kvm: Clean up error handling in kvm_arch_init()

2024-07-14 Thread Zhao Liu
_init(). Fix the above cases. Signed-off-by: Zhao Liu --- target/i386/kvm/kvm.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 0fd1d099ae4c..246fe12ae411 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/

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

2024-07-14 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 v3 6/8] target/i386/confidential-guest: Fix comment of x86_confidential_guest_kvm_type()

2024-07-14 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 v3 5/8] target/i386/kvm: Drop workaround for KVM_X86_DISABLE_EXITS_HTL typo

2024-07-14 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 v3 3/8] target/i386/kvm: Only save/load kvmclock MSRs when kvmclock enabled

2024-07-14 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 v3 1/8] target/i386/kvm: Add feature bit definitions for KVM CPUID

2024-07-14 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 --- v3: Resolved a rebasing conflict. v2: Changed the prefix from CPUID_FEAT_KVM_* to CPUID_KVM_*. (Xiaoyao) --- hw/i386

[PATCH v3 0/8] [PATCH v3 0/8] target/i386: Misc cleanup on KVM PV defs, outdated comments and error handling

2024-07-14 Thread Zhao Liu
qemu-devel/2815f0f1-9e20-4985-849c-d74c6cdc9...@intel.com/ Thanks and Best Regards, Zhao --- Zhao Liu (8): target/i386/kvm: Add feature bit definitions for KVM CPUID target/i386/kvm: Remove local MSR_KVM_WALL_CLOCK and MSR_KVM_SYSTEM_TIME definitions target/i386/kvm: Only save/load kvmc

[PATCH v3 7/8] target/i386/kvm: Clean up return values of MSR filter related functions

2024-07-14 Thread Zhao Liu
lated functions return int type and printing such returned value in error_report(). Signed-off-by: Zhao Liu --- target/i386/kvm/kvm.c | 35 +-- target/i386/kvm/kvm_i386.h | 4 ++-- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/target/i38

Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency

2024-07-11 Thread Zhao Liu
On Wed, Jul 10, 2024 at 04:50:10PM +0200, Paolo Bonzini wrote: > Date: Wed, 10 Jul 2024 16:50:10 +0200 > From: Paolo Bonzini > Subject: Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency > > On Wed, Jul 10, 2024 at 4:48 PM Zhao Liu wrote: > > > > On

Re: [RFC PATCH v2 3/5] rust: add PL011 device model

2024-07-10 Thread Zhao Liu
Hi Manos and all, On Tue, Jun 11, 2024 at 01:33:32PM +0300, Manos Pitsidianakis wrote: > diff --git a/rust/rustfmt.toml b/rust/rustfmt.toml > new file mode 100644 > index 00..ebecb99fe0 > --- /dev/null > +++ b/rust/rustfmt.toml > @@ -0,0 +1,7 @@ > +edition = "2021" > +format_generated_file

Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency

2024-07-10 Thread Zhao Liu
On Tue, Jul 09, 2024 at 02:28:38PM +0200, Paolo Bonzini wrote: > > Here are the stopping points that I found over the last couple weeks: > > 1.56.0: 2021 edition > 1.59.0: const CStr::from_bytes_with_nul_unchecked (needed by cstr > crate, see below) > 1.64.0: std::ffi::c_char > 1.65.0: Generic As

[RFC 4/5] i386/kvm: Support event with masked entry format in KVM PMU filter

2024-07-09 Thread Zhao Liu
KVM_SET_PMU_EVENT_FILTER of x86 KVM supports masked events mode, which accepts masked entry format event to flexibly represent a group of PMU events. Support masked entry format in kvm-pmu-filter object and handle this in i386 kvm codes. Signed-off-by: Zhao Liu --- accel/kvm/kvm-pmu.c | 91

[RFC 3/5] i386/kvm: Support event with select&umask format in KVM PMU filter

2024-07-09 Thread Zhao Liu
The select&umask is the common way for x86 to identify the PMU event, so support this way as the "x86-default" format in kvm-pmu-filter object. Signed-off-by: Zhao Liu --- accel/kvm/kvm-pmu.c | 62 include/sysemu/kvm-pmu.h | 13 +

[RFC 2/5] i386/kvm: Support initial KVM PMU filter

2024-07-09 Thread Zhao Liu
Filter PMU events with raw format in i386 code. For i386, raw format indicates that the PMU event code is already encoded according to the KVM ioctl requirements, and can be delivered directly to KVM without additional encoding work. Signed-off-by: Zhao Liu --- include/sysemu/kvm_int.h | 2

[RFC 1/5] qapi/qom: Introduce kvm-pmu-filter object

2024-07-09 Thread Zhao Liu
advantage of the qapi helpers. Signed-off-by: Zhao Liu --- MAINTAINERS | 1 + accel/kvm/kvm-pmu.c | 143 +++ accel/kvm/meson.build| 1 + include/sysemu/kvm-pmu.h | 29 qapi/kvm.json| 119

[RFC 5/5] i386/kvm: Support fixed counter in KVM PMU filter

2024-07-09 Thread Zhao Liu
KVM_SET_PMU_EVENT_FILTER of x86 KVM allows user to configure x86 fixed function counters by a bitmap. Add the support of x86-fixed-counter in kvm-pmu-filter object and handle this in i386 kvm codes. Signed-off-by: Zhao Liu --- accel/kvm/kvm-pmu.c | 71

[RFC 0/5] accel/kvm: Support KVM PMU filter

2024-07-09 Thread Zhao Liu
tl, or there will be practices to support filter fixed counter by configuring CPUIDs. Based on the above thoughts, for x86, it is not appropriate to make the current per-VM ioctl-based PMU filter a CPU property. Instead, I make it a kvm property and configure it via "-accel kvm,pmu-filter=obj_id&

Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object

2024-07-09 Thread Zhao Liu
> diff --git a/hw/core/smp-cache.c b/hw/core/smp-cache.c > new file mode 100644 > index ..c0157ce51c8f > --- /dev/null > +++ b/hw/core/smp-cache.c > @@ -0,0 +1,103 @@ > +/* > + * Cache Object for SMP machine > + * > + * Copyright (C) 2024 Intel Corporation

[PATCH] doc/net/l2tpv3: Update boolean fields' description to avoid short-form use

2024-07-08 Thread Zhao Liu
The short-form boolean options has been deprecated since v6.0 (refer to docs/about/deprecated.rst). Update the description and example of boolean fields in l2tpv3 option to avoid deprecation warning. Cc: Jason Wang Signed-off-by: Zhao Liu --- qemu-options.hx | 10 +- 1 file changed, 5

Re: [PATCH v1 1/1] target/i386: Add VMX entry load FRED control name to VMX feature words

2024-07-07 Thread Zhao Liu
t; > As VMX entry load FRED control is required to enable FRED in nested VMX, > add it to VMX feature words. > > Signed-off-by: Xin Li (Intel) > --- > target/i386/cpu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Zhao Liu

Re: [PATCH 0/3] target/i386/cpu: Misc Cleanup on host-cache-info

2024-07-07 Thread Zhao Liu
Hi Igor, Just a gentle poke and what do you think about this minor series? Thanks, Zhao On Wed, Jun 19, 2024 at 10:42:12PM +0800, Zhao Liu wrote: > Date: Wed, 19 Jun 2024 22:42:12 +0800 > From: Zhao Liu > Subject: [PATCH 0/3] target/i386/cpu: Misc Cleanup on host-cache-info > X

Re: [PATCH] i386/cpu: Drop the check of phys_bits in host_cpu_realizefn()

2024-07-07 Thread Zhao Liu
t;, > - TARGET_PHYS_ADDR_SPACE_BITS, phys_bits); > -return false; > -} > -cpu->phys_bits = phys_bits; > +cpu->phys_bits = host_cpu_adjust_phys_bits(cpu); Just nit: cpu->phys_bits can be adjusted directly in host_cpu_adjust_phys_bits(), and no need to return it out again. Otherwise, Reviewed-by: Zhao Liu

[PATCH] meson: Update meson-buildoptions.sh

2024-07-04 Thread Zhao Liu
Update meson-buildoptions.sh to stay in sync with meson_options.txt. Signed-off-by: Zhao Liu --- scripts/meson-buildoptions.sh | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index cfadb5ea86af

Re: [PATCH 1/3] hw/cxl: Get rid of unused cfmw_list

2024-07-04 Thread Zhao Liu
On Fri, Jul 05, 2024 at 01:04:51AM +, Zhijian Li (Fujitsu) wrote: > Date: Fri, 5 Jul 2024 01:04:51 + > From: "Zhijian Li (Fujitsu)" > Subject: Re: [PATCH 1/3] hw/cxl: Get rid of unused cfmw_list > > Jonathan, > > > There is a new user for cfmw_list now > https://lore.kernel.org/qemu-dev

[PATCH] hw/cxl/cxl-host: Fix guest crash when getting cxl-fmw property

2024-07-04 Thread Zhao Liu
From: Zhao Liu Guest crashes (Segmentation fault) when getting cxl-fmw property via qmp: (QEMU) qom-get path=machine property=cxl-fmw This issue is caused by accessing wrong callback (opaque) type in machine_get_cfmw(). cxl_machine_init() sets the callback as `CXLState *` type but

[PATCH 0/4] trivial: Fix superfluous trailing semicolon

2024-07-04 Thread Zhao Liu
Hi, I checked the files in QEMU to fix these few errors about "superfluous trailing semicolon" to honor the requirement in checkpatch.pl. Thanks and Best Regards, Zhao --- Zhao Liu (4): accel/kvm/kvm-all: Fix superfluous trailing semicolon hw/i386/x86: Fix superfluous trailing

[PATCH 3/4] util/oslib-posix: Fix superfluous trailing semicolon

2024-07-04 Thread Zhao Liu
Signed-off-by: Zhao Liu --- util/oslib-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index e76441695bdc..b090fe0eed0d 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -263,7 +263,7 @@ int qemu_socketpair(int domain

[PATCH 4/4] target/hexagon/imported/mmvec: Fix superfluous trailing semicolon

2024-07-04 Thread Zhao Liu
Fix the superfluous trailing semicolon in target/hexagon/imported/mmvec/ ext.idef. Cc: Brian Cain Signed-off-by: Zhao Liu --- target/hexagon/imported/mmvec/ext.idef | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hexagon/imported/mmvec/ext.idef b/target/hexagon

[PATCH 2/4] hw/i386/x86: Fix superfluous trailing semicolon

2024-07-04 Thread Zhao Liu
Signed-off-by: Zhao Liu --- hw/i386/x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index a4aa8e081098..01fc5e656272 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -242,7 +242,7 @@ static void x86_machine_get_pit(Object *obj, Visitor *v

[PATCH 1/4] accel/kvm/kvm-all: Fix superfluous trailing semicolon

2024-07-04 Thread Zhao Liu
Signed-off-by: Zhao Liu --- accel/kvm/kvm-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 2b4ab896794b..64bf47a03300 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3878,7 +3878,7 @@ static StatsList

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

2024-07-03 Thread Zhao Liu
Allow user to configure l1d, l1i, l2 and l3 cache topologies for PC machine. Signed-off-by: Zhao Liu --- Changes since RFC v2: * Used cache_supported array. --- hw/i386/pc.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 77415064c62e..1614a3b1bf19

[PATCH 2/8] qapi/qom: Introduce smp-cache object

2024-07-03 Thread Zhao Liu
s), is the most common cache architectures. Therefore, enumerate the L1 D-cache, L1 I-cache, L2 cache and L3 cache with smp-cache object to add the basic cache topology support. Suggested-by: Daniel P. Berrange Signed-off-by: Zhao Liu --- Suggested by credit: * Referred to Daniel's suggesti

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

2024-07-03 Thread 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 b/target/i386

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

2024-07-03 Thread Zhao Liu
User will configure smp cache topology via smp-cache object. For this case, update the x86 CPUs' cache topology with user's configuration in MachineState. Signed-off-by: Zhao Liu --- Changes since RFC v2: * Used smp_cache array to override cache topology. * Wrapped the updat

[PATCH 4/8] hw/core: Check smp cache topology support for machine

2024-07-03 Thread Zhao Liu
Add cache_supported flags in SMPCompatProps to allow machines to configure various caches support. And implement check() method for machine's "smp-cache" link property, which will check the compatibility of the cache properties with the machine support. Signed-off-by: Zhao Liu --

[PATCH 8/8] qemu-options: Add the description of smp-cache object

2024-07-03 Thread Zhao Liu
Signed-off-by: Zhao Liu --- Changes since RFC v2: * Rewrote the document of smp-cache object. Changes since RFC v1: * Use "*_cache=topo_level" as -smp example as the original "level" term for a cache has a totally different meaning. (Jonathan) ---

[PATCH 1/8] hw/core: Make CPU topology enumeration arch-agnostic

2024-07-03 Thread Zhao Liu
CPU_TOPO_LEVEL_SOCKET. Also, enumerate additional topology levels for non-i386 arches, and add a CPU_TOPO_LEVEL_DEFAULT to help future smp-cache object de-compatibilize arch-specific cache topology settings. Signed-off-by: Zhao Liu --- Changes since RFC v2: * Dropped cpu-topology.h and cpu-topology.c

[PATCH 3/8] hw/core: Add smp cache topology for machine

2024-07-03 Thread Zhao Liu
With smp-cache object support, add smp cache topology for machine by linking the smp-cache object. Also add a helper to access cache topology level. Signed-off-by: Zhao Liu --- Changes since RFC v2: * Linked machine's smp_cache to smp-cache object instead of a builtin structure. This

[PATCH 0/8] Introduce SMP Cache Topology

2024-07-03 Thread Zhao Liu
quot;default" topology level even though the cache isn't supported by machine. (Daniel) * Rewrote the document of smp-cache object. Main changes since RFC v1: * Split CpuTopology renaimg out of this RFC. * Use QAPI to enumerate CPU topology levels. * Drop string_to_cpu_topo() si

Re: [PATCH v3] i386/cpu: fixup number of addressable IDs for processor cores in the physical package

2024-06-30 Thread Zhao Liu
On Mon, Jul 01, 2024 at 09:48:02AM +0300, Michael Tokarev wrote: > Date: Mon, 1 Jul 2024 09:48:02 +0300 > From: Michael Tokarev > Subject: Re: [PATCH v3] i386/cpu: fixup number of addressable IDs for > processor cores in the physical package > > 11.06.2024 06:23, Chuang Xu wrote: > > When QEMU i

Re: [PATCH 2/2] target/i386: drop AMD machine check bits from Intel CPUID

2024-06-30 Thread Zhao Liu
On Fri, Jun 28, 2024 at 03:23:11PM +0200, Paolo Bonzini wrote: > Date: Fri, 28 Jun 2024 15:23:11 +0200 > From: Paolo Bonzini > Subject: Re: [PATCH 2/2] target/i386: drop AMD machine check bits from > Intel CPUID > > Il ven 28 giu 2024, 10:32 Xiaoyao Li ha scritto: > > > On 6/27/2024 10:06 PM,

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

2024-06-27 Thread Zhao Liu
Hi Paolo, A gentle poke for this series. Thanks, Zhao On Thu, Jun 06, 2024 at 05:25:31PM +0800, Zhao Liu wrote: > Date: Thu, 6 Jun 2024 17:25:31 +0800 > From: Zhao Liu > Subject: Re: [PATCH v2 0/6] target/i386: Misc cleanup on KVM PV defs and > outdated comments > > Hi

Re: [PATCH] target/i386/tcg: remove unused enum

2024-06-27 Thread Zhao Liu
386/tcg/translate.c | 16 > 1 file changed, 16 deletions(-) > Reviewed-by: Zhao Liu

Re: [RFC PATCH v3 5/5] DO NOT MERGE: replace TYPE_PL011 with x-pl011-rust in arm virt machine

2024-06-25 Thread Zhao Liu
Hi Manos, On Wed, Jun 19, 2024 at 11:14:02PM +0300, Manos Pitsidianakis wrote: > Date: Wed, 19 Jun 2024 23:14:02 +0300 > From: Manos Pitsidianakis > Subject: [RFC PATCH v3 5/5] DO NOT MERGE: replace TYPE_PL011 with > x-pl011-rust in arm virt machine > X-Mailer: git-send-email 2.44.0 > > Conveni

Re: [RFC PATCH v3 2/5] rust: add bindgen step as a meson dependency

2024-06-25 Thread Zhao Liu
> > > + # > WARNING: Project specifies a minimum meson_version '>=0.63.0' > > > but > > > + # > uses features which were added in newer versions: > > > + # > * 0.64.0: {'fs.copyfile'} > > > + # > * 1.0.0: {'dependencies arg in rust.bindgen', 'module rust as > > > stable mo

Re: [PATCH 0/4] Add support for Zhaoxin Yongfeng CPU model and other improvements

2024-06-25 Thread Zhao Liu
Hi EwanHai, On Tue, Jun 25, 2024 at 05:19:01AM -0400, EwanHai wrote: > Date: Tue, 25 Jun 2024 05:19:01 -0400 > From: EwanHai > Subject: [PATCH 0/4] Add support for Zhaoxin Yongfeng CPU model and other > improvements > X-Mailer: git-send-email 2.34.1 > > This patch series introduces support for

Re: [PATCH v3] target/i386/kvm: Refine VMX controls setting for backward compatibility

2024-06-25 Thread Zhao Liu
[snip] > > Additionally, has_msr_vmx_vmfunc has the similar compat issue. I think > > it deserves a fix, too. > > > > -Zhao > Thanks for your reply. In fact, I've tried to process has_msr_vmx_vmfunc in > the same > way as has_msr_vmx_procbased_ctls in this patch, but when I tested on Linux > kern

Re: [PATCH v3] target/i386/kvm: Refine VMX controls setting for backward compatibility

2024-06-25 Thread Zhao Liu
, for (int i = 0; i < kvm_feature_msrs->nmsrs; i++) { > +if (kvm_feature_msrs->indices[i] == MSR_IA32_VMX_PROCBASED_CTLS2) { > +has_msr_vmx_procbased_ctls2 = true; > +} > +} > return 0; > } > > -- > 2.34.1 > Since the minimum KVM version supported for i386 is v4.5 (docs/system/ target-i386.rst), this fix makes sense, so for this patch, Reviewed-by: Zhao Liu Additionally, has_msr_vmx_vmfunc has the similar compat issue. I think it deserves a fix, too. -Zhao

Re: [RFC PATCH v3 2/5] rust: add bindgen step as a meson dependency

2024-06-24 Thread Zhao Liu
Hi Manos, Thanks for your patch. I have a few comments below: > diff --git a/meson.build b/meson.build > index 3533889852..2b305e745a 100644 > --- a/meson.build > +++ b/meson.build > @@ -3876,6 +3876,62 @@ foreach target : target_dirs > lib_deps += dep.partial_dependency(compile_args: true,

Re: [RFC PATCH v3 1/5] build-sys: Add rust feature option

2024-06-24 Thread Zhao Liu
[snip] > diff --git a/meson.build b/meson.build > index c5360fbd299..ad7dbc0d641 100644 > --- a/meson.build > +++ b/meson.build > @@ -290,6 +290,11 @@ foreach lang : all_languages >endif > endforeach > +cargo = not_found > +if 'RUST_TARGET_TRIPLE' in config_host > + cargo = find_program('car

Re: [PATCH] hw/core: Rename CpuTopology to CPUTopology

2024-06-19 Thread Zhao Liu
Hi maintainers, Per my communication with Markus, it seems this renaming matches the "local consistency" principle in (include/hw/boards.h). :-) So do you think this change is acceptable? Thanks, Zhao On Mon, May 27, 2024 at 09:18:37PM +0800, Zhao Liu wrote: > Date: Mon, 27 May

[PATCH 1/3] target/i386/cpu: Use hex mask to check for valid cache CPUID leaf

2024-06-19 Thread Zhao Liu
Hexadecimal mask is more intuitive comparing to decimal. Therefore convert the mask of bits 00-04 to hexadecimal value. Signed-off-by: Zhao Liu --- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 365852cb99e1

[PATCH 2/3] target/i386/cpu: Check guest_thread_ids_per_pkg for host-cache-info case

2024-06-19 Thread Zhao Liu
is consistent before and after the change. Signed-off-by: Zhao Liu --- target/i386/cpu.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c4d4048ec32a..c20ff69b7b65 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @

[PATCH 3/3] target/i386/cpu: Add comment about adjusting the Guest cache topo for host-cache-info

2024-06-19 Thread Zhao Liu
all cache cases. Signed-off-by: Zhao Liu --- target/i386/cpu.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c20ff69b7b65..71300ac6d197 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6463,7 +6463,15 @@ void

[PATCH 0/3] target/i386/cpu: Misc Cleanup on host-cache-info

2024-06-19 Thread Zhao Liu
explanation is clear enough so that my poor English doesn't bother you! [1]: https://lore.kernel.org/qemu-devel/20240527170317.14520...@imammedo.users.ipa.redhat.com/ Thanks and Best Regards, Zhao --- Zhao Liu (3): target/i386/cpu: Use hex mask to check for valid cache CPUID leaf ta

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