[PATCH v6 1/2] block: Ignore close() failure in get_tmp_filename()

2022-10-09 Thread Bin Meng
The temporary file has been created and is ready for use. Checking return value of close() does not seem useful. The file descriptor is almost certainly closed; see close(2) under "Dealing with error returns from close()". Let's simply ignore close() failure here. Suggested-by: Markus Armbruster

Re: [PATCH v3] disas/riscv.c: rvv: Add disas support for vector instructions

2022-10-09 Thread Alistair Francis
On Wed, Sep 28, 2022 at 3:19 PM Yang Liu wrote: > > Tested with https://github.com/ksco/rvv-decoder-tests > > Expected checkpatch errors for consistency and brevity reasons: > > ERROR: line over 90 characters > ERROR: trailing statements should be on next line > ERROR: braces {} are necessary for

[PATCH v6 2/2] block: Refactor get_tmp_filename()

2022-10-09 Thread Bin Meng
At present there are two callers of get_tmp_filename() and they are inconsistent. One does: /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */ char *tmp_filename = g_malloc0(PATH_MAX + 1); ... ret = get_tmp_filename(tmp_filename, PATH_MAX + 1); while the other

Re: Question about RISC-V brom register a1 set value

2022-10-09 Thread Alistair Francis
On Sat, Oct 1, 2022 at 11:33 AM Eric Chan wrote: > > Hi, qemu > > As I know, brom will pass 3 parameters to the next stage bootloader, ex: > openSBI. > a0 will pass hartid, a2 will pass fw_dynamic_info start address. > although a1 doesn't use directly in openSBI. > a1 read value is determined in

Re: [PATCH 3/6] riscv: re-randomize rng-seed on reboot

2022-10-09 Thread Alistair Francis
On Fri, Sep 30, 2022 at 9:24 AM Jason A. Donenfeld wrote: > > When the system reboots, the rng-seed that the FDT has should be > re-randomized, so that the new boot gets a new seed. Since the FDT is in > the ROM region at this point, we add a hook right after the ROM has been > added, so that we

[PATCH] [PING] gdb-xml: Fix size of EFER register on i386 architecture when debugged by GDB

2022-10-09 Thread TaiseiIto
This is a ping to the patch below. https://patchew.org/QEMU/ty0pr0101mb4285f637209075c9f65fcda6a4...@ty0pr0101mb4285.apcprd01.prod.exchangelabs.com/ https://lore.kernel.org/qemu-devel/ty0pr0101mb4285f637209075c9f65fcda6a4...@ty0pr0101mb4285.apcprd01.prod.exchangelabs.com/ Before this commit,

Re: [PATCH v1 2/2] riscv/opentitan: connect lifecycle controller

2022-10-09 Thread Alistair Francis
On Wed, Sep 28, 2022 at 3:13 PM Wilfred Mallawa wrote: > > From: Wilfred Mallawa > > Connects the ibex lifecycle controller with opentitan, > with this change, we can now get past the lifecycle checks > in the boot rom. > > Signed-off-by: Wilfred Mallawa Reviewed-by: Alistair Francis

Re: [PATCH v1 1/2] hw/misc: add ibex lifecycle controller

2022-10-09 Thread Alistair Francis
On Wed, Sep 28, 2022 at 3:11 PM Wilfred Mallawa wrote: > > From: Wilfred Mallawa > > Device model for the OpenTitan lifecycle controller as per [1]. > > Addition of this model is the first of many steps to adding `boot_rom` > support for OpenTitan. The OpenTitan `boot_rom` needs to access the >

[PATCH v3 3/3] qemu-iotests: test zone append operation

2022-10-09 Thread Sam Li
This tests is mainly a helper to indicate append writes in block layer behaves as expected. Signed-off-by: Sam Li --- qemu-io-cmds.c | 62 ++ tests/qemu-iotests/tests/zoned.out | 7 tests/qemu-iotests/tests/zoned.sh | 9 + 3 files

[PATCH v3 1/3] file-posix:add the tracking of the zones write pointers

2022-10-09 Thread Sam Li
Since Linux doesn't have a user API to issue zone append operations to zoned devices from user space, the file-posix driver is modified to add zone append emulation using regular writes. To do this, the file-posix driver tracks the wp location of all zones of the device. It uses an array of

[PATCH v3 2/3] block: introduce zone append write for zoned devices

2022-10-09 Thread Sam Li
A zone append command is a write operation that specifies the first logical block of a zone as the write position. When writing to a zoned block device using zone append, the byte offset of writes is pointing to the write pointer of that zone. Upon completion the device will respond with the

[PATCH v3 0/3] Add zone append write for zoned device

2022-10-09 Thread Sam Li
v3: - only read wps when it is locked [Damien] - allow last smaller zone case [Damien] - add zone type and state checks in zone_mgmt command [Damien] - fix RESET_ALL related problems v2: - split patch to two patches for better reviewing - change BlockZoneWps's structure to an array of integers -

[PATCH v11 7/7] docs/zoned-storage: add zoned device documentation

2022-10-09 Thread Sam Li
Add the documentation about the zoned device support to virtio-blk emulation. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- docs/devel/zoned-storage.rst | 40 ++ docs/system/qemu-block-drivers.rst.inc | 6 2 files changed, 46 insertions(+)

[PATCH v11 6/7] qemu-iotests: test new zone operations

2022-10-09 Thread Sam Li
We have added new block layer APIs of zoned block devices. Test it with: Create a null_blk device, run each zone operation on it and see whether reporting right zone information. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/tests/zoned.out | 53 ++

Re: [PATCH 2/3] hw/riscv: sifive_e: Support the watchdog timer of HiFive 1 rev b.

2022-10-09 Thread Alistair Francis
On Thu, Sep 22, 2022 at 6:45 PM Tommy Wu wrote: > > Create the AON device when we realize the sifive_e machine. > This patch only implemented the functionality of the watchdog timer, > not all the functionality of the AON device. > > Signed-off-by: Tommy Wu > --- > hw/riscv/Kconfig|

[PATCH v11 5/7] config: add check to block layer

2022-10-09 Thread Sam Li
Putting zoned/non-zoned BlockDrivers on top of each other is not allowed. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi --- block.c | 17 + block/file-posix.c | 13 + block/raw-format.c | 1 +

Re: [PATCH 1/3] hw/misc: sifive_e_aon: Support the watchdog timer of HiFive 1 rev b.

2022-10-09 Thread Alistair Francis
On Thu, Sep 22, 2022 at 6:43 PM Tommy Wu wrote: > > The watchdog timer is in the always-on domain device of HiFive 1 rev b, > so this patch added the AON device to the sifive_e machine. This patch > only implemented the functionality of the watchdog timer. > > Signed-off-by: Tommy Wu > --- >

[PATCH v11 3/7] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-10-09 Thread Sam Li
Add a new zoned_host_device BlockDriver. The zoned_host_device option accepts only zoned host block devices. By adding zone management operations in this new BlockDriver, users can use the new block layer APIs including Report Zone and four zone management operations (open, close, finish, reset,

[PATCH v11 4/7] raw-format: add zone operations to pass through requests

2022-10-09 Thread Sam Li
raw-format driver usually sits on top of file-posix driver. It needs to pass through requests of zone commands. Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal --- block/raw-format.c | 13 + 1 file changed, 13 insertions(+) diff --git

[PATCH v11 2/7] file-posix: introduce helper functions for sysfs attributes

2022-10-09 Thread Sam Li
Use get_sysfs_str_val() to get the string value of device zoned model. Then get_sysfs_zoned_model() can convert it to BlockZoneModel type of QEMU. Use get_sysfs_long_val() to get the long value of zoned device information. Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke Reviewed-by: Stefan

[PATCH v11 1/7] include: add zoned device structs

2022-10-09 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal --- include/block/block-common.h | 43 1 file changed, 43 insertions(+) diff --git a/include/block/block-common.h b/include/block/block-common.h index fdb7306e78..36bd0e480e

[PATCH v11 0/7] Add support for zoned device

2022-10-09 Thread Sam Li
Zoned Block Devices (ZBDs) devide the LBA space to block regions called zones that are larger than the LBA size. It can only allow sequential writes, which reduces write amplification in SSD, leading to higher throughput and increased capacity. More details about ZBDs can be found at:

Re: [RFC v2] hw/registerfields: add `FIELDx_1CLEAR()` macro

2022-10-09 Thread Wilfred Mallawa
On Mon, 2022-10-10 at 11:29 +1000, Alistair Francis wrote: > On Tue, Sep 27, 2022 at 10:58 AM Wilfred Mallawa > wrote: > > > > From: Wilfred Mallawa > > > > Changes from V1: > >     * Instead of needing all field bits to be set > >   we clear the field if any are set. If the field

Re: [PATCH] hw/riscv: Update comment for qtest check in riscv_find_firmware()

2022-10-09 Thread Alistair Francis
On Sun, Oct 9, 2022 at 11:04 PM Bin Meng wrote: > > From: Bin Meng > > Since commit 4211fc553234 ("roms/opensbi: Remove ELF images"), the > comment for qtest check in riscv_find_firmware() is out of date. > Update it to reflect the latest status. > > Signed-off-by: Bin Meng Thanks! Applied to

Re: [RFC v2] hw/registerfields: add `FIELDx_1CLEAR()` macro

2022-10-09 Thread Alistair Francis
On Tue, Sep 27, 2022 at 10:58 AM Wilfred Mallawa wrote: > > From: Wilfred Mallawa > > Changes from V1: > * Instead of needing all field bits to be set > we clear the field if any are set. If the field is > 0/clear then no change. The changelog should go > > Adds a

Re: [PATCH V5 3/3] hw/riscv: virt: Enable booting S-mode firmware from pflash

2022-10-09 Thread Alistair Francis
On Tue, Oct 4, 2022 at 7:28 PM Sunil V L wrote: > > To boot S-mode firmware payload like EDK2 from persistent > flash storage, qemu needs to pass the flash address as the > next_addr in fw_dynamic_info to the opensbi. > > When both -kernel and -pflash options are provided in command line, > the

Re: [PATCH] hw/riscv: Update comment for qtest check in riscv_find_firmware()

2022-10-09 Thread Alistair Francis
On Sun, Oct 9, 2022 at 11:04 PM Bin Meng wrote: > > From: Bin Meng > > Since commit 4211fc553234 ("roms/opensbi: Remove ELF images"), the > comment for qtest check in riscv_find_firmware() is out of date. > Update it to reflect the latest status. > > Signed-off-by: Bin Meng Reviewed-by:

Re: [PATCH v2 00/13] ppc/e500: Add support for two types of flash, cleanup

2022-10-09 Thread Daniel Henrique Barboza
On 10/9/22 00:30, Bin Meng wrote: On Sun, Oct 9, 2022 at 12:11 AM Bernhard Beschow wrote: Am 4. Oktober 2022 12:43:35 UTC schrieb Daniel Henrique Barboza : Hey, On 10/3/22 18:27, Philippe Mathieu-Daudé wrote: Hi Daniel, On 3/10/22 22:31, Bernhard Beschow wrote: Cover letter:

Re: [PATCH v2 07/11] acpi/tests/bits: add python test that exercizes QEMU bios tables using biosbits

2022-10-09 Thread Ani Sinha
On Wed, Sep 28, 2022 at 1:14 PM Thomas Huth wrote: > > > > > Do not do any of this stuff, it is irrelevant to QEMU's needs. > > A developer using Avocado with QEMU does nothing more than: > > > > make check-avocado > > Right. And if you want to run individual tests, you can also do it like

[PATCH] hw/riscv: Update comment for qtest check in riscv_find_firmware()

2022-10-09 Thread Bin Meng
From: Bin Meng Since commit 4211fc553234 ("roms/opensbi: Remove ELF images"), the comment for qtest check in riscv_find_firmware() is out of date. Update it to reflect the latest status. Signed-off-by: Bin Meng --- hw/riscv/boot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

Re: [PATCH v3] linux-user: Add close_range() syscall

2022-10-09 Thread Helge Deller
On 9/27/22 13:00, Helge Deller wrote: Signed-off-by: Helge Deller +#if defined(__NR_close_range) && defined(TARGET_NR_close_range) +case TARGET_NR_close_range: +ret = get_errno(sys_close_range(arg1, arg2, arg3)); +if (ret == 0 && !(arg3 & CLOSE_RANGE_CLOEXEC)) { +

Re: [PATCH 1/4] hw/acpi/aml-build: Only generate cluster node in PPTT when specified

2022-10-09 Thread wangyanan (Y)
Hi Yicong, On 2022/9/22 21:11, Yicong Yang wrote: From: Yicong Yang Currently we'll always generate a cluster node no matter user has specified '-smp clusters=X' or not. Cluster is an optional level and it's unncessary to build it if user don't need. So only generate it when user specify

Re: [PATCH v2 07/11] acpi/tests/bits: add python test that exercizes QEMU bios tables using biosbits

2022-10-09 Thread Ani Sinha
On Sun, Oct 9, 2022 at 10:51 AM Ani Sinha wrote: > > On Wed, Sep 28, 2022 at 1:14 PM Thomas Huth wrote: > > > > > > > Do not do any of this stuff, it is irrelevant to QEMU's needs. > > > A developer using Avocado with QEMU does nothing more than: > > > > > > make check-avocado > > > >

[PATCH] linux-user: Implement faccessat2

2022-10-09 Thread WANG Xuerui
User space has been preferring this syscall for a while, due to its closer match with C semantics, and newer platforms such as LoongArch apparently have libc implementations that don't fallback to faccessat so normal access checks are failing without the emulation in place. Tested by successfully