Re: [Qemu PATCH 0/9] Enabling DCD emulation support in Qemu

2023-07-22 Thread Ira Weiny
nifan@ wrote: > From: Fan Ni > > The patch series provides dynamic capacity device (DCD) emulation in Qemu. > More specifically, it provides the following functionalities: > 1. Extended type3 memory device to support DC regions and extents. > 2. Implemented DCD related mailbox command support in

Re: [Qemu PATCH 0/9] Enabling DCD emulation support in Qemu

2023-07-22 Thread Ira Weiny
nifan@ wrote: > From: Fan Ni > > The patch series provides dynamic capacity device (DCD) emulation in Qemu. I don't the patches on the list. https://lore.kernel.org/all/sg2pr06mb33976bb3f9c47cbe08f02d09b2...@sg2pr06mb3397.apcprd06.prod.outlook.com/ Did they get sent? Ira > More

Re: [PATCH] roms/opensbi: Upgrade from v1.3 to v1.3.1

2023-07-22 Thread Alistair Francis
On Thu, Jul 20, 2023 at 3:00 AM Bin Meng wrote: > > Upgrade OpenSBI from v1.3 to v1.3.1 and the pre-built bios images > which fixes the boot failure seen when using QEMU to do a direct > kernel boot with Microchip Icicle Kit board machine. > > The v1.3.1 release includes the following commits: >

Re: [PATCH] accel/tcg: Fix guest instruction address in output assembly log

2023-07-22 Thread Matt Borgerson
On Sat, Jul 22, 2023 at 3:11 AM Richard Henderson wrote: > > On 7/18/23 02:35, Matt Borgerson wrote: > > If CF_PCREL is enabled, generated host assembly logging (command line > > option `-d out_asm`) may incorrectly report guest instruction virtual > > addresses as page offsets instead of

Re: [PATCH v6 0/3] hw/ufs: Add Universal Flash Storage (UFS) support

2023-07-22 Thread Jeuk Kim
On 7/21/2023 8:01 PM, Stefan Hajnoczi wrote: Is there a test case along the lines of tests/qtest/ahci-test.c that exercises this new code? It's important to have at least a basic test that initializes the device and performs a write followed by a read to verify that I/O is working. This will

[PATCH for-8.1 v2 2/4] util/interval-tree: Use qatomic_set_mb in rb_link_node

2023-07-22 Thread Richard Henderson
Ensure that the stores to rb_left and rb_right are complete before inserting the new node into the tree. Otherwise a concurrent reader could see garbage in the new leaf. Cc: qemu-sta...@nongnu.org Signed-off-by: Richard Henderson --- util/interval-tree.c | 6 +- 1 file changed, 5

[PATCH for-8.2? v2 4/4] util/interval-tree: Use qatomic_read/set for rb_parent_color

2023-07-22 Thread Richard Henderson
While less susceptible to optimization problems than left and right, interval_tree_iter_next also reads rb_parent(), so make sure that stores and loads are atomic. This goes further than technically required, changing all loads to be atomic, rather than simply the ones in the iteration side. But

[PATCH for-8.2? v2 3/4] util/interval-tree: Introduce pc_parent

2023-07-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- util/interval-tree.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/util/interval-tree.c b/util/interval-tree.c index 759562db7d..d86c0752db 100644 --- a/util/interval-tree.c +++ b/util/interval-tree.c @@ -68,9 +68,14 @@

[PATCH for-8.1 v2 1/4] util/interval-tree: Use qatomic_read for left/right while searching

2023-07-22 Thread Richard Henderson
Fixes a race condition (generally without optimization) in which the subtree is re-read after the protecting if condition. Cc: qemu-sta...@nongnu.org Signed-off-by: Richard Henderson --- util/interval-tree.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git

[PATCH v2 0/4] util/interval-tree: Avoid race conditions without optimization

2023-07-22 Thread Richard Henderson
Read the left and right trees once, so that the gating tests are meaningful. This was only a problem at -O0, where the compiler didn't CSE the two reads. Changes for v2: * Use qatomic_read for left/right while searching (pmm) * Use qatomic_set_mb when inserting a new node, so that we're

Re: [PATCH 0/3] pegasos2 fixes for 8.1

2023-07-22 Thread Daniel Henrique Barboza
On 7/21/23 19:17, BALATON Zoltan wrote: On Fri, 21 Jul 2023, Daniel Henrique Barboza wrote: On 7/18/23 21:32, BALATON Zoltan wrote: These are some small fixes when using pegasos2 with the QEMU built in VOF instead of the non-free board firmware that fix bugs in the generated device tree and

[PULL for-8.1 0/1] revert "linux-user: Fix qemu-arm to run static armhf binaries"

2023-07-22 Thread Michael Tokarev
The following changes since commit 4ea3fa99bebe8f153e74cf625980183cfd2238f6: Revert "linux-user: Fix qemu-arm to run static armhf binaries" (2023-07-22 19:54:22 +0300) are available in the Git repository at: https://gitlab.com/mjt0k/qemu.git/ tags/pull-revert-armhf-brk-fix for you to

[PULL 1/1] Revert "linux-user: Fix qemu-arm to run static armhf binaries"

2023-07-22 Thread Michael Tokarev
This reverts commit 518f32221af759a29500ac172c4c857bef142067. It is causing similar segfaults at least on aarch64, ppc64el and s390x. Let's revert this one for now and analyze what's going on later. Reopens: https://bugs.debian.org/1040981 Signed-off-by: Michael Tokarev ---

Re: [PATCH for-8.1] target/arm: Special case M-profile in debug_helper.c code

2023-07-22 Thread Richard Henderson
On 7/21/23 15:32, Peter Maydell wrote: A lot of the code called from helper_exception_bkpt_insn() is written assuming A-profile, but we will also call this helper on M-profile CPUs when they execute a BKPT insn. This used to work by accident, but recent changes mean that we will hit an assert

Re: 8.1-rc0 testfloat fails to compile

2023-07-22 Thread Richard Henderson
On 7/21/23 07:54, Thomas Huth wrote: On 20/07/2023 22.47, Olaf Hering wrote: This is going on since a few weeks. I guess there is no check in CI to see if qemu.git#master compiles in Tumbleweed. We only have a check for openSUSE leap ... Which compiler version is causing trouble for you?

Re: [PATCH] tests/decode: Suppress "error: " string for expected-failure tests

2023-07-22 Thread Richard Henderson
On 7/20/23 14:15, Peter Maydell wrote: The "expected failure" tests for decodetree result in the error messages from decodetree ending up in logs and in V=1 output: MALLOC_PERTURB_=226 /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/x86/pyvenv/bin/python3

Re: [PATCH 17/18] host/include/i386: Implement clmul.h

2023-07-22 Thread Richard Henderson
On 7/19/23 12:52, Ilya Leoshkevich wrote: On Thu, 2023-07-13 at 22:14 +0100, Richard Henderson wrote: Detect PCLMUL in cpuinfo; implement the accel hooks. Signed-off-by: Richard Henderson ---  host/include/i386/host/cpuinfo.h    |   1 +  host/include/i386/host/crypto/clmul.h   | 187

[PATCH v2 3/3] accel/tcg: Take mmap_lock in load_atomic*_or_exit

2023-07-22 Thread Richard Henderson
For user-only, the probe for page writability may race with another thread's mprotect. Take the mmap_lock around the operation. This is still faster than the start/end_exclusive fallback. Signed-off-by: Richard Henderson --- accel/tcg/ldst_atomicity.c.inc | 32 ++--

[PATCH v2 1/3] include/exec: Add WITH_MMAP_LOCK_GUARD

2023-07-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 10 ++ bsd-user/mmap.c | 1 + linux-user/mmap.c | 1 + 3 files changed, 12 insertions(+) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 5fa0687cd2..d02517e95f 100644 ---

[PATCH for-8.1 v2 0/3] accel/tcg: Take mmap_lock in load_atomic*_or_exit

2023-07-22 Thread Richard Henderson
For user-only, the probe for page writability may race with another thread's mprotect. Take the mmap_lock around the operation. This is still faster than the start/end_exclusive fallback. Changes for v2: * Introduce WITH_MMAP_LOCK_GUARD, to simplify the changes. * Fix the probes for

[PATCH v2 2/3] accel/tcg: Fix sense of read-only probes in ldst_atomicity

2023-07-22 Thread Richard Henderson
In the initial commit, cdfac37be0d, the sense of the test is incorrect, as the -1/0 return was confusing. In bef6f008b981, we mechanically invert all callers while changing to false/true return, preserving the incorrectness of the test. Now that the return sense is sane, it's easy to see that if

Re: [PATCH] limit brk adjustment wrt interp.brk to arm32 only for now

2023-07-22 Thread Peter Maydell
On Sat, 22 Jul 2023 at 09:26, Michael Tokarev wrote: > > Commit 518f32221af7 "linux-user: Fix qemu-arm to run static armhf binaries" > added brk value adjustment to interpreter brk value after loading the > interpreter. Unfortunately this broke aarch64, ppc64el and s390x emulation, - > the error

Re: [PATCH] accel/tcg: Fix guest instruction address in output assembly log

2023-07-22 Thread Richard Henderson
On 7/18/23 02:35, Matt Borgerson wrote: If CF_PCREL is enabled, generated host assembly logging (command line option `-d out_asm`) may incorrectly report guest instruction virtual addresses as page offsets instead of absolute addresses. This patch corrects the reported guest address.

[PATCH] limit brk adjustment wrt interp.brk to arm32 only for now

2023-07-22 Thread Michael Tokarev
Commit 518f32221af7 "linux-user: Fix qemu-arm to run static armhf binaries" added brk value adjustment to interpreter brk value after loading the interpreter. Unfortunately this broke aarch64, ppc64el and s390x emulation, - the error which we had on armhf now happens on at least these 3

[PATCH v4 2/2] accel/kvm: Specify default IPA size for arm64

2023-07-22 Thread Akihiko Odaki
Before this change, the default KVM type, which is used for non-virt machine models, was 0. The kernel documentation says: > On arm64, the physical address size for a VM (IPA Size limit) is > limited to 40bits by default. The limit can be configured if the host > supports the extension

[PATCH v4 1/2] kvm: Introduce kvm_arch_get_default_type hook

2023-07-22 Thread Akihiko Odaki
kvm_arch_get_default_type() returns the default KVM type. This hook is particularly useful to derive a KVM type that is valid for "none" machine model, which is used by libvirt to probe the availability of KVM. For MIPS, the existing mips_kvm_type() is reused. This function ensures the

[PATCH v4 0/2] accel/kvm: Specify default IPA size for arm64

2023-07-22 Thread Akihiko Odaki
Some Arm systems such as Apple Silicon Macs have IPA size smaller than the default used by KVM. Introduce our own default IPA size that fits on such a system. V3 -> V4: Removed an inclusion of kvm_mips.h that is no longer needed. V2 -> V3: Changed to use the maximum IPA size as the default. V1 ->

Re: [PULL 5/5] linux-user: Fix qemu-arm to run static armhf binaries

2023-07-22 Thread Michael Tokarev
22.07.2023 00:37, Helge Deller wrote: .. So, this is kinda amusing. This broke arm64, ppc64el and s390x: arm64$ ./qemu-aarch64 /bin/sh -c '/bin/ls -dCFl *[t]* >/dev/null' qemu: uncaught target signal 11 (Segmentation fault) - core dumped Segmentation fault Note: I run it on native arm64, so

[PATCH] vl: Free machine list

2023-07-22 Thread Akihiko Odaki
Free machine list and make LeakSanitizer happy. Signed-off-by: Akihiko Odaki --- softmmu/vl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index b0b96f67fa..802f728298 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1484,7 +1484,8 @@ static

[PATCH v3 1/2] kvm: Introduce kvm_arch_get_default_type hook

2023-07-22 Thread Akihiko Odaki
kvm_arch_get_default_type() returns the default KVM type. This hook is particularly useful to derive a KVM type that is valid for "none" machine model, which is used by libvirt to probe the availability of KVM. For MIPS, the existing mips_kvm_type() is reused. This function ensures the

[PATCH v3 2/2] accel/kvm: Specify default IPA size for arm64

2023-07-22 Thread Akihiko Odaki
Before this change, the default KVM type, which is used for non-virt machine models, was 0. The kernel documentation says: > On arm64, the physical address size for a VM (IPA Size limit) is > limited to 40bits by default. The limit can be configured if the host > supports the extension

[PATCH v3 0/2] accel/kvm: Specify default IPA size for arm64

2023-07-22 Thread Akihiko Odaki
Some Arm systems such as Apple Silicon Macs have IPA size smaller than the default used by KVM. Introduce our own default IPA size that fits on such a system. V2 -> V3: Changed to use the maximum IPA size as the default. V1 -> V2: Introduced an arch hook Akihiko Odaki (2): kvm: Introduce

[PATCH] kvm: Remove KVM_CREATE_IRQCHIP support assumption

2023-07-22 Thread Andrew Jones
Since Linux commit 00f918f61c56 ("RISC-V: KVM: Skeletal in-kernel AIA irqchip support") checking KVM_CAP_IRQCHIP returns non-zero when the RISC-V platform has AIA. The cap indicates KVM supports at least one of the following ioctls: KVM_CREATE_IRQCHIP KVM_IRQ_LINE KVM_GET_IRQCHIP