Re: [PATCH] print memory in MB units in initrd-too-large errmsg

2023-08-05 Thread Markus Armbruster
Jim Cromie writes: > Change 2 error messages to display sizes in MB, not bytes. > > qemu: initrd is too large, cannot support this. (max: 2047 MB, need 5833 MB) > > Also, distinguish 2 sites by adding "it" and "this" respectively. > This tells a careful reader that the error above is from the

Re: [PULL 0/7] ppc queue

2023-08-05 Thread Michael Tokarev
04.08.2023 18:29, Daniel Henrique Barboza wrote: .. Nicholas Piggin (3): target/ppc: Implement ASDR register for ISA v3.0 for HPT target/ppc: Fix pending HDEC when entering PM state target/ppc: Fix VRMA page size for ISA v3.0 Should these 3 be picked up for -stable?

Re: [PATCH] Fixed incorrect LLONG alignment for openrisc and cris

2023-08-05 Thread Michael Tokarev
03.08.2023 07:42, Thomas Huth wrote: On 03/08/2023 02.29, Luca Bonissi wrote: From: Luca Bonissi Date: Thu, 3 Aug 2023 02:15:57 +0200 Subject: [PATCH] Fixed incorrect LLONG alignment for openrisc and cris OpenRISC (or1k) has long long alignment to 4 bytes, but currently not defined in

Re: [PATCH for-8.2] hw/s390x/s390-virtio-ccw: Remove superfluous code to set the NIC model

2023-08-05 Thread Michael Tokarev
04.08.2023 10:35, Thomas Huth пишет: The check for nd->model being NULL was originally required, but in commit e11f463295d95aba ("s390x/virtio: use qemu_check_nic_model()") the corresponding code had been replaced by a call to the function qemu_check_nic_model() - and this in turn calls

[RFC PATCH] record-replay: support SMP target machine

2023-08-05 Thread Nicholas Piggin
Hi, I have a use for RR in SMP machine. It seems conceptually simple to add, RR scheduler is driven in a deterministic way like everything else. In practice, I'm not entirely sure if I have all the locking and corner cases covered. The code is also a bit ugly at the moment in terms of CPU

Re: [PATCH v3 0/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR

2023-08-05 Thread Michael Tokarev
04.07.2023 06:34, Hawkins Jiawei wrote: According to VirtIO standard, "The class, command and command-specific-data are set by the driver, and the device sets the ack byte. There is little it can do except issue a diagnostic if ack is not VIRTIO_NET_OK." Therefore, QEMU should stop sending the

Re: [PATCH v2 2/3] hw/smbios: Fix thread count in type4

2023-08-05 Thread Michael Tokarev
05.08.2023 08:58, Michael Tokarev wrote: 196ea60a73 hw/smbios: Fix core count in type4 7298fd7de5 hw/smbios: Fix thread count in type4 d79a284a44 hw/smbios: Fix smbios_smp_sockets caculation plus this one: a1d027be95 machine: Add helpers to get cores/threads per socket /mjt

Re: [PATCH v9 for-8.1 00/24] linux-user + tcg patch queue

2023-08-05 Thread Richard Henderson
On 8/5/23 06:51, Michael Tokarev wrote: 05.08.2023 16:28, Michael Tokarev wrote: ... qemu-8.1 rc, with or without this patch set, does not work in old aarch64 environment at all. F.e. ubuntu xenial or debian jessie, like this: # chroot /tmp/jessie-arm64/ qemu: uncaught target signal 11

[PATCH] configure: Fix linux-user host detection for riscv64

2023-08-05 Thread Richard Henderson
Mirror the host_arch variable from meson.build, so that we probe for the correct linux-user/include/host/ directory. Fixes: e3e477c3bca0 ("configure: Fix cross-building for RISCV host") Signed-off-by: Richard Henderson --- configure | 9 - 1 file changed, 8 insertions(+), 1 deletion(-)

[PATCH QEMU 3/3] vhost-user-blk-pci: introduce auto-num-queues property

2023-08-05 Thread ~hyman
From: Hyman Huang(黄勇) Commit "a4eef0711b vhost-user-blk-pci: default num_queues to -smp N" implment sizing the number of vhost-user-blk-pci request virtqueues to match the number of vCPUs automatically. Which improves IO preformance remarkably. To enable this feature for the existing VMs, the

[PATCH QEMU 1/3] virtio-scsi-pci: introduce auto-num-queues property

2023-08-05 Thread ~hyman
From: Hyman Huang(黄勇) Commit "6a55882284 virtio-scsi-pci: default num_queues to -smp N" implment sizing the number of virtio-scsi-pci request virtqueues to match the number of vCPUs automatically. Which improves IO preformance remarkably. To enable this feature for the existing VMs, the cloud

[PATCH QEMU 0/3] provide a smooth upgrade solution for multi-queues disk

2023-08-05 Thread ~hyman
A 1:1 virtqueue:vCPU mapping implementation for virtio-*-pci disk introduced since qemu >= 5.2.0, which improves IO performance remarkably. To enjoy this feature for exiting running VMs without service interruption, the common solution is to migrate VMs from the lower version of the hypervisor to

[PATCH QEMU 2/3] virtio-blk-pci: introduce auto-num-queues property

2023-08-05 Thread ~hyman
From: Hyman Huang(黄勇) Commit "9445e1e15 virtio-blk-pci: default num_queues to -smp N" implment sizing the number of virtio-blk-pci request virtqueues to match the number of vCPUs automatically. Which improves IO preformance remarkably. To enable this feature for the existing VMs, the cloud

Re: [PATCH 1/2] target/s390x: Fix VSTL with a large length

2023-08-05 Thread David Hildenbrand
On 05.08.23 01:55, Ilya Leoshkevich wrote: The length is always truncated to 16 bytes. Do not probe more than that. Cc: qemu-sta...@nongnu.org Fixes: 0e0a5b49ad58 ("s390x/tcg: Implement VECTOR STORE WITH LENGTH") Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/vec_helper.c | 2 +- 1

Re: [PATCH] migration: Allow user to specify migration available bandwidth

2023-08-05 Thread Markus Armbruster
Peter Xu writes: > On Fri, Aug 04, 2023 at 02:39:15PM +0100, Daniel P. Berrangé wrote: >> On Wed, Jul 26, 2023 at 11:12:31AM -0400, Peter Xu wrote: >> > On Wed, Jul 26, 2023 at 08:21:35AM +0200, Markus Armbruster wrote: >> > > Peter Xu writes: >> > > >> > > > Hi, Markus, >> > > > >> > > > On

Re: [PATCH for-8.2 v2 1/2] qapi/migration: Deduplicate migration parameter field comments

2023-08-05 Thread Markus Armbruster
Peter Xu writes: > On Fri, Aug 04, 2023 at 05:48:49PM +0100, Daniel P. Berrangé wrote: >> On Fri, Aug 04, 2023 at 12:46:18PM -0400, Peter Xu wrote: >> > On Fri, Aug 04, 2023 at 05:29:19PM +0100, Daniel P. Berrangé wrote: >> > > On Fri, Aug 04, 2023 at 12:01:54PM -0400, Peter Xu wrote: >> > > >

Re: [PATCH] migration: Allow user to specify migration available bandwidth

2023-08-05 Thread Markus Armbruster
Peter Xu writes: > On Fri, Aug 04, 2023 at 02:06:02PM +0200, Markus Armbruster wrote: >> Peter Xu writes: >> >> > On Wed, Jul 26, 2023 at 08:21:35AM +0200, Markus Armbruster wrote: >> >> Peter Xu writes: >> >> >> >> > Hi, Markus, >> >> > >> >> > On Tue, Jul 25, 2023 at 01:10:01PM +0200,

Re: [PATCH v5 4/5] qmp: Added new command to retrieve eBPF blob.

2023-08-05 Thread Markus Armbruster
Andrew Melnychenko writes: > Now, the binary objects may be retrieved by id. > It would require for future qmp commands that may require specific > eBPF blob. > > Added command "request-ebpf". This command returns > eBPF program encoded base64. The program taken from the > skeleton and

Re: [PATCH v3 0/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR

2023-08-05 Thread Hawkins Jiawei
On 2023/8/5 14:15, Michael Tokarev wrote: > 04.07.2023 06:34, Hawkins Jiawei wrote: >> According to VirtIO standard, "The class, command and >> command-specific-data are set by the driver, >> and the device sets the ack byte. >> There is little it can do except issue a diagnostic >> if ack is not

Re: [PATCH v3 0/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR

2023-08-05 Thread Michael Tokarev
05.08.2023 12:28, Hawkins Jiawei wrote: .. I don't remember why, but this patch series is marked as "check later" in my qemu-stable-to-apply email folder. Does it make sense to back-port this series to stable-8.0? 6f34807116 vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_offloads()

[PATCH] Fix scripts/checkpatch.py style failures.

2023-08-05 Thread Nathan Egge
From: "Nathan Egge" Signed-off-by: Nathan Egge --- linux-user/syscall.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 95727a816a..38ab2201e2 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -863,8

Re: [PULL 0/2] Fixes for x86 TCG and CirrusCI

2023-08-05 Thread Richard Henderson
On 8/4/23 13:07, Paolo Bonzini wrote: The following changes since commit c26d005e62f4fd177dae0cd70c24cb96761edebc: Merge tag 'hppa-linux-user-speedup-pull-request' ofhttps://github.com/hdeller/qemu-hppa into staging (2023-08-03 18:49:45 -0700) are available in the Git repository at:

Re: [RFC][PATCH] Reduce generated code by 3% by increasing MMU indices

2023-08-05 Thread Helge Deller
* Richard Henderson : > On 8/5/23 09:47, Helge Deller wrote: > > Do we want to enable such an performance optimization? > > If so, I see two possibilities: > > > > a) Re-define NB_MMU_MODES per target > > No, we've just gotten rid of per target definitions of NB_MMU_MODES, on the > way to being

Re: [PATCH 2/3] target/s390x: Fix the "ignored match" case in VSTRS

2023-08-05 Thread David Hildenbrand
On 05.08.23 01:03, Ilya Leoshkevich wrote: Currently the emulation of VSTRS recognizes partial matches in presence of \0 in the haystack, which, according to PoP, is not correct: If the ZS flag is one and a zero byte was detected in the second operand, then there can not be a

Re: [PATCH v9 for-8.1 00/24] linux-user + tcg patch queue

2023-08-05 Thread Michael Tokarev
Please excuse me for jijacking this thread. I was sure it is something relevant to the issues we were dealing with, - since I remember qemu-aarch64 segfaulting with intermediate patches in this area. For this aarch64-user segfault, my guess is that older software isn't prepared for -cpu max.

[RFC][PATCH] Reduce generated code by 3% by increasing MMU indices

2023-08-05 Thread Helge Deller
This is a RFC, in which I want to bring up an option on how to reduce the generated code size by in average 6 bytes for *every* memory-access inside the guest. This applies to nearly every guest target on a x86 host. Other hosts may benefit too, but I didn't checked. In include/exec/cpu-defs.h

Re: [PATCH] target/s390x: Check reserved bits of VFMIN/VFMAX's M5

2023-08-05 Thread David Hildenbrand
On 05.08.23 01:46, Ilya Leoshkevich wrote: VFMIN and VFMAX should raise a specification exceptions when bits 1-3 of M5 are set. Cc: qemu-sta...@nongnu.org Fixes: da4807527f3b ("s390x/tcg: Implement VECTOR FP (MAXIMUM|MINIMUM)") Signed-off-by: Ilya Leoshkevich ---

Re: [PATCH 1/3] linux-user/elfload: Enable vxe2 on s390x

2023-08-05 Thread David Hildenbrand
On 05.08.23 01:03, Ilya Leoshkevich wrote: The vxe2 hwcap is not set for programs running in linux-user, but is set by a Linux kernel running in softmmu. Add it to the former. Signed-off-by: Ilya Leoshkevich --- linux-user/elfload.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [PATCH] Fix scripts/checkpatch.py style failures.

2023-08-05 Thread Michael Tokarev
Applied to my trivial-patches tree (for 8.2). /mjt

Re: [PATCH v9 for-8.1 00/24] linux-user + tcg patch queue

2023-08-05 Thread Michael Tokarev
05.08.2023 16:28, Michael Tokarev wrote: ... qemu-8.1 rc, with or without this patch set, does not work in old aarch64 environment at all. F.e. ubuntu xenial or debian jessie, like this: # chroot /tmp/jessie-arm64/ qemu: uncaught target signal 11 (Segmentation fault) - core dumped Segmentation

Re: [PATCH] Fix scripts/checkpatch.py style failures.

2023-08-05 Thread Michael Tokarev
05.08.2023 15:51, Nathan Egge пишет: From: "Nathan Egge" Signed-off-by: Nathan Egge This needs at least some meaningful subject prefix. With the subject like it is now, it feels like the patch is about fixing checkpatch.py script itself. Something like: linux-user/syscall.c: fix

Re: Rutabaga backwards compatibility

2023-08-05 Thread Alyssa Ross
Gurchetan Singh writes: > On Tue, Aug 1, 2023 at 8:18 AM Alyssa Ross wrote: > >> Gurchetan Singh writes: >> >> > On Mon, Jul 24, 2023 at 2:56 AM Alyssa Ross wrote: >> >> >> >> Gurchetan Singh writes: >> >> >> >> > In terms of API stability/versioning/packaging, once this series is >> >> >

Re: [PATCH v9 for-8.1 00/24] linux-user + tcg patch queue

2023-08-05 Thread Michael Tokarev
05.08.2023 01:00, Richard Henderson wrpte: Supercedes: 20230804014517.6361-1-richard.hender...@linaro.org ("[PATCH for-8.1 v8 00/17] linux-user: brk fixes") Changes for linux-user brk v9: Recover some changes that should have been in v8, had I generated the patches from the correct tree:

Re: [PATCH v9 for-8.1 00/24] linux-user + tcg patch queue

2023-08-05 Thread Michael Tokarev
05.08.2023 17:01, Richard Henderson wrote: Since it was kinda trivial to bisect, I just did. And here's the result: commit 59b6b42cd3446862567637f3a7ab31d69c9bef51 Author: Richard Henderson Date:   Tue Jun 6 10:19:39 2023 +0100 target/arm: Enable FEAT_LSE2 for -cpu max Reverting this

Re: [RFC][PATCH] Reduce generated code by 3% by increasing MMU indices

2023-08-05 Thread Richard Henderson
On 8/5/23 09:47, Helge Deller wrote: Do we want to enable such an performance optimization? If so, I see two possibilities: a) Re-define NB_MMU_MODES per target No, we've just gotten rid of per target definitions of NB_MMU_MODES, on the way to being able to support multiple targets

Re: [RFC][PATCH] Reduce generated code by 3% by increasing MMU indices

2023-08-05 Thread Richard Henderson
On 8/5/23 10:43, Helge Deller wrote: If there were a way to change no more than two lines of code, that would be fine. But otherwise I don't see this as being worth making the rest of the code base any more complex. Ok. What about that 6-line patch below for x86? It's trivial and all what's

[PULL 07/24] linux-user: Do not call get_errno() in do_brk()

2023-08-05 Thread Richard Henderson
From: Akihiko Odaki Later the returned value is compared with -1, and negated errno is not expected. Fixes: 00faf08c95 ("linux-user: Don't use MAP_FIXED in do_brk()") Reviewed-by: Helge Deller Signed-off-by: Akihiko Odaki Message-Id: <20230802071754.14876-4-akihiko.od...@daynix.com>

[PULL 03/24] accel/tcg: Do not issue misaligned i/o

2023-08-05 Thread Richard Henderson
In the single-page case we were issuing misaligned i/o to the memory subsystem, which does not handle it properly. Split such accesses via do_{ld,st}_mmio_*. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1800 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson ---

[PULL 08/24] linux-user: Use MAP_FIXED_NOREPLACE for do_brk()

2023-08-05 Thread Richard Henderson
From: Akihiko Odaki MAP_FIXED_NOREPLACE can ensure the mapped address is fixed without concerning that the new mapping overwrites something else. Signed-off-by: Akihiko Odaki Message-Id: <20230802071754.14876-5-akihiko.od...@daynix.com> [rth: Pass -1 as fd for MAP_ANON] Reviewed-by: Richard

[PULL 06/24] linux-user: Fix MAP_FIXED_NOREPLACE on old kernels

2023-08-05 Thread Richard Henderson
From: Akihiko Odaki The man page states: > Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE > flag will typically (upon detecting a collision with a preexisting > mapping) fall back to a “non-MAP_FIXED” type of behavior: they will > return an address that is different from

[PULL 18/24] linux-user: Adjust initial brk when interpreter is close to executable

2023-08-05 Thread Richard Henderson
From: Helge Deller While we attempt to load a ET_DYN executable far away from TASK_UNMAPPED_BASE, we are not completely in control of the address space layout. If the interpreter lands close to the executable, leaving insufficient heap space, move brk. Tested-by: Helge Deller Signed-off-by:

[PULL 12/24] bsd-user: Remove last_brk

2023-08-05 Thread Richard Henderson
This variable is unused. Signed-off-by: Richard Henderson --- bsd-user/qemu.h | 1 - bsd-user/mmap.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index edf9602f9b..8f2d6a3c78 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -232,7 +232,6 @@

[PULL 16/24] linux-user: Use MAP_FIXED_NOREPLACE for initial image mmap

2023-08-05 Thread Richard Henderson
Use this as extra protection for the guest mapping over any qemu host mappings. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/elfload.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git

[PULL 00/24] tcg + linux-user queue for 8.1-rc3

2023-08-05 Thread Richard Henderson
The following changes since commit 6db03ccc7f4ca33c99debaac290066f4500a2dfb: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2023-08-04 14:47:00 -0700) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20230805 for you

[PULL 23/24] accel/tcg: Call save_iotlb_data from io_readx as well.

2023-08-05 Thread Richard Henderson
From: Mikhail Tyutin Apply save_iotlb_data() to io_readx() as well as to io_writex(). This fixes SEGFAULT on qemu_plugin_hwaddr_phys_addr() call plugins for addresses inside of MMIO region. Signed-off-by: Dmitriy Solovev Signed-off-by: Mikhail Tyutin Reviewed-by: Richard Henderson

[PULL 17/24] linux-user: Use elf_et_dyn_base for ET_DYN with interpreter

2023-08-05 Thread Richard Henderson
Follow the lead of the linux kernel in fs/binfmt_elf.c, in which an ET_DYN executable which uses an interpreter (usually a PIE executable) is loaded away from where the interpreter itself will be loaded. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki

[PULL 22/24] linux-user: Use zero_bss for PT_LOAD with no file contents too

2023-08-05 Thread Richard Henderson
If p_filesz == 0, then vaddr_ef == vaddr. We can reuse the code in zero_bss rather than incompletely duplicating it in load_elf_image. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/elfload.c | 27

[Stable-8.0.4 66/71] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mac()

2023-08-05 Thread Michael Tokarev
From: Hawkins Jiawei According to VirtIO standard, "The class, command and command-specific-data are set by the driver, and the device sets the ack byte. There is little it can do except issue a diagnostic if ack is not VIRTIO_NET_OK." Therefore, QEMU should stop sending the queued SVQ commands

[Stable-8.0.4 71/71] target/i386: Check CR0.TS before enter_mmx

2023-08-05 Thread Michael Tokarev
From: Matt Borgerson When CR0.TS=1, execution of x87 FPU, MMX, and some SSE instructions will cause a Device Not Available (DNA) exception (#NM). System software uses this exception event to lazily context switch FPU state. Before this patch, enter_mmx helpers may be generated just before #NM

[Stable-8.0.4 69/71] target/ppc: Fix pending HDEC when entering PM state

2023-08-05 Thread Michael Tokarev
From: Nicholas Piggin HDEC is defined to not wake from PM state. There is a check in the HDEC timer to avoid setting the interrupt if we are in a PM state, but no check on PM entry to lower HDEC if it already fired. This can cause a HDECR wake up and QEMU abort with unsupported exception in

Re: [RFC][PATCH] Reduce generated code by 3% by increasing MMU indices

2023-08-05 Thread Helge Deller
On 8/5/23 21:40, Helge Deller wrote: On 8/5/23 19:58, Richard Henderson wrote: On 8/5/23 10:43, Helge Deller wrote: If there were a way to change no more than two lines of code, that would be fine.  But otherwise I don't see this as being worth making the rest of the code base any more

[Stable-7.2.5 39/44] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mac()

2023-08-05 Thread Michael Tokarev
From: Hawkins Jiawei According to VirtIO standard, "The class, command and command-specific-data are set by the driver, and the device sets the ack byte. There is little it can do except issue a diagnostic if ack is not VIRTIO_NET_OK." Therefore, QEMU should stop sending the queued SVQ commands

[Stable-7.2.5 00/44] Patch Round-up for stable 7.2.5, freeze on 2023-08-05

2023-08-05 Thread Michael Tokarev
The following patches are queued for QEMU stable v7.2.5: https://gitlab.com/qemu-project/qemu/-/commits/staging-7.2 Patch freeze is 2023-08-05, and the release is planned for 2023-08-07: https://wiki.qemu.org/Planning/7.2 Please respond here or CC qemu-sta...@nongnu.org on any additional

[Stable-7.2.5 41/44] target/ppc: Implement ASDR register for ISA v3.0 for HPT

2023-08-05 Thread Michael Tokarev
From: Nicholas Piggin The ASDR register was introduced in ISA v3.0. It has not been implemented for HPT. With HPT, ASDR is the format of the slbmte RS operand (containing VSID), which matches the ppc_slb_t field. Fixes: 3367c62f522b ("target/ppc: Support for POWER9 native hash") Signed-off-by:

[Stable-7.2.5 42/44] target/ppc: Fix pending HDEC when entering PM state

2023-08-05 Thread Michael Tokarev
From: Nicholas Piggin HDEC is defined to not wake from PM state. There is a check in the HDEC timer to avoid setting the interrupt if we are in a PM state, but no check on PM entry to lower HDEC if it already fired. This can cause a HDECR wake up and QEMU abort with unsupported exception in

[Stable-7.2.5 37/44] vfio/pci: Disable INTx in vfio_realize error path

2023-08-05 Thread Michael Tokarev
From: Zhenzhong Duan When vfio realize fails, INTx isn't disabled if it has been enabled. This may confuse host side with unhandled interrupt report. Fixes: c5478fea27ac ("vfio/pci: Respond to KVM irqchip change notifier") Signed-off-by: Zhenzhong Duan Reviewed-by: Joao Martins Reviewed-by:

[Stable-7.2.5 43/44] target/ppc: Fix VRMA page size for ISA v3.0

2023-08-05 Thread Michael Tokarev
From: Nicholas Piggin Until v2.07s, the VRMA page size (L||LP) was encoded in LPCR[VRMASD]. In v3.0 that moved to the partition table PS field. The powernv machine can now run KVM HPT guests on POWER9/10 CPUs with this fix and the patch to add ASDR. Fixes: 3367c62f522b ("target/ppc: Support

[Stable-7.2.5 44/44] target/i386: Check CR0.TS before enter_mmx

2023-08-05 Thread Michael Tokarev
From: Matt Borgerson When CR0.TS=1, execution of x87 FPU, MMX, and some SSE instructions will cause a Device Not Available (DNA) exception (#NM). System software uses this exception event to lazily context switch FPU state. Before this patch, enter_mmx helpers may be generated just before #NM

Re: [RFC][PATCH] Reduce generated code by 3% by increasing MMU indices

2023-08-05 Thread Helge Deller
On 8/5/23 19:58, Richard Henderson wrote: On 8/5/23 10:43, Helge Deller wrote: If there were a way to change no more than two lines of code, that would be fine. But otherwise I don't see this as being worth making the rest of the code base any more complex. Ok. What about that 6-line patch

Re: [PATCH] linux-user/i386: Properly align signal frame

2023-08-05 Thread Michael Tokarev
30.06.2023 20:53, Richard Henderson wrote: Ping 2. On 6/20/23 15:26, Richard Henderson wrote: Ping. On 5/24/23 07:46, Richard Henderson wrote: The beginning of the structure, with pretaddr, should be just below 16-byte alignment.  Disconnect fpstate from sigframe, just like the kernel does.

[PULL 15/24] linux-user: Define ELF_ET_DYN_BASE in $guest/target_mman.h

2023-08-05 Thread Richard Henderson
Copy each guest kernel's default value, then bound it against reserved_va or the host address space. Tested-by: Helge Deller Reviewed-by: Helge Deller Signed-off-by: Richard Henderson --- linux-user/aarch64/target_mman.h | 3 +++ linux-user/alpha/target_mman.h | 3 +++

[PULL 11/24] linux-user: Remove last_brk

2023-08-05 Thread Richard Henderson
This variable is unused. Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/user-mmap.h | 1 - linux-user/mmap.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/linux-user/user-mmap.h b/linux-user/user-mmap.h index

[PULL 10/24] linux-user: Do not align brk with host page size

2023-08-05 Thread Richard Henderson
From: Akihiko Odaki do_brk() minimizes calls into target_mmap() by aligning the address with host page size, which is potentially larger than the target page size. However, the current implementation of this optimization has two bugs: - The start of brk is rounded up with the host page size

[PULL 05/24] linux-user: Unset MAP_FIXED_NOREPLACE for host

2023-08-05 Thread Richard Henderson
From: Akihiko Odaki Passing MAP_FIXED_NOREPLACE to host will fail for reserved_va because the address space is reserved with mmap. Replace it with MAP_FIXED in that case. Signed-off-by: Akihiko Odaki Message-Id: <20230802071754.14876-2-akihiko.od...@daynix.com> [rth: Expand inline

[Stable-7.2.5 38/44] vdpa: Fix possible use-after-free for VirtQueueElement

2023-08-05 Thread Michael Tokarev
From: Hawkins Jiawei QEMU uses vhost_handle_guest_kick() to forward guest's available buffers to the vdpa device in SVQ avail ring. In vhost_handle_guest_kick(), a `g_autofree` `elem` is used to iterate through the available VirtQueueElements. This `elem` is then passed to

[Stable-7.2.5 40/44] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mq()

2023-08-05 Thread Michael Tokarev
From: Hawkins Jiawei According to VirtIO standard, "The class, command and command-specific-data are set by the driver, and the device sets the ack byte. There is little it can do except issue a diagnostic if ack is not VIRTIO_NET_OK." Therefore, QEMU should stop sending the queued SVQ commands

Re: [PATCH] linux-user/i386: Properly align signal frame

2023-08-05 Thread Richard Henderson
On 8/5/23 14:56, Michael Tokarev wrote: 30.06.2023 20:53, Richard Henderson wrote: Ping 2. On 6/20/23 15:26, Richard Henderson wrote: Ping. On 5/24/23 07:46, Richard Henderson wrote: The beginning of the structure, with pretaddr, should be just below 16-byte alignment.  Disconnect fpstate

[PULL 04/24] gdbstub: use 0 ("any process") on packets with no PID

2023-08-05 Thread Richard Henderson
From: Matheus Tavares Bernardino Previously, qemu-user would always report PID 1 to GDB. This was changed at dc14a7a6e9 (gdbstub: Report the actual qemu-user pid, 2023-06-30), but read_thread_id() still considers GDB packets with "no PID" as "PID 1", which is not the qemu-user PID. Fix that by

[PULL 13/24] linux-user: Adjust task_unmapped_base for reserved_va

2023-08-05 Thread Richard Henderson
Ensure that the chosen values for mmap_next_start and task_unmapped_base are within the guest address space. Tested-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/user-mmap.h | 18 +- linux-user/main.c | 28

[PULL 24/24] linux-user/elfload: Set V in ELF_HWCAP for RISC-V

2023-08-05 Thread Richard Henderson
From: Nathan Egge Set V bit for hwcap if misa is set. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1793 Signed-off-by: Nathan Egge Reviewed-by: Daniel Henrique Barboza Tested-by: Daniel Henrique Barboza Message-Id: <20230803131424.40744-1-ne...@xiph.org> Signed-off-by: Richard

[PULL 09/24] linux-user: Do nothing if too small brk is specified

2023-08-05 Thread Richard Henderson
From: Akihiko Odaki Linux 6.4.7 does nothing when a value smaller than the initial brk is specified. Fixes: 86f04735ac ("linux-user: Fix brk() to release pages") Reviewed-by: Helge Deller Signed-off-by: Akihiko Odaki Message-Id: <20230802071754.14876-6-akihiko.od...@daynix.com> Signed-off-by:

[Stable-8.0.4 00/71] Patch Round-up for stable 8.0.4, freeze on 2023-08-05

2023-08-05 Thread Michael Tokarev
The following patches are queued for QEMU stable v8.0.4: https://gitlab.com/qemu-project/qemu/-/commits/staging-8.0 Patch freeze is 2023-08-05, and the release is planned for 2023-08-07: https://wiki.qemu.org/Planning/8.0 Please respond here or CC qemu-sta...@nongnu.org on any additional

[Stable-8.0.4 70/71] target/ppc: Fix VRMA page size for ISA v3.0

2023-08-05 Thread Michael Tokarev
From: Nicholas Piggin Until v2.07s, the VRMA page size (L||LP) was encoded in LPCR[VRMASD]. In v3.0 that moved to the partition table PS field. The powernv machine can now run KVM HPT guests on POWER9/10 CPUs with this fix and the patch to add ASDR. Fixes: 3367c62f522b ("target/ppc: Support

[Stable-8.0.4 68/71] target/ppc: Implement ASDR register for ISA v3.0 for HPT

2023-08-05 Thread Michael Tokarev
From: Nicholas Piggin The ASDR register was introduced in ISA v3.0. It has not been implemented for HPT. With HPT, ASDR is the format of the slbmte RS operand (containing VSID), which matches the ppc_slb_t field. Fixes: 3367c62f522b ("target/ppc: Support for POWER9 native hash") Signed-off-by:

[Stable-8.0.4 67/71] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mq()

2023-08-05 Thread Michael Tokarev
From: Hawkins Jiawei According to VirtIO standard, "The class, command and command-specific-data are set by the driver, and the device sets the ack byte. There is little it can do except issue a diagnostic if ack is not VIRTIO_NET_OK." Therefore, QEMU should stop sending the queued SVQ commands

[Stable-8.0.4 65/71] vdpa: Fix possible use-after-free for VirtQueueElement

2023-08-05 Thread Michael Tokarev
From: Hawkins Jiawei QEMU uses vhost_handle_guest_kick() to forward guest's available buffers to the vdpa device in SVQ avail ring. In vhost_handle_guest_kick(), a `g_autofree` `elem` is used to iterate through the available VirtQueueElements. This `elem` is then passed to

[Stable-8.0.4 64/71] vfio/pci: Disable INTx in vfio_realize error path

2023-08-05 Thread Michael Tokarev
From: Zhenzhong Duan When vfio realize fails, INTx isn't disabled if it has been enabled. This may confuse host side with unhandled interrupt report. Fixes: c5478fea27ac ("vfio/pci: Respond to KVM irqchip change notifier") Signed-off-by: Zhenzhong Duan Reviewed-by: Joao Martins Reviewed-by:

Re: [RFC][PATCH] Reduce generated code by 3% by increasing MMU indices

2023-08-05 Thread Richard Henderson
On 8/5/23 13:04, Helge Deller wrote: On 8/5/23 21:40, Helge Deller wrote: On 8/5/23 19:58, Richard Henderson wrote: On 8/5/23 10:43, Helge Deller wrote: If there were a way to change no more than two lines of code, that would be fine.  But otherwise I don't see this as being worth making the

[PULL 14/24] linux-user: Define TASK_UNMAPPED_BASE in $guest/target_mman.h

2023-08-05 Thread Richard Henderson
Provide default values that are as close as possible to the values used by the guest's kernel. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/aarch64/target_mman.h | 10 ++

[PULL 21/24] linux-user: Do not adjust zero_bss for host page size

2023-08-05 Thread Richard Henderson
Rely on target_mmap to handle guest vs host page size mismatch. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/elfload.c | 54 +++- 1 file changed, 23 insertions(+), 31

[PULL 01/24] accel/tcg: Adjust parameters and locking with do_{ld, st}_mmio_*

2023-08-05 Thread Richard Henderson
Replace MMULookupPageData* with CPUTLBEntryFull, addr, size. Move QEMU_IOTHREAD_LOCK_GUARD to the caller. This simplifies the usage from do_ld16_beN and do_st16_leN, where we weren't locking the entire operation, and required hoop jumping for passing addr and size. Reviewed-by: Philippe

[PULL 20/24] linux-user: Do not adjust image mapping for host page size

2023-08-05 Thread Richard Henderson
Remove TARGET_ELF_EXEC_PAGESIZE, and 3 other TARGET_ELF_PAGE* macros based off of that. Rely on target_mmap to handle guest vs host page size mismatch. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/elfload.c | 17

[PULL 02/24] accel/tcg: Issue wider aligned i/o in do_{ld,st}_mmio_*

2023-08-05 Thread Richard Henderson
If the address and size are aligned, send larger chunks to the memory subsystem. This will be required to make more use of these helpers. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 76 +- 1 file

[PULL 19/24] linux-user: Properly set image_info.brk in flatload

2023-08-05 Thread Richard Henderson
The heap starts at "brk" not "start_brk". With this fixed, image_info.start_brk is unused and may be removed. Tested-by: Helge Deller Reviewed-by: Helge Deller Reviewed-by: Akihiko Odaki Signed-off-by: Richard Henderson --- linux-user/qemu.h | 1 - linux-user/flatload.c | 2 +-