[PATCH v7 37/64] target/nios2: Prevent writes to read-only or reserved control fields

2022-04-21 Thread Richard Henderson
Create an array of masks which detail the writable and readonly bits for each control register. Apply them when writing to control registers, including the write to status during eret. Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 13 + target/nios2/cpu.c | 100

[PATCH v7 41/64] target/nios2: Support division error exception

2022-04-21 Thread Richard Henderson
Division may (optionally) raise a division exception. Since the linux kernel has been prepared for this for some time, enable it by default. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 2 ++ target/nios2/helper.h | 2 ++

[PATCH v7 09/64] target/nios2: Remove user-only nios2_cpu_do_interrupt

2022-04-21 Thread Richard Henderson
Since 78271684719, this function is unused for user-only, when the TCGCPUOps.do_interrupt hook itself became system-only. Signed-off-by: Richard Henderson --- target/nios2/helper.c | 8 1 file changed, 8 deletions(-) diff --git a/target/nios2/helper.c b/target/nios2/helper.c index

[PATCH v7 28/64] target/nios2: Rename CR_TLBMISC_WR to CR_TLBMISC_WE

2022-04-21 Thread Richard Henderson
WE is the architectural name of the field, not WR. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h| 2 +- target/nios2/helper.c | 4 ++-- target/nios2/mmu.c| 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/nios2/cpu.h

[PATCH v7 55/64] target/nios2: Update helper_eret for shadow registers

2022-04-21 Thread Richard Henderson
When CRS = 0, we restore from estatus; otherwise from sstatus. Update for the new CRS. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 1 + target/nios2/op_helper.c | 10 +++--- target/nios2/translate.c | 13 - 3 files changed, 16

Re: introducing vrc :)

2022-04-21 Thread Peter Xu
On Thu, Apr 21, 2022 at 05:04:52PM +0200, Paolo Bonzini wrote: > On 4/20/22 20:12, Peter Xu wrote: > > > a while ago I looked at tools that could be used too build a call graph. > > > The simplest but most effective that I found was a small Perl program > > > (called "egypt", which is rot13 for

[PATCH v2 0/5] 9pfs: macOS host fixes

2022-04-21 Thread Christian Schoenebeck
A bunch of fixes for recently added (QEMU 7.0) 9p support on macOS hosts. Note: there are still issues to address with case-insensitive file systems on macOS hosts. But I'll send a separate RFC on that issue. v1 -> v2: * Close open file descriptor and return 0 on success instead of

[PATCH v7 49/64] target/nios2: Hoist set of is_jmp into gen_goto_tb

2022-04-21 Thread Richard Henderson
Rather than force all callers to set this, do it within the subroutine. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/translate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/nios2/translate.c b/target/nios2/translate.c index

[PATCH v2 1/5] 9pfs: fix qemu_mknodat(S_IFREG) on macOS

2022-04-21 Thread Christian Schoenebeck
mknod() on macOS does not support creating regular files, so divert to openat_file() if S_IFREG is passed with mode argument. Furthermore, 'man 2 mknodat' on Linux says: "Zero file type is equivalent to type S_IFREG". Link: https://lore.kernel.org/qemu-devel/17933734.zYzKuhC07K@silver/

[PATCH v7 62/64] hw/nios2: Machine with a Vectored Interrupt Controller

2022-04-21 Thread Richard Henderson
From: Amir Gonnen Demonstrate how to use nios2 VIC on a machine. Introduce a new machine property to attach a VIC. When VIC is present, let the CPU know that it should use the External Interrupt Interface instead of the Internal Interrupt Interface. The devices on the machine are attached to

Re: [PATCH v1 25/43] target/loongarch: Add LoongArch CSR instruction

2022-04-21 Thread Richard Henderson
On 4/21/22 02:15, yangxiaojuan wrote: On 2022/4/20 上午1:05, Richard Henderson wrote: You'd use a store, just like you were already doing in trans_csrwr. But here's how I'd improve this.  For avoidance of doubt, all of this would go in trans_priviledged.c.inc -- there's no use of csr_offsets[]

[PATCH v7 57/64] target/nios2: Advance pc when raising exceptions

2022-04-21 Thread Richard Henderson
The exception return address for nios2 is the instruction after the one that was executing at the time of the exception. We have so far implemented this by advancing the pc during the process of raising the exception. It is perhaps a little less confusing to do this advance in the translator

[PATCH 1/1] hw/i386/amd_iommu: Fix IOMMU event log encoding errors

2022-04-21 Thread Wei Huang
Coverity issues several UNINIT warnings against AMD IOMMU device [1]. This patch fixes them by initializing the variables. On top of it, this patch changes the event log size to 16 bytes per IOMMU specification. Also the event encoding function incorrectly defines the format of event log entry,

Re: [PATCH v3 07/60] target/arm: Extend store_cpu_offset to take field size

2022-04-21 Thread Peter Maydell
On Sun, 17 Apr 2022 at 18:50, Richard Henderson wrote: > > Currently we assume all fields are 32-bit. > Prepare for fields of a single byte, using sizeof. > > Signed-off-by: Richard Henderson > --- > target/arm/translate-a32.h | 13 + > target/arm/translate.c | 21

Re: [PATCH v8 10/12] target/hexagon: import parser for idef-parser

2022-04-21 Thread Anton Johansson via
-Original Message- From: Anton Johansson Sent: Thursday, April 21, 2022 6:51 AM To: Taylor Simpson ; qemu-devel@nongnu.org Cc: a...@rev.ng; Brian Cain ; Michael Lambert ; bab...@rev.ng; ni...@rev.ng; richard.hender...@linaro.org Subject: Re: [PATCH v8 10/12] target/hexagon: import

Re: [PATCH v2 3/5] 9pfs: fix wrong encoding of rdev field in Rgetattr on macOS

2022-04-21 Thread Greg Kurz
On Thu, 21 Apr 2022 17:07:46 +0200 Christian Schoenebeck wrote: > The 'rdev' field in 9p reponse 'Rgetattr' is of type dev_t, > which is actually a system dependant type and therefore both the > size and encoding of dev_t differ between macOS and Linux. > > So far we have sent 'rdev' to guest

[PULL 00/18] migration queue

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit 401d46789410e88e9e90d76a11f46e8e9f358d55: Merge tag 'pull-target-arm-20220421' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2022-04-21 08:04:43 -0700) are available in the Git repository at

Re: [PATCH for-7.1 00/11] hw/arm: Add NPCM8XX support

2022-04-21 Thread Hao Wu
Thanks for all the comments you gave! I'll go over and address them recently. For this question, The actual CPU should be cortex A35. However, I don't see them supported in QEMU. If I inserted CPU with "cortex-a35" QEMU will complain: qemu-system-aarch64: missing object type 'cortex-a35-arm-cpu'

[PULL 10/18] migration: Postpone releasing MigrationState.hostname

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Peter Xu We used to release it right after migrate_fd_connect(). That's not good enough when there're more than one socket pair required, because it'll be needed to establish TLS connection for the rest channels. One example is multifd, where we copied over the hostname for each channel

Re: [PATCH v2 5/5] 9pfs: fix removing non-existent POSIX ACL xattr on macOS host

2022-04-21 Thread Greg Kurz
On Thu, 21 Apr 2022 17:07:55 +0200 Christian Schoenebeck wrote: > When mapped POSIX ACL is used, we are ignoring errors when trying > to remove a POSIX ACL xattr that does not exist. On Linux hosts we > would get ENODATA in such cases, on macOS hosts however we get > ENOATTR instead. > > As we

Re: [PATCH v3] hw/rx: rx-gdbsim DTB load address aligned of 16byte.

2022-04-21 Thread Richard Henderson
On 2/7/22 05:27, Yoshinori Sato wrote: Linux kernel required alined address of DTB. But missing align in dtb load function. Fixed to load to the correct address. v3 changes. Fix round value. v2 changes. Use ROUND_DOWN macro. Signed-off-by: Yoshinori Sato Reviewed-by: Philippe Mathieu-Daudé

[PULL 02/18] tests: support QTEST_TRACE env variable

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé When debugging failing qtests it is useful to be able to turn on trace output to stderr. The QTEST_TRACE env variable contents get injected as a '-trace ' command line arg Reviewed-by: Peter Xu Reviewed-by: Thomas Huth Reviewed-by: Juan Quintela Signed-off-by: Daniel

Re: Create qemu-project/py-qemu.qmp repo

2022-04-21 Thread Andrea Bolognani
On Thu, Apr 21, 2022 at 12:46:48PM -0400, John Snow wrote: > Hi Alex: do you have the ability to create a blank/empty "py-qemu.qmp" > repo under the qemu-project grouping, and add me and Cleber as > maintainers for it? There weren't any objections when I floated the > idea [1]. > > (Though I

[PULL 7/7] target/rx: update PC correctly in wait instruction

2022-04-21 Thread Richard Henderson
From: Tomoaki Kawada `cpu_pc` at this point does not necessary point to the current instruction (i.e., the wait instruction being translated), so it's incorrect to calculate the new value of `cpu_pc` based on this. It must be updated with `ctx->base.pc_next`, which contains the correct address

Re: [PATCH v8 02/17] qdev: unplug blocker for devices

2022-04-21 Thread Jag Raman
> On Apr 21, 2022, at 10:55 AM, Markus Armbruster wrote: > > Jagannathan Raman writes: > >> Add blocker to prevent hot-unplug of devices > > Why do you need this? I'm not doubting you do, I just want to read your > reasons here :) Hi Markus, :) The x-vfio-user-server depends on an

Re: [PATCH] target/rx: set PSW.I when executing wait instruction

2022-04-21 Thread Richard Henderson
On 4/16/22 21:59, Tomoaki Kawada wrote: This patch fixes the implementation of the wait instruction to implicitly update PSW.I as required by the ISA specification. Signed-off-by: Tomoaki Kawada --- target/rx/op_helper.c | 1 + 1 file changed, 1 insertion(+) Queued to target-rx-next. r~

[PULL 17/18] migration: Fix operator type

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Clang spotted an & that should have been an &&; fix it. Reported by: David Binderman / https://gitlab.com/dcb Fixes: 65dacaa04fa ("migration: introduce save_normal_page()") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/963 Signed-off-by: Dr. David Alan

Re: [PATCH v3 21/60] target/arm: Use tcg_constant in translate-sve.c

2022-04-21 Thread Peter Maydell
On Sun, 17 Apr 2022 at 19:00, Richard Henderson wrote: > > Use tcg_constant_{i32,i64} as appropriate throughout. > > Signed-off-by: Richard Henderson > --- > target/arm/translate-sve.c | 198 + > 1 file changed, 68 insertions(+), 130 deletions(-) > Too big,

Re: [PATCH v3 24/60] target/arm: Split out cpregs.h

2022-04-21 Thread Peter Maydell
On Sun, 17 Apr 2022 at 19:14, Richard Henderson wrote: > > Move ARMCPRegInfo and all related declarations to a new > internal header, out of the public cpu.h. > > Signed-off-by: Richard Henderson > +#ifndef TARGET_ARM_CPREGS_H > +#define TARGET_ARM_CPREGS_H 1 Our usual style doesn't have the

[PULL 03/17] iotests/mirror-top-perms: switch to AQMP

2022-04-21 Thread John Snow
We don't have to maintain compatibility with both QMP libraries anymore, so we can just remove the old exception. While we're here, take advantage of the extra fields present in the VMLaunchFailure exception that machine.py now raises. (Note: I'm leaving the logging suppression here unchanged. I

[PATCH v7 16/64] target/nios2: Split PC out of env->regs[]

2022-04-21 Thread Richard Henderson
It is cleaner to have a separate name for this variable. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 10 +++- linux-user/elfload.c| 2 +- linux-user/nios2/cpu_loop.c | 19 +++--- linux-user/nios2/signal.c | 6 ++---

[PULL 15/17] python: rename qemu.aqmp to qemu.qmp

2022-04-21 Thread John Snow
Now that we are fully switched over to the new QMP library, move it back over the old namespace. This is being done primarily so that we may upload this package simply as "qemu.qmp" without introducing confusion over whether or not "aqmp" is a new protocol or not. The trade-off is increased

[PATCH v7 24/64] target/nios2: Use hw/registerfields.h for CR_STATUS fields

2022-04-21 Thread Richard Henderson
Add all fields; retain the helper macros for single bit fields. So far there are no uses of the multi-bit status fields. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 28 +++- 1 file changed, 19 insertions(+), 9 deletions(-) diff

[PATCH v7 32/64] target/nios2: Clean up nios2_cpu_do_interrupt

2022-04-21 Thread Richard Henderson
Split out do_exception and do_iic_irq to handle bulk of the interrupt and exception processing. Parameterize the changes required to cpu state. The status.EH bit, which protects some data against double-faults, is only present with the MMU. Several exception cases did not check for status.EH

[PATCH v7 15/64] target/nios2: Add NUM_GP_REGS and NUM_CP_REGS

2022-04-21 Thread Richard Henderson
From: Amir Gonnen Split NUM_CORE_REGS into components that can be used elsewhere. Reviewed-by: Peter Maydell Signed-off-by: Amir Gonnen Message-Id: <20220303153906.2024748-3-amir.gon...@neuroblade.ai> [rth: Split out of a larger patch for shadow register sets.] Signed-off-by: Richard

[PATCH v7 40/64] target/nios2: Remove CPU_INTERRUPT_NMI

2022-04-21 Thread Richard Henderson
This interrupt bit is never set, so testing it in nios2_cpu_has_work is pointless. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 2 -- target/nios2/cpu.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target/nios2/cpu.h

Re: [PATCH] iotests/108: Fix when missing user_allow_other

2022-04-21 Thread Markus Armbruster
Hanna Reitz writes: > FUSE exports' allow-other option defaults to "auto", which means that it > will try passing allow_other as a mount option, and fall back to not > using it when an error occurs. We make no effort to hide fusermount's > error message (because it would be difficult, and

[PATCH v7 29/64] target/nios2: Use hw/registerfields.h for CR_TLBMISC fields

2022-04-21 Thread Richard Henderson
Use FIELD_EX32 and FIELD_DP32 instead of managing the masking by hand. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 29 +++-- target/nios2/helper.c| 7 ++- target/nios2/mmu.c | 35

Re: [PATCH v3] Use io_uring_register_ring_fd() to skip fd operations

2022-04-21 Thread olc
Hi Fam, I've missed out freeing error object and error_report would be a better case indeed. Thanks for pointing out the problem. I'll fix that in no time. Best regards, Sam Fam Zheng 于2022年4月21日周四 21:36写道: > On 2022-04-19 07:33, Sam Li wrote: > > Linux recently added a new io_uring(7)

Re: [PATCH v3 10/60] target/arm: Remove fpexc32_access

2022-04-21 Thread Peter Maydell
On Sun, 17 Apr 2022 at 18:54, Richard Henderson wrote: > > This function is incorrect in that it does not properly consider > CPTR_EL2.FPEN. We've already got another mechanism for raising > an FPU access trap: ARM_CP_FPU, so use that instead. > > Remove CP_ACCESS_TRAP_FP_EL{2,3}, which becomes

Re: [PATCH v3 09/60] target/arm: Change CPUArchState.thumb to bool

2022-04-21 Thread Peter Maydell
On Sun, 17 Apr 2022 at 18:53, Richard Henderson wrote: > > Bool is a more appropriate type for this value. > Adjust the assignments to use true/false. > > Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell thanks -- PMM

[PULL 05/18] tests: switch MigrateStart struct to be stack allocated

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé There's no compelling reason why the MigrateStart struct needs to be heap allocated. Using stack allocation and static initializers is simpler. Signed-off-by: Daniel P. Berrangé Message-Id: <20220310171821.3724080-8-berra...@redhat.com> Reviewed-by: Peter Xu

[PULL 07/18] tests: introduce ability to provide hooks for migration precopy test

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé There are alot of different scenarios to test with migration due to the wide number of parameters and capabilities available. To enable sharing of the basic precopy test scenario, we need to be able to set arbitrary parameters and capabilities before the migration is

Re: [PULL 13/13] dump/win_dump: add 32-bit guest Windows support

2022-04-21 Thread Richard Henderson
On 4/21/22 06:59, Marc-André Lureau wrote: -    check_header(h, _err); +    check_header(h, , _err);      if (local_err) {          error_propagate(errp, local_err);          return;      } +    hdr_size = x64 ? sizeof(WinDumpHeader64) : sizeof(WinDumpHeader32);

Re: [PATCH v2 2/5] 9pfs: fix qemu_mknodat(S_IFSOCK) on macOS

2022-04-21 Thread Christian Schoenebeck
On Donnerstag, 21. April 2022 18:36:31 CEST Greg Kurz wrote: > On Thu, 21 Apr 2022 17:07:43 +0200 > > Christian Schoenebeck wrote: > > mknod() on macOS does not support creating sockets, so divert to > > call sequence socket(), bind() and chmod() respectively if S_IFSOCK > > was passed with mode

[PULL 00/18] migration queue

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit 28298069afff3eb696e4995e63b2579b27adf378: Merge tag 'misc-pull-request' of gitlab.com:marcandre.lureau/qemu into staging (2022-04-21 09:27:54 -0700) are available in the Git repository at: https://gitlab.com/dagrh/qemu.git

Re: [PATCH v3 20/60] target/arm: Use smin/smax for do_sat_addsub_32

2022-04-21 Thread Peter Maydell
On Sun, 17 Apr 2022 at 19:05, Richard Henderson wrote: > > The operation we're performing with the movcond > is either min/max depending on cond -- simplify. > Use tcg_constant_i64 while we're at it. > > Signed-off-by: Richard Henderson > --- > target/arm/translate-sve.c | 9 ++--- > 1 file

Re: [PATCH v3 19/60] target/arm: Use tcg_constant in translate-neon.c

2022-04-21 Thread Peter Maydell
On Sun, 17 Apr 2022 at 19:11, Richard Henderson wrote: > > Use tcg_constant_{i32,i64} as appropriate throughout. > > Signed-off-by: Richard Henderson > --- > target/arm/translate-neon.c | 21 +++-- > 1 file changed, 7 insertions(+), 14 deletions(-) Reviewed-by: Peter Maydell

[PULL 11/17] python/aqmp: fully separate from qmp.QEMUMonitorProtocol

2022-04-21 Thread John Snow
After this patch, qemu.aqmp.legacy.QEMUMonitorProtocol no longer inherits from qemu.qmp.QEMUMonitorProtocol. To do this, several inherited methods need to be explicitly re-defined. (Licensing: This is copying and modifying GPLv2-only code into a GPLv2-only file.) Signed-off-by: John Snow

[PATCH v7 20/64] linux-user/nios2: Only initialize SP and PC in target_cpu_copy_regs

2022-04-21 Thread Richard Henderson
Drop the set of estatus in init_thread; it was clearly intended to be setting the value of CR_STATUS for the application, but we never actually performed that copy. However, the proper value is set in nios2_cpu_reset so we don't need to do anything here. We only initialize SP and EA in

[PULL 17/17] python/qmp: remove pylint workaround from legacy.py

2022-04-21 Thread John Snow
Pylint upgraded recently (2.13.z) and having a pylint: disable comment in the middle of an argument field causes it some grief (It appears to stop parsing when it encounters it, causing some syntax problems). Since the duplicate line threshold was bumped up in 22305c2a081b, we don't need this

[PATCH v7 06/64] linux-user/nios2: Remove do_sigreturn

2022-04-21 Thread Richard Henderson
There is no sigreturn syscall, only rt_sigreturn. This function is unused. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/nios2/signal.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/linux-user/nios2/signal.c b/linux-user/nios2/signal.c index

[PATCH v7 17/64] target/nios2: Split out helper for eret instruction

2022-04-21 Thread Richard Henderson
From: Amir Gonnen The implementation of eret will become much more complex with the introduction of shadow registers. Reviewed-by: Peter Maydell Signed-off-by: Amir Gonnen Message-Id: <20220303153906.2024748-3-amir.gon...@neuroblade.ai> [rth: Split out of a larger patch for shadow register

[PATCH v7 33/64] target/nios2: Hoist CPU_LOG_INT logging

2022-04-21 Thread Richard Henderson
Performing this early means that we can merge more cases within the non-logging switch statement. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/helper.c | 58 +++ 1 file changed, 47 insertions(+), 11 deletions(-) diff

[PATCH v7 61/64] hw/nios2: Move memory regions into Nios2Machine

2022-04-21 Thread Richard Henderson
Convert to contiguous allocation, as much as possible so far. The two timer objects are not exposed for subobject allocation. Reviewed-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- hw/nios2/10m50_devboard.c | 30 -- 1 file changed, 16 insertions(+), 14

[PATCH v7 51/64] target/nios2: Use tcg_gen_lookup_and_goto_ptr

2022-04-21 Thread Richard Henderson
Use lookup_and_goto_ptr for indirect chaining between TBs. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/nios2/translate.c b/target/nios2/translate.c index

[PATCH v2 3/5] 9pfs: fix wrong encoding of rdev field in Rgetattr on macOS

2022-04-21 Thread Christian Schoenebeck
The 'rdev' field in 9p reponse 'Rgetattr' is of type dev_t, which is actually a system dependant type and therefore both the size and encoding of dev_t differ between macOS and Linux. So far we have sent 'rdev' to guest in host's dev_t format as-is, which caused devices to appear with wrong

[PATCH v7 46/64] target/nios2: Drop CR_STATUS_EH from tb->flags

2022-04-21 Thread Richard Henderson
There's nothing about EH that affects translation, so there's no need to include it in tb->flags. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index

[PATCH v7 58/64] linux-user/nios2: Handle various SIGILL exceptions

2022-04-21 Thread Richard Henderson
We missed out on a couple of exception types that may legitimately be raised by a userland program. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/nios2/cpu_loop.c | 12 1 file changed, 12 insertions(+) diff --git a/linux-user/nios2/cpu_loop.c

Re: [PATCH v3 08/60] target/arm: Change DisasContext.thumb to bool

2022-04-21 Thread Peter Maydell
On Sun, 17 Apr 2022 at 18:51, Richard Henderson wrote: > > Bool is a more appropriate type for this value. > Move the member down in the struct to keep the > bool type members together and remove a hole. > > Signed-off-by: Richard Henderson > --- Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v2 4/5] 9pfs: fix wrong errno being sent to Linux client on macOS host

2022-04-21 Thread Greg Kurz
On Thu, 21 Apr 2022 17:07:49 +0200 Christian Schoenebeck wrote: > Linux and macOS only share some errno definitions with equal macro > name and value. In fact most mappings for errno are completely > different on the two systems. > > This patch converts some important errno values from macOS

Re: [PATCH 1/1] hw/i386/amd_iommu: Fix IOMMU event log encoding errors

2022-04-21 Thread Peter Maydell
On Thu, 21 Apr 2022 at 17:01, Wei Huang wrote: > > Coverity issues several UNINIT warnings against AMD IOMMU device [1]. This > patch fixes them by initializing the variables. On top of it, this patch > changes the event log size to 16 bytes per IOMMU specification. Also the > event encoding

Re: [PATCH v2 1/5] 9pfs: fix qemu_mknodat(S_IFREG) on macOS

2022-04-21 Thread Greg Kurz
On Thu, 21 Apr 2022 17:07:38 +0200 Christian Schoenebeck wrote: > mknod() on macOS does not support creating regular files, so > divert to openat_file() if S_IFREG is passed with mode argument. > > Furthermore, 'man 2 mknodat' on Linux says: "Zero file type is > equivalent to type S_IFREG". >

Re: [PATCH] Only advertise aio=io_uring if support is actually available

2022-04-21 Thread Dirk Müller
On Mittwoch, 20. April 2022 10:33:38 CEST Daniel P. Berrangé wrote: Hi Daniel, > That all said, the patch itself is OK, because for human targetted > interactive usage, it is desirable for --help to be representative > of what's available. > > IOW, I'm just complaining about the commit message

[PATCH v2] Only advertise aio=io_uring if support is actually available

2022-04-21 Thread Dirk Müller
Change --help output for aio option to only list the aio backend options that are actually available. io_uring is an optional, linux only backend option so hide it for cases where it isn't there. Reviewed-by: Eric Blake Signed-off-by: Dirk Müller --- block/file-posix.c | 4 qemu-nbd.c

[PULL 01/18] tests: improve error message when saving TLS PSK file fails

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé Reviewed-by: Peter Xu Signed-off-by: Daniel P. Berrangé Message-Id: <20220310171821.3724080-3-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- tests/unit/crypto-tls-psk-helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PULL 16/18] migration: Allow migrate-recover to run multiple times

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Peter Xu Previously migration didn't have an easy way to cleanup the listening transport, migrate recovery only allows to execute once. That's done with a trick flag in postcopy_recover_triggered. Now the facility is already there. Drop postcopy_recover_triggered and instead allows a

Re: [PATCH 0/4] target/rx: Track PSW.U in tb->flags

2022-04-21 Thread Richard Henderson
On 4/19/22 00:40, Yoshinori Sato wrote: On Mon, 18 Apr 2022 01:51:26 +0900, Richard Henderson wrote: This is a follow up to Kawada-san's patch for the problem of a missed update to the stack pointer in CLRPSW/SETPSW. This fixes the problem without movcond by tracking the current state of PSW.U

Re: [PATCH] accel/tcg: Assert mmu_idx in range before use in cputlb

2022-04-21 Thread Richard Henderson
Ping. On 4/1/22 10:08, Richard Henderson wrote: Coverity reports out-of-bound accesses within cputlb.c. This should be a false positive due to how the index is decoded from MemOpIdx. To be fair, nothing is checking the correct bounds during encoding either. Assert index in range before use,

[PULL 06/18] tests: merge code for UNIX and TCP migration pre-copy tests

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé The test cases differ only in the URI they provide to the migration commands, and the ability to set the dirty_ring mode. This code is trivially merged into a common helper. Signed-off-by: Daniel P. Berrangé Message-Id: <20220310171821.3724080-9-berra...@redhat.com>

[PULL 01/18] tests: improve error message when saving TLS PSK file fails

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé Reviewed-by: Peter Xu Signed-off-by: Daniel P. Berrangé Message-Id: <20220310171821.3724080-3-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- tests/unit/crypto-tls-psk-helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH v3 17/60] target/arm: Use tcg_constant in translate.c

2022-04-21 Thread Peter Maydell
On Sun, 17 Apr 2022 at 19:07, Richard Henderson wrote: > > Use tcg_constant_{i32,i64,ptr} as appropriate throughout, which > means we get to remove lots of tcg_temp_free_*. Drop variables > in many cases, passing the constant directly to another function. > > Signed-off-by: Richard Henderson >

[PULL 18/18] migration: Read state once

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The 'status' field for the migration is updated normally using an atomic operation from the migration thread. Most readers of it aren't that careful, and in most cases it doesn't matter. In query_migrate->fill_source_migration_info the 'state' is read twice; the

[PULL 00/17] Python patches

2022-04-21 Thread John Snow
The following changes since commit b1efff6bf031a93b5b8bf3912ddc720cc1653a61: Merge tag 'pull-ppc-20220420-2' of https://gitlab.com/danielhb/qemu into staging (2022-04-20 21:54:24 -0700) are available in the Git repository at: https://gitlab.com/jsnow/qemu.git tags/python-pull-request for

[PULL 05/17] python/aqmp: add explicit GPLv2 license to legacy.py

2022-04-21 Thread John Snow
The legacy.py module is heavily based on the QMP module by Luiz Capitulino (et al) which is licensed as explicit GPLv2-only. The async QMP package is currently licensed similarly, but I intend to relicense the async package to the more flexible LGPLv2+. In preparation for that change, make the

[PULL 13/17] python: remove the old QMP package

2022-04-21 Thread John Snow
Thank you for your service! Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Message-id: 20220330172812.3427355-6-js...@redhat.com Signed-off-by: John Snow --- python/PACKAGE.rst | 4 +- python/README.rst | 2 +-

[PATCH v7 04/64] linux-user/nios2: Adjust error return

2022-04-21 Thread Richard Henderson
Follow the kernel assembly, which considers all negative return values to be errors. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/nios2/cpu_loop.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/linux-user/nios2/cpu_loop.c

[PATCH v7 13/64] target/nios2: Check supervisor on eret

2022-04-21 Thread Richard Henderson
From: Amir Gonnen eret instruction is only allowed in supervisor mode. Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Amir Gonnen Message-Id: <20220303153906.2024748-2-amir.gon...@neuroblade.ai> Signed-off-by: Richard Henderson --- target/nios2/translate.c | 2 ++

[PATCH v7 25/64] target/nios2: Use hw/registerfields.h for CR_EXCEPTION fields

2022-04-21 Thread Richard Henderson
Use FIELD_DP32 instead of manual shifting and masking. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/cpu.h| 4 target/nios2/helper.c | 37 ++--- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git

[PATCH v7 11/64] target/nios2: Build helper.c for system only

2022-04-21 Thread Richard Henderson
Remove the #ifdef !defined(CONFIG_USER_ONLY) that surrounds the whole file, and move helper.c to nios2_softmmu_ss. Signed-off-by: Richard Henderson --- target/nios2/helper.c| 3 +-- target/nios2/meson.build | 7 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git

[PATCH v7 02/64] linux-user/nios2: Fix clone child return

2022-04-21 Thread Richard Henderson
The child side of clone needs to set the secondary syscall return value, r7, to indicate syscall success. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/nios2/target_cpu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/nios2/target_cpu.h

[PATCH v7 19/64] target/nios2: Do not create TCGv for control registers

2022-04-21 Thread Richard Henderson
We don't need to reference them often, and when we do it is just as easy to load/store from cpu_env directly. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/nios2/translate.c | 33 ++--- 1 file changed, 26 insertions(+), 7 deletions(-) diff

[PATCH v7 64/64] tests/tcg/nios2: Add test-shadow-1

2022-04-21 Thread Richard Henderson
Add a regression test for tcg indirect global lowering. This appeared with nios2, with cps != 0, so that we use indirection into the shadow register set. An indirect call verifies alignment of rA. The use of rA was live across the brcond leading to a tcg_debug_assert failure. Cc: Alex Bennée

[PATCH v2 4/5] 9pfs: fix wrong errno being sent to Linux client on macOS host

2022-04-21 Thread Christian Schoenebeck
Linux and macOS only share some errno definitions with equal macro name and value. In fact most mappings for errno are completely different on the two systems. This patch converts some important errno values from macOS host to corresponding Linux errno values before eventually sending such error

Re: [PATCH v2 1/5] qdev: add user_creatable_requires_machine_allowance class flag

2022-04-21 Thread Peter Maydell
On Thu, 31 Mar 2022 at 13:19, Damien Hedde wrote: > > This flag will be used in device_add to check if > the device needs special allowance from the machine > model. > > It will replace the current check based only on the > device being a TYPE_SYB_BUS_DEVICE. > > Signed-off-by: Damien Hedde >

[PULL 06/18] tests: merge code for UNIX and TCP migration pre-copy tests

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé The test cases differ only in the URI they provide to the migration commands, and the ability to set the dirty_ring mode. This code is trivially merged into a common helper. Signed-off-by: Daniel P. Berrangé Message-Id: <20220310171821.3724080-9-berra...@redhat.com>

[PULL 17/18] migration: Fix operator type

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Clang spotted an & that should have been an &&; fix it. Reported by: David Binderman / https://gitlab.com/dcb Fixes: 65dacaa04fa ("migration: introduce save_normal_page()") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/963 Signed-off-by: Dr. David Alan

Re: [PATCH v3 11/60] target/arm: Split out set_btype_raw

2022-04-21 Thread Peter Maydell
On Sun, 17 Apr 2022 at 18:54, Richard Henderson wrote: > > Common code for reset_btype and set_btype. > Use tcg_constant_i32. > > Signed-off-by: Richard Henderson > --- > target/arm/translate-a64.c | 25 - > 1 file changed, 12 insertions(+), 13 deletions(-) >

[PULL 09/18] tests: expand the migration precopy helper to support failures

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé The migration precopy testing helper function always expects the migration to run to a completion state. There will be test scenarios for TLS where expect either the client or server to fail the migration. This expands the helper to cope with these scenarios.

[PULL 2/7] target/rx: Store PSW.U in tb->flags

2022-04-21 Thread Richard Henderson
With this, we don't need movcond to determine which stack pointer is current. Signed-off-by: Richard Henderson Reviewed-by: Yoshinori Sato Message-Id: <20220417165130.695085-3-richard.hender...@linaro.org> --- target/rx/cpu.h | 1 + target/rx/translate.c | 42

[PULL 14/18] migration: Export ram_load_postcopy()

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Peter Xu Will be reused in postcopy fast load thread. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Message-Id: <20220331150857.74406-6-pet...@redhat.com> Reviewed-by: Daniel P. Berrangé Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 2 +- migration/ram.h |

[PULL 09/18] tests: expand the migration precopy helper to support failures

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé The migration precopy testing helper function always expects the migration to run to a completion state. There will be test scenarios for TLS where expect either the client or server to fail the migration. This expands the helper to cope with these scenarios.

[PULL 04/18] migration: fix use of TLS PSK credentials with a UNIX socket

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Daniel P. Berrangé The migration TLS code has a check mandating that a hostname be available when starting a TLS session. This is expected when using x509 credentials, but is bogus for PSK and anonymous credentials as neither involve hostname validation. The TLS crdentials object gained

[PULL 16/18] migration: Allow migrate-recover to run multiple times

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Peter Xu Previously migration didn't have an easy way to cleanup the listening transport, migrate recovery only allows to execute once. That's done with a trick flag in postcopy_recover_triggered. Now the facility is already there. Drop postcopy_recover_triggered and instead allows a

[PULL 15/18] migration: Move channel setup out of postcopy_try_recover()

2022-04-21 Thread Dr. David Alan Gilbert (git)
From: Peter Xu We used to use postcopy_try_recover() to replace migration_incoming_setup() to setup incoming channels. That's fine for the old world, but in the new world there can be more than one channels that need setup. Better move the channel setup out of it so that postcopy_try_recover()

Re: [PATCH v3 12/60] target/arm: Split out gen_rebuild_hflags

2022-04-21 Thread Peter Maydell
On Sun, 17 Apr 2022 at 18:58, Richard Henderson wrote: > > For aa32, the function has a parameter to use the new el. > For aa64, that never happens. > Use tcg_constant_i32 while we're at it. > > Signed-off-by: Richard Henderson > --- Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v2] Only advertise aio=io_uring if support is actually available

2022-04-21 Thread Eric Blake
On Thu, Apr 21, 2022 at 06:50:48PM +0200, Dirk Müller wrote: > Change --help output for aio option to only list the aio backend options that > are actually available. io_uring is an optional, linux only backend > option so hide it for cases where it isn't there. As pointed out by Dan, this commit

[PATCH 23/50] lasi: checkpatch fixes

2022-04-21 Thread Mark Cave-Ayland
Signed-off-by: Mark Cave-Ayland --- hw/hppa/lasi.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c index 88c3791eb6..3b77fba1c6 100644 --- a/hw/hppa/lasi.c +++ b/hw/hppa/lasi.c @@ -169,10 +169,11 @@ static MemTxResult

[PATCH 07/50] dino: move PCI bus master address space setup to dino_pcihost_realize()

2022-04-21 Thread Mark Cave-Ayland
Add a new dino_pcihost_unrealize() function to remove the address space when the device is unrealized. Signed-off-by: Mark Cave-Ayland --- hw/hppa/dino.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index

[PATCH 11/50] dino: split declarations from dino.c into dino.h

2022-04-21 Thread Mark Cave-Ayland
This is to allow access to DinoState from outside dino.c. With the changes to the headers it is now possible to remove the duplicate definition for TYPE_DINO_PCI_HOST_BRIDGE from hppa_sys.h. Signed-off-by: Mark Cave-Ayland --- hw/hppa/dino.c | 111 +--

<    1   2   3   4   5   6   >