Re: vm-build-haiku.x86_64 failures

2022-06-12 Thread Thomas Huth
On 11/06/2022 02.16, John Snow wrote: Hi, on today's upstream of b3cd3b5a66f0dddfe3d5ba2bef13cd4f5b89cde9, I am seeing failures with the Haiku VM building test: FAILED: libqemuutil.a.p/util_cutils.c.o [...] ../src/util/cutils.c: In function 'qemu_init_exec_dir': ../src/util/cutils.c:1019:9:

[RFC v1] Adding block layer APIs resembling Linux ZoneBlockDevice ioctls.

2022-06-12 Thread Sam Li
By adding zone management operations in BlockDriver, storage controller emulation can use the new block layer APIs including zone_report, zone_reset, zone_open, zone_close, and zone_finish. Signed-off-by: Sam Li --- block/block-backend.c | 20 block/coroutines.h

Re: [PATCH v15 8/9] target/loongarch: Adjust functions and structure to support user-mode

2022-06-12 Thread gaosong
On 2022/6/12 上午12:06, Richard Henderson wrote: void helper_asrtle_d(CPULoongArchState *env,  target_ulong rj, target_ulong  rk) {   if (rj > rk) {     env->badvaddr = env->pc;     do_raise_exception(env, EXCCODE_BCE, env->badvaddr);   } } Well, not quite.  The value of

Re: [PATCH] hw/openrisc: pass random seed to fdt

2022-06-12 Thread Stafford Horne
On Sun, Jun 12, 2022 at 11:59:49PM +0200, Jason A. Donenfeld wrote: > If the FDT contains /chosen/rng-seed, then the Linux RNG will use it to > initialize early. Set this using the usual guest random number > generation function. This is confirmed to successfully initialize the > RNG on Linux

Re: [PATCH 3/3] target/riscv: Skip parsing extensions from properties for KVM

2022-06-12 Thread Alistair Francis
On Thu, Jun 9, 2022 at 11:11 AM Bin Meng wrote: > > When running with accel=kvm, the extensions are actually told by > KVM, so let's skip the parsing logic from properties for KVM. > > Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Alistair > --- > > target/riscv/cpu.c | 7 +-- >

Re: [PATCH 2/3] target/riscv: kvm: Set env->misa_ext_mask to the supported value

2022-06-12 Thread Alistair Francis
On Thu, Jun 9, 2022 at 11:09 AM Bin Meng wrote: > > env->misa_ext_mask might be set to the same value of env->misa_ext > in riscv_cpu_realize() based on given properties, but it may differ > from what KVM tells us. > > Let's set the correct env->misa_ext_mask in kvm_arch_init_vcpu(). > >

Re: [PATCH 1/3] target/riscv: Remove the redundant initialization of env->misa_mxl

2022-06-12 Thread Alistair Francis
On Thu, Jun 9, 2022 at 11:08 AM Bin Meng wrote: > > env->misa_mxl was already set in the RISC-V cpu init routine, and > validated at the beginning of riscv_cpu_realize(). There is no need > to do a redundant initialization later. > > Signed-off-by: Bin Meng > --- > > target/riscv/cpu.c | 2 +- >

Re: [PATCH] target/riscv: Remove condition guarding register zero for auipc and lui

2022-06-12 Thread Alistair Francis
On Sat, Jun 11, 2022 at 2:59 AM Víctor Colombo wrote: > > Commit 57c108b8646 introduced gen_set_gpri(), which already contains > a check for if the destination register is 'zero'. The check in auipc > and lui are then redundant. This patch removes those checks. > > Signed-off-by: Víctor Colombo

Re: [PATCH 3/3] target/riscv: Minimize the calls to decode_save_opc

2022-06-12 Thread Alistair Francis
On Sun, Jun 5, 2022 at 9:12 AM Richard Henderson wrote: > > The set of instructions that require decode_save_opc for > unwinding is really fairly small -- only insns that can > raise ILLEGAL_INSN at runtime. This includes CSR, anything > that uses a *new* fp rounding mode, and many privileged

Re: [PATCH 2/3] target/riscv: Remove generate_exception_mtval

2022-06-12 Thread Alistair Francis
On Sun, Jun 5, 2022 at 9:13 AM Richard Henderson wrote: > > The function doesn't set mtval, it sets badaddr. Move the set > of badaddr directly into gen_exception_inst_addr_mis and use > generate_exception. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- >

Re: [PATCH 1/3] target/riscv: Set env->bins in gen_exception_illegal

2022-06-12 Thread Alistair Francis
On Sun, Jun 5, 2022 at 9:11 AM Richard Henderson wrote: > > While we set env->bins when unwinding for ILLEGAL_INST, > from e.g. csrrw, we weren't setting it for immediately > illegal instructions. > > Add a testcase for mtval via both exception paths. > > Resolves:

Re: [PATCH] target/riscv: Remove condition guarding register zero for auipc and lui

2022-06-12 Thread Alistair Francis
On Sat, Jun 11, 2022 at 2:59 AM Víctor Colombo wrote: > > Commit 57c108b8646 introduced gen_set_gpri(), which already contains > a check for if the destination register is 'zero'. The check in auipc > and lui are then redundant. This patch removes those checks. > > Signed-off-by: Víctor Colombo

[PATCH] hw/openrisc: pass random seed to fdt

2022-06-12 Thread Jason A. Donenfeld
If the FDT contains /chosen/rng-seed, then the Linux RNG will use it to initialize early. Set this using the usual guest random number generation function. This is confirmed to successfully initialize the RNG on Linux 5.19-rc2. Cc: Stafford Horne Signed-off-by: Jason A. Donenfeld ---

[PATCH 10/11] bsd-user: Implement trunctate and ftruncate

2022-06-12 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/bsd-file.h | 30 ++ bsd-user/freebsd/os-syscall.c | 8 2 files changed, 38 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index 73263ba482f..ccfa65ec5e9

[PATCH 00/11] bsd-user: Next round of syscalls

2022-06-12 Thread Warner Losh
Implement the next round of system calls. These are open, openat, close, fdatasync, fsync, close_from, revoke, access, eacccess, facccessat, chdir, fchdir, rename, renameat, mkdir, mkdirat, rmdir, _getcwd, dup, dup2, truncate, ftruncate, acct and sync. In addition, the helper functions needed for

[PATCH 09/11] bsd-user: Implement dup and dup2

2022-06-12 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/bsd-file.h | 14 ++ bsd-user/freebsd/os-syscall.c | 8 2 files changed, 22 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index 500d6ba78b9..73263ba482f 100644 ---

[PATCH 11/11] bsd-user: Implement acct and sync

2022-06-12 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/bsd-file.h | 24 bsd-user/freebsd/os-syscall.c | 8 2 files changed, 32 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index ccfa65ec5e9..6b20442ecdc 100644 ---

[PATCH 06/11] bsd-user: Implement link, linkat, unlink and unlinkat

2022-06-12 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Jung-uk Kim Signed-off-by: Warner Losh --- bsd-user/bsd-file.h | 54 +++ bsd-user/freebsd/os-syscall.c | 16 +++ 2 files changed, 70 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h

[PATCH 08/11] bsd-user: Implement rmdir and undocumented -_getcwd

2022-06-12 Thread Warner Losh
Implemenet rmdir and __getcwd. Declare __getcwd as extern because there's no installed FreeBSD header that has it. It's used internally by libc, which doesn't provide an external declaration, but does export the symbol. Signed-off-by: Stacey Son Signed-off-by: Jung-uk Kim Signed-off-by: Warner

[PATCH 01/11] bsd-user: Implement open, openat and close

2022-06-12 Thread Warner Losh
Add the open, openat and close system calls. We need to lock paths, so implmenent that as well. Signed-off-by: Stacey Son Signed-off-by: Jung-uk Kim Signed-off-by: Kyle Evans Signed-off-by: Warner Losh --- bsd-user/bsd-file.h | 50 +++

[PATCH 07/11] bsd-user: Implement mkdir and mkdirat

2022-06-12 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/bsd-file.h | 27 +++ bsd-user/freebsd/os-syscall.c | 8 2 files changed, 35 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index 08b1d3a53a9..35036364ad8 100644

[PATCH 04/11] bsd-user: Implement chdir and fchdir

2022-06-12 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/bsd-file.h | 20 bsd-user/freebsd/os-syscall.c | 8 2 files changed, 28 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index 37b3efccd2c..8e5d302972c 100644 ---

[PATCH 02/11] bsd-user: Implement fdatasync, fsync and close_from

2022-06-12 Thread Warner Losh
Implement fdatasync(2), fsync(2) and close_from(2). Signed-off-by: Stacey Son Signed-off-by: Jung-uk Kim Signed-off-by: Warner Losh --- bsd-user/bsd-file.h | 22 ++ bsd-user/freebsd/os-syscall.c | 12 2 files changed, 34 insertions(+) diff --git

[PATCH 03/11] bsd-user: Implement revoke, access, eaccess and faccessat

2022-06-12 Thread Warner Losh
Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/bsd-file.h | 53 +++ bsd-user/freebsd/os-syscall.c | 16 +++ 2 files changed, 69 insertions(+) diff --git a/bsd-user/bsd-file.h b/bsd-user/bsd-file.h index

[PATCH 05/11] bsd-user: Implement rename and renameat

2022-06-12 Thread Warner Losh
Plus the helper LOCK_PATH2 and UNLOCK_PATH2 macros. Signed-off-by: Stacey Son Signed-off-by: Jung-uk Kim Signed-off-by: Warner Losh --- bsd-user/bsd-file.h | 45 +++ bsd-user/freebsd/os-syscall.c | 8 +++ 2 files changed, 53 insertions(+) diff

[PATCH] hw/pci-host/i440fx: Remove unused parameter from i440fx_init()

2022-06-12 Thread Bernhard Beschow
pi440fx_state is an out-parameter which is never read by the caller. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c| 3 --- hw/pci-host/i440fx.c | 4 +--- include/hw/pci-host/i440fx.h | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git

[PATCH 0/3] CanoKey: Fix xHCI compatibility and CCID ZLP

2022-06-12 Thread Hongren (Zenithal) Zheng
In patch v5 [1] of Introduce CanoKey QEMU I said that canokey-qemu was incompatible with qemu-xhci. kraxel kindly suggested[2] that it should be the problem of usb_wakeup So I fixed it in this patch set. Now that the v5 patch has been in the process of git PULL [3], I think it would be better to

[PATCH 3/3] docs/system/devices/usb/canokey: remove limitations on qemu-xhci

2022-06-12 Thread Hongren (Zenithal) Zheng
Signed-off-by: Hongren (Zenithal) Zheng --- docs/system/devices/canokey.rst | 10 -- 1 file changed, 10 deletions(-) diff --git a/docs/system/devices/canokey.rst b/docs/system/devices/canokey.rst index 169f99b8eb..c2c58ae3e7 100644 --- a/docs/system/devices/canokey.rst +++

[PATCH 2/3] hw/usb/canokey: fix compatibility of qemu-xhci

2022-06-12 Thread Hongren (Zenithal) Zheng
XHCI wont poll interrupt IN endpoint if NAKed, and needs wakeup Suggested-by: Gerd Hoffmann Signed-off-by: Hongren (Zenithal) Zheng --- hw/usb/canokey.c | 28 hw/usb/canokey.h | 1 + 2 files changed, 29 insertions(+) diff --git a/hw/usb/canokey.c

[PATCH 1/3] hw/usb/canokey: Fix CCID ZLP

2022-06-12 Thread Hongren (Zenithal) Zheng
CCID could send zero-length packet (ZLP) if we invoke two data_in, two packets would be concated and we could not distinguish them. The CANOKEY_EMU_EP_CTAPHID is exported from canokey-qemu.h Reported-by: MkfsSion Signed-off-by: Hongren (Zenithal) Zheng --- hw/usb/canokey.c | 7 +++ 1 file

[PATCH v2] docs: add PCIe root bus for VGA compat guideline

2022-06-12 Thread Kevin Locke
PCI Express devices which use legacy VGA compatibility should be placed on the Root Complex. This simplifies ioport access to VGA registers, which requires use of a special exception bit to work across PCI(e) bridges. It is also necessary for ioport access to VESA BIOS Extension (VBE) registers,

Re: [RFC PATCH] linux-user: un-parent OBJECT(cpu) when closing thread

2022-06-12 Thread Laurent Vivier
Le 10/06/2022 à 16:38, Alex Bennée a écrit : While forcing the CPU to unrealize by hand does trigger the clean-up code we never fully free resources because refcount never reaches zero. This is because QOM automatically added objects without an explicit parent to /unattached/, incrementing the

Re: [PULL v2 00/50] MIPS patches for 2022-06-11

2022-06-12 Thread Richard Henderson
On 6/11/22 15:00, Philippe Mathieu-Daudé wrote: From: Philippe Mathieu-Daudé Hi Richard, In case it is not too late, this v2 includes another fix from Bernhard which was supposed to be in v1. Otherwise it will go in the next PR. The second PR merged well with the first, so I have applied

[PATCH] goldfish_rtc: Add endianness property

2022-06-12 Thread Stafford Horne
Add an endianness property to allow configuring the RTC as either native, little or big endian. Cc: Laurent Vivier Cc: Arnd Bergmann Signed-off-by: Stafford Horne --- In a recent mail thread[0] it was discussed that future users of goldfish devices should use little-endian rather than native

Re: [PATCH 1/2] hw/nvme: Implement shadow doorbell buffer support

2022-06-12 Thread Jinhao Fan
> On Jun 10, 2022, at 1:27 AM, Klaus Jensen wrote: > > I'm ok with following the concensus here, but we all agree that this is > a blatant spec violation that ended up manifesting itself down the > stack, right? > > So... if QEMU wants to be compliant here, I guess we could ask the > kernel

Re: [PATCH v2 00/11] hw/acpi/piix4: remove legacy piix4_pm_init() function

2022-06-12 Thread Michael S. Tsirkin
On Mon, May 30, 2022 at 01:27:07PM +0200, Philippe Mathieu-Daudé wrote: > From: Philippe Mathieu-Daudé > > This series moves the outstanding logic from piix4_pm_init() into > the relevant instance init() and realize() functions, changes the > IRQs to use qdev gpios, and then finally removes the