Re: [PATCH 4/8] accel/tcg: Add guest_base_signed_addr32 for user-only

2021-10-13 Thread Alistair Francis
On Mon, Oct 11, 2021 at 3:52 AM Richard Henderson wrote: > > While the host may prefer to treat 32-bit addresses as signed, > there are edge cases of guests that cannot be implemented with > addresses 0x7fff_ and 0x8000_ being non-consecutive. > > Therefore, default to guest_base_signed_ad

Re: [PATCH 8/8] target/riscv: Support TCG_TARGET_SIGNED_ADDR32

2021-10-13 Thread Alistair Francis
On Mon, Oct 11, 2021 at 3:50 AM Richard Henderson wrote: > > All RV64 32-bit operations sign-extend the output, so we are easily > able to keep TCG_TYPE_I32 values sign-extended in host registers. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > tcg/riscv/t

Re: [RFC PATCH v2 04/16] softmmu/qdev-monitor: add error handling in qdev_set_id

2021-10-13 Thread Alistair Francis
On Thu, Sep 23, 2021 at 2:29 AM Damien Hedde wrote: > > qdev_set_id() is mostly used when the user adds a device (using > -device cli option or device_add qmp command). This commit adds > an error parameter to handle the case where the given id is > already taken. > > Also document the function an

Re: [RFC PATCH v2 11/16] softmmu/memory: add memory_region_try_add_subregion function

2021-10-13 Thread Alistair Francis
On Thu, Sep 23, 2021 at 2:29 AM Damien Hedde wrote: > > It allows to try to add a subregion to a memory region with error > handling. Like memory_region_add_subregion_overlap, it handles > priority as well. > Apart the error handling, the behavior is the same. It can be used > to do the simple mem

Re: [PATCH v1 2/2] memory: Update description of memory_region_is_mapped()

2021-10-13 Thread David Hildenbrand
On 12.10.21 12:09, David Hildenbrand wrote: The less confusing would be one where check works for any memory region involved. Exactly, so for any alias, even in-between another alias and the target. I am not aware of actual issues, this is rather a cleanup.

Re: [RFC PATCH v2 12/16] add x-sysbus-mmio-map qmp command

2021-10-13 Thread Alistair Francis
On Thu, Sep 23, 2021 at 2:26 AM Damien Hedde wrote: > > This command allows to map an mmio region of sysbus device onto > the system memory. Its behavior mimics the sysbus_mmio_map() > function apart from the automatic unmap (the C function unmaps > the region if it is already mapped). > For the q

Re: [PATCH v3 2/4] s390x: kvm: topology: interception of PTF instruction

2021-10-13 Thread Thomas Huth
On 16/09/2021 15.50, Pierre Morel wrote: When the host supports the CPU topology facility, the PTF instruction with function code 2 is interpreted by the SIE, provided that the userland hypervizor activates the interpretation by using the KVM_CAP_S390_CPU_TOPOLOGY KVM extension. The PTF instruct

Re: [PATCH v3 2/7] python/machine: Handle QMP errors on close more meticulously

2021-10-13 Thread Hanna Reitz
On 13.10.21 00:34, John Snow wrote: To use the AQMP backend, Machine just needs to be a little more diligent about what happens when closing a QMP connection. The operation is no longer a freebie in the async world; it may return errors encountered in the async bottom half on incoming message rec

Re: [PATCH v3 3/7] python/aqmp: Remove scary message

2021-10-13 Thread Hanna Reitz
On 13.10.21 00:34, John Snow wrote: The scary message interferes with the iotests output. Coincidentally, if iotests works by removing this, then it's good evidence that we don't really need to scare people away from using it. Signed-off-by: John Snow --- python/qemu/aqmp/__init__.py | 12 ---

Re: [PATCH v3 4/7] iotests: Accommodate async QMP Exception classes

2021-10-13 Thread Hanna Reitz
On 13.10.21 00:34, John Snow wrote: (But continue to support the old ones for now, too.) There are very few cases of any user of QEMUMachine or a subclass thereof relying on a QMP Exception type. If you'd like to check for yourself, you want to grep for all of the derivatives of QMPError, exclud

[PATCH v2 1/2] hw/core/machine: Split out the smp parsing code

2021-10-13 Thread Yanan Wang
We are going to introduce an unit test for the parser smp_parse() in hw/core/machine.c, but now machine.c is only built in softmmu. In order to solve the build dependency on the smp parsing code and avoid building unrelated stuff for the unit tests, move the tested code from machine.c into a separ

[PATCH v2 2/2] tests/unit: Add an unit test for smp parsing

2021-10-13 Thread Yanan Wang
Now that we have a generic parser smp_parse(), let's add an unit test for the code. All possible valid/invalid SMP configurations that the user can specify are covered. Signed-off-by: Yanan Wang Reviewed-by: Andrew Jones --- MAINTAINERS | 1 + tests/unit/meson.build | 1

Re: [PATCH v2 24/24] configure: automatically parse command line for meson -D options

2021-10-13 Thread Paolo Bonzini
On 12/10/21 20:15, Thomas Huth wrote: Old output with --help:  --enable-trace-backend=B Set trace backend    Available backends: nop, dtrace, ftrace, simple, stderr, ust New output:   --enable-trace-backends=CHOICE    Set available tracing

[PATCH v2 0/2] hw/core/machine: Add an unit test for smp_parse

2021-10-13 Thread Yanan Wang
Hi, This is v2 which introduces an unit test for generic smp_parse(). We have had enough discussions about what kind of SMP configurations by the user should be considered valid and what should be invalid. Since we have finished optimizing the SMP parsing code, then this test normatively listed a

Re: [PATCH v2 13/24] configure, meson: move remaining HAVE_* compiler tests to Meson

2021-10-13 Thread Paolo Bonzini
On 12/10/21 15:17, Thomas Huth wrote: @@ -1609,7 +1626,8 @@ config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles('''   return printf("%zu", SIZE_MAX);   }''', args: ['-Werror'])) -ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target +ignored = ['CONFIG_QEMU_INTERP_

Re: [PATCH v3 2/4] s390x: kvm: topology: interception of PTF instruction

2021-10-13 Thread Pierre Morel
On 10/13/21 09:25, Thomas Huth wrote: On 16/09/2021 15.50, Pierre Morel wrote: When the host supports the CPU topology facility, the PTF instruction with function code 2 is interpreted by the SIE, provided that the userland hypervizor activates the interpretation by using the KVM_CAP_S390_CPU

Re: [PATCH 00/16] fdt: Make OF_BOARD a boolean option

2021-10-13 Thread François Ozog
Hi Simon Le mer. 13 oct. 2021 à 03:35, Tom Rini a écrit : > On Wed, Oct 13, 2021 at 09:29:14AM +0800, Bin Meng wrote: > > Hi Simon, > > > > On Wed, Oct 13, 2021 at 9:01 AM Simon Glass wrote: > > > > > > With Ilias' efforts we have dropped OF_PRIOR_STAGE and OF_HOSTFILE so > > > there are only

Re: [PATCH] hw/misc: Add a virtual pci device to dynamically attach memory to QEMU

2021-10-13 Thread david.dai
On Mon, Oct 11, 2021 at 09:43:53AM +0200, David Hildenbrand (da...@redhat.com) wrote: > > > > > > virito-mem currently relies on having a single sparse memory region (anon > > > mmap, mmaped file, mmaped huge pages, mmap shmem) per VM. Although we can > > > share memory with other processes, sh

Re: [PATCH v2 1/2] hw/core/machine: Split out the smp parsing code

2021-10-13 Thread Andrew Jones
On Wed, Oct 13, 2021 at 03:41:18PM +0800, Yanan Wang wrote: > We are going to introduce an unit test for the parser smp_parse() > in hw/core/machine.c, but now machine.c is only built in softmmu. > > In order to solve the build dependency on the smp parsing code and > avoid building unrelated stuf

Re: [PATCH v2 14/24] configure, meson: move pthread_setname_np checks to Meson

2021-10-13 Thread Paolo Bonzini
On 12/10/21 15:35, Thomas Huth wrote: -# pthread probe -PTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" Looks like the variants in PTHREADLIBS_LIST were not taking into account for linking anymore since the switch to meson? Are there still recent systems around where this is needed? I gues

Re: [PATCH v3 5/7] iotests: Conditionally silence certain AQMP errors

2021-10-13 Thread Hanna Reitz
On 13.10.21 00:34, John Snow wrote: AQMP likes to be very chatty about errors it encounters. In general, this is good because it allows us to get good diagnostic information for otherwise complex async failures. For example, during a failed QMP connection attempt, we might see: +ERROR:qemu.aqmp

Re: [PATCH v3 4/4] s390x: topology: implementating Store Topology System Information

2021-10-13 Thread Thomas Huth
On 16/09/2021 15.50, Pierre Morel wrote: The handling of STSI is enhanced with the interception of the function code 15 for storing CPU topology. Using the objects built during the pluging of CPU, we build the SYSIB 15_1_x structures. With this patch the maximum MNEST level is 2, this is also t

Re: [PATCH v3 6/7] python/aqmp: Create sync QMP wrapper for iotests

2021-10-13 Thread Hanna Reitz
On 13.10.21 00:34, John Snow wrote: This is a wrapper around the async QMPClient that mimics the old, synchronous QEMUMonitorProtocol class. It is designed to be interchangeable with the old implementation. It does not, however, attempt to mimic Exception compatibility. Signed-off-by: John Snow

Question about virtio-scsi max_segments setting

2021-10-13 Thread Lin Ma
Hi all, We know that the seg_max of virtio-scsi respects to virtqueue size: scsiconf->seg_max is set to virtqueue size - 2. Some of my scsi HBAs have max_segments as low as 64 in host(max_sectors_kb is 256). When I use scsi lun passthrough disk in guest, In case of default virtqueue size(256), T

Re: [PATCH 12/13] target/riscv: Use gen_unary_per_ol for RVB

2021-10-13 Thread LIU Zhiwei
On 2021/10/8 上午1:47, Richard Henderson wrote: The count zeros instructions require a separate implementation for RV32 when TARGET_LONG_BITS == 64. Signed-off-by: Richard Henderson --- target/riscv/translate.c| 16 target/riscv/insn_trans/trans_rvb.c.inc | 33 ++

Re: [PATCH] hw/misc: Add a virtual pci device to dynamically attach memory to QEMU

2021-10-13 Thread David Hildenbrand
On 13.10.21 10:13, david.dai wrote: On Mon, Oct 11, 2021 at 09:43:53AM +0200, David Hildenbrand (da...@redhat.com) wrote: virito-mem currently relies on having a single sparse memory region (anon mmap, mmaped file, mmaped huge pages, mmap shmem) per VM. Although we can share memory with oth

Re: [PATCH v3 4/4] s390x: topology: implementating Store Topology System Information

2021-10-13 Thread Pierre Morel
On 10/13/21 10:20, Thomas Huth wrote: On 16/09/2021 15.50, Pierre Morel wrote: The handling of STSI is enhanced with the interception of the function code 15 for storing CPU topology. Using the objects built during the pluging of CPU, we build the SYSIB 15_1_x structures. With this patch th

Re: [PATCH v3 0/7] Switch iotests to using Async QMP

2021-10-13 Thread Hanna Reitz
On 13.10.21 00:34, John Snow wrote: Based-on: <20211012214152.802483-1-js...@redhat.com> [PULL 00/10] Python patches GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-aqmp-iotest-wrapper CI: https://gitlab.com/jsnow/qemu/-/pipelines/387210591 Hiya, This series continues where th

Re: [PATCH v5] Prevent vhost-user-blk-test hang

2021-10-13 Thread Michael S. Tsirkin
On Wed, Oct 13, 2021 at 06:25:33AM +, Raphael Norwitz wrote: > On Tue, Oct 05, 2021 at 10:31:06AM -0400, Michael S. Tsirkin wrote: > > On Thu, Sep 30, 2021 at 10:48:09AM +0100, Stefan Hajnoczi wrote: > > > On Thu, Sep 30, 2021 at 05:29:06AM +, Raphael Norwitz wrote: > > > > On Tue, Sep 28,

[PULL 01/40] MAINTAINERS: Add myself as reviewer of the 'Memory API'

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Having developed interest with the Memory API, volunteer to review the patches. Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Hildenbrand Message-Id: <20211007091949.319404-1-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- MAINTAINERS | 1 + 1 file ch

[PULL 09/40] target/i386/kvm: Restrict SEV stubs to x86 architecture

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé SEV is x86-specific, no need to add its stub to other architectures. Move the stub file to target/i386/kvm/. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007161716.453984-5-phi...@redhat.com> Signed-off-by: Paolo Bonzini ---

[PULL 02/40] tests: add missing dependency for check-block

2021-10-13 Thread Paolo Bonzini
qemu-iotests run qemu-storage-daemon, make sure it is up to date. Signed-off-by: Paolo Bonzini --- tests/Makefile.include | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Makefile.include b/tests/Makefile.include index 7bb8961515..cc1e4f2c07 100644 --- a/tests/Makefile.include +++ b/tes

[PULL 03/40] build: fix "make check" without earlier "make"

2021-10-13 Thread Paolo Bonzini
"make check", if not preceded by "make", will not build the tools needed by qemu-iotests. This happens because qemu-iotests, aka "make check-block", is not yet part of meson.build. While at it, remove the reference to the now-dead QEMU_IOTESTS_HELPERS-y variable. Signed-off-by: Paolo Bonzini --

[PULL 05/40] util/compatfd.c: use libc signalfd wrapper instead of raw syscall

2021-10-13 Thread Paolo Bonzini
From: Kacper Słomiński This allows the use of native signalfd instead of the sigtimedwait based emulation on systems other than Linux. Signed-off-by: Kacper Słomiński Message-Id: <20210905011621.200785-1-kacper.slominsk...@gmail.com> Signed-off-by: Paolo Bonzini --- meson.build | 7 +++---

[PULL 11/40] target/i386/monitor: Return QMP error when SEV is not enabled for guest

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé If the management layer tries to inject a secret, it gets an empty response in case the guest doesn't have SEV enabled, or the binary is built without SEV: { "execute": "sev-inject-launch-secret", "arguments": { "packet-header": "mypkt", "secret": "mypass", "gp

[PULL 04/40] qemu-iotests: flush after every test

2021-10-13 Thread Paolo Bonzini
This makes it possible to see what is happening, even if the output of "make check-block" is not sent to a tty (for example if it is sent to grep or tee). Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- tests/qemu-iotests/testrunner.py | 1 + 1 file changed, 1 insertion(+) diff

[PULL 06/40] qapi/misc-target: Wrap long 'SEV Attestation Report' long lines

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Wrap long lines before 70 characters for legibility. Suggested-by: Markus Armbruster Reviewed-by: Markus Armbruster Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007161716.453984-2-phi...@redhat.com> Signed-off-by: Paolo Bonzi

[PULL 12/40] target/i386/cpu: Add missing 'qapi/error.h' header

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Commit 00b81053244 ("target-i386: Remove assert_no_error usage") forgot to add the "qapi/error.h" for &error_abort, add it now. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-

[PULL 08/40] target/i386/kvm: Introduce i386_softmmu_kvm Meson source set

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Introduce the i386_softmmu_kvm Meson source set to be able to add features dependent on CONFIG_KVM. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007161716.453984-4-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- target/i3

[PULL 00/40] Misc patches for 2021-10-13

2021-10-13 Thread Paolo Bonzini
The following changes since commit ee26ce674a93c824713542cec3b6a9ca85459165: Merge remote-tracking branch 'remotes/jsnow/tags/python-pull-request' into staging (2021-10-12 16:08:33 -0700) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you

[PULL 17/40] target/i386/sev: Use g_autofree in sev_launch_get_measure()

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Use g_autofree to remove a pair of g_free/goto. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007161716.453984-13-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) d

[PULL 21/40] target/i386/sev: Remove stubs by using code elision

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Only declare sev_enabled() and sev_es_enabled() when CONFIG_SEV is set, to allow the compiler to elide unused code. Remove unnecessary stubs. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Blake Message-Id: <20211007161716.453984-17-phi...@redhat.com> Sign

[PULL 07/40] qapi/misc-target: Group SEV QAPI definitions

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé There is already a section with various SEV commands / types, so move the SEV guest attestation together. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007161716.453984-3-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- qap

[PULL 10/40] target/i386/sev: Prefix QMP errors with 'SEV'

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Multiple errors might be reported to the monitor, better to prefix the SEV ones so we can distinct them. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Dr. David Alan Gilbert Message-Id: <20211007161716.453984-6-phi...@redhat.com> Signed-off-by: Paolo Bonzini

[PULL 13/40] target/i386/sev_i386.h: Remove unused headers

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Declarations don't require these headers, remove them. Reviewed-by: Connor Kuehl Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007161716.453984-9-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/sev-stub.c | 1

[PULL 25/40] target/i386/sev: Move qmp_query_sev_launch_measure() to sev.c

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Move qmp_query_sev_launch_measure() from monitor.c to sev.c and make sev_get_launch_measurement() static. We don't need the stub anymore, remove it. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007161716.453984-21-phi...@redhat

[PULL 20/40] target/i386/sev: Declare system-specific functions in 'sev.h'

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé "sysemu/sev.h" is only used from x86-specific files. Let's move it to include/hw/i386, and merge it with target/i386/sev.h. Suggested-by: Paolo Bonzini Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007161716.453984-16-phi...@re

[PULL 14/40] target/i386/sev: Remove sev_get_me_mask()

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Unused dead code makes review harder, so remove it. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007161716.453984-10-phi...@redhat.com> Signed-off-by: Paolo Bonzin

[PULL 24/40] target/i386/sev: Move qmp_query_sev_capabilities() to sev.c

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Move qmp_query_sev_capabilities() from monitor.c to sev.c and make sev_get_capabilities() static. We don't need the stub anymore, remove it. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007161716.453984-20-phi...@redhat.com> Si

[PULL 15/40] target/i386/sev: Mark unreachable code with g_assert_not_reached()

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé The unique sev_encrypt_flash() invocation (in pc_system_flash_map) is protected by the "if (sev_enabled())" check, so is not reacheable. Replace the abort() call in sev_es_save_reset_vector() by g_assert_not_reached() which meaning is clearer. Reviewed-by: Connor Kue

[PULL 19/40] target/i386/sev: Rename sev_i386.h -> sev.h

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé SEV is a x86 specific feature, and the "sev_i386.h" header is already in target/i386/. Rename it as "sev.h" to simplify. Patch created mechanically using: $ git mv target/i386/sev_i386.h target/i386/sev.h $ sed -i s/sev_i386.h/sev.h/ $(git grep -l sev_i386.h) S

[PULL 16/40] target/i386/sev: sev_get_attestation_report use g_autofree

2021-10-13 Thread Paolo Bonzini
From: "Dr. David Alan Gilbert" Removes a whole bunch of g_free's and a goto. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Connor Kuehl Reviewed-by: Brijesh Singh Message-Id: <20210603113017.34922-1-dgilb...@redhat.com> Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé M

[PULL 34/40] hw/i386/sgx: Move qmp_query_sgx_capabilities() to hw/i386/sgx.c

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Move qmp_query_sgx_capabilities() from target/i386/monitor.c to hw/i386/sgx.c, removing the sgx_get_capabilities() indirection. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007175612.496366-4-phi...@redhat.com> Signed-off-by:

[PULL 26/40] target/i386/sev: Move qmp_query_sev() & hmp_info_sev() to sev.c

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Move qmp_query_sev() & hmp_info_sev()() from monitor.c to sev.c and make sev_get_info() static. We don't need the stub anymore, remove it. Add a stub for hmp_info_sev(). Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007161716.45

[PULL 22/40] target/i386/sev: Move qmp_query_sev_attestation_report() to sev.c

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Move qmp_query_sev_attestation_report() from monitor.c to sev.c and make sev_get_attestation_report() static. We don't need the stub anymore, remove it. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007161716.453984-18-phi...@re

[PULL 18/40] target/i386/sev: Restrict SEV to system emulation

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé SEV is irrelevant on user emulation, so restrict it to sysemu. Some stubs are still required because used in cpu.c by x86_register_cpudef_types(), so move the sysemu specific stubs to sev-sysemu-stub.c instead. This will allow us to simplify monitor.c (which is not av

[PULL 31/40] hvf: Determine slot count from struct layout

2021-10-13 Thread Paolo Bonzini
From: Alexander Graf We can handle up to a static amount of memory slots, capped by the size of an internal array. Let's make sure that array size is the only source of truth for the number of elements in that array. Signed-off-by: Alexander Graf Reviewed-by: Richard Henderson Message-Id: <20

[PULL 27/40] monitor: Reduce hmp_info_sev() declaration

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé While being conditionally used for TARGET_I386 in hmp-commands-info.hx, hmp_info_sev() is declared for all targets. Reduce its declaration to target including "monitor/hmp-target.h". This is a minor cleanup. Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu

[PULL 33/40] hw/i386/sgx: Have sgx_epc_get_section() return a boolean

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007175612.496366-3-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/sgx-stub.c| 2 +- hw/i386/sgx.c | 6 +++--- include/hw/i386/sgx-epc.h | 2 +- 3 files changed, 5 insertions(+)

[PULL 28/40] MAINTAINERS: Cover SEV-related files with X86/KVM section

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Complete the x86/KVM section with SEV-related files. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007161716.453984-24-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) d

[PULL 32/40] MAINTAINERS: Cover SGX documentation file with X86/KVM section

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Cc: Yang Zhong Cc: Paolo Bonzini Cc: Marcelo Tosatti Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007175612.496366-2-phi...@redhat.com> Signed-off-by: Paolo Bonzini --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAIN

[PULL 39/40] target/i386/sev: Use local variable for kvm_sev_launch_measure

2021-10-13 Thread Paolo Bonzini
From: Dov Murik The struct kvm_sev_launch_measure has a constant and small size, and therefore we can use a regular local variable for it instead of allocating and freeing heap memory for it. Signed-off-by: Dov Murik Reviewed-by: Dr. David Alan Gilbert Message-Id: <20211011173026.2454294-3-dov

[PULL 35/40] hw/i386/sgx: Move qmp_query_sgx() and hmp_info_sgx() to hw/i386/sgx.c

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Move qmp_query_sgx() and hmp_info_sgx() from target/i386/monitor.c to hw/i386/sgx.c, removing the sgx_get_info() indirection and the "hw/i386/sgx.h" header. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211007175612.496366-5-phi..

[PULL 23/40] target/i386/sev: Move qmp_sev_inject_launch_secret() to sev.c

2021-10-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé Move qmp_sev_inject_launch_secret() from monitor.c to sev.c and make sev_inject_launch_secret() static. We don't need the stub anymore, remove it. Previously with binaries built without SEV, management layer was getting an empty response: { "execute": "sev-inject-

Re: [PATCH v5] Prevent vhost-user-blk-test hang

2021-10-13 Thread Stefan Hajnoczi
On Wed, Oct 13, 2021 at 06:25:33AM +, Raphael Norwitz wrote: > On Tue, Oct 05, 2021 at 10:31:06AM -0400, Michael S. Tsirkin wrote: > > On Thu, Sep 30, 2021 at 10:48:09AM +0100, Stefan Hajnoczi wrote: > > > On Thu, Sep 30, 2021 at 05:29:06AM +, Raphael Norwitz wrote: > > > > On Tue, Sep 28,

[PULL 40/40] ebpf: really include it only in system emulators

2021-10-13 Thread Paolo Bonzini
eBPF libraries are being included in user emulators, which is useless and also breaks --static compilation if a shared library for libbpf is present in the system. Reported-by: Alex Bennée Signed-off-by: Paolo Bonzini --- meson.build | 2 -- 1 file changed, 2 deletions(-) diff --git a/meson.bu

[PULL 38/40] target/i386/sev: Use local variable for kvm_sev_launch_start

2021-10-13 Thread Paolo Bonzini
From: Dov Murik The struct kvm_sev_launch_start has a constant and small size, and therefore we can use a regular local variable for it instead of allocating and freeing heap memory for it. Signed-off-by: Dov Murik Reviewed-by: Dr. David Alan Gilbert Message-Id: <20211011173026.2454294-2-dovmu

[PULL 29/40] qapi: Make some ObjectTypes depend on the build settings

2021-10-13 Thread Paolo Bonzini
From: Thomas Huth Some of the ObjectType entries already depend on CONFIG_* switches. Some others also only make sense with certain configurations, but are currently always listed in the ObjectType enum. Let's make them depend on the correpsonding CONFIG_* switches, too, so that upper layers (lik

[PULL 30/40] tests: tcg: Fix PVH test with binutils 2.36+

2021-10-13 Thread Paolo Bonzini
From: Cole Robinson binutils started adding a .note.gnu.property ELF section which makes the PVH test fail: TESThello on x86_64 qemu-system-x86_64: Error loading uncompressed kernel without PVH ELF Note Discard .note.gnu* while keeping the PVH .note bits intact. This also strips the buil

[PULL 36/40] Revert "hw/misc: applesmc: use host osk as default on macs"

2021-10-13 Thread Paolo Bonzini
This reverts commit 93ddefbc3c909bb6c3b76086f1dfc8ad98dd3725. The commit included code under the APSL 2.0, which is incompatible with the GPL v2. Signed-off-by: Paolo Bonzini --- hw/misc/applesmc.c | 192 + 1 file changed, 1 insertion(+), 191 deletions

Re: [PATCH 04/15] pcie: Add callback preceding SR-IOV VFs update

2021-10-13 Thread Michael S. Tsirkin
On Tue, Oct 12, 2021 at 06:06:46PM +0200, Lukasz Maniak wrote: > On Tue, Oct 12, 2021 at 03:25:12AM -0400, Michael S. Tsirkin wrote: > > On Thu, Oct 07, 2021 at 06:23:55PM +0200, Lukasz Maniak wrote: > > > PCIe devices implementing SR-IOV may need to perform certain actions > > > before the VFs are

Re: [PATCH v1] libvhost-user: fix VHOST_USER_REM_MEM_REG skipping mmap_addr

2021-10-13 Thread Stefan Hajnoczi
On Mon, Oct 11, 2021 at 10:10:47PM +0200, David Hildenbrand wrote: > We end up not copying the mmap_addr of all existing regions, resulting > in a SEGFAULT once we actually try to map/access anything within our > memory regions. > > Fixes: 875b9fd97b34 ("Support individual region unmap in libvhost

Re: [PATCH] contrib/plugins: add a drcov plugin

2021-10-13 Thread Alex Bennée
arkadiy.iva...@ispras.ru writes: > Alex Bennée писал 2021-10-12 13:36: >> Arkadiy writes: >> >>> From: NDNF >>> This patch adds the ability to generate files in drcov format. >>> Primary goal this script is to have coverage >>> logfiles thatwork in Lighthouse. >>> Problems: >>> - The path

Re: [PATCH] aspeed: Add support for the fp5280g2-bmc board

2021-10-13 Thread Cédric Le Goater
Hello John, On 10/13/21 09:26, John Wang wrote: The fp5280g2-bmc is supported by OpenBMC, It's based on the following device tree https://github.com/openbmc/linux/blob/dev-5.10/arch/arm/boot/dts/aspeed-bmc-inspur-fp5280g2.dts Signed-off-by: John Wang --- hw/arm/aspeed.c | 48 +++

[PULL 37/40] monitor: Tidy up find_device_state()

2021-10-13 Thread Paolo Bonzini
From: Markus Armbruster Commit 6287d827d4 "monitor: allow device_del to accept QOM paths" extended find_device_state() to accept QOM paths in addition to qdev IDs. This added a checked conversion to TYPE_DEVICE at the end, which duplicates the check done for the qdev ID case earlier, except it s

Re: [PATCH 1/2] numa: Set default distance map if needed

2021-10-13 Thread Igor Mammedov
On Wed, 13 Oct 2021 10:32:18 +1100 Gavin Shan wrote: > Hi Igor, > > On 10/13/21 12:53 AM, Igor Mammedov wrote: > > On Tue, 12 Oct 2021 15:13:08 +0200 > > Andrew Jones wrote: > >> On Tue, Oct 12, 2021 at 02:27:54PM +0200, Igor Mammedov wrote: > >>> On Tue, 12 Oct 2021 12:37:54 +0200 > >>> A

Re: [PATCH v3 2/4] s390x: kvm: topology: interception of PTF instruction

2021-10-13 Thread Thomas Huth
On 13/10/2021 09.55, Pierre Morel wrote: On 10/13/21 09:25, Thomas Huth wrote: On 16/09/2021 15.50, Pierre Morel wrote: When the host supports the CPU topology facility, the PTF instruction with function code 2 is interpreted by the SIE, provided that the userland hypervizor activates the int

Re: [PATCH 0/3] KVM: qemu patches for few KVM features I developed

2021-10-13 Thread Maxim Levitsky
On Tue, 2021-09-14 at 18:52 +0300, Maxim Levitsky wrote: > These patches implement the qemu side logic to support > the KVM features I developed recently. > > First two patches are for features that are already accepted > upstream, and I already posted them on the qemu mailing list once. > > And

Re: [PATCH] target/riscv: csr: Implement mconfigptr CSR

2021-10-13 Thread Bin Meng
HI Rahul, On Fri, Oct 8, 2021 at 5:47 PM Rahul Pathak wrote: > > Hi Bin > > > On Thu, Oct 7, 2021 at 11:07 AM Bin Meng wrote: > > > > On Sun, Oct 3, 2021 at 7:29 PM Rahul Pathak > > wrote: > > > > > > mconfigptr is an mandatory CSR as per the priv spec. > > > > %s/an/a > > > > Done > > > > > a

Re: [PATCH] block/vpc: Add a sanity check that fixed-size images have the right type

2021-10-13 Thread Hanna Reitz
On 12.10.21 10:27, Thomas Huth wrote: The code in vpc.c uses BDRVVPCState->footer.type in various places to decide whether the image is a fixed-size (VHD_FIXED) or a dynamic (VHD_DYNAMIC) image. However, we never check that this field really contains VHD_FIXED if we detected a fixed size image in

Re: [PATCH v1] libvhost-user: fix VHOST_USER_REM_MEM_REG skipping mmap_addr

2021-10-13 Thread Stefan Hajnoczi
On Mon, Oct 11, 2021 at 10:10:47PM +0200, David Hildenbrand wrote: > We end up not copying the mmap_addr of all existing regions, resulting > in a SEGFAULT once we actually try to map/access anything within our > memory regions. > > Fixes: 875b9fd97b34 ("Support individual region unmap in libvhost

[PATCH] virtio-iommu: Remove non transitional name

2021-10-13 Thread Eric Auger
Remove non transitional name for virtio iommu. Like other devices introduced after 1.0 spec, the virtio-iommu does not need it. Signed-off-by: Eric Auger Reported-by: Andrea Bolognani --- hw/virtio/virtio-iommu-pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/virtio/virtio-iommu-pci.

Re: [PATCH v1] libvhost-user: fix VHOST_USER_REM_MEM_REG not closing the fd

2021-10-13 Thread Stefan Hajnoczi
On Tue, Oct 12, 2021 at 08:38:32PM +0200, David Hildenbrand wrote: > We end up not closing the file descriptor, resulting in leaking one > file descriptor for each VHOST_USER_REM_MEM_REG message. > > Fixes: 875b9fd97b34 ("Support individual region unmap in libvhost-user") > Cc: Michael S. Tsirkin

Re: [PATCH v3 6/6] tests/qapi-schema: Test cases for aliases

2021-10-13 Thread Markus Armbruster
Kevin Wolf writes: > Am 11.10.2021 um 09:44 hat Markus Armbruster geschrieben: >> Kevin Wolf writes: >> >> [...] >> >> > What I had in mind was using the schema to generate the necessary code, >> > using the generic keyval parser everywhere, and just providing a hook >> > where the QDict could

Re: [PATCH v1] libvhost-user: fix VHOST_USER_REM_MEM_REG not closing the fd

2021-10-13 Thread David Hildenbrand
On 13.10.21 11:48, Stefan Hajnoczi wrote: On Tue, Oct 12, 2021 at 08:38:32PM +0200, David Hildenbrand wrote: We end up not closing the file descriptor, resulting in leaking one file descriptor for each VHOST_USER_REM_MEM_REG message. Fixes: 875b9fd97b34 ("Support individual region unmap in libv

Re: [PATCH v1 2/2] memory: Update description of memory_region_is_mapped()

2021-10-13 Thread Igor Mammedov
On Wed, 13 Oct 2021 09:14:35 +0200 David Hildenbrand wrote: > On 12.10.21 12:09, David Hildenbrand wrote: > >> > >> The less confusing would be one where check works for any memory region > >> involved. > > > > Exactly, so for any alias, even in-between another alias and the target. > > > >

Re: [PATCH 00/16] fdt: Make OF_BOARD a boolean option

2021-10-13 Thread Andre Przywara
On Tue, 12 Oct 2021 19:01:04 -0600 Simon Glass wrote: Hi, > With Ilias' efforts we have dropped OF_PRIOR_STAGE and OF_HOSTFILE so > there are only three ways to obtain a devicetree: > >- OF_SEPARATE - the normal way, where the devicetree is built and > appended to U-Boot >- OF_EMB

Re: [PATCH v3 1/1] virtio: write back F_VERSION_1 before validate

2021-10-13 Thread Michael S. Tsirkin
On Mon, Oct 11, 2021 at 07:39:21AM +0200, Halil Pasic wrote: > The virtio specification virtio-v1.1-cs01 states: "Transitional devices > MUST detect Legacy drivers by detecting that VIRTIO_F_VERSION_1 has not > been acknowledged by the driver." This is exactly what QEMU as of 6.1 > has done relyin

Re: [PATCH] virtio-iommu: Remove non transitional name

2021-10-13 Thread Cornelia Huck
On Wed, Oct 13 2021, Eric Auger wrote: > Remove non transitional name for virtio iommu. Like other > devices introduced after 1.0 spec, the virtio-iommu does > not need it. > > Signed-off-by: Eric Auger > Reported-by: Andrea Bolognani > --- > hw/virtio/virtio-iommu-pci.c | 1 - > 1 file change

[PATCH RFC 00/15] virtio-mem: Expose device memory via separate memslots

2021-10-13 Thread David Hildenbrand
Based-on: 20211011175346.15499-1-da...@redhat.com A virtio-mem device is represented by a single large RAM memory region backed by a single large mmap. Right now, we map that complete memory region into guest physical addres space, resulting in a very large memory mapping, KVM memory slot, ... al

[PATCH RFC 01/15] memory: Drop mapping check from memory_region_get_ram_discard_manager()

2021-10-13 Thread David Hildenbrand
It's sufficient to check whether a memory region is RAM, the region doesn't necessarily have to be mapped into another memory region. For example, RAM memory regions mapped via an alias will never make "memory_region_is_mapped()" succeed. Signed-off-by: David Hildenbrand --- softmmu/memory.c | 2

[PATCH RFC 02/15] kvm: Return number of free memslots

2021-10-13 Thread David Hildenbrand
Let's return the number of free slots instead of only checking if there is a free slot. Required to support memory devices that consume multiple memslots. Signed-off-by: David Hildenbrand --- accel/kvm/kvm-all.c| 24 +++- accel/stubs/kvm-stub.c | 4 ++-- hw/mem/memory-de

[PATCH RFC 06/15] memory-device: Move memory_device_check_addable() directly into memory_device_pre_plug()

2021-10-13 Thread David Hildenbrand
Move it out of memory_device_get_free_addr(), which is cleaner and prepares for future changes. Signed-off-by: David Hildenbrand --- hw/mem/memory-device.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/mem/memory-device.c b/hw/mem/memory-device.c index 7f

[PATCH RFC 03/15] vhost: Return number of free memslots

2021-10-13 Thread David Hildenbrand
Let's return the number of free slots instead of only checking if there is a free slot. Required to support memory devices that consume multiple memslots. Signed-off-by: David Hildenbrand --- hw/mem/memory-device.c| 2 +- hw/virtio/vhost-stub.c| 2 +- hw/virtio/vhost.c | 4 ++--

[PATCH RFC 05/15] vhost: Don't merge unmergeable memory sections

2021-10-13 Thread David Hildenbrand
Memory sections that are marked unmergeable should not be merged, to allow for atomic removal later. Signed-off-by: David Hildenbrand --- hw/virtio/vhost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 2707972870..49a1074097 1

[PATCH RFC 04/15] memory: Allow for marking memory region aliases unmergeable

2021-10-13 Thread David Hildenbrand
Let's allow for marking memory region aliases unmergeable, to teach flatview code (and memory listeners like vhost-user) to not merge adjacent aliases to the same memory region into a larger memory section; instead, we want separate alias to stay separate such that we can atomically map/unmap alias

[PATCH RFC 08/15] memory-device: Support memory devices that consume a variable number of memslots

2021-10-13 Thread David Hildenbrand
We want to support memory devices that have a container as device memory region, and (dynamically) map individual chunks into that container resulting in multiple memslots getting consumed by such a device. We already have one such device: NVDIMM. However, an NVDIMM also end up consuming exactly o

[PATCH RFC 07/15] memory-device: Generalize memory_device_used_region_size()

2021-10-13 Thread David Hildenbrand
Let's generalize traversal of all plugged memory devices to collect information to prepare for future changes. Signed-off-by: David Hildenbrand --- hw/mem/memory-device.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/hw/mem/memory-device.c b/hw/mem/m

[PATCH RFC 09/15] vhost: Respect reserved memslots for memory devices when realizing a vhost device

2021-10-13 Thread David Hildenbrand
Make sure that the current reservations can be fulfilled, otherwise we might run out of memslots later when memory devices start actually using the reserved memslots and crash. Signed-off-by: David Hildenbrand --- hw/virtio/vhost.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-)

[PATCH RFC 12/15] virtio-mem: Expose device memory via separate memslots

2021-10-13 Thread David Hildenbrand
KVM nowadays supports a lot of memslots. We want to exploit that in virtio-mem, exposing device memory via separate memslots to the guest on demand, essentially reducing the total size of KVM slots significantly (and thereby metadata in KVM and in QEMU for KVM memory slots) especially when exposing

  1   2   3   4   >