Re: [RFC PATCH 1/3] net: Pad short frames to minimum size (60 bytes)

2021-02-26 Thread Bin Meng
On Sat, Feb 27, 2021 at 2:57 AM Peter Maydell wrote: > > On Fri, 26 Feb 2021 at 10:03, Bin Meng wrote: > > > > From: Bin Meng > > > > The minimum Ethernet frame length is 60 bytes, and we should pad > > frames whose length is smaller to the minimum size. > > > > This commit fixes the issue as se

Re: [PATCH V2 6/7] hw/block/nvme: support namespace attachment command

2021-02-26 Thread Minwoo Im
On 21-02-27 02:59:35, Keith Busch wrote: > On Thu, Feb 11, 2021 at 01:09:36AM +0900, Minwoo Im wrote: > > @@ -183,6 +183,7 @@ static const uint32_t nvme_cse_acs[256] = { > > [NVME_ADM_CMD_SET_FEATURES] = NVME_CMD_EFF_CSUPP, > > [NVME_ADM_CMD_GET_FEATURES] = NVME_CMD_EFF_CSUPP, > >

Re: Can not set high msize with virtio-9p (Was: Re: virtiofs vs 9p performance)

2021-02-26 Thread Dominique Martinet
Christian Schoenebeck wrote on Fri, Feb 26, 2021 at 02:49:12PM +0100: > Right now the client uses a hard coded amount of 128 elements. So what about > replacing VIRTQUEUE_NUM by a variable which is initialized with a value > according to the user's requested 'msize' option at init time? > > Accord

Re: [PATCH 1/2] Acceptance Tests: restore downloading of VM images

2021-02-26 Thread Cleber Rosa
On Fri, Feb 26, 2021 at 01:01:28AM +0100, Philippe Mathieu-Daudé wrote: > On 2/26/21 12:21 AM, Cleber Rosa wrote: > > The "get-vm-images" target defined in tests/Makefile.include is a > > prerequisite for "check-acceptance", so that those files get > > downloaded before the Avocado job even starts.

Re: [PATCH v2 31/31] qom: Drop QemuOpts based interfaces

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > user_creatable_add_opts() has only a single user left, which is a test > case. Rewrite the test to use user_creatable_add_type() instead (which > is the remaining function that doesn't require a QAPI schema) and drop > the QemuOpts related functions. > > Sig

Re: [PATCH v2 30/31] vl: QAPIfy -object

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This switches the system emulator from a QemuOpts-based parser for > -object to user_creatable_parse_str() which uses a keyval parser and > enforces the QAPI schema. > > Apart from being a cleanup, this makes non-scalar properties accessible. > > This adopt

Re: [PATCH v2 29/31] qom: Add user_creatable_parse_str()

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > The system emulator has a more complicated way of handling command line > options in that it reorders options before it processes them. This means > that parsing object options and creating the object happen at two > different points. Split the parsing part i

Re: [PATCH v2 28/31] hmp: QAPIfy object_add

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This switches the HMP command object_add from a QemuOpts-based parser to > user_creatable_add_from_str() which uses a keyval parser and enforces > the QAPI schema. > > Apart from being a cleanup, this makes non-scalar properties and help > accessible. In ord

Re: [PATCH v2 27/31] qom: Add user_creatable_add_from_str()

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This is a version of user_creatable_process_cmdline() with an Error > parameter that never calls exit() and is therefore usable in HMP. > > Signed-off-by: Kevin Wolf > --- > include/qom/object_interfaces.h | 16 > qom/object_interfaces.c

Re: [RFC PATCH 2/2] hw/mips/jazz: Remove confusing ifdef'ry

2021-02-26 Thread Richard Henderson
On 2/26/21 5:27 AM, Philippe Mathieu-Daudé wrote: > @@ -211,10 +209,8 @@ static void mips_jazz_init(MachineState *machine, > * memory region that catches all memory accesses, as we do on Malta. > */ > cc = CPU_GET_CLASS(cpu); > -#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)

Re: [PATCH v2 26/31] qemu-nbd: Use user_creatable_process_cmdline() for --object

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This switches qemu-nbd from a QemuOpts-based parser for --object to > user_creatable_process_cmdline() which uses a keyval parser and enforces > the QAPI schema. > > Apart from being a cleanup, this makes non-scalar properties accessible. > > Signed-off-by:

Re: [PATCH v2 25/31] qemu-img: Use user_creatable_process_cmdline() for --object

2021-02-26 Thread Eric Blake
On 2/26/21 3:56 PM, Eric Blake wrote: > On 2/24/21 7:52 AM, Kevin Wolf wrote: >> This switches qemu-img from a QemuOpts-based parser for --object to >> user_creatable_process_cmdline() which uses a keyval parser and enforces >> the QAPI schema. >> >> Apart from being a cleanup, this makes non-scala

[PATCH] meson: add tests option

2021-02-26 Thread Romain Naour
tests/fp/fp-bench.c use fenv.h that is not always provided by the libc (uClibc). To workaround this issue, add an new meson option to disable tests while building Qemu. Fixes: http://autobuild.buildroot.net/results/53f5d8baa994d599b9da013ee643b82353366ec3/build-end.log Signed-off-by: Romain Naou

Re: [PATCH v2 25/31] qemu-img: Use user_creatable_process_cmdline() for --object

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This switches qemu-img from a QemuOpts-based parser for --object to > user_creatable_process_cmdline() which uses a keyval parser and enforces > the QAPI schema. > > Apart from being a cleanup, this makes non-scalar properties accessible. > > Signed-off-by:

Re: [PATCH v2 24/31] qemu-io: Use user_creatable_process_cmdline() for --object

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This switches qemu-io from a QemuOpts-based parser for --object to > user_creatable_process_cmdline() which uses a keyval parser and enforces > the QAPI schema. > > Apart from being a cleanup, this makes non-scalar properties accessible. > > Signed-off-by:

Re: [PATCH v2 23/31] qom: Factor out user_creatable_process_cmdline()

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > The implementation for --object can be shared between > qemu-storage-daemon and other binaries, so move it into a function in > qom/object_interfaces.c that is accessible from everywhere. > > This also requires moving the implementation of qmp_object_add() i

Re: vhost reply_ack negotiation (a.k.a differences in vhost-user behaviour with libvhost-user and vhost-user-backend.rs)

2021-02-26 Thread Raphael Norwitz
As an afterthought - if VHOST_USER_F_PROTOCOL_FEATURES is indeed unset, the issue may well be caused by QEMU reading an uninitialized value for dev->protocol_features. Some device types like cryptodev explicitly zero it out. As I said, it isn't set anywhere else in the source and If dev->protocol_f

Re: [PATCH v2 22/31] qom: Remove user_creatable_add_dict()

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This function is now unused and can be removed. > > Signed-off-by: Kevin Wolf > --- > include/qom/object_interfaces.h | 18 -- > qom/object_interfaces.c | 32 > 2 files changed, 50 deletions(-) > R

Re: [PATCH v2 21/31] qemu-storage-daemon: Implement --object with qmp_object_add()

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This QAPIfies --object and ensures that QMP and the command line option > behave the same. > > Signed-off-by: Kevin Wolf > --- > storage-daemon/qemu-storage-daemon.c | 21 ++--- > 1 file changed, 10 insertions(+), 11 deletions(-) > Review

Re: [PATCH v2 20/31] qom: Make "object" QemuOptsList optional

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This code is going away anyway, but for a few more commits, we'll be in > a state where some binaries still use QemuOpts and others don't. If the > "object" QemuOptsList doesn't even exist, we don't have to remove (or > fail to remove, and therefore abort) a

Re: [PATCH v2 19/31] qapi/qom: QAPIfy object-add

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This converts object-add from 'gen': false to the ObjectOptions QAPI > type. As an immediate benefit, clients can now use QAPI schema > introspection for user creatable QOM objects. > > It is also the first step towards making the QAPI schema the only > exte

Re: [PATCH v2 18/31] qapi/qom: Add ObjectOptions for x-remote-object

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the x-remote-object > object. > > Signed-off-by: Kevin Wolf > --- > qapi/qom.json | 20 ++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > > diff --git a/qapi/qom.json b/qapi/qom.json >

Re: [PATCH v2 17/31] qapi/qom: Add ObjectOptions for input-*

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the input-* objects. > > ui.json cannot be included in qom.json because the storage daemon can't > use it, so move GrabToggleKeys to common.json. > > Signed-off-by: Kevin Wolf > --- > qapi/common.json | 12 +++

Re: [PATCH v2 16/31] qapi/qom: Add ObjectOptions for confidential-guest-support

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the objects implementing > the confidential-guest-support interface. > > pef-guest and s390x-pv-guest don't have any properties, so they only > need to be added to the ObjectType enum without adding a new branch

Re: [PATCH v2 15/31] qapi/qom: Add ObjectOptions for pr-manager-helper

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the pr-manager-helper > object. > > Signed-off-by: Kevin Wolf > --- > qapi/qom.json | 14 ++ > 1 file changed, 14 insertions(+) > > diff --git a/qapi/qom.json b/qapi/qom.json > index e3357f5123..e7

Re: [PATCH v2 14/31] qapi/qom: Add ObjectOptions for filter-*

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the filter-* objects. > > Some parts of the interface (in particular NetfilterProperties.position) > are very unusual for QAPI, but for now just describe the existing > interface. > > net.json can't be included

[Bug 1917085] [NEW] [OSS-Fuzz] Issue 30588 pcnet: Loopback-related stack-overflow

2021-02-26 Thread Alexander Bulekov
Public bug reported: === Reproducer === cat << EOF | ./qemu-system-i386 -display none -machine accel=qtest, -m \ 512M -machine q35 -nodefaults -device pcnet,netdev=net0 -netdev \ user,id=net0 -qtest /dev/null -qtest stdio outl 0xcf8 0x8810 outl 0xcfc 0xc001 outl 0xcf8 0x8804 outw 0xcfc 0x7

Re: vhost reply_ack negotiation (a.k.a differences in vhost-user behaviour with libvhost-user and vhost-user-backend.rs)

2021-02-26 Thread Raphael Norwitz
There are two sets of features being negotiated - virtio and vhost-user. Based on what you've posted here, I suspect the VHOST_USER_F_PROTOCOL_FEATURES virtio feature may not be negotiated by the backend, preventing the vhost-user protocol feature negotiation from happening at all. I'm not 100% su

Re: [PATCH v2 13/31] qapi/qom: Add ObjectOptions for colo-compare

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the colo-compare object. > > Signed-off-by: Kevin Wolf > --- > qapi/qom.json | 49 + > 1 file changed, 49 insertions(+) > > diff --git a/qapi/qom.json b/qapi/qom

Re: [PATCH v2 12/31] qapi/qom: Add ObjectOptions for can-*

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the can-* objects. > > can-bus doesn't have any properties, so it only needs to be added to the > ObjectType enum without adding a new branch to ObjectOptions. I somewhat prefer 'can-bus': {}, to make it expli

[Bug 1917082] [NEW] [OSS-Fuzz] Issue 27574 e1000: Loopback-related stack-overflow

2021-02-26 Thread Alexander Bulekov
Public bug reported: === Reproducer === cat << EOF | ./qemu-system-i386 -display none -machine accel=qtest, -m \ 512M -M q35 -nodefaults -device e1000,netdev=net0 -netdev user,id=net0 \ -qtest /dev/null -qtest stdio outl 0xcf8 0x8813 outl 0xcfc 0xfe outl 0xcf8 0x8803 outw 0xcfc 0x0600 writ

Re: [PATCH v2 11/31] qapi/qom: Add ObjectOptions for tls-*, deprecate 'loaded'

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the tls-* objects. > > The 'loaded' property doesn't seem to make sense as an external > interface: It is automatically set to true in ucc->complete, and > explicitly setting it to true earlier just means that ad

Re: [PATCH v2 10/31] qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded'

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the secret* objects. > > The 'loaded' property doesn't seem to make sense as an external > interface: It is automatically set to true in ucc->complete, and > explicitly setting it to true earlier just means that

[PATCH] rtl8193: switch to use qemu_receive_packet() for loopback

2021-02-26 Thread Alexander Bulekov
This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Buglink: https://bugs.launchpad.net/qemu/+bug/1910826 Signed-off-by: Alexander Bulekov --- Although it's not a nc->info->receive() call, maybe this can also go in this series? -Alex hw/net/rtl8139.c

Re: [RFC PATCH 1/3] net: Pad short frames to minimum size (60 bytes)

2021-02-26 Thread Peter Maydell
On Fri, 26 Feb 2021 at 10:03, Bin Meng wrote: > > From: Bin Meng > > The minimum Ethernet frame length is 60 bytes, and we should pad > frames whose length is smaller to the minimum size. > > This commit fixes the issue as seen with various ethernet models, > that ARP requests get dropped, preven

Re: [QEMU-SECURITY] [PATCH 1/6] net: introduce qemu_receive_packet()

2021-02-26 Thread Alexander Bulekov
On 210226 1814, P J P wrote: > Hello Alex, > > On Thursday, 25 February, 2021, 10:00:33 pm IST, Alexander Bulekov > wrote:  > On 210225 1128, Alexander Bulekov wrote: > > On 210225 1931, P J P wrote: > > > +-- On Wed, 24 Feb 2021, Philippe Mathieu-Daudé wrote --+ > > > | On 2/24/21 2:17 PM, Jaso

Re: [PATCH v25 14/20] i386: separate fpu_helper into user and sysemu parts

2021-02-26 Thread Richard Henderson
On 2/26/21 9:51 AM, Claudio Fontana wrote: > +/* fpu_helper.c */ > + > +void do_fsave(CPUX86State *env, target_ulong ptr, int data32, uintptr_t ra); > +void do_frstor(CPUX86State *env, target_ulong ptr, int data32, uintptr_t ra); > +void do_fxsave(CPUX86State *env, target_ulong ptr, uintptr_t ra);

Re: [PATCH v25 13/20] i386: split misc helper user stubs and sysemu part

2021-02-26 Thread Richard Henderson
On 2/26/21 9:51 AM, Claudio Fontana wrote: > Signed-off-by: Claudio Fontana > --- > target/i386/tcg/misc_helper.c| 463 --- > target/i386/tcg/sysemu/misc_helper.c | 438 + > target/i386/tcg/user/misc_stubs.c| 75 + > target/i386/tcg

Re: [PATCH v25 00/20] i386 cleanup PART 2

2021-02-26 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20210226175143.22388-1-cfont...@suse.de/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210226175143.22388-1-cfont...@suse.de Subject: [PATCH v25 00/20] i386 cleanup PART 2 === T

Re: [PATCH v2 0/5] target/sh4: Pass MMUAccessType to get_physical_address()

2021-02-26 Thread Philippe Mathieu-Daudé
On 2/18/21 3:51 PM, Philippe Mathieu-Daudé wrote: > Taking notes while reviewing commit 671a0a1265a > ("use MMUAccessType instead of int in mmu_translate"). > Philippe Mathieu-Daudé (5): > target/sh4: Fix code style for checkpatch.pl > target/sh4: Replace magic value by MMUAccessType definitio

Re: [PATCH v4 0/8] hw/sh4: Kconfig cleanups

2021-02-26 Thread Philippe Mathieu-Daudé
On 2/22/21 3:15 PM, Philippe Mathieu-Daudé wrote: > Philippe Mathieu-Daudé (8): > hw/sh4: Add missing license > hw/sh4: Add missing Kconfig dependency on SH7750 for the R2D board > hw/intc: Introduce SH_INTC Kconfig entry > hw/char: Introduce SH_SCI Kconfig entry > hw/timer: Introduce SH

[PATCH v25 11/20] i386: split tcg excp_helper into sysemu and user parts

2021-02-26 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson --- target/i386/tcg/excp_helper.c| 572 -- target/i386/tcg/sysemu/excp_helper.c | 581 +++ target/i386/tcg/user/excp_helper.c | 39 ++ target/i386/tcg/sysemu/meson.build |

Re: [QEMU-SECURITY] [PATCH 1/6] net: introduce qemu_receive_packet()

2021-02-26 Thread P J P
Hello Alex, On Thursday, 25 February, 2021, 10:00:33 pm IST, Alexander Bulekov wrote:  On 210225 1128, Alexander Bulekov wrote: > On 210225 1931, P J P wrote: > > +-- On Wed, 24 Feb 2021, Philippe Mathieu-Daudé wrote --+ > > | On 2/24/21 2:17 PM, Jason Wang wrote: > > | > On 2021/2/24 6:11 下午, P

[PATCH v25 20/20] i386: make cpu_load_efer sysemu-only

2021-02-26 Thread Claudio Fontana
cpu_load_efer is now used only for sysemu code. Therefore, move this function implementation to sysemu-only section of helper.c Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson --- target/i386/cpu.h| 20 +--- target/i386/helper.c | 13 + 2 files cha

[PATCH v25 16/20] i386: split seg_helper into user-only and sysemu parts

2021-02-26 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson --- target/i386/tcg/helper-tcg.h| 5 + target/i386/tcg/seg_helper.h| 66 target/i386/tcg/seg_helper.c| 233 +--- target/i386/tcg/sysemu/seg_helper.c | 125 +++ ta

[PATCH v25 18/20] target/i386: gdbstub: introduce aux functions to read/write CS64 regs

2021-02-26 Thread Claudio Fontana
a number of registers are read as 64bit under the condition that (hflags & HF_CS64_MASK) || TARGET_X86_64) and a number of registers are written as 64bit under the condition that (hflags & HF_CS64_MASK). Provide some auxiliary functions that do that. Signed-off-by: Claudio Fontana Cc: Paolo Bon

[PATCH v25 12/20] i386: move TCG bpt_helper into sysemu/

2021-02-26 Thread Claudio Fontana
for user-mode, assert that the hidden IOBPT flags are not set while attempting to generate io_bpt helpers. Signed-off-by: Claudio Fontana Cc: Paolo Bonzini Reviewed-by: Richard Henderson --- target/i386/helper.h| 7 + target/i386/tcg/helper-tcg.h| 3 + target/i386/t

[PATCH v25 14/20] i386: separate fpu_helper into user and sysemu parts

2021-02-26 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- target/i386/cpu.h | 3 ++ target/i386/tcg/helper-tcg.h| 7 +++ target/i386/tcg/fpu_helper.c| 77 +++-- target/i386/tcg/sysemu/fpu_helper.c | 57 + target/i386/tcg/user/fpu_helper.c

[PATCH v25 09/20] i386: split off sysemu-only functionality in tcg-cpu

2021-02-26 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson --- target/i386/tcg/tcg-cpu.h | 24 + target/i386/tcg/sysemu/tcg-cpu.c | 83 ++ target/i386/tcg/tcg-cpu.c | 75 ++- target/i386/tcg/meson.build|

[PATCH v25 15/20] i386: split svm_helper into sysemu and stub-only user

2021-02-26 Thread Claudio Fontana
For now we just copy over the previous user stubs, but really, everything that requires s->cpl == 0 should be impossible to trigger from user-mode emulation. Later on we should add a check that asserts this easily f.e.: static bool check_cpl0(DisasContext *s) { int cpl = s->cpl; #ifdef CON

[PATCH v25 08/20] meson: add target_user_arch

2021-02-26 Thread Claudio Fontana
the lack of target_user_arch makes it hard to fully leverage the build system in order to separate user code from sysemu code. Provide it, so that we can avoid the proliferation of #ifdef in target code. Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée [claudio: added changes for new ta

[PATCH v25 17/20] i386: split off sysemu part of cpu.c

2021-02-26 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson --- target/i386/cpu-internal.h | 70 +++ target/i386/cpu-sysemu.c | 352 + target/i386/cpu.c | 385 + target/i386/meson.build| 1 + 4 files chan

Re: [PATCH V2 6/7] hw/block/nvme: support namespace attachment command

2021-02-26 Thread Keith Busch
On Thu, Feb 11, 2021 at 01:09:36AM +0900, Minwoo Im wrote: > @@ -183,6 +183,7 @@ static const uint32_t nvme_cse_acs[256] = { > [NVME_ADM_CMD_SET_FEATURES] = NVME_CMD_EFF_CSUPP, > [NVME_ADM_CMD_GET_FEATURES] = NVME_CMD_EFF_CSUPP, > [NVME_ADM_CMD_ASYNC_EV_REQ] = NVME_CMD_EF

[PATCH v25 13/20] i386: split misc helper user stubs and sysemu part

2021-02-26 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- target/i386/tcg/misc_helper.c| 463 --- target/i386/tcg/sysemu/misc_helper.c | 438 + target/i386/tcg/user/misc_stubs.c| 75 + target/i386/tcg/sysemu/meson.build | 1 + target/i386/tcg/user/mes

[PATCH v25 10/20] i386: split smm helper (sysemu)

2021-02-26 Thread Claudio Fontana
smm is only really useful for sysemu, split in two modules around the CONFIG_USER_ONLY, in order to remove the ifdef and use the build system instead. add cpu_abort() when detecting attempts to enter SMM mode via SMI interrupt in user-mode, and assert that the cpu is not in SMM mode while translat

[PATCH v25 19/20] target/i386: gdbstub: only write CR0/CR2/CR3/EFER for sysemu

2021-02-26 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Cc: Paolo Bonzini Reviewed-by: Richard Henderson --- target/i386/gdbstub.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/target/i386/gdbstub.c b/target/i386/gdbstub.c index 4ad1295425..098a2ad15a 100644 --- a/target/i386/gdbstub.c +++ b/target/i3

[PATCH v25 03/20] i386: split cpu accelerators from cpu.c, using AccelCPUClass

2021-02-26 Thread Claudio Fontana
i386 is the first user of AccelCPUClass, allowing to split cpu.c into: cpu.ccpuid and common x86 cpu functionality host-cpu.c host x86 cpu functions and "host" cpu type kvm/kvm-cpu.cKVM x86 AccelCPUClass hvf/hvf-cpu.cHVF x86 AccelCPUClass tcg/tcg-cpu.cTCG x86 AccelCPU

[PATCH v25 07/20] accel-cpu: make cpu_realizefn return a bool

2021-02-26 Thread Claudio Fontana
overall, all devices' realize functions take an Error **errp, but return void. hw/core/qdev.c code, which realizes devices, therefore does: local_err = NULL; dc->realize(dev, &local_err); if (local_err != NULL) { goto fail; } However, we can improve at least accel_cpu to return a meaningful

[PATCH v25 06/20] target/i386: fix host_cpu_adjust_phys_bits error handling

2021-02-26 Thread Claudio Fontana
move the check for phys_bits outside of host_cpu_adjust_phys_bits, because otherwise it is impossible to return an error condition explicitly. Signed-off-by: Claudio Fontana Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- target/i386/host-cpu.c

[PATCH v25 05/20] accel: introduce new accessor functions

2021-02-26 Thread Claudio Fontana
avoid open coding the accesses to cpu->accel_cpu interfaces, and instead introduce: accel_cpu_instance_init, accel_cpu_realizefn to be used by the targets/ initfn code, and by cpu_exec_realizefn respectively. Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée Reviewed-by: Richard Henderso

[PATCH v25 04/20] cpu: call AccelCPUClass::cpu_realizefn in cpu_exec_realizefn

2021-02-26 Thread Claudio Fontana
move the call to accel_cpu->cpu_realizefn to the general cpu_exec_realizefn from target/i386, so it does not need to be called for every target explicitly as we enable more targets. Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- cpu.c |

[PATCH v25 00/20] i386 cleanup PART 2

2021-02-26 Thread Claudio Fontana
v24 -> v25: * i386: separate fpu_helper into user and sysemu parts - added 2 preliminary patches to the series (from Richard) - rebased on those * i386: move TCG btp_helper into sysemu/ - fixed title typo (Alex) - nested #ifdef more easily (Richard) v23 -> v24: * i386: gdbstub: only write

[PATCH v25 02/20] target/i386: Split out do_fsave, do_frstor, do_fxsave, do_fxrstor

2021-02-26 Thread Claudio Fontana
From: Richard Henderson The helper_* functions must use GETPC() to unwind from TCG. The cpu_x86_* functions cannot, and directly calling the helper_* functions is a bug. Split out new functions that perform the work and can be used by both. Signed-off-by: Richard Henderson Reviewed-by: Philipp

[PATCH v25 01/20] target/i386: Rename helper_fldt, helper_fstt

2021-02-26 Thread Claudio Fontana
From: Richard Henderson Change the prefix from "helper" to "do". The former should be reserved for those functions that are called from TCG; the latter is in use within the file already for those functions that are called from the helper functions, adding a "retaddr" argument. Signed-off-by: Ri

Re: [PATCH v2] qemu-config: add error propagation to qemu_config_parse

2021-02-26 Thread Philippe Mathieu-Daudé
On 2/26/21 6:08 PM, Paolo Bonzini wrote: > This enables some simplification of vl.c via error_fatal, and improves > error messages. Before: > > Before: > $ ./qemu-system-x86_64 -readconfig . > qemu-system-x86_64: error reading file > qemu-system-x86_64: -readconfig .: read config .: Invalid

target/arm: "define_arm_cp_regs" and similar for KVM

2021-02-26 Thread Claudio Fontana
Hi Peter, I am trying to find out how to split properly KVM and TCG in target/arm, among other things. I skipped or stubbed all define_arm_cp_regs and similar functions, and made a cpregs module that is TCG-only. Thought it is fine, as we have a kvm_arm_init_cpreg_list that throws away everyt

Re: [PATCH v2 09/31] qapi/qom: Add ObjectOptions for throttle-group

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the throttle-group object. > > The only purpose of the x-* properties is to make the nested options in > 'limits' available for a command line parser that doesn't support > structs. Any parser that will use the Q

Re: [PATCH 0/2] target/i386: Fix cpu_x86_{fsave,frstor,fxsave,fxrstor}

2021-02-26 Thread Paolo Bonzini
On 26/02/21 17:59, Claudio Fontana wrote: On 2/26/21 5:20 PM, Richard Henderson wrote: As discussed during review of Claudio's "i386 cleanup" patch set. r~ Richard Henderson (2): target/i386: Rename helper_fldt, helper_fstt target/i386: Split out do_fsave, do_frstor, do_fxsave, do_fxrs

Re: [PATCH v2 08/31] qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened'

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the rng-* objects. > > The 'opened' property doesn't seem to make sense as an external > interface: It is automatically set to true in ucc->complete, and > explicitly setting it to true earlier just means that tr

Re: [PATCH 0/2] target/i386: Fix cpu_x86_{fsave,frstor,fxsave,fxrstor}

2021-02-26 Thread Claudio Fontana
On 2/26/21 6:12 PM, Paolo Bonzini wrote: > On 26/02/21 17:59, Claudio Fontana wrote: >> On 2/26/21 5:20 PM, Richard Henderson wrote: >>> As discussed during review of Claudio's "i386 cleanup" patch set. >>> >>> >>> r~ >>> >>> >>> Richard Henderson (2): >>>target/i386: Rename helper_fldt, helper

Re: [PATCH 2/2] target/i386: Split out do_fsave, do_frstor, do_fxsave, do_fxrstor

2021-02-26 Thread Philippe Mathieu-Daudé
On 2/26/21 5:20 PM, Richard Henderson wrote: > The helper_* functions must use GETPC() to unwind from TCG. > The cpu_x86_* functions cannot, and directly calling the > helper_* functions is a bug. Split out new functions that > perform the work and can be used by both. > > Signed-off-by: Richard

[PATCH v2] qemu-config: add error propagation to qemu_config_parse

2021-02-26 Thread Paolo Bonzini
This enables some simplification of vl.c via error_fatal, and improves error messages. Before: Before: $ ./qemu-system-x86_64 -readconfig . qemu-system-x86_64: error reading file qemu-system-x86_64: -readconfig .: read config .: Invalid argument $ /usr/libexec/qemu-kvm -readconfig foo q

Re: [PATCH v5 1/5] hw/dma: xlnx_csu_dma: Implement a Xilinx CSU DMA model

2021-02-26 Thread Edgar E. Iglesias
On Wed, Feb 24, 2021 at 08:50:20PM +0800, Bin Meng wrote: > From: Xuzhou Cheng > > ZynqMP QSPI supports SPI transfer using DMA mode, but currently this > is unimplemented. When QSPI is programmed to use DMA mode, QEMU will > crash. This is observed when testing VxWorks 7. > > This adds a Xilinx

Re: [PATCH 1/2] target/i386: Rename helper_fldt, helper_fstt

2021-02-26 Thread Philippe Mathieu-Daudé
On 2/26/21 5:20 PM, Richard Henderson wrote: > Change the prefix from "helper" to "do". The former should be > reserved for those functions that are called from TCG; the latter > is in use within the file already for those functions that are > called from the helper functions, adding a "retaddr" a

Re: [PATCH 0/2] target/i386: Fix cpu_x86_{fsave,frstor,fxsave,fxrstor}

2021-02-26 Thread Claudio Fontana
On 2/26/21 5:20 PM, Richard Henderson wrote: > As discussed during review of Claudio's "i386 cleanup" patch set. > > > r~ > > > Richard Henderson (2): > target/i386: Rename helper_fldt, helper_fstt > target/i386: Split out do_fsave, do_frstor, do_fxsave, do_fxrstor > > target/i386/tcg/fpu

[RFC PATCH] cpu: system_ops: move to cpu-system-ops.h, keep a pointer in CPUClass

2021-02-26 Thread Philippe Mathieu-Daudé
Similarly to commit 78271684719 ("cpu: tcg_ops: move to tcg-cpu-ops.h, keep a pointer in CPUClass"): We cannot in principle make the SysEmu Operations field definitions conditional on CONFIG_SOFTMMU in code that is included by both common_ss and specific_ss modules. Therefore, what we can do safe

[PATCH 16/16] cpu: Restrict cpu_paging_enabled / cpu_get_memory_mapping to sysemu

2021-02-26 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 47e65d517f6..29e1623f775 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -499,6 +499,8 @@ s

[PATCH 13/16] cpu: Move CPUClass::get_phys_page_debug to CPUSystemOperations

2021-02-26 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 21 + hw/core/cpu.c | 6 +++--- target/alpha/cpu.c | 2 +- target/arm/cpu.c| 2 +- target/avr/cpu.c| 2 +- target/cris/cpu.c

[PATCH 15/16] cpu: Move CPUClass::get_paging_enabled to CPUSystemOperations

2021-02-26 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 6 -- hw/core/cpu.c | 4 ++-- target/i386/cpu.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index caca5896592..47e65d517f6 100644 --- a/includ

[PATCH 5/5] spapr.c: send QAPI event when memory hotunplug fails

2021-02-26 Thread Daniel Henrique Barboza
Recent changes allowed the pSeries machine to rollback the hotunplug process for the DIMM when the guest kernel signals, via a reconfiguration of the DR connector, that it's not going to release the LMBs. Let's also warn QAPI listerners about it. One place to do it would be right after the unplug

[PATCH 11/16] cpu: Move CPUClass::write_elf* to CPUSystemOperations

2021-02-26 Thread Philippe Mathieu-Daudé
The write_elf*() handlers are used to dump vmcore images. This feature is only meaningful for system emulation. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 41 +++-- hw/core/cpu.c | 16 ++--- target/arm/cpu.c

[PATCH 12/16] cpu: Move CPUClass::asidx_from_attrs to CPUSystemOperations

2021-02-26 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 8 +--- hw/core/cpu.c | 4 ++-- target/arm/cpu.c | 2 +- target/i386/cpu.c | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index e8c2e9af3bb.

[PATCH 14/16] cpu: Move CPUClass::get_memory_mapping to CPUSystemOperations

2021-02-26 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 8 +--- hw/core/cpu.c | 4 ++-- target/i386/cpu.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5bc66653c19..caca5896592 100644 --- a/incl

[PATCH 08/16] cpu: Move CPUClass::vmsd to CPUSystemOperations

2021-02-26 Thread Philippe Mathieu-Daudé
Migration is specific to system emulation. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 6 -- cpu.c | 12 ++-- target/alpha/cpu.c | 2 +- target/arm/cpu.c| 2 +- target/avr/cpu.c|

[PATCH 10/16] cpu: Move CPUClass::get_crash_info to CPUSystemOperations

2021-02-26 Thread Philippe Mathieu-Daudé
cpu_get_crash_info() is called on GUEST_PANICKED events, which only occur in system emulation. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 6 +- hw/core/cpu.c | 4 ++-- target/i386/cpu.c | 2 +- target/s390x/cpu.c| 2 +- 4 files changed, 9 insertions(+),

[PATCH 3/5] spapr.c: add 'unplug already in progress' message for PHB unplug

2021-02-26 Thread Daniel Henrique Barboza
Both CPU hotunplug and PC_DIMM unplug reports an user warning, mentioning that the hotunplug is in progress, if consecutive 'device_del' are issued in quick succession. Do the same for PHBs in spapr_phb_unplug_request(). Signed-off-by: Daniel Henrique Barboza --- hw/ppc/spapr.c | 4 1 file

[PATCH 06/16] cpu: Directly use get_memory_mapping() fallback handlers in place

2021-02-26 Thread Philippe Mathieu-Daudé
No code uses CPUClass::get_memory_mapping() outside of hw/core/cpu.c: $ git grep -F -- '->get_memory_mapping' hw/core/cpu.c:87:cc->get_memory_mapping(cpu, list, errp); hw/core/cpu.c:439:k->get_memory_mapping = cpu_common_get_memory_mapping; target/i386/cpu.c:7422:cc->get_memory

[PATCH 4/5] spapr_pci.c: add 'unplug already in progress' message for PCI unplug

2021-02-26 Thread Daniel Henrique Barboza
Hotunplug for all other devices are warning the user when the hotunplug is already in progress. Do the same for PCI devices in spapr_pci_unplug_request(). Signed-off-by: Daniel Henrique Barboza --- hw/ppc/spapr_pci.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/ppc/spapr_pci.c b/hw

[PATCH 09/16] cpu: Move CPUClass::virtio_is_big_endian to CPUSystemOperations

2021-02-26 Thread Philippe Mathieu-Daudé
VirtIO devices are only meaningful with system emulation. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 13 - hw/core/cpu.c | 4 ++-- target/arm/cpu.c| 2 +- target/ppc/translate_init.c.inc | 2 +- 4 files changed, 12

[PATCH 2/5] spapr.c: check unplug_request flag in spapr_memory_unplug_request()

2021-02-26 Thread Daniel Henrique Barboza
Now that we're asserting the first DRC LMB earlier, use it to query if the DRC is already pending unplug and, in this case, issue the same error we already do. The previous check was introduced in commit 2a129767ebb1 and it works, but it's easier to check the unplug_requested flag instead of look

[PATCH 03/16] cpu: Introduce cpu_virtio_is_big_endian()

2021-02-26 Thread Philippe Mathieu-Daudé
Introduce the cpu_virtio_is_big_endian() generic helper to avoid calling CPUClass internal virtio_is_big_endian() one. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 9 + hw/core/cpu.c | 8 ++-- hw/virtio/virtio.c| 4 +--- 3 files changed, 16 insertions

[PATCH 07/16] cpu: Introduce CPUSystemOperations structure

2021-02-26 Thread Philippe Mathieu-Daudé
Introduce a structure to hold handler specific to sysemu. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index b12028c3c03..ab89235cb45 100644 --- a/include/hw/core/cpu.h +

[PATCH 1/5] spapr.c: assert first DRC LMB earlier in spapr_memory_unplug_request()

2021-02-26 Thread Daniel Henrique Barboza
We are asserting the existence of the first DRC LMB after sending unplug requests to all LMBs of the DIMM, where every DRC is being asserted inside the loop. This means that the first DRC is being asserted twice. We will use the first DRC to simplify the code a bit in the next patch, so instead of

[PATCH 05/16] cpu: Directly use get_paging_enabled() fallback handlers in place

2021-02-26 Thread Philippe Mathieu-Daudé
No code uses CPUClass::get_paging_enabled() outside of hw/core/cpu.c: $ git grep -F -- '->get_paging_enabled' hw/core/cpu.c:74:return cc->get_paging_enabled(cpu); hw/core/cpu.c:438:k->get_paging_enabled = cpu_common_get_paging_enabled; target/i386/cpu.c:7418:cc->get_paging_enab

[PATCH 02/16] cpu: Un-inline cpu_get_phys_page_debug and cpu_asidx_from_attrs

2021-02-26 Thread Philippe Mathieu-Daudé
To be able to later extract the cpu_get_phys_page_debug() and cpu_asidx_from_attrs() handlers from CPUClass, un-inline them from "hw/core/cpu.h". Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 33 - hw/core/cpu.c | 32 +++

[PATCH 0/5] send QAPI_EVENT_MEM_UNPLUG_ERROR for ppc64 unplugs

2021-02-26 Thread Daniel Henrique Barboza
Hi, This series is a follow-up of the existing change in ppc-for-6.0 branch in David's tree, where the pSeries machine is now detecting one case in which the memory hotunplug is rejected by the guest kernel. Initially I would like to also add a QAPI event to report a CPU unplug error, but we don'

[PATCH 04/16] cpu: Directly use cpu_write_elf*() fallback handlers in place

2021-02-26 Thread Philippe Mathieu-Daudé
No code directly accesses CPUClass::write_elf*() handlers out of hw/core/cpu.c (the rest are assignation in target/ code): $ git grep -F -- '->write_elf' hw/core/cpu.c:157:return (*cc->write_elf32_qemunote)(f, cpu, opaque); hw/core/cpu.c:171:return (*cc->write_elf32_note)(f, cpu, cpu

[PATCH 00/16] cpu: Introduce CPUSystemOperations structure

2021-02-26 Thread Philippe Mathieu-Daudé
Hi, This series is inspired on Claudio TCG work. Instead of separate TCG from other accelerators, here we separate sysemu operations (system VS user). This is part 1, overall preparation. Part 2 will make this field a pointer, similarly to commit 78271684719 ("cpu: tcg_ops: move to tcg-cpu-ops.h

[PATCH 01/16] target: Set CPUClass::vmsd instead of DeviceClass::vmsd

2021-02-26 Thread Philippe Mathieu-Daudé
The cpu model is the single device available in user-mode. Since we want to restrict some fields to user-mode emulation, we prefer to set the vmsd field of CPUClass, rather than the DeviceClass one. Signed-off-by: Philippe Mathieu-Daudé --- target/alpha/cpu.c | 2 +- target/cris/cpu.c

Re: [PATCH v2 07/31] qapi/qom: Add ObjectOptions for memory-backend-*

2021-02-26 Thread Eric Blake
On 2/24/21 7:52 AM, Kevin Wolf wrote: > This adds a QAPI schema for the properties of the memory-backend-* > objects. > > HostMemPolicy has to be moved to an include file that can be used by the > storage daemon, too, because ObjectOptions must be the same in all > binaries if we don't want to com

  1   2   3   >