Re: [PATCH v2 1/2] system/memory.c: support unaligned access

2024-03-18 Thread Philippe Mathieu-Daudé
Hi Tomoyuki, On 19/3/24 07:43, Philippe Mathieu-Daudé wrote: On 18/3/24 17:15, Peter Xu wrote: Hi, On Thu, Feb 01, 2024 at 05:13:12PM +0900, Tomoyuki HIROSE wrote: The previous code ignored 'impl.unaligned' and handled unaligned accesses as is. But this implementation cannot emulate specific

Re: [PATCH v2 1/2] system/memory.c: support unaligned access

2024-03-18 Thread Philippe Mathieu-Daudé
On 18/3/24 17:15, Peter Xu wrote: Hi, On Thu, Feb 01, 2024 at 05:13:12PM +0900, Tomoyuki HIROSE wrote: The previous code ignored 'impl.unaligned' and handled unaligned accesses as is. But this implementation cannot emulate specific registers of some devices that allow unaligned access such as x

[PATCH v1] target/loongarch: Fix qemu-loongarch64 hang when executing 'll.d $t0, $t0, 0'

2024-03-18 Thread Song Gao
On gen_ll, if a->imm is 0, The value of t0 should be src1. Links: https://www.openwall.com/lists/musl/2024/03/12/4 Signed-off-by: Song Gao --- target/loongarch/tcg/insn_trans/trans_atomic.c.inc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target/loongarch/tcg/insn_

Re: [PATCH-for-9.1 0/8] target/microblaze: Sprint housekeeping

2024-03-18 Thread Philippe Mathieu-Daudé
s/sprint/spring/ in Subject ;) On 19/3/24 07:28, Philippe Mathieu-Daudé wrote: Cleanups while trying to remove non-essential target_ulong uses. Last use is in helper_stackprot(), but I couldn't figure what to do there yet. Philippe Mathieu-Daudé (8): target/microblaze: Use correct string fo

[PATCH-for-9.1 2/8] target/microblaze: Use hwaddr/vaddr in cpu_get_phys_page_attrs_debug()

2024-03-18 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index 0a12c4ea94..3f410fc7b5 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c

Re: [PATCH] target/tricore/helper: Use correct string format in cpu_tlb_fill()

2024-03-18 Thread Philippe Mathieu-Daudé
+Anton On 19/3/24 06:14, Philippe Mathieu-Daudé wrote: 'address' got converted from target_ulong to vaddr in commit 68d6eee73c ("target/tricore: Convert to CPUClass::tlb_fill"). Use the corresponding format string to avoid casting. Signed-off-by: Philippe Mathieu-Daudé --- target/tricore/hel

Re: [PATCH] target/ppc/mmu-radix64: Use correct string format in walk_tree()

2024-03-18 Thread Philippe Mathieu-Daudé
+Anton On 19/3/24 06:10, Philippe Mathieu-Daudé wrote: 'mask', 'nlb' and 'base_addr' are all uin64_t types. Use the corresponding PRIx64 format. Fixes: d2066bc50d ("target/ppc: Check page dir/table base alignment") Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/mmu-radix64.c | 8 --

[PATCH-for-9.1 5/8] target/microblaze: Restrict 64-bit 'res_addr' to system emulation

2024-03-18 Thread Philippe Mathieu-Daudé
'res_addr' is only used in system emulation, where we have TARGET_LONG_BITS = 64, so we can directly use the native uint64_t type instead of target_ulong. Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/cpu.h | 10 +- target/microblaze/cpu.c | 2 ++ target/microb

[PATCH-for-9.1 3/8] target/microblaze: Widen vaddr in mmu_translate()

2024-03-18 Thread Philippe Mathieu-Daudé
Use 'vaddr' type for virtual addresses. Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/mmu.h | 2 +- target/microblaze/mmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/microblaze/mmu.h b/target/microblaze/mmu.h index 1068bd2d52..2aca39c923 100644 -

[RFC PATCH-for-9.1 8/8] target/microblaze: Widen $ear to 64-bit

2024-03-18 Thread Philippe Mathieu-Daudé
The Exception Address Register is 64-bit wide. User emulation only access the 32 lower bits. Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/cpu.h | 2 +- linux-user/elfload.c | 2 +- target/microblaze/gdbstub.c | 2 +- target/microblaze/translate.c | 2 +- 4 files c

[PATCH-for-9.1 4/8] target/microblaze: Use 32-bit destination in gen_goto_tb()

2024-03-18 Thread Philippe Mathieu-Daudé
cpu_pc and jmp_dest are 32-bit. Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 4e52ef32db..d6a42381bb 100644 --- a/target/microblaze/tr

[PATCH-for-9.1 7/8] target/microblaze: Move MMU helpers to sys_helper.c

2024-03-18 Thread Philippe Mathieu-Daudé
MMU helpers are only used during system emulation, move them to sys_helper.c. Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/op_helper.c | 48 -- target/microblaze/sys_helper.c | 47 + 2 files changed, 47 insertions(+)

[PATCH-for-9.1 6/8] target/microblaze: Rename helper.c -> sys_helper.c

2024-03-18 Thread Philippe Mathieu-Daudé
helper.c only contains system emulation helpers, rename it as sys_helper.c. Adapt meson and remove pointless #ifdef'ry. Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/{helper.c => sys_helper.c} | 5 + target/microblaze/meson.build| 2 +- 2 files changed, 2 insert

[PATCH-for-9.1 0/8] target/microblaze: Sprint housekeeping

2024-03-18 Thread Philippe Mathieu-Daudé
Cleanups while trying to remove non-essential target_ulong uses. Last use is in helper_stackprot(), but I couldn't figure what to do there yet. Philippe Mathieu-Daudé (8): target/microblaze: Use correct string format in do_unaligned_access() target/microblaze: Use hwaddr/vaddr in cpu_get_phys

[PATCH-for-9.1 1/8] target/microblaze: Use correct string format in do_unaligned_access()

2024-03-18 Thread Philippe Mathieu-Daudé
'addr' is of type 'vaddr'; no need to cast, use the corresponding format string. Fixes: ab0c8d0f5b ("target/microblaze: Use cc->do_unaligned_access") Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targe

RE: [PATCH v1 11/11] backends/iommufd: Introduce helper function iommufd_device_get_info()

2024-03-18 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 11/11] backends/iommufd: Introduce helper >function iommufd_device_get_info() > >Hi Joao, > >On 3/18/24 16:09, Joao Martins wrote: >> On 18/03/2024 07:54, Eric Auger wrote: >>> Hi Zhenzhong, >>> >>> On 2/28/24 04:59, Zhenzhong

RE: [PATCH v1 00/11] Add a host IOMMU device abstraction

2024-03-18 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 00/11] Add a host IOMMU device abstraction > > > >On 2/28/24 04:58, Zhenzhong Duan wrote: >> Hi, >> >> Based on Joao's suggestion, the iommufd nesting prerequisite series [1] >> is further splitted to host IOMMU device abstrac

RE: [PATCH v1 09/11] hw/pci: Introduce pci_device_set/unset_iommu_device()

2024-03-18 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 09/11] hw/pci: Introduce >pci_device_set/unset_iommu_device() > >Hi Zhenzhong, > >On 2/28/24 04:58, Zhenzhong Duan wrote: >> From: Yi Liu >> >> This adds pci_device_set/unset_iommu_device() to set/unset >> HostIOMMUDevice for

RE: [PATCH v1 05/11] vfio: Introduce host_iommu_device_create callback

2024-03-18 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 05/11] vfio: Introduce host_iommu_device_create >callback > > > >On 2/28/24 04:58, Zhenzhong Duan wrote: >> Introduce host_iommu_device_create callback and a wrapper for it. >> >> This callback is used to allocate a host iommu

[PATCH] target/tricore/helper: Use correct string format in cpu_tlb_fill()

2024-03-18 Thread Philippe Mathieu-Daudé
'address' got converted from target_ulong to vaddr in commit 68d6eee73c ("target/tricore: Convert to CPUClass::tlb_fill"). Use the corresponding format string to avoid casting. Signed-off-by: Philippe Mathieu-Daudé --- target/tricore/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletion

答复: [PATCH v1 2/2] system/cpus: Fix resume_all_vcpus() under vCPU hotplug condition

2024-03-18 Thread zhukeqian via
Hi David, On 17.03.24 09:37, Keqian Zhu via wrote: >> For vCPU being hotplugged, qemu_init_vcpu() is called. In this >> function, we set vcpu state as stopped, and then wait vcpu thread to >> be created. >> >> As the vcpu state is stopped, it will inform us it has been created >> and then wait

[PATCH] target/ppc/mmu-radix64: Use correct string format in walk_tree()

2024-03-18 Thread Philippe Mathieu-Daudé
'mask', 'nlb' and 'base_addr' are all uin64_t types. Use the corresponding PRIx64 format. Fixes: d2066bc50d ("target/ppc: Check page dir/table base alignment") Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/mmu-radix64.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff -

答复: [PATCH v1 1/2] system/cpus: Fix pause_all_vcpus() under concurrent environment

2024-03-18 Thread zhukeqian via
Hi David, Thanks for reviewing. On 17.03.24 09:37, Keqian Zhu via wrote: >> Both main loop thread and vCPU thread are allowed to call >> pause_all_vcpus(), and in general resume_all_vcpus() is called after >> it. Two issues live in pause_all_vcpus(): > >In general, calling pause_all_vcpus() fro

Re: [PATCH] target/i386: Export RFDS bit to guests

2024-03-18 Thread Xiaoyao Li
On 3/13/2024 10:53 PM, Pawan Gupta wrote: Register File Data Sampling (RFDS) is a CPU side-channel vulnerability that may expose stale register value. CPUs that set RFDS_NO bit in MSR IA32_ARCH_CAPABILITIES indicate that they are not vulnerable to RFDS. Similarly, RFDS_CLEAR indicates that CPU is

RE: [PATCH v1 01/11] Introduce a common abstract struct HostIOMMUDevice

2024-03-18 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 01/11] Introduce a common abstract struct >HostIOMMUDevice > >Hi Zhenzhong, >On 2/28/24 04:58, Zhenzhong Duan wrote: >> HostIOMMUDevice will be inherited by two sub classes, >> legacy and iommufd currently. >As this patch intr

RE: [PATCH v1 08/11] vfio/pci: Allocate and initialize HostIOMMUDevice after attachment

2024-03-18 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 08/11] vfio/pci: Allocate and initialize >HostIOMMUDevice after attachment > > > >On 2/28/24 04:58, Zhenzhong Duan wrote: >> Signed-off-by: Zhenzhong Duan >> --- >> hw/vfio/pci.c | 4 >> 1 file changed, 4 insertions(+)

RE: [PATCH v1 05/11] vfio: Introduce host_iommu_device_create callback

2024-03-18 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 05/11] vfio: Introduce host_iommu_device_create >callback > > > >On 3/18/24 14:52, Eric Auger wrote: >> Hi ZHenzhong, >> >> On 2/28/24 04:58, Zhenzhong Duan wrote: >>> Introduce host_iommu_device_create callback and a wrapper

RE: [PATCH v1 05/11] vfio: Introduce host_iommu_device_create callback

2024-03-18 Thread Duan, Zhenzhong
Hi Eric, >-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 05/11] vfio: Introduce host_iommu_device_create >callback > >Hi ZHenzhong, > >On 2/28/24 04:58, Zhenzhong Duan wrote: >> Introduce host_iommu_device_create callback and a wrapper for it. >> >> This callback is used to

[PATCH v2 2/4] ui/vnc: Do not use console_select()

2024-03-18 Thread Akihiko Odaki
console_select() is shared by other displays and a console_select() call from one of them triggers console switching also in ui/curses, circumventing key state reinitialization that needs to be performed in preparation and resulting in stuck keys. Use its internal state to track the current active

[PATCH v2 4/4] ui/curses: Do not use console_select()

2024-03-18 Thread Akihiko Odaki
ui/curses is the only user of console_select(). Move the implementation to ui/curses. Signed-off-by: Akihiko Odaki --- include/ui/console.h | 1 - ui/console-priv.h | 2 +- ui/console-vc-stubs.c | 2 +- ui/console-vc.c | 3 +- ui/console.c | 121 +-

[PATCH v2 3/4] ui/cocoa: Do not use console_select()

2024-03-18 Thread Akihiko Odaki
ui/cocoa needs to update the UI info and reset the keyboard state tracker when switching the console, or the new console will see the stale UI info or keyboard state. Previously, updating the UI info was done with cocoa_switch(), but it is meant to be called when the surface is being replaced, and

[PATCH v2 0/4] ui/console: Remove console_select()

2024-03-18 Thread Akihiko Odaki
so eliminates the need to replace NULL with the active console and save code. Signed-off-by: Akihiko Odaki --- Changes in v2: - Changed to fall back to a text console if there is no graphical console as previously done. - Link to v1: https://lore.kernel.org/r/20240318-console-v1-0-f4efbfa71..

[PATCH v2 1/4] ui/vc: Do not inherit the size of active console

2024-03-18 Thread Akihiko Odaki
A chardev-vc used to inherit the size of a graphic console when its size not explicitly specified, but it often did not make sense. If a chardev-vc is instantiated during the startup, the active graphic console has no content at the time, so it will have the size of graphic console placeholder, whi

RE: [PATCH v1 04/11] vfio: Add HostIOMMUDevice handle into VFIODevice

2024-03-18 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v1 04/11] vfio: Add HostIOMMUDevice handle into >VFIODevice > > > >On 2/28/24 04:58, Zhenzhong Duan wrote: >> This handle points to either IOMMULegacyDevice or IOMMUFDDevice >variant, >> neither both. >I would reword into: >store

Re: [PATCH-for-9.1 v2 2/3] hw/display/pxa2xx_lcd: Set rotation angle using qemu_console_set_rotate

2024-03-18 Thread Akihiko Odaki
On 2024/03/18 20:31, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki --- hw/display/pxa2xx_lcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c index a9d0d981a0..7d03fa57d0 100644 --- a/

Re: [PATCH-for-9.1 v2 3/3] ui/console: Add 'rotate_arcdegree' field to allow per-console rotation

2024-03-18 Thread Akihiko Odaki
On 2024/03/18 20:31, Philippe Mathieu-Daudé wrote: Add the 'rotate_arcdegree' field to QemuGraphicConsole and remove the use of the 'graphic_rotate' global. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki --- ui/console.c | 15 +++ 1 file changed, 11 inserti

Re: [PATCH-for-9.1 v2 1/3] ui/console: Introduce API to change console orientation

2024-03-18 Thread Akihiko Odaki
On 2024/03/18 20:31, Philippe Mathieu-Daudé wrote: Extract the following methods: - qemu_console_set_rotate() - qemu_console_is_rotated() - qemu_console_get_rotate_arcdegree() Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki --- include/ui/console.h | 3 +++ u

Re: [PATCH v5 15/65] i386/tdx: Get tdx_capabilities via KVM_TDX_CAPABILITIES

2024-03-18 Thread Wang, Lei
On 2/29/2024 14:36, Xiaoyao Li wrote:> KVM provides TDX capabilities via sub command KVM_TDX_CAPABILITIES of > IOCTL(KVM_MEMORY_ENCRYPT_OP). Get the capabilities when initializing > TDX context. It will be used to validate user's setting later. > > Since there is no interface reporting how many cp

[PATCH] hw/loongarch: Refine default numa id calculation

2024-03-18 Thread Bibo Mao
With numa_test test case, there is subcase named test_def_cpu_split(), there are 8 sockets and 2 numa nodes. Here is command line: "-machine smp.cpus=8,smp.sockets=8 -numa node,memdev=ram -numa node" The required result is: node 0 cpus: 0 2 4 6 node 1 cpus: 1 3 5 7 Test case numa_test fails on

[PATCH] monitor/hmp-cmds-target.c: append a space in error message in gpa2hva()

2024-03-18 Thread Shiyang Ruan via
From: Yao Xingtao In qemu monitor mode, when we use gpa2hva command to print the host virtual address corresponding to a guest physical address, if the gpa is not in RAM, the error message is below: (qemu) gpa2hva 0x75000 Memory at address 0x75000is not RAM a space is missed between '0x

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

2024-03-18 Thread Wang, Lei
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 KVM_MEMORY_EXIT_FLAG_PRIVATE in fl

Re: [PATCH 2/4] i386/sev: Switch to use confidential_guest_kvm_init()

2024-03-18 Thread Xiaoyao Li
On 3/19/2024 5:51 AM, Paolo Bonzini wrote: On Thu, Feb 29, 2024 at 7:01 AM Xiaoyao Li wrote: Use confidential_guest_kvm_init() instead of calling SEV specific sev_kvm_init(). As a bouns, it fits to future TDX when TDX implements its own confidential_guest_support and .kvm_init(). Move the "Ty

Re: [PATCH v5 06/65] kvm: Introduce support for memory_attributes

2024-03-18 Thread Wang, Lei
On 2/29/2024 14:36, Xiaoyao Li wrote:> Introduce the helper functions to set the attributes of a range of > memory to private or shared. > > This is necessary to notify KVM the private/shared attribute of each gpa > range. KVM needs the information to decide the GPA needs to be mapped at > hva-ba

Re: [PATCH for 9.0 v15 02/10] trans_rvv.c.inc: set vstart = 0 in int scalar move insns

2024-03-18 Thread LIU Zhiwei
On 2024/3/15 1:56, Daniel Henrique Barboza wrote: trans_vmv_x_s, trans_vmv_s_x, trans_vfmv_f_s and trans_vfmv_s_f aren't setting vstart = 0 after execution. This is usually done by a helper in vector_helper.c but these functions don't use helpers. We'll set vstart after any potential 'over' br

Re: [PATCH for 9.0 v15 01/10] target/riscv/vector_helper.c: set vstart = 0 in GEN_VEXT_VSLIDEUP_VX()

2024-03-18 Thread LIU Zhiwei
On 2024/3/15 1:56, Daniel Henrique Barboza wrote: The helper isn't setting env->vstart = 0 after its execution, as it is expected from every vector instruction that completes successfully. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis

Re: [PATCH v2 1/1] cxl/mem: Fix for the index of Clear Event Record Handle

2024-03-18 Thread Dan Williams
Jonathan Cameron wrote: > On Mon, 18 Mar 2024 10:29:28 +0800 > Yuquan Wang wrote: > > > The dev_dbg info for Clear Event Records mailbox command would report > > the handle of the next record to clear not the current one. > > > > This was because the index 'i' had incremented before printing the

Re: [PULL 0/4] machine development tool

2024-03-18 Thread Peter Xu
On Mon, Mar 18, 2024 at 08:08:29PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 08.03.24 06:47, Peter Xu wrote: > > On Thu, Mar 07, 2024 at 12:06:59PM +0300, Maksim Davydov wrote: > > > > > > On 3/6/24 04:57, Peter Xu wrote: > > > > On Tue, Mar 05, 2024 at 03:43:41PM +0100, Markus Armbruster wr

Re: [PATCH v4 2/2] vhost: Perform memory section dirty scans once per iteration

2024-03-18 Thread Si-Wei Liu
On 3/17/2024 8:22 PM, Jason Wang wrote: On Sat, Mar 16, 2024 at 2:45 AM Si-Wei Liu wrote: On 3/14/2024 9:03 PM, Jason Wang wrote: On Fri, Mar 15, 2024 at 5:39 AM Si-Wei Liu wrote: On setups with one or more virtio-net devices with vhost on, dirty tracking iteration increases cost the bi

Re: [PATCH v4 1/2] vhost: dirty log should be per backend type

2024-03-18 Thread Si-Wei Liu
On 3/17/2024 8:20 PM, Jason Wang wrote: On Sat, Mar 16, 2024 at 2:33 AM Si-Wei Liu wrote: On 3/14/2024 8:50 PM, Jason Wang wrote: On Fri, Mar 15, 2024 at 5:39 AM Si-Wei Liu wrote: There could be a mix of both vhost-user and vhost-kernel clients in the same QEMU process, where separate v

Re: [PATCH v2 1/2] target/s390x: Use mutable temporary value for op_ts

2024-03-18 Thread David Hildenbrand
On 18.03.24 21:27, Ilya Leoshkevich wrote: From: Ido Plat Otherwise TCG would assume the register that holds t1 would be constant and reuse whenever it needs the value within it. Cc: qemu-sta...@nongnu.org Fixes: f1ea739bd598 ("target/s390x: Use tcg_constant_* in local contexts") Reviewed-by:

[PATCH 2/2] vl: do not assert if sev-guest is used together with TCG

2024-03-18 Thread Paolo Bonzini
cgs->ready can be false if the accelerator does not look at current_machine->cgs altogether. Assume that the lack of initialization is due to this, and report a nicer error instead of an assertion failure: $ qemu-system-x86_64 -object sev-guest,id=sev0,policy=0x5,id=sev0,cbitpos=51,reduced-p

[PATCH 0/2] avoid assertion failure when trying confidential guests without KVM

2024-03-18 Thread Paolo Bonzini
When using confidential guests and forgetting the accelerator, the result is not very nice: $ qemu-system-x86_64 -object sev-guest,id=sev0,policy=0x5,id=sev0,cbitpos=51,reduced-phys-bits=1 -M confidential-guest-support=sev0 qemu-system-x86_64: ../softmmu/vl.c:2619: qemu_machine_creation_

[PATCH 1/2] vl: convert qemu_machine_creation_done() to Error **

2024-03-18 Thread Paolo Bonzini
Allow using Error ** to pass an error string up to qmp_x_exit_preconfig() and possibly main(). Signed-off-by: Paolo Bonzini --- system/vl.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/system/vl.c b/system/vl.c index 70f4cece7f9..0c970cf0203 100644 --- a/system/

Re: [PATCH v2 2/2] tests/tcg/s390x: Test TEST AND SET

2024-03-18 Thread Richard Henderson
On 3/18/24 10:27, Ilya Leoshkevich wrote: Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/ts.c| 35 + 2 files changed, 36 insertions(+) create mode 100644 tests/

Re: [PATCH 2/4] i386/sev: Switch to use confidential_guest_kvm_init()

2024-03-18 Thread Paolo Bonzini
On Thu, Feb 29, 2024 at 7:01 AM Xiaoyao Li wrote: > > Use confidential_guest_kvm_init() instead of calling SEV specific > sev_kvm_init(). As a bouns, it fits to future TDX when TDX implements > its own confidential_guest_support and .kvm_init(). > > Move the "TypeInfo sev_guest_info" definition an

Re: [PATCH 7/7] target/hppa: fix do_stdby_e()

2024-03-18 Thread Richard Henderson
On 3/17/24 12:14, Sven Schnelle wrote: stdby,e,m was writing data from the wrong half of the register into memory for cases 0-3. Signed-off-by: Sven Schnelle --- target/hppa/op_helper.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) Fixes: 25460fc5a71 ("target/hppa: Implem

[PULL v2 0/4] machine development tool

2024-03-18 Thread Maksim Davydov
The following changes since commit ba49d760eb04630e7b15f423ebecf6c871b8f77b: Merge tag 'pull-maintainer-final-130324-1' of https://gitlab.com/stsquad/qemu into staging (2024-03-13 15:12:14 +) are available in the Git repository at: https://gitlab.com/davydov-max/qemu.git tags/pull-compa

[PULL v2 3/4] python/qemu/machine: add method to retrieve QEMUMachine::binary field

2024-03-18 Thread Maksim Davydov
Add a supportive property to access the path to the QEMU binary Signed-off-by: Maksim Davydov Reviewed-by: John Snow Reviewed-by: Philippe Mathieu-Daudé --- python/qemu/machine/machine.py | 5 + 1 file changed, 5 insertions(+) diff --git a/python/qemu/machine/machine.py b/python/qemu/mach

[PULL v2 4/4] scripts: add script to compare compatibility properties

2024-03-18 Thread Maksim Davydov
This script runs QEMU to obtain compat_props of machines and default values of different types of drivers to produce comparison table. This table can be used to compare machine types to choose the most suitable machine or compare binaries to be sure that migration to the newer version will save all

[PULL v2 2/4] qmp: add dump machine type compatibility properties

2024-03-18 Thread Maksim Davydov
To control that creating new machine type doesn't affect the previous types (their compat_props) and to check complex compat_props inheritance we need qmp command to print machine type compatibility properties. This patch adds the ability to get list of all the compat_props of the corresponding sup

[PULL v2 1/4] qom: add default value

2024-03-18 Thread Maksim Davydov
qmp_qom_list_properties can print default values if they are available as qmp_device_list_properties does, because both of them use the ObjectPropertyInfo structure with default_value field. This can be useful when working with "not device" types (e.g. memory-backend). Signed-off-by: Maksim Davydo

Re: [PATCH 6/7] target/hppa: mask privilege bits in mfia

2024-03-18 Thread Richard Henderson
On 3/17/24 12:14, Sven Schnelle wrote: mfia should return only the iaoq bits without privilege bits. Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Fixes: 98a9cb792c8 ("target-hppa: Implement system and memory-management insns

Re: [PATCH 5/7] target/hppa: copy new_spc to iasq_f on be,n instruction

2024-03-18 Thread Richard Henderson
On 3/17/24 12:14, Sven Schnelle wrote: Otherwise the first instruction at the new location gets executed from the old space. Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index

Re: [PATCH 4/7] target/hppa: exit tb on flush cache instructions

2024-03-18 Thread Richard Henderson
On 3/17/24 12:14, Sven Schnelle wrote: When the guest modifies the tb it is currently executing from, it executes a fic instruction. Exit the tb on such instruction, otherwise we might execute stale code. Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 2 ++ 1 file changed, 2 inse

Re: [PATCH 3/7] target/hppa: fix access_id check

2024-03-18 Thread Richard Henderson
On 3/17/24 12:14, Sven Schnelle wrote: +static bool match_prot_id(CPUHPPAState *env, uint32_t access_id, uint32_t *_pid) +{ +for (int i = 0; i < 8; i++) { +uint32_t pid = get_pid(env, i); There are only 4 pid's for pa1.x. +static uint32_t get_pid(CPUHPPAState *env, int num) +{ +

Re: [PULL 0/4] machine development tool

2024-03-18 Thread Maksim Davydov
On 3/8/24 06:47, Peter Xu wrote: On Thu, Mar 07, 2024 at 12:06:59PM +0300, Maksim Davydov wrote: On 3/6/24 04:57, Peter Xu wrote: On Tue, Mar 05, 2024 at 03:43:41PM +0100, Markus Armbruster wrote: Peter Maydell writes: On Mon, 4 Mar 2024 at 13:52, Maksim Davydov wrote: The following cha

Re: [PATCH 6/7] target/hppa: mask privilege bits in mfia

2024-03-18 Thread Helge Deller
On 3/17/24 23:14, Sven Schnelle wrote: mfia should return only the iaoq bits without privilege bits. Signed-off-by: Sven Schnelle Reviewed-by: Helge Deller Helge --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/t

Re: [PATCH 4/7] target/hppa: exit tb on flush cache instructions

2024-03-18 Thread Helge Deller
On 3/17/24 23:14, Sven Schnelle wrote: When the guest modifies the tb it is currently executing from, it executes a fic instruction. Exit the tb on such instruction, otherwise we might execute stale code. Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 2 ++ 1 file changed, 2 inse

Re: [PATCH 3/7] target/hppa: fix access_id check

2024-03-18 Thread Helge Deller
On 3/17/24 23:14, Sven Schnelle wrote: PA2.0 provides 8 instead of 4 PID registers. Signed-off-by: Sven Schnelle Reviewed-by: Helge Deller with a few comments below... Helge --- roms/SLOF| 2 +- target/hppa/mem_helper.c | 67 +++- 2

Re: [PATCH 2/7] target/hppa: fix shrp for wide mode

2024-03-18 Thread Richard Henderson
On 3/17/24 12:14, Sven Schnelle wrote: Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Fixes: f7b775a9c075 ("target/hppa: Implement SHRPD") Reviewed-by: Richard Henderson r~

Re: [PATCH 1/7] target/hppa: ldcw,s uses static shift of 3

2024-03-18 Thread Richard Henderson
On 3/17/24 12:14, Sven Schnelle wrote: Signed-off-by: Sven Schnelle --- target/hppa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index eb2046c5ad..6a513d7d5c 100644 --- a/target/hppa/translate.c +++ b/target/

Re: [PATCH 2/7] target/hppa: fix shrp for wide mode

2024-03-18 Thread Helge Deller
On 3/17/24 23:14, Sven Schnelle wrote: Signed-off-by: Sven Schnelle Reviewed-by: Helge Deller Helge --- target/hppa/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 6a513d7d5c..8ba31567e8 100644 -

[PATCH v2 1/2] target/s390x: Use mutable temporary value for op_ts

2024-03-18 Thread Ilya Leoshkevich
From: Ido Plat Otherwise TCG would assume the register that holds t1 would be constant and reuse whenever it needs the value within it. Cc: qemu-sta...@nongnu.org Fixes: f1ea739bd598 ("target/s390x: Use tcg_constant_* in local contexts") Reviewed-by: Ilya Leoshkevich Reviewed-by: Richard Hender

[PATCH v2 2/2] tests/tcg/s390x: Test TEST AND SET

2024-03-18 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/ts.c| 35 + 2 files changed, 36 insertions(+) create mode 100644 tests/tcg/s390x/ts.c diff --git a/tests/tcg/s390x/Ma

Re: [PATCH 3/3 for 9.0] Revert "chardev: use a child source for qio input source"

2024-03-18 Thread Marc-André Lureau
Hi On Mon, Mar 18, 2024 at 10:25 PM Daniel P. Berrangé wrote: > > This reverts commit a7077b8e354d90fec26c2921aa2dea85b90dff90, > and add comments to explain why child sources cannot be used. > > When a GSource is added as a child of another GSource, if its > 'prepare' function indicates readines

Re: [External] Re: [PATCH v2 1/1] memory tier: acpi/hmat: create CPUless memory tiers after obtaining HMAT info

2024-03-18 Thread Ho-Ren (Jack) Chuang
I'm working on V3. Thanks for Ying's feedback. cc: sthanne...@micron.com On Thu, Mar 14, 2024 at 12:54 AM Huang, Ying wrote: > > "Ho-Ren (Jack) Chuang" writes: > > > On Tue, Mar 12, 2024 at 2:21 AM Huang, Ying wrote: > >> > >> "Ho-Ren (Jack) Chuang" writes: > >> > >> > The current implementa

Re: Intention to work on GSoC project

2024-03-18 Thread Sahil
Hi, I was reading the "Virtqueues and virtio ring: How the data travels" article [1]. There are a few things that I have not understood in the "avail rings" section. Q1. Step 2 in the "Process to make a buffer available" diagram depicts how the virtio driver writes the descriptor index in the ava

Re: [PATCH for-9.0 v3] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-03-18 Thread Eugenio Perez Martin
On Mon, Mar 18, 2024 at 10:02 AM Michael S. Tsirkin wrote: > > On Mon, Mar 18, 2024 at 12:31:26PM +0800, Jason Wang wrote: > > On Fri, Mar 15, 2024 at 11:59 PM Kevin Wolf wrote: > > > > > > VDUSE requires that virtqueues are first enabled before the DRIVER_OK > > > status flag is set; with the cu

Re: [PATCH 1/3 for 9.0] chardev: lower priority of the HUP GSource in socket chardev

2024-03-18 Thread Marc-André Lureau
On Mon, Mar 18, 2024 at 10:25 PM Daniel P. Berrangé wrote: > > The socket chardev often has 2 GSource object registered against the > same FD. One is registered all the time and is just intended to handle > POLLHUP events, while the other gets registered & unregistered on the > fly as the frontend

Re: [PATCH] vhost-vdpa: check vhost_vdpa_set_vring_ready() return value

2024-03-18 Thread Eugenio Perez Martin
On Mon, Mar 18, 2024 at 5:35 AM Jason Wang wrote: > > On Fri, Mar 15, 2024 at 4:23 PM Stefano Garzarella > wrote: > > > > On Thu, Mar 14, 2024 at 11:17:01AM +0800, Jason Wang wrote: > > >On Wed, Feb 7, 2024 at 5:27 PM Stefano Garzarella > > >wrote: > > >> > > >> vhost_vdpa_set_vring_ready() co

Re: [PATCH 21/22] plugins: Inline plugin_gen_empty_callback

2024-03-18 Thread Alex Bennée
Richard Henderson writes: > Each caller can use tcg_gen_plugin_cb directly. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée Virtualisation Tech Lead @ Linaro

Re: [PATCH 2/3 for 9.0] Revert "chardev/char-socket: Fix TLS io channels sending too much data to the backend"

2024-03-18 Thread Marc-André Lureau
Hi On Mon, Mar 18, 2024 at 10:23 PM Daniel P. Berrangé wrote: > > This commit results in unexpected termination of the TLS connection. > When 'fd_can_read' returns 0, the code goes on to pass a zero length > buffer to qio_channel_read. The TLS impl calls into gnutls_recv() > with this zero length

Re: [PATCH] vhost-vdpa: check vhost_vdpa_set_vring_ready() return value

2024-03-18 Thread Eugenio Perez Martin
On Wed, Feb 7, 2024 at 10:27 AM Stefano Garzarella wrote: > > vhost_vdpa_set_vring_ready() could already fail, but if Linux's > patch [1] will be merged, it may fail with more chance if > userspace does not activate virtqueues before DRIVER_OK when > VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK is not n

Re: [PATCH v2] virtio-blk: iothread-vq-mapping coroutine pool sizing

2024-03-18 Thread Stefan Hajnoczi
On Tue, Mar 12, 2024 at 11:12:04AM -0400, Stefan Hajnoczi wrote: > It is possible to hit the sysctl vm.max_map_count limit when the > coroutine pool size becomes large. Each coroutine requires two mappings > (one for the stack and one for the guard page). QEMU can crash with > "failed to set up sta

[PATCH] coroutine: cap per-thread local pool size

2024-03-18 Thread Stefan Hajnoczi
The coroutine pool implementation can hit the Linux vm.max_map_count limit, causing QEMU to abort with "failed to allocate memory for stack" or "failed to set up stack guard page" during coroutine creation. This happens because per-thread pools can grow to tens of thousands of coroutines. Each cor

[PATCH 3/3 for 9.0] Revert "chardev: use a child source for qio input source"

2024-03-18 Thread Daniel P . Berrangé
This reverts commit a7077b8e354d90fec26c2921aa2dea85b90dff90, and add comments to explain why child sources cannot be used. When a GSource is added as a child of another GSource, if its 'prepare' function indicates readiness, then the parent's 'prepare' function will never be run. The io_watch_pol

[PATCH 1/3 for 9.0] chardev: lower priority of the HUP GSource in socket chardev

2024-03-18 Thread Daniel P . Berrangé
The socket chardev often has 2 GSource object registered against the same FD. One is registered all the time and is just intended to handle POLLHUP events, while the other gets registered & unregistered on the fly as the frontend is ready to receive more data or not. It is very common for poll() t

[PATCH 0/3 for 9.0] Fix TLS support for chardevs and incoming data loss on EOF

2024-03-18 Thread Daniel P . Berrangé
This fixes a problem with TLS support on chardevs that Thomas has previously attempted to deal with: https://lists.nongnu.org/archive/html/qemu-devel/2024-02/msg06915.html Unfortunately that fix caused unexpected side effects that resulted in premature termination of the TLS connection. See pat

[PATCH 2/3 for 9.0] Revert "chardev/char-socket: Fix TLS io channels sending too much data to the backend"

2024-03-18 Thread Daniel P . Berrangé
This commit results in unexpected termination of the TLS connection. When 'fd_can_read' returns 0, the code goes on to pass a zero length buffer to qio_channel_read. The TLS impl calls into gnutls_recv() with this zero length buffer, at which point GNUTLS returns an error GNUTLS_E_INVALID_REQUEST.

Re: [PATCH v2] ppc/pnv: I2C controller is not user creatable

2024-03-18 Thread Miles Glenn
On Mon, 2024-03-18 at 16:58 +0100, Cédric Le Goater wrote: Thanks for fixing that! -Glenn Reviewed-by: Glenn Miles > The I2C controller is a subunit of the processor. Make it so and > avoid > QEMU crashes. > > $ build/qemu-system-ppc64 -S -machine powernv9 -device pnv-i2c > qemu-system-pp

[PULL 0/4] s390x and misc patches for 9.0-rc0

2024-03-18 Thread Thomas Huth
Hi Peter! The following changes since commit ba49d760eb04630e7b15f423ebecf6c871b8f77b: Merge tag 'pull-maintainer-final-130324-1' of https://gitlab.com/stsquad/qemu into staging (2024-03-13 15:12:14 +) are available in the Git repository at: https://gitlab.com/thuth/qemu.git tags/pull

[PULL 1/4] docs/s390: clarify even more that cpu-topology is KVM-only

2024-03-18 Thread Thomas Huth
From: Claudio Fontana At least for now cpu-topology is implemented only for KVM. We already say this, but this tries to be more explicit, and also show it in the examples. This adds a new reference in the introduction that we can point to, whenever we need to reference accelerators and how to s

[PULL 2/4] target/s390x: improve cpu compatibility check error message

2024-03-18 Thread Thomas Huth
From: Claudio Fontana some users were confused by this message showing under TCG: Selected CPU generation is too new. Maximum supported model in the configuration: 'xyz' Clarify that the maximum can depend on the accel, and add a hint to try a different one. Also add a hint for features mism

[PULL 3/4] target/sparc/cpu: Improve the CPU help text

2024-03-18 Thread Thomas Huth
Remove the unnecessary "Sparc" at the beginning of the line and put the chip information into parentheses so that it is clearer which part of the line have to be passed to "-cpu" to specify a different CPU. Message-ID: <20240307174334.130407-4-th...@redhat.com> Reviewed-by: Richard Henderson Revi

[PULL 4/4] travis-ci: Rename SOFTMMU -> SYSTEM

2024-03-18 Thread Thomas Huth
From: Philippe Mathieu-Daudé Since we *might* have user emulation with softmmu, rename MAIN_SOFTMMU_TARGETS as MAIN_SYSTEM_TARGETS to express 'system emulation targets'. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240313213339.82071-3-phi...@linaro.org> Reviewed-by: Thomas Huth Review

Re: [PATCH 20/22] plugins: Move qemu_plugin_insn_cleanup_fn to tcg.c

2024-03-18 Thread Alex Bennée
Richard Henderson writes: > This is only used in one place, and usage requires an > out-of-line function. > > Signed-off-by: Richard Henderson > --- > include/qemu/plugin.h | 12 > tcg/tcg.c | 12 > 2 files changed, 12 insertions(+), 12 deletions(-) > > dif

RE: [EXTERNAL] [PATCH v3 for 9.1 5/6] vhost/vhost-user: Add VIRTIO_F_NOTIFICATION_DATA to vhost feature bits

2024-03-18 Thread Srujana Challa
> Subject: [EXTERNAL] [PATCH v3 for 9.1 5/6] vhost/vhost-user: Add > VIRTIO_F_NOTIFICATION_DATA to vhost feature bits > > Prioritize security for external emails: Confirm sender and content safety > before clicking links or opening attachments > > -

Re: [PATCH 1/2] target/s390x: Use mutable temporary value for op_ts

2024-03-18 Thread Richard Henderson
On 3/18/24 06:26, Ilya Leoshkevich wrote: From: Ido Plat Otherwise TCG would assume the register that holds t1 would be constant and reuse whenever it needs the value within it. Reviewed-by: Ilya Leoshkevich [iii: Adjust a newline and capitalization] Signed-off-by: Ido Plat --- target/s390

Re: [PATCH 0/3] 64 Bit support for hppa gdbstub

2024-03-18 Thread Sven Schnelle
Richard Henderson writes: > On 3/17/24 20:32, Sven Schnelle wrote: >> Hi Richard, >> Sven Schnelle writes: >> >>> Hi List, >>> >>> this patchset allows to debug the hppa target when running in wide (64 bit) >>> mode. gdb needs a small patch to switch to 64 bit mode. I pushed the >>> patch to >

Re: [PATCH 0/3] 64 Bit support for hppa gdbstub

2024-03-18 Thread Richard Henderson
On 3/17/24 20:32, Sven Schnelle wrote: Hi Richard, Sven Schnelle writes: Hi List, this patchset allows to debug the hppa target when running in wide (64 bit) mode. gdb needs a small patch to switch to 64 bit mode. I pushed the patch to https://github.com/bminor/binutils-gdb/commit/fd8662ec2

  1   2   3   4   >