Re: [PATCH] qemu-options: fix incorrect description for '-drive index='

2022-02-02 Thread Thomas Huth
On 02/02/2022 15.34, Laurent Vivier wrote: qemu-options.hx contains grammar that a native English-speaking person would never use. Replace "This option defines where is connected the drive" by "This option defines where the drive is connected". Fixes: https://gitlab.com/qemu-project/qemu/-/issu

Re: [PATCH v2] 9pfs: Fix segfault in do_readdir_many caused by struct dirent overread

2022-02-02 Thread Vitaly Chikunov
On Thu, Feb 03, 2022 at 07:55:41AM +0300, Vitaly Chikunov wrote: > Christian, > > On Wed, Feb 02, 2022 at 05:55:45PM +0100, Christian Schoenebeck wrote: > > On Freitag, 28. Januar 2022 23:33:26 CET Vitaly Chikunov wrote: > > > `struct dirent' returned from readdir(3) could be shorter than > > > `s

Re: [PATCH v2] 9pfs: Fix segfault in do_readdir_many caused by struct dirent overread

2022-02-02 Thread Vitaly Chikunov
Christian, On Wed, Feb 02, 2022 at 05:55:45PM +0100, Christian Schoenebeck wrote: > On Freitag, 28. Januar 2022 23:33:26 CET Vitaly Chikunov wrote: > > `struct dirent' returned from readdir(3) could be shorter than > > `sizeof(struct dirent)', thus memcpy of sizeof length will overread > > into un

Re: [PATCH 13/13] hw/intc/arm_gicv3_its: Split error checks

2022-02-02 Thread Richard Henderson
On 2/2/22 06:32, Peter Maydell wrote: In most of the ITS command processing, we check different error possibilities one at a time and log them appropriately. In process_mapti() and process_mapd() we have code which checks multiple error cases at once, which means the logging is less specific than

Re: [PATCH 12/13] hw/intc/arm_gicv3_its: Don't allow intid 1023 in MAPI/MAPTI

2022-02-02 Thread Richard Henderson
On 2/2/22 06:32, Peter Maydell wrote: When handling MAPI/MAPTI, we allow the supplied interrupt ID to be either 1023 or something in the valid LPI range. This is a mistake: only a real valid LPI is allowed. (The general behaviour of the ITS is that most interrupt ID fields require a value in th

Re: [PATCH 11/13] hw/intc/arm_gicv3_its: In MAPC with V=0, don't check rdbase field

2022-02-02 Thread Richard Henderson
On 2/2/22 06:32, Peter Maydell wrote: In the MAPC command, if V=0 this is a request to delete a collection table entry and the rdbase field of the command packet will not be used. In particular, the specification says that the "UNPREDICTABLE if rdbase is not valid" only applies for V=1. We were

Re: [PATCH 10/13] hw/intc/arm_gicv3_its: Drop TableDesc and CmdQDesc valid fields

2022-02-02 Thread Richard Henderson
On 2/2/22 06:32, Peter Maydell wrote: Currently we track in the TableDesc and CmdQDesc structs the state of the GITS_BASER and GITS_CBASER Valid bits. However we aren't very consistent abut checking the valid field: we test it in update_cte() and update_dte(), but not anywhere else we look thing

Re: [PATCH 09/13] hw/intc/arm_gicv3_its: Make update_ite() use ITEntry

2022-02-02 Thread Richard Henderson
On 2/2/22 06:32, Peter Maydell wrote: Make the update_ite() struct use the new ITEntry struct, so that callers don't need to assemble the in-memory ITE data themselves, and only get_ite() and update_ite() need to care about that in-memory layout. We can then drop the no-longer-used IteEntry stru

Re: [PATCH 08/13] hw/intc/arm_gicv3_its: Pass ITE values back from get_ite() via a struct

2022-02-02 Thread Richard Henderson
On 2/2/22 06:32, Peter Maydell wrote: In get_ite() we currently return the caller some of the fields of an Interrupt Table Entry via a set of pointer arguments, and validate some of them internally (interrupt type and valid bit) to return a simple true/false 'valid' indication. Define a new ITEnt

Re: [PATCH 07/13] hw/intc/arm_gicv3_its: Avoid nested ifs in get_ite()

2022-02-02 Thread Richard Henderson
On 2/2/22 06:32, Peter Maydell wrote: The get_ite() code has some awkward nested if statements; clean them up by returning early if the memory accesses fail. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_its.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletion

Re: [PATCH 06/13] hw/intc/arm_gicv3_its: Fix address calculation in get_ite() and update_ite()

2022-02-02 Thread Richard Henderson
On 2/2/22 06:32, Peter Maydell wrote: In get_ite() and update_ite() we work with a 12-byte in-guest-memory table entry, which we intend to handle as an 8-byte value followed by a 4-byte value. Unfortunately the calculation of the address of the 4-byte value is wrong, because we write it as: t

Re: [PATCH 05/13] hw/intc/arm_gicv3_its: Pass CTEntry to update_cte()

2022-02-02 Thread Richard Henderson
On 2/2/22 06:31, Peter Maydell wrote: Make update_cte() take a CTEntry struct rather than all the fields of the new CTE as separate arguments. This brings it into line with the update_dte() API. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_its.c | 32 +--- 1

Re: [PATCH 04/13] hw/intc/arm_gicv3_its: Keep CTEs as a struct, not a raw uint64_t

2022-02-02 Thread Richard Henderson
On 2/2/22 06:31, Peter Maydell wrote: In the ITS, a CTE is an entry in the collection table, which contains multiple fields. Currently the function get_cte() which reads one entry from the device table returns a success/failure boolean and passes back the raw 64-bit integer CTE value via a pointe

Re: [PATCH v8 3/5] target/riscv: add support for svnapot extension

2022-02-02 Thread Weiwei Li
在 2022/2/3 上午6:25, Alistair Francis 写道: On Wed, Feb 2, 2022 at 3:24 AM Weiwei Li wrote: - add PTE_N bit - add PTE_N bit check for inner PTE - update address translation to support 64KiB continuous region (napot_bits = 4) Signed-off-by: Weiwei Li Signed-off-by: Junqiang Wang Reviewed-by: An

Re: [PATCH 03/13] hw/intc/arm_gicv3_its: Pass DTEntry to update_dte()

2022-02-02 Thread Richard Henderson
On 2/2/22 06:31, Peter Maydell wrote: Make update_dte() take a DTEntry struct rather than all the fields of the new DTE as separate arguments. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_its.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-)

[PATCH 4/4] iotests: switch to AQMP

2022-02-02 Thread John Snow
All that's left is to import type definitions from the new library instead. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal --- tests/qemu-iotests/iotests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iote

[PATCH 2/4] scripts/bench-block-job: switch to AQMP

2022-02-02 Thread John Snow
For this commit, we only need to remove accommodations for the synchronous QMP library. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal --- scripts/simplebench/bench_block_job.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/

[PATCH 3/4] iotests/mirror-top-perms: switch to AQMP

2022-02-02 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 h

[PATCH 1/4] python/machine: permanently switch to AQMP

2022-02-02 Thread John Snow
Remove the QEMU_PYTHON_LEGACY_QMP environment variable, making the switch permanent. Update Exceptions and import paths as necessary. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal --- python/qemu/machine/machine.py | 18 +++--- python/

[PATCH 0/4] iotests: finalize switch to async QMP

2022-02-02 Thread John Snow
Based-on: <20220203015946.1330386-1-js...@redhat.com> [PULL 0/4] Python patches GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-qmp-legacy-switch-pt1b This tiny series is a spiritual v4 to: "[PATCH v3 00/31] Python: delete synchronous qemu.qmp package". I've isolated just the bit

Re: [PATCH 02/13] hw/intc/arm_gicv3_its: Keep DTEs as a struct, not a raw uint64_t

2022-02-02 Thread Richard Henderson
On 2/2/22 06:31, Peter Maydell wrote: In the ITS, a DTE is an entry in the device table, which contains multiple fields. Currently the function get_dte() which reads one entry from the device table returns it as a raw 64-bit integer, which we then pass around in that form, only extracting fields

Re: [PATCH 01/13] hw/intc/arm_gicv3_its: Use address_space_map() to access command queue packets

2022-02-02 Thread Richard Henderson
On 2/2/22 06:31, Peter Maydell wrote: Currently the ITS accesses each 8-byte doubleword in a 4-doubleword command packet with a separate address_space_ldq_le() call. This is awkward because the individual command processing functions have ended up with code to handle "load more doublewords out o

[PULL 4/4] python/aqmp: add socket bind step to legacy.py

2022-02-02 Thread John Snow
The synchronous QMP library would bind to the server address during __init__(). The new library delays this to the accept() call, because binding occurs inside of the call to start_[unix_]server(), which is an async method -- so it cannot happen during __init__ anymore. Python 3.7+ adds the abilit

[PULL 2/4] python/machine: raise VMLaunchFailure exception from launch()

2022-02-02 Thread John Snow
This allows us to pack in some extra information about the failure, which guarantees that if the caller did not *intentionally* cause a failure (by capturing this Exception), some pretty good clues will be printed at the bottom of the traceback information. This will help make failures in the even

[PULL 3/4] python: upgrade mypy to 0.780

2022-02-02 Thread John Snow
We need a slightly newer version of mypy in order to use some features of the asyncio server functions in the next commit. (Note: pipenv is not really suited to upgrading individual packages; I need to replace this tool with something better for the task. For now, the miscellaneous updates not rel

[PULL 0/4] Python patches

2022-02-02 Thread John Snow
The following changes since commit 47cc1a3655135b89fa75c2824fbddd29df874612: Merge remote-tracking branch 'remotes/kwolf-gitlab/tags/for-upstream' into staging (2022-02-01 19:48:15 +) are available in the Git repository at: https://gitlab.com/jsnow/qemu.git tags/python-pull-request for

[PULL 1/4] python/aqmp: Fix negotiation with pre-"oob" QEMU

2022-02-02 Thread John Snow
QEMU versions prior to the "oob" capability *also* can't accept the "enable" keyword argument at all. Fix the handshake process with older QEMU versions. Signed-off-by: John Snow Reviewed-by: Hanna Reitz Reviewed-by: Kevin Wolf Message-id: 20220201041134.1237016-2-js...@redhat.com Signed-off-by

Re: Notes on Generating Python signatures for QMP RPCs

2022-02-02 Thread John Snow
On Thu, Jan 27, 2022 at 9:03 AM Markus Armbruster wrote: > > John Snow writes: > > > Hiya, I was experimenting with $subject and ran into a few points of > > interest. This is basically an informal status report from me. I've > > CC'd some of the usual suspects for people who care about SDKs and

RE: [RFC PATCH 0/4] improve coverage of vector backend

2022-02-02 Thread Taylor Simpson
> -Original Message- > From: Alex Bennée > Sent: Wednesday, February 2, 2022 5:16 PM > To: richard.hender...@linaro.org; qemu-devel@nongnu.org > Cc: qemu-...@nongnu.org; f...@euphon.net; berra...@redhat.com; > f4...@amsat.org; aurel...@aurel32.net; pbonz...@redhat.com; > stefa...@redhat.c

Re: [PATCH 11/20] tcg/i386: Implement avx512 immediate rotate

2022-02-02 Thread Richard Henderson
On 2/3/22 01:05, Alex Bennée wrote: Is there any reason why gen_shift couldn't be pushed into a helper function so we just had: static void tcg_out_vec_shift(s, vece, insn, sub, a0, a1, a2) { tcg_debug_assert(vece != MO_8); if (type == TCG_TYPE_V256) { insn |=

Re: [PATCH v8 5/5] target/riscv: add support for svpbmt extension

2022-02-02 Thread Alistair Francis
On Wed, Feb 2, 2022 at 2:13 AM Weiwei Li wrote: > > - add PTE_PBMT bits: It uses two PTE bits, but otherwise has no effect on > QEMU, since QEMU is sequentially consistent and doesn't model PMAs currently > - add PTE_PBMT bit check for inner PTE > > Signed-off-by: Weiwei Li > Signed-off-by: Junq

Re: [PATCH v8 4/5] target/riscv: add support for svinval extension

2022-02-02 Thread Alistair Francis
On Wed, Feb 2, 2022 at 2:46 AM Weiwei Li wrote: > > - sinval.vma, hinval.vvma and hinval.gvma do the same as sfence.vma, > hfence.vvma and hfence.gvma except extension check > - do nothing other than extension check for sfence.w.inval and sfence.inval.ir > > Signed-off-by: Weiwei Li > Signed-off

[PATCH v2] target/rx: Remove unused ENV_OFFSET definition

2022-02-02 Thread Philippe Mathieu-Daudé via
The last use of ENV_OFFSET was removed in 5e1401969b ("cpu: Move icount_decr to CPUNegativeOffsetState"); the commit of target/rx came in just afterward. Reviewed-by: Richard Henderson Reviewed-by: Yoshinori Sato Signed-off-by: Philippe Mathieu-Daudé --- target/rx/cpu.h | 2 -- 1 file changed,

[PATCH v2] hw/display/tcx: Mark the VRAM dirty upon reset

2022-02-02 Thread Philippe Mathieu-Daudé via
When resetting we don't want to *reset* the dirty bitmap, we want to *set* it to mark the entire VRAM dirty due to the memset() call. Replace memory_region_reset_dirty() by tcx_set_dirty() which conveniently set the correct ranges dirty. Suggested-by: Mark Cave-Ayland Signed-off-by: Philippe Mat

Re: [PATCH 2/3] m68k: virt: add a bootstrap ROM

2022-02-02 Thread Philippe Mathieu-Daudé via
On 2/2/22 23:35, Laurent Vivier wrote: This ROM will be started by QEMU and will load the firmware. The firware will be based on Petit Boot, the aim of the bootstrap "firmware" is to ask QEMU to load the kernel and initramfs to the RAM. It also builds the bootinfo structure to pass to the ke

Re: [RFC PATCH 0/4] improve coverage of vector backend

2022-02-02 Thread Alex Bennée
Alex Bennée writes: > Hi Richard, > > While reviewing the TCG vector clean-ups I tried to improve the > range of instructions we tested. I couldn't get the existing hacky > sha1 test to vectorise nicely so I snarfed the sha512 algorithm from > CCAN. The sha512 test is good because it is all pur

Re: [PATCH v2] Fix %#0 misuses

2022-02-02 Thread Philippe Mathieu-Daudé via
On 2/2/22 19:34, Dr. David Alan Gilbert (git) wrote: From: "Dr. David Alan Gilbert" Joe Perches pointed out on lkml [1] that the format special %# (which adds 0x) is included in the character count, i.e.: printf("0: %#08x\n0: %#08x\n", 0xabcdef01,1); gives: 0: 0xabcdef01 0: 0x01 rather

[PATCH 1/3] m68k: bootinfo entry size must be aligned on 4 bytes

2022-02-02 Thread Laurent Vivier
This is checked by petitboot. Signed-off-by: Laurent Vivier --- hw/m68k/bootinfo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/m68k/bootinfo.h b/hw/m68k/bootinfo.h index adbf0c5521e5..94c97a71fa07 100644 --- a/hw/m68k/bootinfo.h +++ b/hw/m68k/bootinfo.h @@ -48,12 +

[PATCH 2/3] m68k: virt: add a bootstrap ROM

2022-02-02 Thread Laurent Vivier
This ROM will be started by QEMU and will load the firmware. The firware will be based on Petit Boot, the aim of the bootstrap is to ask QEMU to load the kernel and initramfs to the RAM. It also builds the bootinfo structure to pass to the kernel the same way QEMU does when it loads directly the k

[PATCH 0/3] m68k: virt: add a firmware to the virt machine (petit boot)

2022-02-02 Thread Laurent Vivier
For the moment, the virt machine can only be started by using QEMU "-kernel" parameter, and thus can only load the kernel/initramfs from the host filesystem. Adding a firmware is a good way to allow the machine to boot and update a kernel from the guest point of view (disk, network, cdrom, ...).

[PATCH 3/3] m68k: virt: add a firmware (petitboot)

2022-02-02 Thread Laurent Vivier
Add a firmware for the m68k virt machine The firmware is based on petit boot (also used in bare metal POWER systems) Petit boot is embedded in a buildroot filesystem. This patch define the buildroot repository, add make targets to build and install the kernel and filesystem produced by buildroot

Re: [PATCH v8 3/5] target/riscv: add support for svnapot extension

2022-02-02 Thread Alistair Francis
On Wed, Feb 2, 2022 at 3:24 AM Weiwei Li wrote: > > - add PTE_N bit > - add PTE_N bit check for inner PTE > - update address translation to support 64KiB continuous region (napot_bits = > 4) > > Signed-off-by: Weiwei Li > Signed-off-by: Junqiang Wang > Reviewed-by: Anup Patel > --- > target/r

Re: [PATCH 05/16] hw/arm: allwinner: Don't enable PSCI conduit when booting guest in EL3

2022-02-02 Thread Samuel Holland
On 1/31/22 4:52 AM, Andre Przywara wrote: > On Sun, 30 Jan 2022 23:35:37 +0100 > Niek Linnenbank wrote: >> On Thu, Jan 27, 2022 at 4:46 PM Peter Maydell >> wrote: >>> If anybody knows for definite that the secondaries should be >>> powered-down at startup for guest firmware, we can delete the TOD

Re: [PATCH] hw/i2c: flatten pca954x mux device

2022-02-02 Thread Patrick Venture
On Wed, Feb 2, 2022 at 9:31 AM Philippe Mathieu-Daudé wrote: > On 2/2/22 17:40, Patrick Venture wrote: > > > Philippe, > > > > I0202 08:29:45.380384 6641 stream.go:31] qemu: child buses at > > "pca9546": "channel[*]", "channel[*]", "channel[*]", "channel[*]" > > > > Ok, so that's

[RFC] thread-pool: Add option to fix the pool size

2022-02-02 Thread Nicolas Saenz Julienne
The thread pool regulates itself: when idle, it kills threads until empty, when in demand, it creates new threads until full. This behaviour doesn't play well with latency sensitive workloads where the price of creating a new thread is too high. For example, when paired with qemu's '-mlock', or usi

Re: [RFC PATCH 3/4] tests/tcg: add sha512 test

2022-02-02 Thread Richard Henderson
On 2/3/22 06:12, Alex Bennée wrote: This imports the sha512 algorithm and related tests from ccan which offers a cleaner hash implementation with its own validation tests with which we can exercise TCG code generations. [AJB: this exercise in copy and paste does raise the question of should we a

Re: [RFC PATCH 4/4] tests/tcg: add vectorised sha512 versions

2022-02-02 Thread Richard Henderson
On 2/3/22 06:12, Alex Bennée wrote: This builds vectorised versions of sha512 to exercise the vector code: - aarch64 (sve and sve2) Again, I think you want to test advsimd as well. - i385 (SSE) s/5/6/. Here, might as well enable as much as we can: -msse4. Oh, I see, the pshufb commen

Re: [RFC PATCH 1/4] tests/tcg: cleanup sha1 source code

2022-02-02 Thread Richard Henderson
On 2/3/22 06:12, Alex Bennée wrote: We have a lot of legacy mess in this imported code which makes figuring out what is going on harder. Clean it up: - delete non-SHA1HANDSOFF legs, remove symbol - don't bother clearing variables at the end - remove #if 0 dead code - some light inden

Re: [RFC PATCH 2/4] tests/tcg: build sha1-vector for SVE and compare

2022-02-02 Thread Richard Henderson
On 2/3/22 06:12, Alex Bennée wrote: The aim of this is to test code generation for vectorised operations. Unfortunately gcc struggles to do much with the messy sha1 code (try -fopt-info-vec-missed to see why). However it's better than nothing. We assume the non-vectorised output is gold and bari

Re: [PATCH v4 00/12] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-02-02 Thread Nakajima, Jun
> On Feb 2, 2022, at 1:23 AM, Steven Price wrote: > > Hi Jun, > > On 02/02/2022 02:28, Nakajima, Jun wrote: >> >>> On Jan 28, 2022, at 8:47 AM, Steven Price wrote: >>> >>> On 18/01/2022 13:21, Chao Peng wrote: This is the v4 of this series which try to implement the fd-based KVM gu

[PATCH v5 5/9] virtiofsd, fuse_lowlevel.c: Add capability to parse security context

2022-02-02 Thread Vivek Goyal
Add capability to enable and parse security context as sent by client and put into fuse_req. Filesystems now can get security context from request and set it on files during creation. Signed-off-by: Vivek Goyal --- tools/virtiofsd/fuse_common.h | 5 ++ tools/virtiofsd/fuse_i.h| 7 +++

Re: [PULL 0/1] Bsd user fix patches

2022-02-02 Thread Peter Maydell
On Tue, 1 Feb 2022 at 21:59, Warner Losh wrote: > > The following changes since commit 3bbe296c1c7a6ddce7a294e006b8c4a53b385292: > > Merge remote-tracking branch > 'remotes/hreitz-gitlab/tags/pull-block-2022-02-01' into staging (2022-02-01 > 16:32:54 +) > > are available in the Git reposit

[PATCH v5 4/9] virtiofsd: Extend size of fuse_conn_info->capable and ->want fields

2022-02-02 Thread Vivek Goyal
->capable keeps track of what capabilities kernel supports and ->wants keep track of what capabilities filesytem wants. Right now these fields are 32bit in size. But now fuse has run out of bits and capabilities can now have bit number which are higher than 31. That means 32 bit fields are not su

Re: [PATCH] hw/i2c: flatten pca954x mux device

2022-02-02 Thread Patrick Venture
On Wed, Feb 2, 2022 at 11:01 AM Peter Maydell wrote: > On Wed, 2 Feb 2022 at 17:36, Patrick Venture wrote: > > Just saw your reply, and found a bunch of other non-spam in my > > spam folder. I sent the message to the anti-spam team, hopefully > > that'll resolve this for myself and presumably o

[PATCH v4 1/1] virtio: fix the condition for iommu_platform not supported

2022-02-02 Thread Halil Pasic
The commit 04ceb61a40 ("virtio: Fail if iommu_platform is requested, but unsupported") claims to fail the device hotplug when iommu_platform is requested, but not supported by the (vhost) device. On the first glance the condition for detecting that situation looks perfect, but because a certain pec

[PATCH v5 0/9] virtiofsd: Add support for file security context at file creation

2022-02-02 Thread Vivek Goyal
Hi, This is V5 of the patches. I posted V4 here. https://listman.redhat.com/archives/virtio-fs/2022-January/msg00041.html These will allow us to support SELinux with virtiofs. This will send SELinux context at file creation to server and server can set it on file. Changes since V4 -

[PATCH v5 2/9] linux-headers: Update headers to v5.17-rc1

2022-02-02 Thread Vivek Goyal
Update headers to 5.17-rc1. I need latest fuse changes. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- include/standard-headers/asm-x86/kvm_para.h | 1 + include/standard-headers/drm/drm_fourcc.h | 11 ++ include/standard-headers/linux/ethtool.h | 1 + includ

[PATCH v5 7/9] virtiofsd: Create new file with fscreate set

2022-02-02 Thread Vivek Goyal
This patch adds support to set /proc/thread-self/attr/fscreate before file creation. It is set to a value as sent by client. This will allow for atomic creation of security context on files w.r.t file creation. This is primarily useful when either there is no SELinux enabled on host or host and gu

[RFC PATCH 3/4] tests/tcg: add sha512 test

2022-02-02 Thread Alex Bennée
This imports the sha512 algorithm and related tests from ccan which offers a cleaner hash implementation with its own validation tests with which we can exercise TCG code generations. [AJB: this exercise in copy and paste does raise the question of should we add ccan as a module to use for writing

[PATCH v5 3/9] virtiofsd: Parse extended "struct fuse_init_in"

2022-02-02 Thread Vivek Goyal
Add some code to parse extended "struct fuse_init_in". And use a local variable "flag" to represent 64 bit flags. This will make it easier to add more features without having to worry about two 32bit flags (->flags and ->flags2) in "fuse_struct_in". Signed-off-by: Vivek Goyal --- tools/virtiofsd

[PATCH v5 6/9] virtiofsd: Move core file creation code in separate function

2022-02-02 Thread Vivek Goyal
Move core file creation bits in a separate function. Soon this is going to get more complex as file creation need to set security context also. And there will be multiple modes of file creation in next patch. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Vivek Goyal --- tools/virtiofsd/pas

[PATCH v5 9/9] virtiofsd: Add an option to enable/disable security label

2022-02-02 Thread Vivek Goyal
Provide an option "-o security_label/no_security_label" to enable/disable security label functionality. By default these are turned off. If enabled, server will indicate to client that it is capable of handling one security label during file creation. Typically this is expected to be a SELinux lab

[PATCH v5 8/9] virtiofsd: Create new file using O_TMPFILE and set security context

2022-02-02 Thread Vivek Goyal
If guest and host policies can't work with each other, then guest security context (selinux label) needs to be set into an xattr. Say remap guest security.selinux xattr to trusted.virtiofs.security.selinux. That means setting "fscreate" is not going to help as that's ony useful for security.selinu

[RFC PATCH 0/4] improve coverage of vector backend

2022-02-02 Thread Alex Bennée
Hi Richard, While reviewing the TCG vector clean-ups I tried to improve the range of instructions we tested. I couldn't get the existing hacky sha1 test to vectorise nicely so I snarfed the sha512 algorithm from CCAN. The sha512 test is good because it is all purely integer so we should be able to

[PATCH v5 1/9] virtiofsd: Fix breakage due to fuse_init_in size change

2022-02-02 Thread Vivek Goyal
Kernel version 5.17 has increased the size of "struct fuse_init_in" struct. Previously this struct was 16 bytes and now it has been extended to 64 bytes in size. Once qemu headers are updated to latest, it will expect to receive 64 byte size struct (for protocol version major 7 and minor > 6). But

[RFC PATCH 4/4] tests/tcg: add vectorised sha512 versions

2022-02-02 Thread Alex Bennée
This builds vectorised versions of sha512 to exercise the vector code: - aarch64 (sve and sve2) - i385 (SSE) - s390x (MVX) - ppc64 (vector) Signed-off-by: Alex Bennée --- tests/tcg/aarch64/Makefile.target | 11 +++ tests/tcg/i386/Makefile.target| 6 ++ tests/tcg/ppc64le

Re: [PATCH v4 4/4] python/aqmp: add socket bind step to legacy.py

2022-02-02 Thread John Snow
On Tue, Feb 1, 2022 at 2:46 PM Kevin Wolf wrote: > > Am 01.02.2022 um 19:32 hat John Snow geschrieben: > > On Tue, Feb 1, 2022 at 8:21 AM Kevin Wolf wrote: > > > > > > Am 01.02.2022 um 05:11 hat John Snow geschrieben: > > > > The synchronous QMP library would bind to the server address during > >

Re: [PATCH v6 3/3] spapr: nvdimm: Introduce spapr-nvdimm device

2022-02-02 Thread Daniel Henrique Barboza
On 2/1/22 18:58, Shivaprasad G Bhat wrote: If the device backend is not persistent memory for the nvdimm, there is need for explicit IO flushes on the backend to ensure persistence. On SPAPR, the issue is addressed by adding a new hcall to request for an explicit flush from the guest when the

[RFC PATCH 1/4] tests/tcg: cleanup sha1 source code

2022-02-02 Thread Alex Bennée
We have a lot of legacy mess in this imported code which makes figuring out what is going on harder. Clean it up: - delete non-SHA1HANDSOFF legs, remove symbol - don't bother clearing variables at the end - remove #if 0 dead code - some light indentation fixes Signed-off-by: Alex Bennée

[RFC PATCH 2/4] tests/tcg: build sha1-vector for SVE and compare

2022-02-02 Thread Alex Bennée
The aim of this is to test code generation for vectorised operations. Unfortunately gcc struggles to do much with the messy sha1 code (try -fopt-info-vec-missed to see why). However it's better than nothing. We assume the non-vectorised output is gold and baring compiler bugs the outputs should ma

[PULL 4/6] hw/display/artist: rewrite vram access mode handling

2022-02-02 Thread Helge Deller
From: Sven Schnelle When writing this code it was assumed that register 0x118000 is the buffer access mode for color map accesses. It turned out that this is wrong. Instead register 0x118000 sets both src and dst buffer access mode at the same time. This required a larger rewrite of the code. Th

Re: [RFC PATCH v3 3/3] target/ppc: Fix gen_priv_exception error value in mfspr/mtspr

2022-02-02 Thread Fabiano Rosas
matheus.fe...@eldorado.org.br writes: > From: Matheus Ferst > > The code in linux-user/ppc/cpu_loop.c expects POWERPC_EXCP_PRIV > exception with error POWERPC_EXCP_PRIV_OPC or POWERPC_EXCP_PRIV_REG, > while POWERPC_EXCP_INVAL_SPR is expected in POWERPC_EXCP_INVAL > exceptions. This mismatch cause

[PULL 2/6] hw/hppa: Allow up to 16 emulated CPUs

2022-02-02 Thread Helge Deller
This brings the hppa_hardware.h file in sync with the copy in the SeaBIOS-hppa sources. In order to support up to 16 CPUs, it's required to move the HPA for MEMORY_HPA out of the address space of the new 16th CPU. The new address of 0xf000 worked well for Linux and HP-UX, while other addresses

[PATCH v2] Fix %#0 misuses

2022-02-02 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Joe Perches pointed out on lkml [1] that the format special %# (which adds 0x) is included in the character count, i.e.: printf("0: %#08x\n0: %#08x\n", 0xabcdef01,1); gives: 0: 0xabcdef01 0: 0x01 rather than padding to the expected 8 data characters. Replac

[PULL 3/6] hppa: Add support for an emulated TOC/NMI button.

2022-02-02 Thread Helge Deller
Almost all PA-RISC machines have either a button that is labeled with 'TOC' or a BMC/GSP function to trigger a TOC. TOC is a non-maskable interrupt that is sent to the processor. This can be used for diagnostic purposes like obtaining a stack trace/register dump or to enter KDB/KGDB in Linux. Th

Re: [PATCH v6 2/3] spapr: nvdimm: Implement H_SCM_FLUSH hcall

2022-02-02 Thread Daniel Henrique Barboza
On 2/1/22 18:57, Shivaprasad G Bhat wrote: The patch adds support for the SCM flush hcall for the nvdimm devices. To be available for exploitation by guest through the next patch. The hcall is applicable only for new SPAPR specific device class which is also introduced in this patch. The hcal

Re: [PATCH] hw/i2c: flatten pca954x mux device

2022-02-02 Thread Peter Maydell
On Wed, 2 Feb 2022 at 17:36, Patrick Venture wrote: > Just saw your reply, and found a bunch of other non-spam in my > spam folder. I sent the message to the anti-spam team, hopefully > that'll resolve this for myself and presumably others. I dunno if you folk get a specially tuned version or ju

Re: [PATCH v6 21/33] block: move BQL logic of bdrv_co_invalidate_cache in bdrv_activate

2022-02-02 Thread Kevin Wolf
Am 02.02.2022 um 18:27 hat Paolo Bonzini geschrieben: > On 1/27/22 12:03, Kevin Wolf wrote: > > > +int coroutine_fn bdrv_co_invalidate_cache(BlockDriverState *bs, Error > > > **errp) > > > +{ > > > +Error *local_err = NULL; > > > + > > > +if (bs->drv->bdrv_co_invalidate_cache) { > > > +

[PULL 0/6] hppa target updates and fixes

2022-02-02 Thread Helge Deller
The following changes since commit 91f5f7a5df1fda8c34677a7c49ee8a4bb5b56a36: Merge remote-tracking branch 'remotes/lvivier-gitlab/tags/linux-user-for-7.0-pull-request' into staging (2022-01-12 11:51:47 +) are available in the Git repository at: https://github.com/hdeller/qemu-hppa.git

Re: [PATCH v3 04/11] 9p: darwin: Handle struct dirent differences

2022-02-02 Thread Will Cohen
This makes sense! Much appreciated, will revise. On Wed, Feb 2, 2022 at 12:37 PM Christian Schoenebeck < qemu_...@crudebyte.com> wrote: > On Mittwoch, 2. Februar 2022 16:07:09 CET Will Cohen wrote: > > Does the version proposed in v3 address the V9fsFidState issues? In 9p.c > > for v2 to v3, we p

Re: [PATCH v3 03/11] 9p: darwin: Handle struct stat(fs) differences

2022-02-02 Thread Christian Schoenebeck
On Freitag, 28. Januar 2022 01:56:03 CET Will Cohen wrote: > From: Keno Fischer > > Signed-off-by: Keno Fischer > Signed-off-by: Michael Roitzsch > [Will Cohen: - Note lack of f_namelen and f_frsize on Darwin] > Signed-off-by: Will Cohen > --- > hw/9pfs/9p-proxy.c | 18 +++--- > h

[PULL 6/6] hw/display/artist: Fix draw_line() artefacts

2022-02-02 Thread Helge Deller
From: Sven Schnelle The draw_line() function left artefacts on the screen because it was using the x/y variables which were incremented in the loop before. Fix it by using the unmodified x1/x2 variables instead. Signed-off-by: Sven Schnelle Signed-off-by: Helge Deller Cc: qemu-sta...@nongnu.or

[PULL 5/6] hw/display/artist: Mouse cursor fixes for HP-UX

2022-02-02 Thread Helge Deller
This patch fix the behaviour and positioning of the X11 mouse cursor in HP-UX. The current code missed to subtract the offset of the CURSOR_CTRL register from the current mouse cursor position. The HP-UX graphics driver stores in this register the offset of the mouse graphics compared to the curre

Re: [PATCH 10/12] block.c: add subtree_drains where needed

2022-02-02 Thread Paolo Bonzini
On 2/2/22 16:37, Emanuele Giuseppe Esposito wrote: So we have disk B with backing file C, and new disk A that wants to have backing file C. I think I understand what you mean, so in theory the operation would be - create new child - add child to A->children list - add child to C->parents list S

Re: [PATCH v3 04/11] 9p: darwin: Handle struct dirent differences

2022-02-02 Thread Christian Schoenebeck
On Mittwoch, 2. Februar 2022 16:07:09 CET Will Cohen wrote: > Does the version proposed in v3 address the V9fsFidState issues? In 9p.c > for v2 to v3, we propose > > -return telldir(fidp->fs.dir.stream); > +return v9fs_co_telldir(pdu, fidp); > > and in codir.c from v2 to v3 we propose > -

Re: [PATCH] hw/i2c: flatten pca954x mux device

2022-02-02 Thread Philippe Mathieu-Daudé via
On 2/2/22 17:40, Patrick Venture wrote: Philippe, I0202 08:29:45.380384  6641 stream.go:31] qemu: child buses at "pca9546": "channel[*]", "channel[*]", "channel[*]", "channel[*]" Ok, so that's interesting.  In one system (using qom-list) it's correct, but then when using it

Re: [PATCH v6 21/33] block: move BQL logic of bdrv_co_invalidate_cache in bdrv_activate

2022-02-02 Thread Paolo Bonzini
On 1/27/22 12:03, Kevin Wolf wrote: +int coroutine_fn bdrv_co_invalidate_cache(BlockDriverState *bs, Error **errp) +{ +Error *local_err = NULL; + +if (bs->drv->bdrv_co_invalidate_cache) { +bs->drv->bdrv_co_invalidate_cache(bs, &local_err); +if (local_err) { +bs

Re: [PATCH v5 03/18] pci: isolated address space for PCI bus

2022-02-02 Thread Alex Williamson
On Wed, 2 Feb 2022 09:30:42 + Peter Maydell wrote: > On Tue, 1 Feb 2022 at 23:51, Alex Williamson > wrote: > > > > On Tue, 1 Feb 2022 21:24:08 + > > Jag Raman wrote: > > > The PCIBus data structure already has address_space_mem and > > > address_space_io to contain the BAR regions of

Re: [PATCH v3 1/1] virtio: fix the condition for iommu_platform not supported

2022-02-02 Thread Michael S. Tsirkin
On Wed, Feb 02, 2022 at 05:23:53PM +0100, Halil Pasic wrote: > On Wed, 2 Feb 2022 10:24:51 -0300 > Daniel Henrique Barboza wrote: > > > On 2/1/22 22:15, Halil Pasic wrote: > > > On Tue, 1 Feb 2022 16:31:22 -0300 > > > Daniel Henrique Barboza wrote: > > > > > >> On 2/1/22 15:33, Halil Pasic wr

Re: [PATCH v6 1/3] nvdimm: Add realize, unrealize callbacks to NVDIMMDevice class

2022-02-02 Thread Daniel Henrique Barboza
On 2/1/22 18:57, Shivaprasad G Bhat wrote: A new subclass inheriting NVDIMMDevice is going to be introduced in subsequent patches. The new subclass uses the realize and unrealize callbacks. Add them on NVDIMMClass to appropriately call them as part of plug-unplug. Signed-off-by: Shivaprasad G

Re: [PATCH v5 03/18] pci: isolated address space for PCI bus

2022-02-02 Thread Michael S. Tsirkin
On Wed, Feb 02, 2022 at 08:49:33AM -0700, Alex Williamson wrote: > > Alex, what did you refer to? > > My evidence is largely by omission, but that might be that in practice > it's not used rather than explicitly forbidden. I note that the bus > master enable bit specifies: > > Bus Master E

Re: [PATCH v3 1/1] virtio: fix the condition for iommu_platform not supported

2022-02-02 Thread Halil Pasic
On Wed, 2 Feb 2022 10:24:51 -0300 Daniel Henrique Barboza wrote: > On 2/1/22 22:15, Halil Pasic wrote: > > On Tue, 1 Feb 2022 16:31:22 -0300 > > Daniel Henrique Barboza wrote: > > > >> On 2/1/22 15:33, Halil Pasic wrote: > >>> On Tue, 1 Feb 2022 12:36:25 -0300 > >>> Daniel Henrique Barboza

Re: [PATCH] hw/i2c: flatten pca954x mux device

2022-02-02 Thread Patrick Venture
On Tue, Feb 1, 2022 at 12:54 PM Patrick Venture wrote: > > > On Tue, Feb 1, 2022 at 11:02 AM Philippe Mathieu-Daudé > wrote: > >> On 1/2/22 17:30, Patrick Venture wrote: >> > Previously this device created N subdevices which each owned an i2c bus. >> > Now this device simply owns the N i2c busse

Re: [PATCH v2] 9pfs: Fix segfault in do_readdir_many caused by struct dirent overread

2022-02-02 Thread Christian Schoenebeck
On Freitag, 28. Januar 2022 23:33:26 CET Vitaly Chikunov wrote: > `struct dirent' returned from readdir(3) could be shorter than > `sizeof(struct dirent)', thus memcpy of sizeof length will overread > into unallocated page causing SIGSEGV. Example stack trace: > > #0 0x559ebeed v9fs_co_r

[PATCH v2] hw/i2c: flatten pca954x mux device

2022-02-02 Thread Patrick Venture
Previously this device created N subdevices which each owned an i2c bus. Now this device simply owns the N i2c busses directly. Tested: Verified devices behind mux are still accessible via qmp and i2c from within an arm32 SoC. Reviewed-by: Hao Wu Signed-off-by: Patrick Venture Reviewed-by: Phil

Re: [PATCH] hw/i2c: flatten pca954x mux device

2022-02-02 Thread Patrick Venture
On Wed, Feb 2, 2022 at 8:34 AM Patrick Venture wrote: > > > On Tue, Feb 1, 2022 at 12:54 PM Patrick Venture > wrote: > >> >> >> On Tue, Feb 1, 2022 at 11:02 AM Philippe Mathieu-Daudé >> wrote: >> >>> On 1/2/22 17:30, Patrick Venture wrote: >>> > Previously this device created N subdevices which

Re: [PATCH] hw/i2c: flatten pca954x mux device

2022-02-02 Thread Philippe Mathieu-Daudé via
On 1/2/22 21:54, Patrick Venture wrote: On Tue, Feb 1, 2022 at 11:02 AM Philippe Mathieu-Daudé > wrote: On 1/2/22 17:30, Patrick Venture wrote: > Previously this device created N subdevices which each owned an i2c bus. > Now this device simply owns th

Re: [PATCH v3 04/11] 9p: darwin: Handle struct dirent differences

2022-02-02 Thread Will Cohen
Does the version proposed in v3 address the V9fsFidState issues? In 9p.c for v2 to v3, we propose -return telldir(fidp->fs.dir.stream); +return v9fs_co_telldir(pdu, fidp); and in codir.c from v2 to v3 we propose -saved_dir_pos = telldir(fidp->fs.dir.stream); +saved_dir_pos

Re: [PATCH v3 1/1] virtio: fix the condition for iommu_platform not supported

2022-02-02 Thread Daniel Henrique Barboza
On 2/2/22 13:23, Halil Pasic wrote: On Wed, 2 Feb 2022 10:24:51 -0300 Daniel Henrique Barboza wrote: On 2/1/22 22:15, Halil Pasic wrote: On Tue, 1 Feb 2022 16:31:22 -0300 Daniel Henrique Barboza wrote: On 2/1/22 15:33, Halil Pasic wrote: On Tue, 1 Feb 2022 12:36:25 -0300 Daniel Henr

Re: [PATCH v1 1/1] target/i386: Mask xstate_bv based on the cpu enabled features

2022-02-02 Thread David Edmondson
On Tuesday, 2022-02-01 at 16:09:57 -03, Leonardo Brás wrote: > Hello David, thanks for this feedback! > > On Mon, 2022-01-31 at 12:53 +, David Edmondson wrote: >> On Saturday, 2022-01-29 at 06:46:45 -03, Leonardo Bras wrote: >> >> > The following steps describe a migration bug: >> > 1 - Bring

  1   2   >