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

2024-06-28 Thread Xiaoyao Li
on vendor in kvm_arch_get_supported_cpuid() is better than in x86_cpu_get_supported_feature_word(). Otherwise kvm_arch_get_supported_cpuid() still returns "risky" value for Intel VMs. Suggested-by: Xiaoyao Li Cc: John Allen Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 16 +

Re: [PATCH 1/2] target/i386: pass X86CPU to x86_cpu_get_supported_feature_word

2024-06-28 Thread Xiaoyao Li
D, and bits from AMD should be dropped when configuring the guest for an Intel model. Cc: Xiaoyao Li Cc: John Allen Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 3 +-- target/i386/cpu.c | 13 ++--- target/i386/kvm/kvm-cpu.c | 2 +- 3 files changed, 8 inserti

Re: [PATCH v5 25/65] i386/tdx: Add property sept-ve-disable for tdx-guest object

2024-06-26 Thread Xiaoyao Li
On 6/24/2024 11:01 PM, Daniel P. Berrangé wrote: On Fri, Jun 14, 2024 at 08:49:57AM +0100, Daniel P. Berrangé wrote: On Fri, Jun 14, 2024 at 09:04:33AM +0800, Xiaoyao Li wrote: On 6/13/2024 4:35 PM, Duan, Zhenzhong wrote: -Original Message- From: Li, Xiaoyao Subject: Re: [PATCH v5

[PATCH] hw/loongarch: Modify flash block size to 256K

2024-06-23 Thread Xianglai Li
loongarch added a common library for edk2 to parse flash base addresses through fdt. For compatibility with other architectures, the flash block size in qemu is now changed to 256k. Signed-off-by: Xianglai Li --- Cc: Bibo Mao Cc: Song Gao include/hw/loongarch/virt.h | 2 +- 1 file changed, 1

[PATCH] hw/loongarch: Change the tpm support by default

2024-06-23 Thread Xianglai Li
Add devices that support tpm by default, Fixed incomplete tpm acpi table information. Signed-off-by: Xianglai Li --- Cc: Bibo Mao Cc: Paolo Bonzini Cc: Song Gao hw/loongarch/Kconfig | 1 + hw/loongarch/acpi-build.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/hw/loongarch

Re: [PATCH] migration: Remove unused VMSTATE_ARRAY_TEST() macro

2024-06-21 Thread Zhijian Li (Fujitsu)
On 21/06/2024 15:03, Philippe Mathieu-Daudé wrote: > Last use of VMSTATE_ARRAY_TEST() was removed in commit 46baa9007f > ("migration/i386: Remove old non-softfloat 64bit FP support"), we > can safely get rid of it. > > Signed-off-by: Philippe Mathieu-Daudé

Re: [PATCH v2 02/10] migration: Rename thread debug names

2024-06-18 Thread Zhijian Li (Fujitsu)
recv}_%d". > > We used to have "live_migration" thread for a very long time, now it's > called "mig/src/main". We may hope to have "mig/dst/main" soon but not > yet. > > Reviewed-by: Fabiano Rosas > Signed-off-by: Peter Xu R

Re: [PATCH v4 28/31] hw/i386: Add support for loading BIOS using guest_memfd

2024-06-14 Thread Xiaoyao Li
On 6/14/2024 4:48 PM, Gupta, Pankaj wrote: On 6/14/2024 10:34 AM, Xiaoyao Li wrote: On 5/30/2024 7:16 PM, Pankaj Gupta wrote: From: Michael Roth When guest_memfd is enabled, the BIOS is generally part of the initial encrypted guest image and will be accessed as private guest memory. Add

Re: [PATCH v4 27/31] hw/i386/sev: Use guest_memfd for legacy ROMs

2024-06-14 Thread Xiaoyao Li
On 5/30/2024 7:16 PM, Pankaj Gupta wrote: From: Michael Roth Current SNP guest kernels will attempt to access these regions with with C-bit set, so guest_memfd is needed to handle that. Otherwise, kvm_convert_memory() will fail when the guest kernel tries to access it and QEMU attempts to call

Re: [PATCH v4 28/31] hw/i386: Add support for loading BIOS using guest_memfd

2024-06-14 Thread Xiaoyao Li
On 5/30/2024 7:16 PM, Pankaj Gupta wrote: From: Michael Roth When guest_memfd is enabled, the BIOS is generally part of the initial encrypted guest image and will be accessed as private guest memory. Add the necessary changes to set up the associated RAM region with a guest_memfd backend to

Re: [PATCH v5 25/65] i386/tdx: Add property sept-ve-disable for tdx-guest object

2024-06-13 Thread Xiaoyao Li
On 6/13/2024 4:35 PM, Duan, Zhenzhong wrote: -Original Message- From: Li, Xiaoyao Subject: Re: [PATCH v5 25/65] i386/tdx: Add property sept-ve-disable for tdx-guest object On 6/6/2024 6:45 PM, Daniel P. Berrangé wrote: Copying Zhenzhong Duan as my point relates to the proposed

Re: [PATCH v5 17/65] i386/tdx: Adjust the supported CPUID based on TDX restrictions

2024-06-13 Thread Xiaoyao Li
On 6/13/2024 4:26 PM, Duan, Zhenzhong wrote: + * + * It also has side effect to enable unsupported bits, e.g., the + * bits of "fixed0" type while present natively. It's safe because + * the unsupported bits will be masked off by .fixed0 later. + */ +    *ret |=

Re: [PULL 39/42] i386: Add support for SUCCOR feature

2024-06-13 Thread Xiaoyao Li
On 6/8/2024 4:34 PM, Paolo Bonzini wrote: From: John Allen Add cpuid bit definition for the SUCCOR feature. This cpuid bit is required to be exposed to guests to allow them to handle machine check exceptions on AMD hosts. v2: - Add "succor" feature word. - Add case to

Re: [PATCH v5 18/65] i386/tdx: Make Intel-PT unsupported for TD guest

2024-06-12 Thread Xiaoyao Li
On 5/31/2024 5:27 PM, Duan, Zhenzhong wrote: On 2/29/2024 2:36 PM, Xiaoyao Li wrote: Due to the fact that Intel-PT virtualization support has been broken in QEMU since Sapphire Rapids generation[1], below warning is triggered when luanching TD guest:    warning: host doesn't support requested

Re: [PATCH v5 17/65] i386/tdx: Adjust the supported CPUID based on TDX restrictions

2024-06-12 Thread Xiaoyao Li
On 5/31/2024 4:47 PM, Duan, Zhenzhong wrote: On 2/29/2024 2:36 PM, Xiaoyao Li wrote: According to Chapter "CPUID Virtualization" in TDX module spec, CPUID bits of TD can be classified into 6 types: 1 | As

Re: [PATCH v5 25/65] i386/tdx: Add property sept-ve-disable for tdx-guest object

2024-06-12 Thread Xiaoyao Li
On 6/6/2024 6:45 PM, Daniel P. Berrangé wrote: Copying Zhenzhong Duan as my point relates to the proposed libvirt TDX patches. On Thu, Feb 29, 2024 at 01:36:46AM -0500, Xiaoyao Li wrote: Bit 28 of TD attribute, named SEPT_VE_DISABLE. When set to 1, it disables EPT violation conversion to #VE

RE: [PATCH v3 4/6] target/i386: add support for VMX FRED controls

2024-06-07 Thread Li, Xin3
> The bits in the secondary vmexit controls are not supported, and in general > the same > is true for the secondary vmexit case. I think it's better to not include > the vmx-entry- > load-fred bit either, and only do the vmxcap changes. Right, we don't need it at all. > > Also, in patch 1

Re: [PATCH] i386/apic: Add hint on boot failure because of disabling x2APIC

2024-06-07 Thread Xiaoyao Li
On 6/7/2024 3:46 PM, Zhao Liu wrote: Hi Philippe, On Fri, Jun 07, 2024 at 08:17:36AM +0200, Philippe Mathieu-Daudé wrote: Date: Fri, 7 Jun 2024 08:17:36 +0200 From: Philippe Mathieu-Daudé Subject: Re: [PATCH] i386/apic: Add hint on boot failure because of disabling x2APIC On 6/6/24 16:08,

Re: [PATCH 0/6] refactor RDMA live migration based on rsocket API

2024-06-06 Thread Zhijian Li (Fujitsu)
On 06/06/2024 19:31, Leon Romanovsky wrote: > On Wed, Jun 05, 2024 at 10:00:24AM +, Gonglei (Arei) wrote: >> >> >>> -Original Message- >>> From: Michael S. Tsirkin [mailto:m...@redhat.com] >>> Sent: Wednesday, June 5, 2024 3:57 PM >>> To: Gonglei (Arei) >>> Cc:

Re: [PATCH] target/i386: SEV: do not assume machine->cgs is SEV

2024-06-06 Thread Xiaoyao Li
On 6/6/2024 6:44 AM, Paolo Bonzini wrote: There can be other confidential computing classes that are not derived from sev-common. Avoid aborting when encountering them. I hit it today when rebasing TDX patches to latest QEMU master, which has the SEV-SNP series merged. (I didn't get time to

Re: [PATCH] cxl: Get rid of unused cfmw_list

2024-06-05 Thread Zhijian Li (Fujitsu)
On 05/06/2024 20:02, Jonathan Cameron wrote: > On Fri, 31 May 2024 14:13:17 +0800 > Li Zhijian wrote: > >> There is no user for this member. All '-M cxl-fmw.N' options have >> been parsed and saved to CXLState.fixed_windows. >> >> Signed-off-by: Li Zhijian &g

Re: [PATCH V3 2/2] target/i386: Advertise MWAIT iff host supports

2024-06-04 Thread Xiaoyao Li
tch merges host_cpu_enable_cpu_pm() into kvm_cpu_realizefn(). Fixes: f5cc5a5c1686 ("i386: split cpu accelerators from cpu.c, using AccelCPUClass") Fixes: 662175b91ff2 ("i386: reorder call to cpu_exec_realizefn") Signed-off-by: Zide Chen Reviewed-by: Xiaoyao Li --- V3: - don't set CPUID_EX

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

2024-06-04 Thread Xiaoyao Li
On 6/4/2024 5:43 PM, Zhao Liu wrote: Hi Chuang, On Mon, Jun 03, 2024 at 04:36:41PM +0800, Chuang Xu wrote: Date: Mon, 3 Jun 2024 16:36:41 +0800 From: Chuang Xu Subject: [PATCH v2] i386/cpu: fixup number of addressable IDs for processor cores in the physical package X-Mailer: git-send-email

[PATCH] cxl: Get rid of unused cfmw_list

2024-05-31 Thread Li Zhijian via
There is no user for this member. All '-M cxl-fmw.N' options have been parsed and saved to CXLState.fixed_windows. Signed-off-by: Li Zhijian --- hw/cxl/cxl-host.c| 1 - include/hw/cxl/cxl.h | 1 - 2 files changed, 2 deletions(-) diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index

Re: [PATCH v8 06/14] hw/mem/cxl_type3: Add support to create DC regions to type3 memory devices

2024-05-27 Thread Zhijian Li (Fujitsu)
/bus/cxl/drivers/cxl_region/bind > > Reviewed-by: Gregory Price > Reviewed-by: Jonathan Cameron > Signed-off-by: Fan Ni Reviewed-by: Li Zhijian

[PATCH] dump: use 10 base for phys_base

2024-05-23 Thread Zhibin Li
>From vmcoreinfo 'phys_base' is a decimal instead a hexadecimal so use base of 10 instead of 16 when converting this string. Signed-off-by: Zhibin Li --- Hi everyone. I'm trying to use 'dump-guest-memory' QMP command to generate a kdump-compressed vmcore file which can be consu

Re: [PATCH v7 00/12] Enabling DCD emulation support in Qemu

2024-05-16 Thread Zhijian Li (Fujitsu)
] RBP: 7ffebec70bd0 R08: R09: 7ffebec70640 [ 127.000879] R10: R11: 0246 R12: 00403840 [ 127.003572] R13: R14: R15: [ 127.005543] Thanks Zhijian On 17/05/2024 01:12, fan wrote: > On Tue

[PATCH v2 3/3] migration/colo: Tidy up bql_unlock() around bdrv_activate_all()

2024-05-15 Thread Li Zhijian via
Make the code more tight. Suggested-by: Michael Tokarev Reviewed-by: Peter Xu Reviewed-by: Zhang Chen Signed-off-by: Li Zhijian --- V2: Collected reviewed-by tags This change/comment suggested by "Michael Tokarev " came a bit late at that time, let's update it together in these

[PATCH v2 2/3] migration/colo: make colo_incoming_co() return void

2024-05-15 Thread Li Zhijian via
Rosas Reviewed-by: Peter Xu Reviewed-by: Zhang Chen Signed-off-by: Li Zhijian --- V2: Fix compilation failed, reported by Fabiano Rosas Collected reviewed-by tags --- include/migration/colo.h | 2 +- migration/colo-stubs.c | 3 +-- migration/colo.c | 9 ++--- migration

[PATCH v2 1/3] migration/colo: Minor fix for colo error message

2024-05-15 Thread Li Zhijian via
- Explicitly show the missing module name: replication - Fix capability name to x-colo Reviewed-by: Peter Xu Reviewed-by: Zhang Chen Signed-off-by: Li Zhijian --- V2: Collected reviewed-by tags --- migration/migration.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

Re: [PATCH 2/3] migration/colo: make colo_incoming_co() return void

2024-05-15 Thread Zhijian Li (Fujitsu)
On 16/05/2024 03:04, Fabiano Rosas wrote: > Li Zhijian via writes: > >> Currently, it always returns 0, no need to check the return value at all. >> In addition, enter colo coroutine only if migration_incoming_colo_enabled() >> is true. >> Once the destinati

[PATCH v4 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-15 Thread Li Feng
ing in subsequent reconnection not being executed. The next patch will completely fix this issue with a better approach. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 +-- hw/virtio/vhost-user-base.c| 2 +- hw/virtio/vhost-use

[PATCH v4 2/2] vhost-user: fix lost reconnect again

2024-05-15 Thread Li Feng
his issue, including vhost-user-blk/scsi. Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 3 ++- hw/scsi/vhost-user-scsi.c | 3 ++- hw/virtio/vhost-user-base.c | 3 ++- hw/virtio/vhost-user.c | 10

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

2024-05-15 Thread Xiaoyao Li
On 5/13/2024 8:33 PM, Daniel P. Berrangé wrote: Validate that it is possible to pass 'parameter=1' for any SMP topology parameter, since unsupported parameters are implicitly considered to always have a value of 1. Signed-off-by: Daniel P. Berrangé --- tests/unit/test-smp-parse.c | 8

Re: [PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-15 Thread Li Feng
> 2024年5月15日 23:47,Raphael Norwitz 写道: > > The case your describing makes sense but now I have some concerns on > the vhost_dev_cleanup bit. > > On Wed, May 15, 2024 at 1:47 AM Li Feng <mailto:fen...@smartx.com>> wrote: >> >> >> >>&g

Re: [PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-14 Thread Li Feng
> 2024年5月14日 21:58,Raphael Norwitz 写道: > > Code looks good. Just a question on the error case you're trying to fix. > > On Tue, May 14, 2024 at 2:12 AM Li Feng wrote: >> >> When the vhost-user is reconnecting to the backend, and if the vhost-user >

Re: [PATCH v3 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-14 Thread Li Feng
> 2024年5月14日 21:58,Raphael Norwitz 写道: > > The code for these two patches looks fine. Just some questions on the > failure case you're trying to fix. > > > On Tue, May 14, 2024 at 2:12 AM Li Feng wrote: >> >> This reverts commit f02a4b8e6431598612466

Re: [PATCH v7 06/12] hw/mem/cxl_type3: Add host backend and address space handling for DC regions

2024-05-14 Thread Zhijian Li (Fujitsu)
On 19/04/2024 07:10, nifan@gmail.com wrote: > +uint64_t dc_size; > + > +mr = host_memory_backend_get_memory(ct3d->dc.host_dc); > +dc_size = memory_region_size(mr); > +region_len = DIV_ROUND_UP(dc_size, ct3d->dc.num_regions); > + > +if (dc_size % (ct3d->dc.num_regions *

Re: [PATCH v7 04/12] hw/mem/cxl_type3: Add support to create DC regions to type3 memory devices

2024-05-14 Thread Zhijian Li (Fujitsu)
On 19/04/2024 07:10, nifan@gmail.com wrote: > From: Fan Ni > > +} > + > static bool cxl_setup_memory(CXLType3Dev *ct3d, Error **errp) > { > DeviceState *ds = DEVICE(ct3d); > @@ -635,6 +676,13 @@ static bool cxl_setup_memory(CXLType3Dev *ct3d, Error > **errp) >

[PATCH v3 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-14 Thread Li Feng
ing in subsequent reconnection not being executed. The next patch will completely fix this issue with a better approach. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 +-- hw/virtio/vhost-user-base.c| 2 +- hw/virtio/vhost-use

[PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-14 Thread Li Feng
false. At this time, the event handler will be cleared. We need to ensure that the event handler can remain installed. All vhost-user devices have this issue, including vhost-user-blk/scsi. Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/

Re: [PATCH v7 09/12] hw/cxl/events: Add qmp interfaces to add/release dynamic capacity extents

2024-05-13 Thread Zhijian Li (Fujitsu)
On 19/04/2024 07:11, nifan@gmail.com wrote: > +} else if (type == DC_EVENT_ADD_CAPACITY) { > +if (cxl_extents_overlaps_dpa_range(>dc.extents, dpa, len)) { > +error_setg(errp, > + "cannot add DPA already accessible to the same >

Re: [PATCH v7 00/12] Enabling DCD emulation support in Qemu

2024-05-13 Thread Zhijian Li (Fujitsu)
Hi Fan Do you have a newer instruction to play with the DCD. It seems that the instruction in RFC[0] doesn't work for current code. [0] https://lore.kernel.org/all/20230511175609.2091136-1-fan...@samsung.com/ On 19/04/2024 07:10, nifan@gmail.com wrote: > A git tree of this series can be

[PATCH v2 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-13 Thread Li Feng
This reverts commit f02a4b8e6431598612466f76aac64ab492849abf. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 +-- hw/virtio/vhost-user-base.c| 2 +- hw/virtio/vhost-user.c | 10 ++ include/hw/virtio/vhost-user.h | 3

[PATCH v2 2/2] vhost-user: fix lost reconnect again

2024-05-13 Thread Li Feng
false. At this time, the event handler will be cleared. We need to ensure that the event handler can remain installed. All vhost-user devices have this issue, including vhost-user-blk/scsi. Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/

[PATCH 2/3] migration/colo: make colo_incoming_co() return void

2024-05-08 Thread Li Zhijian via
-by: Li Zhijian --- migration/colo.c | 9 ++--- migration/migration.c | 6 +++--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index 5600a43d78..991806c06a 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -929,16 +929,13 @@ out

[PATCH 3/3] migration/colo: Tidy up bql_unlock() around bdrv_activate_all()

2024-05-08 Thread Li Zhijian via
Make the code more tight. Cc: Michael Tokarev Signed-off-by: Li Zhijian --- This change/comment suggested by "Michael Tokarev " came a bit late at that time, let's update it together in these minor set this time. --- migration/colo.c | 3 +-- 1 file changed, 1 insertion(+), 2

[PATCH 1/3] migration/colo: Minor fix for colo error message

2024-05-08 Thread Li Zhijian via
- Explicitly show the missing module name: replication - Fix capability name to x-colo Signed-off-by: Li Zhijian --- migration/migration.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 6502e169a3..b4a09c561c 100644

Re: [PATCH] qemu-io: add cvtnum() error handling for zone commands

2024-05-07 Thread Sam Li
not be represented. > > Reported-by: Peter Maydell > Cc: Sam Li > Signed-off-by: Stefan Hajnoczi > --- > qemu-io-cmds.c | 48 +++- > 1 file changed, 47 insertions(+), 1 deletion(-) Reviewed-by: Sam Li Hi Stefan, Thank you for fixing th

Re: [PATCH v3 1/1] accel/kvm: Fix segmentation fault

2024-05-06 Thread Zhijian Li (Fujitsu)
a null check for kvm_status to prevent segmentation faults. > > Signed-off-by: Masato Imai LGTM, Tested-by: Li Zhijian > --- > 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 >

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

2024-04-26 Thread Xiaoyao Li
On 4/26/2024 6:07 PM, Zhao Liu wrote: Update the comment to match the X86ConfidentialGuestClass implementation. Suggested-by: Xiaoyao Li I think it should be "Reported-by" Signed-off-by: Zhao Liu --- target/i386/confidential-guest.h | 2 +- 1 file changed, 1 insertion(+),

[PATCH 2/2] vhost-user: fix lost reconnect again

2024-04-26 Thread Li Feng
Fixes: 71e076a07d ("hw/virtio: generalise CHR_EVENT_CLOSED handling") Signed-off-by: Li Feng --- hw/virtio/vhost-user.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index c929097e87..c407ea8939 100644 --- a/hw/vir

[PATCH 1/2] Revert "vhost-user: fix lost reconnect"

2024-04-26 Thread Li Feng
This reverts commit f02a4b8e6431598612466f76aac64ab492849abf. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 2 +- hw/scsi/vhost-user-scsi.c | 3 +-- hw/virtio/vhost-user-base.c| 2 +- hw/virtio/vhost-user.c | 10 ++ include/hw/virtio/vhost-user.h | 3

[PATCH 0/2] Fixed the problem of vhost-user reconnection

2024-04-26 Thread Li Feng
Previous discussion here: https://lore.kernel.org/all/f86d6159-5610-476c-a69e-cd3a717f9...@nvidia.com/ The merged version cannot fully cover all possible scenarios. Here we revert the previous fixes and then use new methods to fix them. Li Feng (2): Revert "vhost-user: fix lost reco

Re: [PATCH v2] hw/mem/cxl_type3: reset dvsecs in ct3d_reset()

2024-04-25 Thread Zhijian Li (Fujitsu)
ping On 11/04/2024 18:18, Jonathan Cameron wrote: > On Tue, 9 Apr 2024 15:58:46 +0800 > Li Zhijian wrote: > >> After the kernel commit >> 0cab68720598 ("cxl/pci: Fix disabling memory if DVSEC CXL Range does not >> match a CFMWS window") >> CXL

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

2024-04-25 Thread Xiaoyao Li
On 4/25/2024 6:29 PM, Zhao Liu wrote: 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 Xiaoyao Li
On 4/25/2024 3:17 PM, Zhao Liu wrote: 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

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

2024-04-24 Thread Xiaoyao Li
On 3/29/2024 6:19 PM, Zhao Liu wrote: From: Zhao Liu Hi list, This series is based on Paolo's guest_phys_bits patchset [1]. Currently, the old and new kvmclocks have the same feature name "kvmclock" in FeatureWordInfo[FEAT_KVM]. When I tried to dig into the history of this unusual naming

Re: [PATCH for-9.1 2/7] target/i386/kvm: Remove local MSR_KVM_WALL_CLOCK and MSR_KVM_SYSTEM_TIME definitions

2024-04-24 Thread Xiaoyao Li
On 3/29/2024 6:19 PM, Zhao Liu wrote: From: 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. Signed-off-by: Zhao Liu Reviewed-by: Xiaoyao Li --- target/i386/kvm/kvm.c | 3

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

2024-04-24 Thread Xiaoyao Li
On 3/29/2024 6:19 PM, Zhao Liu wrote: From: 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 --- hw/i386/kvm/clock.c | 5 ++--- target/i386/cpu.h |

Re: [PULL 43/63] target/i386: Implement mc->kvm_type() to get VM type

2024-04-24 Thread Xiaoyao Li
On 4/23/2024 11:09 PM, Paolo Bonzini wrote: + +/** + * x86_confidential_guest_kvm_type: + * + * Calls #X86ConfidentialGuestClass.unplug callback of @plug_handler. the comment needs to be updated: Calls #X86ConfidentialGuestClass.kvm_type() callback + */ +static inline int

Re: [PATCH v2 1/1] migration/dirtyrate: Fix segmentation fault

2024-04-24 Thread Zhijian Li (Fujitsu)
On 24/04/2024 12:52, mii wrote: > > On 2024/04/24 10:28, Yong Huang wrote: >> >> >> On Tue, Apr 23, 2024 at 9:35 PM Peter Xu wrote: >> >> On Tue, Apr 23, 2024 at 09:13:08AM +, Masato Imai wrote: >> > When the KVM acceleration parameter is not set, executing >> calc_dirty_rate >>

Re: [PULL 25/63] i386/kvm: Move architectural CPUID leaf generation to separate helper

2024-04-23 Thread Xiaoyao Li
this is just a cleanup, so keep the function static. Signed-off-by: Sean Christopherson Signed-off-by: Xiaoyao Li Message-ID: <20240229063726.610065-23-xiaoyao...@intel.com> Reviewed-by: Xiaoyao Li Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c

[PATCH] backends/cryptodev-builtin: Fix local_error leaks

2024-04-22 Thread Li Zhijian via
It seems that this error does not need to be propagated to the upper, directly output the error to avoid the leaks Closes: https://gitlab.com/qemu-project/qemu/-/issues/2283 Signed-off-by: Li Zhijian --- backends/cryptodev-builtin.c | 9 + 1 file changed, 5 insertions(+), 4 deletions

Re: [PATCH v2] migration/colo: Fix bdrv_graph_rdlock_main_loop: Assertion `!qemu_in_coroutine()' failed.

2024-04-17 Thread Zhijian Li (Fujitsu)
On 17/04/2024 14:13, Philippe Mathieu-Daudé wrote: > On 17/4/24 04:56, Li Zhijian via wrote: >> bdrv_activate_all() should not be called from the coroutine context, move >> it to the QEMU thread colo_process_incoming_thread() with the bql_lock >> protected. >> >

Re: [PATCH] migration/colo: Fix bdrv_graph_rdlock_main_loop: Assertion `!qemu_in_coroutine()' failed.

2024-04-16 Thread Zhijian Li (Fujitsu)
On 17/04/2024 10:44, Li Zhijian wrote: > bdrv_activate_all() should not be called from the coroutine context, move > it to the QEMU thread colo_process_incoming_thread() with the bql_lock > protected. > > The backtrace is as follows: > #4 0x561af7948362 in bdrv_grap

[PATCH v2] migration/colo: Fix bdrv_graph_rdlock_main_loop: Assertion `!qemu_in_coroutine()' failed.

2024-04-16 Thread Li Zhijian via
/-/issues/2277 Fixes: 2b3912f135 ("block: Mark bdrv_first_blk() and bdrv_is_root_node() GRAPH_RDLOCK") Signed-off-by: Li Zhijian --- V2: fix missing bql_unlock() in error path. --- migration/colo.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a

[PATCH] migration/colo: Fix bdrv_graph_rdlock_main_loop: Assertion `!qemu_in_coroutine()' failed.

2024-04-16 Thread Li Zhijian via
/-/issues/2277 Fixes: 2b3912f135 ("block: Mark bdrv_first_blk() and bdrv_is_root_node() GRAPH_RDLOCK") Signed-off-by: Li Zhijian --- migration/colo.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index 84632a603e..

Re: [PATCH v5 28/65] i386/tdx: Disable pmu for TD guest

2024-04-16 Thread Xiaoyao Li
On 4/16/2024 4:32 PM, Chenyi Qiang wrote: On 2/29/2024 2:36 PM, Xiaoyao Li wrote: Current KVM doesn't support PMU for TD guest. It returns error if TD is created with PMU bit being set in attributes. Disable PMU for TD guest on QEMU side. Signed-off-by: Xiaoyao Li --- target/i386/kvm

Re: [PATCH v2] target/i386: Give IRQs a chance when resetting HF_INHIBIT_IRQ_MASK

2024-04-15 Thread Ruihan Li
inhibit_reset = true; > } else if (inhibit) { > gen_set_hflag(s, HF_INHIBIT_IRQ_MASK); > } Yes, I agree with you that your changes look a bit clearer. I have tested your changes and verified that they fix the reported bug. > No need to submit v3, I can do the change myself when applying. Thank you for your review. Feel free to do that. Thanks, Ruihan Li

[PATCH v2] target/i386: Give IRQs a chance when resetting HF_INHIBIT_IRQ_MASK

2024-04-15 Thread Ruihan Li
-by: Ruihan Li --- The same problem was discovered two years ago, see [StackOverflow][so]. [so]: https://stackoverflow.com/questions/68135305/executing-ret-after-sti-doesnt-start-interrupts Changes since v1: - Fix a typo: "RET is followed by STI" -> "STI is followed by RET"

Re: [PATCH-for-9.1 v2 2/3] migration: Remove RDMA protocol handling

2024-04-09 Thread Zhijian Li (Fujitsu)
on 4/10/2024 3:46 AM, Peter Xu wrote: >> Is there document/link about the unittest/CI for migration tests, Why >> are those tests missing? >> Is it hard or very special to set up an environment for that? maybe we >> can help in this regards. > See tests/qtest/migration-test.c. We put most of

[PATCH v2] hw/mem/cxl_type3: reset dvsecs in ct3d_reset()

2024-04-09 Thread Li Zhijian via
registers could be changed by the firmware or OS, let them have their initial value in reboot so that the OS can read their clean status. Fixes: e1706ea83da0 ("hw/cxl/device: Add a memory device (8.2.8.5)") Signed-off-by: Li Zhijian --- root_port, usp and dsp have the same issue, if this p

Re: [PATCH v2] hw/i386/acpi: Set PCAT_COMPAT bit only when pic is not disabled

2024-04-03 Thread Xiaoyao Li
On 4/3/2024 11:12 PM, Igor Mammedov wrote: On Wed, 3 Apr 2024 10:59:53 -0400 Xiaoyao Li wrote: A value 1 of PCAT_COMPAT (bit 0) of MADT.Flags indicates that the system also has a PC-AT-compatible dual-8259 setup, i.e., the PIC. When PIC is not enabled (pic=off) for x86 machine

[PATCH v2] hw/i386/acpi: Set PCAT_COMPAT bit only when pic is not disabled

2024-04-03 Thread Xiaoyao Li
-by: Xiaoyao Li --- changes in v2: - Clarify more in commit message; --- hw/i386/acpi-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c index 20f19269da40..0cc2919bb851 100644 --- a/hw/i386/acpi-common.c +++ b/hw/i386/acpi-common.c

Re: [PATCH 2/2] CXL/cxl_type3: reset DVSEC CXL Control in ct3d_reset

2024-04-03 Thread Zhijian Li (Fujitsu)
On 03/04/2024 11:42, Li Zhijian wrote: > > > On 02/04/2024 17:17, Jonathan Cameron wrote: >> On Tue,  2 Apr 2024 09:46:47 +0800 >> Li Zhijian wrote: >> >>> After the kernel commit >>> 0cab68720598 ("cxl/pci: Fix disabling memory if

Re: [PATCH 2/2] CXL/cxl_type3: reset DVSEC CXL Control in ct3d_reset

2024-04-02 Thread Zhijian Li (Fujitsu)
On 02/04/2024 17:17, Jonathan Cameron wrote: > On Tue, 2 Apr 2024 09:46:47 +0800 > Li Zhijian wrote: > >> After the kernel commit >> 0cab68720598 ("cxl/pci: Fix disabling memory if DVSEC CXL Range does not >> match a CFMWS window") > > Fixes tag

Re: [PATCH] hw/i386/acpi: Set PCAT_COMPAT bit only when pic is not disabled

2024-04-02 Thread Xiaoyao Li
On 4/2/2024 10:31 PM, Michael S. Tsirkin wrote: On Tue, Apr 02, 2024 at 09:18:44PM +0800, Xiaoyao Li wrote: On 4/2/2024 6:02 PM, Michael S. Tsirkin wrote: On Tue, Apr 02, 2024 at 04:25:16AM -0400, Xiaoyao Li wrote: Set MADT.FLAGS[bit 0].PCAT_COMPAT based on x86ms->pic. Signed-off-by: Xiao

Re: [PATCH] hw/i386/acpi: Set PCAT_COMPAT bit only when pic is not disabled

2024-04-02 Thread Xiaoyao Li
On 4/2/2024 6:02 PM, Michael S. Tsirkin wrote: On Tue, Apr 02, 2024 at 04:25:16AM -0400, Xiaoyao Li wrote: Set MADT.FLAGS[bit 0].PCAT_COMPAT based on x86ms->pic. Signed-off-by: Xiaoyao Li Please include more info in the commit log: what is the behaviour you observe, why it is wrong,

Re: vhost-user-blk reconnect issue

2024-04-02 Thread Li Feng
comments? Revert: https://lore.kernel.org/all/a68c0148e9bf105f9e83ff5e763b8fcb6f7ba9be.1697644299.git@redhat.com/ New: https://lore.kernel.org/all/20230804052954.2918915-2-fen...@smartx.com/ Thanks, Li > 2024年4月1日 16:43,Yajun Wu 写道: > > > > On 4/1/2024 4:34 PM, Li Feng wrote:

[PATCH] hw/i386/acpi: Set PCAT_COMPAT bit only when pic is not disabled

2024-04-02 Thread Xiaoyao Li
Set MADT.FLAGS[bit 0].PCAT_COMPAT based on x86ms->pic. Signed-off-by: Xiaoyao Li --- hw/i386/acpi-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c index 20f19269da40..0cc2919bb851 100644 --- a/hw/i386/acpi-commo

Re: [PATCH 1/2] CXL/cxl_type3: add first_dvsec_offset() helper

2024-04-01 Thread Zhijian Li (Fujitsu)
On 02/04/2024 12:09, fan wrote: > On Tue, Apr 02, 2024 at 09:46:46AM +0800, Li Zhijian via wrote: >> It helps to figure out where the first dvsec register is located. In >> addition, replace offset and size hardcore with existing macros. >> >> Signed-off-by: Li

[PATCH 1/2] CXL/cxl_type3: add first_dvsec_offset() helper

2024-04-01 Thread Li Zhijian via
It helps to figure out where the first dvsec register is located. In addition, replace offset and size hardcore with existing macros. Signed-off-by: Li Zhijian --- hw/mem/cxl_type3.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/hw/mem/cxl_type3.c b/hw

[PATCH 2/2] CXL/cxl_type3: reset DVSEC CXL Control in ct3d_reset

2024-04-01 Thread Li Zhijian via
ult) value in reboot so that the OS can read its clean status. Signed-off-by: Li Zhijian --- hw/mem/cxl_type3.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index ad2fe7d463fb..3fe136053390 100644 --- a/hw/mem/cxl_typ

Re: [PATCH 26/26] i386/kvm: Move architectural CPUID leaf generation to separate helper

2024-04-01 Thread Xiaoyao Li
this is just a cleanup, so keep the function static. Signed-off-by: Sean Christopherson Signed-off-by: Xiaoyao Li Message-ID: <20240229063726.610065-23-xiaoyao...@intel.com> [Unify error reporting, rename function. - Paolo] Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c

Re: vhost-user-blk reconnect issue

2024-04-01 Thread Li Feng
/a68c0148e9bf105f9e83ff5e763b8fcb6f7ba9be.1697644299.git@redhat.com/ Thanks, Li > 2024年4月1日 10:08,Yajun Wu 写道: > > > On 3/27/2024 6:47 PM, Stefano Garzarella wrote: >> External email: Use caution opening links or attachments >> >> >> Hi Yajun, >> &

Re: [PATCH-for-9.1 v2 2/3] migration: Remove RDMA protocol handling

2024-04-01 Thread Zhijian Li (Fujitsu)
Phil, on 3/29/2024 6:28 PM, Philippe Mathieu-Daudé wrote: >> >> >>> IMHO it's more important to know whether there are still users and >>> whether >>> they would still like to see it around. >> >> Agree. >> I didn't immediately express my opinion in V1 because I'm also >> consulting our >>

[PATCH] migration, docs: mark RDMA migration as deprecated

2024-03-31 Thread Li Zhijian via
...@fujitsu.com [2] https://lore.kernel.org/r/cahecvy7hxswn4ow_kog+q+tn6f_kmeichevz1qgm-fbxbpp...@mail.gmail.com CC: Peter Xu CC: Philippe Mathieu-Daudé CC: Fabiano Rosas CC: Thomas Huth CC: Daniel P. Berrangé CC: Yu Zhang Signed-off-by: Li Zhijian --- docs/about/deprecated.rst | 15

Re: [PATCH-for-9.1 v2 2/3] migration: Remove RDMA protocol handling

2024-03-28 Thread Zhijian Li (Fujitsu)
rdma subsystem") >>> released in v8.2. >>> >>> Remove: >>> - RDMA handling from migration >>> - dependencies on libibumad, libibverbs and librdmacm >>> >>> Keep the RAM_SAVE_FLAG_HOOK definition since it might appears >>&

Re: [PATCH v3 48/49] hw/i386/sev: Use guest_memfd for legacy ROMs

2024-03-27 Thread Xiaoyao Li
On 3/21/2024 2:12 AM, Isaku Yamahata wrote: On Wed, Mar 20, 2024 at 03:39:44AM -0500, Michael Roth wrote: TODO: make this SNP-specific if TDX disables legacy ROMs in general TDX disables pc.rom, not disable isa-bios. IIRC, TDX doesn't need pc pflash. Not TDX doesn't need pc pflash, but

Re: [PATCH for-9.1 v5 2/3] target/i386: add guest-phys-bits cpu property

2024-03-26 Thread Xiaoyao Li
viewed-by: Xiaoyao Li --- v4->v5: - move here all non-KVM parts - add compat property and support for special value "-1" (accelerator defines value) target/i386/cpu.h | 1 + hw/i386/pc.c | 4 +++- target/i386/cpu.c | 22 ++ 3 files changed, 26 insert

Re: [PATCH 12/26] KVM: track whether guest state is encrypted

2024-03-26 Thread Xiaoyao Li
On 3/23/2024 2:11 AM, Paolo Bonzini wrote: So far, KVM has allowed KVM_GET/SET_* ioctls to execute even if the guest state is encrypted, in which case they do nothing. For the new API using VM types, instead, the ioctls will fail which is a safer and more robust approach. The new API will be

Re: [PATCH 21/26] kvm/memory: Make memory type private by default if it has guest memfd backend

2024-03-26 Thread Xiaoyao Li
On 3/23/2024 2:11 AM, Paolo Bonzini wrote: From: Xiaoyao Li KVM side leaves the memory to shared by default, while may incur the /s/while/which/ fix typo from myself. overhead of paging conversion on the first visit of each page. Because the expectation is that page is likely to private

Re: [PATCH 25/26] kvm: handle KVM_EXIT_MEMORY_FAULT

2024-03-26 Thread Xiaoyao Li
, the original shared memory can be discarded via ram_block_discard_range(). Note, shared memory can be discarded only when it's not back'ed by hugetlb because hugetlb is supposed to be pre-allocated and no need for discarding. Signed-off-by: Chao Peng Co-developed-by: Xiaoyao Li Signed-off

Re: [PATCH 3/7] KVM: track whether guest state is encrypted

2024-03-22 Thread Xiaoyao Li
in the future in order to suppor migration). From that point, skip reading registers so that cpu->vcpu_dirty is never true: if it ever becomes true, kvm_arch_put_registers() will fail miserably. Signed-off-by: Paolo Bonzini Reviewed-by: Xiaoyao Li

Re: [PATCH 4/7] KVM: remove kvm_arch_cpu_check_are_resettable

2024-03-22 Thread Xiaoyao Li
Reviewed-by: Xiaoyao Li

Re: [PATCH 5/7] target/i386: introduce x86-confidential-guest

2024-03-22 Thread Xiaoyao Li
On 3/19/2024 9:59 PM, Paolo Bonzini wrote: Introduce a common superclass for x86 confidential guest implementations. It will extend ConfidentialGuestSupportClass with a method that provides the VM type to be passed to KVM_CREATE_VM. Signed-off-by: Paolo Bonzini Reviewed-by: Xiaoyao Li

Re: [PATCH 6/7] target/i386: Implement mc->kvm_type() to get VM type

2024-03-22 Thread Xiaoyao Li
On 3/19/2024 9:59 PM, Paolo Bonzini wrote: From: Xiaoyao Li KVM is introducing a new API to create confidential guests, which will be used by TDX and SEV-SNP but is also available for SEV and SEV-ES. The API uses the VM type argument to KVM_CREATE_VM to identify which confidential computing

Re: [PATCH RFC v3 00/49] Add AMD Secure Nested Paging (SEV-SNP) support

2024-03-20 Thread Xiaoyao Li
On 3/21/2024 1:08 AM, Paolo Bonzini wrote: On Wed, Mar 20, 2024 at 10:59 AM Paolo Bonzini wrote: I will now focus on reviewing patches 6-20. This way we can prepare a common tree for SEV_INIT2/SNP/TDX, for both vendors to build upon. Ok, the attachment is the delta that I have. The only

Re: [PATCH v5 08/65] kvm: handle KVM_EXIT_MEMORY_FAULT

2024-03-20 Thread Xiaoyao Li
On 3/19/2024 10:14 AM, Wang, Lei wrote: On 2/29/2024 14:36, Xiaoyao Li wrote: From: Chao Peng When geeting KVM_EXIT_MEMORY_FAULT exit, it indicates userspace needs to do the memory conversion on the RAMBlock to turn the memory into desired attribute, i.e., private/shared. Currently only

  1   2   3   4   5   6   7   8   9   10   >