Re: [PATCH intel_iommu 5/7] intel_iommu: extract device IOTLB invalidation logic

2024-04-22 Thread CLEMENT MATHIEU--DRIF
On 22/04/2024 18:59, Philippe Mathieu-Daudé wrote: > On 22/4/24 17:52, CLEMENT MATHIEU--DRIF wrote: >> This piece of code can be shared by both IOTLB invalidation and >> PASID-based IOTLB invalidation >> >> Signed-off-by: Clément Mathieu--Drif >> --- >>   hw/i386/intel_iommu.c | 57

Re: [PATCH intel_iommu 3/7] intel_iommu: make types match

2024-04-22 Thread CLEMENT MATHIEU--DRIF
On 22/04/2024 19:03, Philippe Mathieu-Daudé wrote: > On 22/4/24 17:52, CLEMENT MATHIEU--DRIF wrote: >> The 'level' field in vtd_iotlb_key is an uint8_t. >> We don't need to store level as an int in vtd_lookup_iotlb >> >> Signed-off-by: Clément Mathieu--Drif >> --- >>   hw/i386/intel_iommu.c | 2

[PATCH v10 3/6] ui/console: Use qemu_dmabuf_get_..() helpers instead

2024-04-22 Thread dongwon . kim
From: Dongwon Kim This commit updates all instances where fields within the QemuDmaBuf struct are directly accessed, replacing them with calls to these new helper functions. v6: fix typos in helper names in ui/spice-display.c v7: removed prefix, "dpy_gl_" from all helpers v8: Introduction of

[PATCH v10 5/6] ui/console: Use qemu_dmabuf_new() and free() helpers instead

2024-04-22 Thread dongwon . kim
From: Dongwon Kim This commit introduces utility functions for the creation and deallocation of QemuDmaBuf instances. Additionally, it updates all relevant sections of the codebase to utilize these new utility functions. v7: remove prefix, "dpy_gl_" from all helpers qemu_dmabuf_free()

[PATCH v10 2/6] ui/console: new dmabuf.h and dmabuf.c for QemuDmaBuf struct and helpers

2024-04-22 Thread dongwon . kim
From: Dongwon Kim New header and source files are added for containing QemuDmaBuf struct definition and newly introduced helpers for creating/freeing the struct and accessing its data. v10: Change the license type for both dmabuf.h and dmabuf.c from MIT to GPL to be in line with QEMU's

[PATCH v10 4/6] ui/console: Use qemu_dmabuf_set_..() helpers instead

2024-04-22 Thread dongwon . kim
From: Dongwon Kim This commit updates all occurrences where these fields were set directly have been updated to utilize helper functions. v7: removed prefix, "dpy_gl_" from all helpers v8: Introduction of helpers was removed as those were already added by the previous commit Suggested-by:

[PATCH v10 0/6] ui/console: Private QemuDmaBuf struct

2024-04-22 Thread dongwon . kim
From: Dongwon Kim This series introduces privacy enhancements to the QemuDmaBuf struct and its contained data to bolster security. it accomplishes this by introducing of helper functions for allocating, deallocating, and accessing individual fields within the struct and replacing all direct

[PATCH v10 1/6] ui/gtk: Check if fence_fd is equal to or greater than 0

2024-04-22 Thread dongwon . kim
From: Dongwon Kim 'fence_fd' needs to be validated always before being referenced And the passing condition should include '== 0' as 0 is a valid value for the file descriptor. Suggested-by: Marc-André Lureau Cc: Philippe Mathieu-Daudé Cc: Daniel P. Berrangé Cc: Vivek Kasireddy

[PATCH v10 6/6] ui/console: move QemuDmaBuf struct def to dmabuf.c

2024-04-22 Thread dongwon . kim
From: Dongwon Kim To complete privatizing process of QemuDmaBuf, QemuDmaBuf struct def is moved to dmabuf.c Suggested-by: Marc-André Lureau Cc: Philippe Mathieu-Daudé Cc: Daniel P. Berrangé Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim --- include/ui/dmabuf.h | 19 +--

Re: [PATCH 00/27] Add qapi-domain Sphinx extension

2024-04-22 Thread John Snow
On Mon, Apr 22, 2024 at 12:38 PM John Snow wrote: > > On Mon, Apr 22, 2024 at 5:20 AM Markus Armbruster wrote: > > > > John Snow writes: > > > > > On Fri, Apr 19, 2024, 10:45 AM Markus Armbruster > > > wrote: > > > > > >> John Snow writes: > > >> > > >> > This series adds a new qapi-domain

Re: [PATCH RESEND 0/2] Fix crash of VMs configured with the CDROM device

2024-04-22 Thread Yong Huang
Ping. I would appreciate comments on this series. Thanks, Yong On Mon, Apr 8, 2024 at 8:08 PM Hyman Huang wrote: > This patchset fixes the crash of VMs configured with the CDROM device > on the destination during live migration. See the commit message for > details. > > The previous patchset

[PATCH 6.6.y] virtio_net: Do not send RSS key if it is not supported

2024-04-22 Thread Vlad Poenaru
From: Breno Leitao commit 059a49aa2e25c58f90b50151f109dd3c4cdb3a47 upstream. There is a bug when setting the RSS options in virtio_net that can break the whole machine, getting the kernel into an infinite loop. Running the following command in any QEMU virtual machine with virtionet will

[PATCH v4] hw/audio/virtio-snd: Always use little endian audio format

2024-04-22 Thread Philippe Mathieu-Daudé
The VIRTIO Sound Device conforms with the Virtio spec v1.2, thus only use little endianness. Remove the suspicious target_words_bigendian() noticed during code review. Cc: qemu-sta...@nongnu.org Fixes: eb9ad377bb ("virtio-sound: handle control messages and streams") Signed-off-by: Philippe

Re: [PATCH v3] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Michael S. Tsirkin
On Mon, Apr 22, 2024 at 11:07:21PM +0200, Philippe Mathieu-Daudé wrote: > On 22/4/24 23:02, Michael S. Tsirkin wrote: > > On Mon, Apr 22, 2024 at 04:20:56PM +0200, Philippe Mathieu-Daudé wrote: > > > Since VirtIO devices can change endianness at runtime, > > > we need to use the device endianness,

Re: [PATCH v3] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 23:02, Michael S. Tsirkin wrote: On Mon, Apr 22, 2024 at 04:20:56PM +0200, Philippe Mathieu-Daudé wrote: Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Cc: qemu-sta...@nongnu.org Fixes: eb9ad377bb ("virtio-sound:

Re: [PATCH] target/arm: Restrict translation disabled alignment check to VMSA

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 19:09, Richard Henderson wrote: On 4/22/24 10:07, Richard Henderson wrote: For cpus using PMSA, when the MPU is disabled, the default memory type is Normal, Non-cachable. Fixes: 59754f85ed3 ("target/arm: Do memory type alignment check when translation disabled") Reported-by:

Re: [PATCH v3] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Michael S. Tsirkin
On Mon, Apr 22, 2024 at 04:20:56PM +0200, Philippe Mathieu-Daudé wrote: > Since VirtIO devices can change endianness at runtime, > we need to use the device endianness, not the target > one. > > Cc: qemu-sta...@nongnu.org > Fixes: eb9ad377bb ("virtio-sound: handle control messages and streams") >

Re: [PATCH v3] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Manos Pitsidianakis
On Mon, 22 Apr 2024 17:20, Philippe Mathieu-Daudé wrote: Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Cc: qemu-sta...@nongnu.org Fixes: eb9ad377bb ("virtio-sound: handle control messages and streams") Signed-off-by: Philippe

[PATCH 3/4] hw/i386/x86: Eliminate two if statements in x86_bios_rom_init()

2024-04-22 Thread Bernhard Beschow
Given that memory_region_set_readonly() is a no-op when the readonlyness is already as requested it is possible to simplify the pattern if (condition) { foo(true); } to foo(condition); which is shorter and allows to see the invariant of the code more easily. Signed-off-by: Bernhard

[PATCH 0/4] X86: Alias isa-bios area and clean up

2024-04-22 Thread Bernhard Beschow
This series changes the "isa-bios" MemoryRegion to be an alias rather than a copy in the pflash case. This fixes issuing pflash commands in the isa-bios region which matches real hardware and which some real-world legacy bioses I'm running rely on. Furthermore, aliasing in the isa-bios area is

[PATCH 4/4] hw/i386: Consolidate isa-bios creation

2024-04-22 Thread Bernhard Beschow
Now that the -bios and -pflash code paths work the same it is possible to have a common implementation. While at it convert the magic number 0x10 (== 1MiB) to increase readability. Signed-off-by: Bernhard Beschow --- include/hw/i386/x86.h | 2 ++ hw/i386/pc_sysfw.c| 28

[PATCH 2/4] hw/i386/pc_sysfw: Alias rather than copy isa-bios region

2024-04-22 Thread Bernhard Beschow
In the -bios case the "isa-bios" memory region is an alias to the BIOS mapped to the top of the 4G memory boundary. Do the same in the -pflash case to have common behavior. This also makes pflash commands work in the "isa-bios" region which some real-world legacy bioses rely on. Note that in the

[PATCH 1/4] hw/i386/pc_sysfw: Remove unused parameter from pc_isa_bios_init()

2024-04-22 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- hw/i386/pc_sysfw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index 3efabbbab2..87b5bf59d6 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -41,8 +41,7 @@ #define

Re: [PATCH] target/riscv: change RISCV_EXCP_SEMIHOST exception number to 63

2024-04-22 Thread Daniel Henrique Barboza
On 4/22/24 16:44, Richard Henderson wrote: On 4/22/24 10:45, Daniel Henrique Barboza wrote: Palmer, Anup, On 4/22/24 10:58, Clément Léger wrote: The current semihost exception number (16) is a reserved number (range [16-17]). The upcoming double trap specification uses that number for the

Re: [PATCH] target/riscv: change RISCV_EXCP_SEMIHOST exception number to 63

2024-04-22 Thread Richard Henderson
On 4/22/24 10:45, Daniel Henrique Barboza wrote: Palmer, Anup, On 4/22/24 10:58, Clément Léger wrote: The current semihost exception number (16) is a reserved number (range [16-17]). The upcoming double trap specification uses that number for the double trap exception. Since the privileged

Re: [PATCH for-9.1] util/log: add cleanup function

2024-04-22 Thread Stefan Hajnoczi
On Wed, Apr 17, 2024 at 09:33:33PM +0300, Vladimir Sementsov-Ogievskiy wrote: > We leak global_filename, and do not close global_file. Let's fix that. What is the goal? Leaking global_filename does not cause unbounded memory consumption. I guess the goal in freeing global_filename is to keep

Re: [PATCH] target/i386/translate.c: always write 32-bits for SGDT and SIDT

2024-04-22 Thread Volker Rümelin
Am 20.04.24 um 07:40 schrieb Mark Cave-Ayland: > On 20/04/2024 02:21, Richard Henderson wrote: > >> On 4/19/24 12:51, Mark Cave-Ayland wrote: >>> The various Intel CPU manuals claim that SGDT and SIDT can write >>> either 24-bits >>> or 32-bits depending upon the operand size, but this is

[PATCH v7 2/2] Implement SSH commands in QEMU GA for Windows

2024-04-22 Thread aidan_leuck
From: aidaleuc Signed-off-by: aidaleuc --- qga/commands-windows-ssh.c | 712 + qga/commands-windows-ssh.h | 26 ++ qga/meson.build| 7 +- qga/qapi-schema.json | 17 +- 4 files changed, 750 insertions(+), 12 deletions(-) create mode

[PATCH v7 1/2] Refactor common functions between POSIX and Windows implementation

2024-04-22 Thread aidan_leuck
From: aidaleuc Signed-off-by: aidaleuc --- qga/commands-common-ssh.c | 50 +++ qga/commands-common-ssh.h | 10 qga/commands-posix-ssh.c | 47 +--- qga/meson.build | 1 + 4 files changed, 62 insertions(+),

[PATCH v7 0/2] Implement SSH commands in QEMU GA for Windows

2024-04-22 Thread aidan_leuck
From: aidaleuc Changes since v6 * Fixed issue with file permissions causing public keys to be rejected by the SSH server. credit (kkostiuk) Older versions of OpenSSH such as the one shipped with Windows Server 2022 are more stringent on file permissions. * Removed everyone group from

RE: [PATCH v6 0/2] Implement SSH commands in QEMU GA for Windows

2024-04-22 Thread Aidan Leuck
Hi Konstantin, Thank you for taking the time to look over the patch and test it. I do expect this to work when installing OpenSSH by Windows features. I have been testing my implementation on Windows 11 which uses a newer version of OpenSSH server than the one shipped with Windows Server 2022.

Re: [PATCH] target/riscv/kvm: Fix exposure of Zkr

2024-04-22 Thread Daniel Henrique Barboza
On 4/22/24 10:46, Andrew Jones wrote: The Zkr extension may only be exposed to KVM guests if the VMM implements the SEED CSR. Use the same implementation as TCG. Without this patch, running with a KVM which does not forward the SEED CSR access to QEMU will result in an ILL exception being

Re: [PATCH] target/riscv: change RISCV_EXCP_SEMIHOST exception number to 63

2024-04-22 Thread Daniel Henrique Barboza
Palmer, Anup, On 4/22/24 10:58, Clément Léger wrote: The current semihost exception number (16) is a reserved number (range [16-17]). The upcoming double trap specification uses that number for the double trap exception. Since the privileged spec (Table 22) defines ranges for custom uses change

[PATCH v2 1/1] target/riscv/kvm: tolerate KVM disable ext errors

2024-04-22 Thread Daniel Henrique Barboza
Running a KVM guest using a 6.9-rc3 kernel, in a 6.8 host that has zkr enabled, will fail with a kernel oops SIGILL right at the start. The reason is that we can't expose zkr without implementing the SEED CSR. Disabling zkr in the guest would be a workaround, but if the KVM doesn't allow it we'll

[PATCH v2 0/1] target/riscv/kvm: tolerate KVM disable ext errors

2024-04-22 Thread Daniel Henrique Barboza
Hi, In this new version we changed the commit message a bit and we're now only handling the case for EINVAL. Both were suggested by Drew in v1. Changes from v1: - added an extra paragraph explaining why we're throwing an warning - changed the warning string - warning is now being thrown only if

Re: [PATCH] target/arm: Restrict translation disabled alignment check to VMSA

2024-04-22 Thread Richard Henderson
On 4/22/24 10:07, Richard Henderson wrote: For cpus using PMSA, when the MPU is disabled, the default memory type is Normal, Non-cachable. Fixes: 59754f85ed3 ("target/arm: Do memory type alignment check when translation disabled") Reported-by: Clément Chigot Signed-off-by: Richard Henderson

[PATCH] target/arm: Restrict translation disabled alignment check to VMSA

2024-04-22 Thread Richard Henderson
For cpus using PMSA, when the MPU is disabled, the default memory type is Normal, Non-cachable. Fixes: 59754f85ed3 ("target/arm: Do memory type alignment check when translation disabled") Reported-by: Clément Chigot Signed-off-by: Richard Henderson --- Since v9 will likely be tagged tomorrow

Re: [PATCH intel_iommu 3/7] intel_iommu: make types match

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 17:52, CLEMENT MATHIEU--DRIF wrote: The 'level' field in vtd_iotlb_key is an uint8_t. We don't need to store level as an int in vtd_lookup_iotlb Signed-off-by: Clément Mathieu--Drif --- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH intel_iommu 5/7] intel_iommu: extract device IOTLB invalidation logic

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 17:52, CLEMENT MATHIEU--DRIF wrote: This piece of code can be shared by both IOTLB invalidation and PASID-based IOTLB invalidation Signed-off-by: Clément Mathieu--Drif --- hw/i386/intel_iommu.c | 57 +-- 1 file changed, 33 insertions(+), 24

Re: [PATCH 0/7] plugins: Use unwind info for special gdb registers

2024-04-22 Thread Alex Bennée
Richard Henderson writes: > Based-on: 20240404230611.21231-1-richard.hender...@linaro.org > ("[PATCH v2 00/21] Rewrite plugin code generation") I'm getting code conflicts w.r.t to the above (which is already merged?) so it would be helpful to get a re-base. > > This is an attempt to fix >

Re: [PATCH 0/6] Add ivshmem-flat device

2024-04-22 Thread Gustavo Romero
Hi Markus, Thanks for interesting in the ivshmem-flat device. Bill Mills (cc:ed) is the best person to answer your question, so please find his answer below. On 2/28/24 3:29 AM, Markus Armbruster wrote: Gustavo Romero writes: [...] This patchset introduces a new device, ivshmem-flat,

Re: [PATCH 00/27] Add qapi-domain Sphinx extension

2024-04-22 Thread John Snow
On Mon, Apr 22, 2024 at 5:20 AM Markus Armbruster wrote: > > John Snow writes: > > > On Fri, Apr 19, 2024, 10:45 AM Markus Armbruster wrote: > > > >> John Snow writes: > >> > >> > This series adds a new qapi-domain extension for Sphinx, which adds a > >> > series of custom directives for

Re: [PATCH v3 5/6] target/arm: Do memory type alignment check when translation disabled

2024-04-22 Thread Peter Maydell
On Mon, 22 Apr 2024 at 16:48, Richard Henderson wrote: > > On 4/22/24 08:26, Clément Chigot wrote: > > Hi Richard, > > > > While testing the future V9, I've some regressions on a custom board > > using cortex-R5 CPUs. > > Unaligned data accesses are no longer allowed because of that patch. > > >

Re: [PATCH 0/3] target/arm: Make the counter frequency default 1GHz for new CPUs, machines

2024-04-22 Thread Peter Maydell
On Mon, 22 Apr 2024 at 15:18, Peter Maydell wrote: > I imagine that value gets written into CNTFRQ by TF-A somewhere > along the line (and then read by EDK2 later), though I haven't > quite found where. Plus I notice that the TF-A sbsa-watchdog-timer > assumes that the generic-timer frequency and

[PATCH intel_iommu 4/7] intel_iommu: add support for first-stage translation

2024-04-22 Thread CLEMENT MATHIEU--DRIF
This translation mode will only be made available in scalable mode Signed-off-by: Clément Mathieu--Drif --- hw/i386/intel_iommu.c | 364 - hw/i386/intel_iommu_internal.h | 51 - 2 files changed, 362 insertions(+), 53 deletions(-) diff --git

[PATCH intel_iommu 7/7] intel_iommu: add a CLI option to enable FLTS

2024-04-22 Thread CLEMENT MATHIEU--DRIF
Signed-off-by: Clément Mathieu--Drif --- hw/i386/intel_iommu.c | 6 ++ include/hw/i386/intel_iommu.h | 1 + 2 files changed, 7 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 4b54a45107..c35ccc3a98 100644 --- a/hw/i386/intel_iommu.c +++

[PATCH intel_iommu 2/7] intel_iommu: rename slpte to pte before adding FLTS

2024-04-22 Thread CLEMENT MATHIEU--DRIF
Some variables struct fields and functions can be used for both slpte and flpte. We can modify certain identifiers to make them more generic. - slpte in IOMMUTLBEntry becomes pte and will be used for both FL and SL - VTD_SL_PT_LEVEL, VTD_SL_PT_PAGE_SIZE_MASK and VTD_SL_LEVEL_BITS can be renamed

[PATCH intel_iommu 0/7] FLTS for VT-d

2024-04-22 Thread CLEMENT MATHIEU--DRIF
This series is the first of a list that add support for SVM in the Intel IOMMU. Here, we implement support for first-stage translation in VT-d. The PASID-based IOTLB invalidation is also added in this series as it is a requirement of FLTS. The last patch introduces the 'flts' option to enable

[PATCH intel_iommu 6/7] intel_iommu: add PASID-based IOTLB invalidation

2024-04-22 Thread CLEMENT MATHIEU--DRIF
Signed-off-by: Clément Mathieu--Drif --- hw/i386/intel_iommu.c | 130 ++--- hw/i386/intel_iommu_internal.h | 51 +++-- 2 files changed, 150 insertions(+), 31 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index

[PATCH intel_iommu 5/7] intel_iommu: extract device IOTLB invalidation logic

2024-04-22 Thread CLEMENT MATHIEU--DRIF
This piece of code can be shared by both IOTLB invalidation and PASID-based IOTLB invalidation Signed-off-by: Clément Mathieu--Drif --- hw/i386/intel_iommu.c | 57 +-- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/hw/i386/intel_iommu.c

[PATCH intel_iommu 3/7] intel_iommu: make types match

2024-04-22 Thread CLEMENT MATHIEU--DRIF
The 'level' field in vtd_iotlb_key is an uint8_t. We don't need to store level as an int in vtd_lookup_iotlb Signed-off-by: Clément Mathieu--Drif --- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index

[PATCH intel_iommu 1/7] intel_iommu: fix FRCD construction macro.

2024-04-22 Thread CLEMENT MATHIEU--DRIF
The constant must be unsigned, otherwise the two's complement overrides the other fields when a PASID is present Signed-off-by: Clément Mathieu--Drif --- hw/i386/intel_iommu_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu_internal.h

Re: [PATCH v3 5/6] target/arm: Do memory type alignment check when translation disabled

2024-04-22 Thread Richard Henderson
On 4/22/24 08:26, Clément Chigot wrote: Hi Richard, While testing the future V9, I've some regressions on a custom board using cortex-R5 CPUs. Unaligned data accesses are no longer allowed because of that patch. I've dug into the various documentation and it seems that R-profile CPUs don't

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

2024-04-22 Thread Gregory Price
On Mon, Apr 22, 2024 at 01:04:48PM +0100, Jonathan Cameron wrote: > On Sat, 20 Apr 2024 16:35:46 -0400 > Gregory Price wrote: > > > On Fri, Apr 19, 2024 at 11:43:14AM -0700, fan wrote: > > > On Fri, Apr 19, 2024 at 02:24:36PM -0400, Gregory Price wrote: > > > > > > > > added review to all

Re: [PATCH 0/3] target/arm: Make the counter frequency default 1GHz for new CPUs, machines

2024-04-22 Thread Marcin Juszkiewicz
W dniu 22.04.2024 o 16:18, Peter Maydell pisze: On Mon, 22 Apr 2024 at 14:38, Marcin Juszkiewicz From what I see in EDK2 code we read CNTFREQ_EL0: GetPlatformTimerFreq() checks for PcdArmArchTimerFreqInHz variable which sbsa-ref has set to 0. So it calls ArmGenericTimerGetTimerFreq() ->

Re: [PATCH v2] tests/unit: Remove debug statements in test-nested-aio-poll.c

2024-04-22 Thread Stefan Hajnoczi
On Mon, Apr 22, 2024 at 01:22:46PM +0200, Philippe Mathieu-Daudé wrote: > We have been running this test for almost a year; it > is safe to remove its debug statements, which clutter > CI jobs output: > > ▶ 88/100 /nested-aio-poll OK > io_read 0x16bb26158 >

Re: [PATCH v3 5/6] target/arm: Do memory type alignment check when translation disabled

2024-04-22 Thread Clément Chigot
Hi Richard, While testing the future V9, I've some regressions on a custom board using cortex-R5 CPUs. Unaligned data accesses are no longer allowed because of that patch. I've dug into the various documentation and it seems that R-profile CPUs don't have the same default memory type as

Re: [PATCH] target/arm: fix MPIDR value for ARM CPUs with SMT

2024-04-22 Thread Richard Henderson
On 4/22/24 08:21, Richard Henderson wrote: For Arm's CPUs they fall into two categories:   * older ones don't set MT in their MPIDR, and the Aff0     field is effectively the CPU number   * newer ones do set MT in their MPIDR, but don't have     SMT, so their Aff0 is always 0 and their Aff1    

Re: [PATCH] target/arm: fix MPIDR value for ARM CPUs with SMT

2024-04-22 Thread Richard Henderson
On 4/22/24 04:26, Peter Maydell wrote: On Mon, 22 Apr 2024 at 11:46, Peter Maydell wrote: On Sun, 21 Apr 2024 at 06:40, Richard Henderson wrote: --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1314,8 +1314,18 @@ static void arm_cpu_dump_state(CPUState *cs, FILE *f, int flags) }

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

2024-04-22 Thread Jonathan Cameron via
On Mon, 22 Apr 2024 15:23:16 +0100 Jonathan Cameron wrote: > On Mon, 22 Apr 2024 13:04:48 +0100 > Jonathan Cameron wrote: > > > On Sat, 20 Apr 2024 16:35:46 -0400 > > Gregory Price wrote: > > > > > On Fri, Apr 19, 2024 at 11:43:14AM -0700, fan wrote: > > > > On Fri, Apr 19, 2024 at

Re: [PATCH v2 5/6] hw/ppc: SPI controller wiring to P10 chip and create seeprom device

2024-04-22 Thread Cédric Le Goater
On 4/9/24 19:56, Chalapathi V wrote: In this commit Creates SPI controller on p10 chip. Create the keystore seeprom of type "seeprom-25csm04" Connect the cs of seeprom to PIB_SPIC[2] cs irq. The QOM tree of spi controller and seeprom are. /machine (powernv10-machine) /chip[0]

Re: [PATCH v3 43/49] qapi, i386: Move kernel-hashes to SevCommonProperties

2024-04-22 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Wed, Mar 20, 2024 at 03:39:39AM -0500, Michael Roth wrote: >> From: Dov Murik >> >> In order to enable kernel-hashes for SNP, pull it from >> SevGuestProperties to its parent SevCommonProperties so >> it will be available for both SEV and SNP. >> >>

Re: [PATCH v3 36/49] i386/sev: Add KVM_EXIT_VMGEXIT handling for Extended Guest Requests

2024-04-22 Thread Markus Armbruster
Michael Roth writes: > The GHCB specification[1] defines a VMGEXIT-based Guest Request > hypercall to allow an SNP guest to issue encrypted requests directly to > SNP firmware to do things like query the attestation report for the > guest. These are generally handled purely in the kernel. > > In

Re: [PATCH v3 31/49] i386/sev: Update query-sev QAPI format to handle SEV-SNP

2024-04-22 Thread Markus Armbruster
Michael Roth writes: > Most of the current 'query-sev' command is relevant to both legacy > SEV/SEV-ES guests and SEV-SNP guests, with 2 exceptions: > > - 'policy' is a 64-bit field for SEV-SNP, not 32-bit, and > the meaning of the bit positions has changed > - 'handle' is not relevant

[PATCH] hvf: arm: Remove PL1_WRITE_MASK

2024-04-22 Thread Zenghui Yu
As it had never been used since the first commit a1477da3ddeb ("hvf: Add Apple Silicon support"). Signed-off-by: Zenghui Yu --- target/arm/hvf/hvf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 65a5601804..015e96a6d3 100644 ---

Re: [PATCH v2 4/6] hw/misc: Microchip's 25CSM04 SEEPROM model

2024-04-22 Thread Cédric Le Goater
Hello Chalapathi On 4/9/24 19:56, Chalapathi V wrote: This commit implements a Serial EEPROM utilizing the Serial Peripheral Interface (SPI) compatible bus. Currently implemented SEEPROM is Microchip's 25CSM04 which provides 4 Mbits of Serial EEPROM utilizing the Serial Peripheral Interface

Re: [PATCH] target/riscv/kvm: tolerate KVM disable ext errors

2024-04-22 Thread Andrew Jones
On Mon, Apr 22, 2024 at 11:08:31AM -0300, Daniel Henrique Barboza wrote: > > > On 4/22/24 10:43, Andrew Jones wrote: > > On Mon, Apr 22, 2024 at 10:12:53AM -0300, Daniel Henrique Barboza wrote: > > > Running a KVM guest using a 6.9-rc3 kernel, in a 6.8 host that has zkr > > > enabled, will fail

Re: [PATCH v2] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 15:45, Manos Pitsidianakis wrote: On Mon, 22 Apr 2024 16:13, Philippe Mathieu-Daudé wrote: Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Hey Philippe, can you clarify what do you mean by they can change endianness

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

2024-04-22 Thread Jonathan Cameron via
On Mon, 22 Apr 2024 13:04:48 +0100 Jonathan Cameron wrote: > On Sat, 20 Apr 2024 16:35:46 -0400 > Gregory Price wrote: > > > On Fri, Apr 19, 2024 at 11:43:14AM -0700, fan wrote: > > > On Fri, Apr 19, 2024 at 02:24:36PM -0400, Gregory Price wrote: > > > > > > > > added review to all

[PATCH v3] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Philippe Mathieu-Daudé
Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Cc: qemu-sta...@nongnu.org Fixes: eb9ad377bb ("virtio-sound: handle control messages and streams") Signed-off-by: Philippe Mathieu-Daudé --- v2: Use virtio_is_big_endian() v3: Remove

Re: [PATCH v2 1/1] ebpf: Added traces back. Changed source set for eBPF to 'system'.

2024-04-22 Thread Andrew Melnichenko
Hello, everyone. Was added missed "trace.h" Best regards. On Mon, Apr 22, 2024 at 5:17 PM Andrew Melnychenko wrote: > > There was an issue with Qemu build with "--disable-system". > The traces could be generated and the build fails. > The traces were 'cut out' for previous patches, and overall,

Re: [PATCH 0/3] target/arm: Make the counter frequency default 1GHz for new CPUs, machines

2024-04-22 Thread Peter Maydell
On Mon, 22 Apr 2024 at 14:38, Marcin Juszkiewicz wrote: > > W dniu 22.04.2024 o 14:56, Peter Maydell pisze: > > On Fri, 19 Apr 2024 at 19:46, Peter Maydell > > wrote: > > >> The upshot is that the only CPU type that changes is 'max'; but any > >> new type we add in future (whether v8.6 or not)

[PATCH v2 1/1] ebpf: Added traces back. Changed source set for eBPF to 'system'.

2024-04-22 Thread Andrew Melnychenko
There was an issue with Qemu build with "--disable-system". The traces could be generated and the build fails. The traces were 'cut out' for previous patches, and overall, the 'system' source set should be used like in pre-'eBPF blob' patches. Signed-off-by: Andrew Melnychenko ---

Re: [PATCH] target/riscv/kvm: tolerate KVM disable ext errors

2024-04-22 Thread Daniel Henrique Barboza
On 4/22/24 10:43, Andrew Jones wrote: On Mon, Apr 22, 2024 at 10:12:53AM -0300, Daniel Henrique Barboza wrote: Running a KVM guest using a 6.9-rc3 kernel, in a 6.8 host that has zkr enabled, will fail with a kernel oops SIGILL right at the start. The reason is that we can't expose zkr

Re: [PATCH v2 2/6] hw/ppc: SPI controller model - registers implementation

2024-04-22 Thread Cédric Le Goater
On 4/16/24 19:02, Chalapathi V wrote: On 15-04-2024 20:44, Cédric Le Goater wrote: Hello Chalapathi The subject could be rephrased to : "ppc/pnv: Add SPI controller model". On 4/9/24 19:56, Chalapathi V wrote: SPI controller device model supports a connection to a single SPI responder. This

[PATCH] target/riscv: change RISCV_EXCP_SEMIHOST exception number to 63

2024-04-22 Thread Clément Léger
The current semihost exception number (16) is a reserved number (range [16-17]). The upcoming double trap specification uses that number for the double trap exception. Since the privileged spec (Table 22) defines ranges for custom uses change the semihosting exception number to 63 which belongs to

Re: [PATCH v3 22/49] i386/sev: Introduce 'sev-snp-guest' object

2024-04-22 Thread Markus Armbruster
Michael Roth writes: > From: Brijesh Singh > > SEV-SNP support relies on a different set of properties/state than the > existing 'sev-guest' object. This patch introduces the 'sev-snp-guest' > object, which can be used to configure an SEV-SNP guest. For example, > a default-configured SEV-SNP

Re: [PATCH v2] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Manos Pitsidianakis
On Mon, 22 Apr 2024 16:13, Philippe Mathieu-Daudé wrote: Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Hey Philippe, can you clarify what do you mean by they can change endianness at runtime? The target's one is used

[PATCH] target/riscv/kvm: Fix exposure of Zkr

2024-04-22 Thread Andrew Jones
The Zkr extension may only be exposed to KVM guests if the VMM implements the SEED CSR. Use the same implementation as TCG. Without this patch, running with a KVM which does not forward the SEED CSR access to QEMU will result in an ILL exception being injected into the guest (this results in

Re: [PATCH] target/riscv/kvm: tolerate KVM disable ext errors

2024-04-22 Thread Andrew Jones
On Mon, Apr 22, 2024 at 10:12:53AM -0300, Daniel Henrique Barboza wrote: > Running a KVM guest using a 6.9-rc3 kernel, in a 6.8 host that has zkr > enabled, will fail with a kernel oops SIGILL right at the start. The > reason is that we can't expose zkr without implementing the SEED CSR. >

Re: [PATCH 0/3] target/arm: Make the counter frequency default 1GHz for new CPUs, machines

2024-04-22 Thread Marcin Juszkiewicz
W dniu 22.04.2024 o 14:56, Peter Maydell pisze: On Fri, 19 Apr 2024 at 19:46, Peter Maydell wrote: The upshot is that the only CPU type that changes is 'max'; but any new type we add in future (whether v8.6 or not) will also get the new 1GHz default (assuming we spot in code review any

Re: [PATCH v1 3/4] virtio-snd: factor card removal out of unrealize()

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 14:52, Manos Pitsidianakis wrote: Extract audio card removal logic out of the device unrealize callback so that it can be re-used in follow up commits. Signed-off-by: Manos Pitsidianakis --- hw/audio/virtio-snd.c | 20 ++-- 1 file changed, 14 insertions(+), 6

Re: [PATCH v1 2/4] virtio-snd: factor card setup out of realize func

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 14:52, Manos Pitsidianakis wrote: Extract audio card setup logic out of the device realize callback so that it can be re-used in follow up commits. Signed-off-by: Manos Pitsidianakis --- hw/audio/virtio-snd.c | 72 --- 1 file changed, 41

Re: [PATCH v1 1/4] virtio-snd: add virtio_snd_is_config_valid()

2024-04-22 Thread Philippe Mathieu-Daudé
Hi Manos, On 22/4/24 14:52, Manos Pitsidianakis wrote: Factor out virtio_snd_config value validation in a separate function, in order to re-use it in follow up commits. Signed-off-by: Manos Pitsidianakis --- hw/audio/virtio-snd.c | 47 ++- 1 file

[PATCH v2] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Philippe Mathieu-Daudé
Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Cc: qemu-sta...@nongnu.org Fixes: eb9ad377bb ("virtio-sound: handle control messages and streams") Signed-off-by: Philippe Mathieu-Daudé --- hw/audio/virtio-snd.c | 8 +--- 1

[PATCH] target/riscv/kvm: tolerate KVM disable ext errors

2024-04-22 Thread Daniel Henrique Barboza
Running a KVM guest using a 6.9-rc3 kernel, in a 6.8 host that has zkr enabled, will fail with a kernel oops SIGILL right at the start. The reason is that we can't expose zkr without implementing the SEED CSR. Disabling zkr in the guest would be a workaround, but if the KVM doesn't allow it we'll

Re: [PATCH] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Philippe Mathieu-Daudé
On 22/4/24 15:04, Philippe Mathieu-Daudé wrote: Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Cc: qemu-sta...@nongnu.org Fixes: eb9ad377bb ("virtio-sound: handle control messages and streams") Signed-off-by: Philippe

Re: [PATCH v3 21/49] i386/sev: Introduce "sev-common" type to encapsulate common SEV state

2024-04-22 Thread Markus Armbruster
Michael Roth writes: > Currently all SEV/SEV-ES functionality is managed through a single > 'sev-guest' QOM type. With upcoming support for SEV-SNP, taking this > same approach won't work well since some of the properties/state > managed by 'sev-guest' is not applicable to SEV-SNP, which will

[PATCH] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-22 Thread Philippe Mathieu-Daudé
Since VirtIO devices can change endianness at runtime, we need to use the device endianness, not the target one. Cc: qemu-sta...@nongnu.org Fixes: eb9ad377bb ("virtio-sound: handle control messages and streams") Signed-off-by: Philippe Mathieu-Daudé --- hw/audio/virtio-snd.c | 8 +--- 1

Re: [RFC PATCH 1/3] target/riscv: change RISCV_EXCP_SEMIHOST exception number

2024-04-22 Thread Clément Léger
On 22/04/2024 05:25, Alistair Francis wrote: > On Thu, Apr 18, 2024 at 11:40 PM Clément Léger wrote: >> >> The double trap specification defines the double trap exception number >> to be 16 which is actually used by the internal semihosting one. Change >> it to some other value. >> >>

[PATCH] hw/arm/npcm7xx: Store derivative OTP fuse key in little endian

2024-04-22 Thread Philippe Mathieu-Daudé
Use little endian for derivative OTP fuse key. Cc: qemu-sta...@nongnu.org Fixes: c752bb079b ("hw/nvram: NPCM7xx OTP device model") Suggested-by: Avi Fishman Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/npcm7xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

Re: [PATCH 0/3] target/arm: Make the counter frequency default 1GHz for new CPUs, machines

2024-04-22 Thread Peter Maydell
On Fri, 19 Apr 2024 at 19:46, Peter Maydell wrote: > > In previous versions of the Arm architecture, the frequency of the > generic timers as reported in CNTFRQ_EL0 could be any IMPDEF value, > and for QEMU we picked 62.5MHz, giving a timer tick period of 16ns. > In Armv8.6, the architecture

[PATCH v1 3/4] virtio-snd: factor card removal out of unrealize()

2024-04-22 Thread Manos Pitsidianakis
Extract audio card removal logic out of the device unrealize callback so that it can be re-used in follow up commits. Signed-off-by: Manos Pitsidianakis --- hw/audio/virtio-snd.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/hw/audio/virtio-snd.c

[PATCH v1 2/4] virtio-snd: factor card setup out of realize func

2024-04-22 Thread Manos Pitsidianakis
Extract audio card setup logic out of the device realize callback so that it can be re-used in follow up commits. Signed-off-by: Manos Pitsidianakis --- hw/audio/virtio-snd.c | 72 --- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git

[PATCH v1 4/4] virtio_snd_set_config: validate and re-setup card

2024-04-22 Thread Manos Pitsidianakis
Validate new configuration values and re-setup audio card. Changing the number of streams via virtio_snd_set_config() did not re-configure the audio card, leaving it in an invalid state. This can be demonstrated by this heap buffer overflow: ```shell cat << EOF | qemu-system-x86_64 -display none

[PATCH v1 1/4] virtio-snd: add virtio_snd_is_config_valid()

2024-04-22 Thread Manos Pitsidianakis
Factor out virtio_snd_config value validation in a separate function, in order to re-use it in follow up commits. Signed-off-by: Manos Pitsidianakis --- hw/audio/virtio-snd.c | 47 ++- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git

[PATCH v1 0/4] virtio_snd_set_config: Fix #2296

2024-04-22 Thread Manos Pitsidianakis
Changing the number of streams via virtio_snd_set_config() did not re-configure the audio card, leaving it in an invalid state. Reported in https://gitlab.com/qemu-project/qemu/-/issues/2296 Manos Pitsidianakis (4): virtio-snd: add virtio_snd_is_config_valid() virtio-snd: factor card setup

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

2024-04-22 Thread 皮振伟
Hi, Please add the following message: Fixes: 2fda101de07("virtio-crypto: Support asynchronous mode") LGTM. Reviewed-by: zhenwei pi < pizhen...@bytedance.com> > From:"Li Zhijian" > Date:Mon, Apr 22, 2024, 16:50 > Subject:[External] [PATCH] backends/cryptodev-builtin: Fix local_error leaks > To:<

Re: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu()

2024-04-22 Thread Philippe Mathieu-Daudé
On 13/12/22 14:53, Peter Maydell wrote: On Tue, 13 Dec 2022 at 12:52, Philippe Mathieu-Daudé wrote: This partly revert commit d48751ed4f ("xilinx-ethlite: Simplify byteswapping to/from brams") which states the packet data is stored in big-endian. Signed-off-by: Philippe Mathieu-Daudé @@

Re: [PATCH] docs/devel: fix minor typo in submitting-a-patch.rst

2024-04-22 Thread Peter Maydell
On Mon, 22 Apr 2024 at 13:43, Manos Pitsidianakis wrote: > > s/Resolved:/Resolves:/ > > Cc: qemu-triv...@nongnu.org > Signed-off-by: Manos Pitsidianakis > --- > docs/devel/submitting-a-patch.rst | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

  1   2   >