Re: [PATCH 28/37] target/i386: reimplement 0x0f 0x38, add AVX

2022-09-15 Thread Richard Henderson
On 9/14/22 18:04, Paolo Bonzini wrote: +void glue(helper_vpgatherdd, SUFFIX)(CPUX86State *env, +Reg *d, Reg *v, Reg *s, target_ulong a0, unsigned scale) +{ +int i; +for (i = 0; i < (2 << SHIFT); i++) { +if (v->L(i) >> 31) { +target_ulong addr = a0 +

Re: [PATCH 30/37] target/i386: reimplement 0x0f 0x10-0x17, add AVX

2022-09-15 Thread Richard Henderson
On 9/14/22 23:45, Paolo Bonzini wrote: You've just been moving i64 pieces in the other functions, why is this one different using a gvec move in the middle? I do wonder if a generic helper moving offset->offset, with the comparison wouldn't be helpful within these functions, even when you know

Re: [PATCH v2 19/30] gitlab-ci/custom-runners: Disable -static-pie for ubuntu-20.04-aarch64

2022-09-15 Thread Thomas Huth
On 14/09/2022 16.59, Alex Bennée wrote: From: Richard Henderson The project has reached the magic size at which we see /usr/aarch64-linux-gnu/lib/libc.a(init-first.o): in function `__libc_init_first': (.text+0x10): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against \ symbol `__e

Re: [PATCH v2 20/30] gitlab-ci: update aarch32/aarch64 custom runner jobs

2022-09-15 Thread Thomas Huth
On 14/09/2022 16.59, Alex Bennée wrote: The custom runner is now using 22.04 so we can drop our hacks to deal with broken libssh and glusterfs. The provisioning scripts will be updated in a separate commit. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Message-Id: <20220826172128.353798-

Re: [PATCH v2 15/30] tests/docker: remove tricore qemu/debian10 dependency

2022-09-15 Thread Thomas Huth
On 14/09/2022 16.59, Alex Bennée wrote: We missed removing this dependency when we flattened the build. Fixes: 39ce923732 (gitlab: enable a very minimal build with the tricore container) Signed-off-by: Alex Bennée Fixes: 39ce923732 ("gitlab: enable a very minimal build with the tricore conta

Re: [RFC PATCH 2/4] qtest: make read/write operation appear to be from CPU

2022-09-15 Thread Richard Henderson
On 9/14/22 17:09, Alex Bennée wrote: The point of qtest is to simulate how running code might interact with the system. However because it's not a real system we have places in the code which especially handle check qtest_enabled() before referencing current_cpu. Now we can encode these details i

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

2022-09-15 Thread Eric Blake
On Sat, Sep 10, 2022 at 01:27:53PM +0800, Sam Li wrote: > Signed-off-by: Sam Li > Reviewed-by: Stefan Hajnoczi > Reviewed-by: Damien Le Moal > --- > include/block/block-common.h | 43 > 1 file changed, 43 insertions(+) > > diff --git a/include/block/block-c

Re: [RFC PATCH 3/4] hw/intc/gic: use MxTxAttrs to divine accessing CPU

2022-09-15 Thread Richard Henderson
On 9/14/22 17:09, Alex Bennée wrote: Now that MxTxAttrs encodes a CPU we should use that to figure it out. This solves edge cases like accessing via gdbstub or qtest. Signed-off-by: Alex Bennée Resolves: https://gitlab.com/qemu-project/qemu/-/issues/124 --- hw/intc/arm_gic.c | 39

Re: [PATCH v2 01/30] gitlab: reduce targets in cross_user_build_job

2022-09-15 Thread Richard Henderson
On 9/14/22 16:59, Alex Bennée wrote: We already limit the scope of the cross system build to reduce the cross build times. With the recent addition of more targets we are also running into timeout issues for some of the cross user builds. I've selected a few of those linux-user targets which are

Re: [RFC PATCH 1/4] hw: encode accessing CPU index in MemTxAttrs

2022-09-15 Thread Richard Henderson
On 9/14/22 17:09, Alex Bennée wrote: @@ -1340,8 +1340,13 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry, uint64_t val; bool locked = false; MemTxResult r; +MemTxAttrs attrs = iotlbentry->attrs; -section = iotlb_to_section(cpu, iotlbentry->ad

Re: [PATCH v2 03/30] tests/avocado: add explicit timeout for Aarch64 TCG tests

2022-09-15 Thread Richard Henderson
On 9/14/22 16:59, Alex Bennée wrote: We don't want to rely on the soon to be reduced default time. These tests are still slow for something we want to run in CI though. Signed-off-by: Alex Bennée --- tests/avocado/boot_linux.py | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Richard Hend

Re: [PATCH v2 06/30] tests/avocado: split the AST2x00Machine classes

2022-09-15 Thread Richard Henderson
On 9/14/22 16:59, Alex Bennée wrote: The SDK tests take a lot longer to run and hence need a longer timeout. As they run well over the 60 second maximum for CI lets also disable them for CI as well. I suspect they also suffer from the inability to detect the login prompt due to no newlines being

Re: [RFC PATCH 4/4] hw/timer: convert mptimer access to attrs to derive cpu index

2022-09-15 Thread Richard Henderson
On 9/14/22 17:09, Alex Bennée wrote: This removes the hacks to deal with empty current_cpu. Signed-off-by: Alex Bennée --- hw/timer/arm_mptimer.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/hw/timer/arm_mptimer.c b/hw/timer/arm_mptimer.c in

Re: [PATCH v2 28/30] tests/docker: update and flatten debian-toolchain

2022-09-15 Thread Richard Henderson
On 9/14/22 16:59, Alex Bennée wrote: -FROM qemu/debian10 +FROM docker.io/library/debian:bullseye-slim I'd rather you be consistent about debian-11 instead of codename. Otherwise, Reviewed-by: Richard Henderson r~

Re: [PATCH v2 07/30] tests/avocado: reduce the default timeout to 120s

2022-09-15 Thread Richard Henderson
On 9/14/22 16:59, Alex Bennée wrote: We should be aiming to keep our tests under 2 minutes so lets reduce the default timeout to that. Tests that we know take longer should explicitly set a longer timeout. Signed-off-by: Alex Bennée Message-Id:<20220826172128.353798-3-alex.ben...@linaro.org> ---

Re: [PATCH v2 05/30] tests/avocado: add explicit timeout for ppc64le TCG tests

2022-09-15 Thread Richard Henderson
On 9/14/22 16:59, Alex Bennée wrote: We don't want to rely on the soon to be reduced default time. These tests are still slow for something we want to run in CI though. Signed-off-by: Alex Bennée --- tests/avocado/boot_linux.py | 2 ++ 1 file changed, 2 insertions(+) Reviewed-by: Richard He

Re: [PATCH v4 2/3] module: add Error arguments to module_load_one and module_load_qom_one

2022-09-15 Thread Claudio Fontana
On 9/8/22 20:30, Claudio Fontana wrote: > improve error handling during module load, by changing: > > bool module_load_one(const char *prefix, const char *lib_name); > void module_load_qom_one(const char *type); > > to: > > bool module_load_one(const char *prefix, const char *name, Error **errp)

Re: [PATCH v2 18/30] configure: explicitly set cflags for --disable-pie

2022-09-15 Thread Richard Henderson
On 9/14/22 16:59, Alex Bennée wrote: This is working around current limitation of Meson's handling of --disable-pie. Signed-off-by: Alex Bennée Cc: Paolo Bonzini --- configure | 6 ++ 1 file changed, 6 insertions(+) Ah, yes, thanks. Reviewed-by: Richard Henderson r~

Re: [PATCH v2 22/30] tests/docker: flatten debian-riscv64-test-cross

2022-09-15 Thread Richard Henderson
On 9/14/22 16:59, Alex Bennée wrote: Flatten into a single dockerfile and update to match the rest of the test cross compile dockerfiles. Signed-off-by: Alex Bennée Message-Id:<20220826172128.353798-17-alex.ben...@linaro.org> --- v2 - minor reword of commit msg --- .gitlab-ci.d/container-c

[PATCH v3 0/2] Update linux headers to v6.0-rc4 and fix the clang build error

2022-09-15 Thread Chenyi Qiang
After updating linux headers to v6.0-rc, clang build on x86 target would generate warnings related to -Wgnu-variable-sized-type-not-at-end. Simply turn off this warning in this patch set. --- Change logs v2 -> v3 - A minor modification in commit message. (Cornelia Huck) - v2: https://lore.kerne

[PATCH v6 0/2] Enable notify VM exit

2022-09-15 Thread Chenyi Qiang
Notify VM exit is introduced to mitigate the potential DOS attach from malicious VM. This series is the userspace part to enable this feature through a new KVM capability KVM_CAP_X86_NOTIFY_VMEXIT. The detailed info can be seen in Patch 3. The corresponding KVM support can be found in linux 6.0-rc

Re: [PATCH v2 21/30] Deprecate 32 bit big-endian MIPS

2022-09-15 Thread Richard Henderson
On 9/14/22 16:59, Alex Bennée wrote: It's becoming harder to maintain a cross-compiler to test this host architecture as the old stable Debian 10 ("Buster") moved into LTS which supports fewer architectures. For now: - mark it's deprecation in the docs - downgrade the containers to build T

Re: [PATCH v2 29/30] tests/docker: remove FROM qemu/ support from docker.py

2022-09-15 Thread Richard Henderson
On 9/14/22 16:59, Alex Bennée wrote: We want to migrate from docker.py to building our images directly with docker/podman. Before we get there we need to make sure we don't re-introduce our layered builds so bug out if we see FROM qemu/ in a Dockerfile. Signed-off-by: Alex Bennée Acked-by: Thoma

Re: [PATCH v2 23/30] tests/docker: update and flatten debian-all-test-cross

2022-09-15 Thread Richard Henderson
On 9/14/22 16:59, Alex Bennée wrote: Update to the latest stable Debian. While we are at it flatten into a single dockerfile. We also need to ensure we install clang as it is used for those builds as well. It would be nice to port this to lcitool but for now this will do. Signed-off-by: Alex Be

Re: [PATCH v2 30/30] tests/docker: remove the Debian base images

2022-09-15 Thread Richard Henderson
On 9/14/22 16:59, Alex Bennée wrote: We no longer use these in any of our images. Clean-up the remaining comments and documentation that reference them and remove from the build. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Message-Id:<20220826172128.353798-25-alex.ben...@linaro.org> ---

Re: [PATCH v2 27/30] tests/docker: update and flatten debian-hexagon-cross

2022-09-15 Thread Richard Henderson
On 9/14/22 16:59, Alex Bennée wrote: Update to the latest stable Debian. While we are at it flatten into a single dockerfile as we do not some of the extraneous packages from the base image to build the toolchain. Signed-off-by: Alex Bennée Message-Id: <20220826172128.353798-22-alex.ben...@lina

[PATCH v3 1/2] configure: Add -Wno-gnu-variable-sized-type-not-at-end

2022-09-15 Thread Chenyi Qiang
A Linux headers update to v6.0-rc switches some definitions from GNU 'zero-length-array' extension to the C-standard-defined flexible array member. e.g. struct kvm_msrs { __u32 nmsrs; /* number of msrs in entries */ __u32 pad; - struct kvm_msr_entry entries[0]; + struc

[PATCH v3 2/2] Update linux headers to v6.0-rc4

2022-09-15 Thread Chenyi Qiang
commit 7e18e42e4b280c85b76967a9106a13ca61c16179 Reviewed-by: Cornelia Huck Signed-off-by: Chenyi Qiang --- include/standard-headers/asm-x86/bootparam.h | 7 +- include/standard-headers/drm/drm_fourcc.h | 73 +++- include/standard-headers/linux/ethtool.h | 29 +-- include/stand

[PATCH v6 1/2] i386: kvm: extend kvm_{get, put}_vcpu_events to support pending triple fault

2022-09-15 Thread Chenyi Qiang
For the direct triple faults, i.e. hardware detected and KVM morphed to VM-Exit, KVM will never lose them. But for triple faults sythesized by KVM, e.g. the RSM path, if KVM exits to userspace before the request is serviced, userspace could migrate the VM and lose the triple fault. A new flag KVM_

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

2022-09-15 Thread Sam Li
Eric Blake 于2022年9月15日周四 16:05写道: > > On Sat, Sep 10, 2022 at 01:27:53PM +0800, Sam Li wrote: > > Signed-off-by: Sam Li > > Reviewed-by: Stefan Hajnoczi > > Reviewed-by: Damien Le Moal > > --- > > include/block/block-common.h | 43 > > 1 file changed, 43 in

[PATCH v6 2/2] i386: Add notify VM exit support

2022-09-15 Thread Chenyi Qiang
There are cases that malicious virtual machine can cause CPU stuck (due to event windows don't open up), e.g., infinite loop in microcode when nested #AC (CVE-2015-5307). No event window means no event (NMI, SMI and IRQ) can be delivered. It leads the CPU to be unavailable to host or other VMs. Not

Re: [PATCH v2] tcg/ppc: Optimize 26-bit jumps

2022-09-15 Thread Richard Henderson
On 9/14/22 19:41, Leandro Lupori wrote: PowerPC64 processors handle direct branches better than indirect ones, resulting in less stalled cycles and branch misses. However, PPC's tb_target_set_jmp_target() was only using direct branches for 16-bit jumps, while PowerPC64's unconditional branch ins

Re: [PATCH v4 0/1] monitor: Support specified vCPU registers

2022-09-15 Thread Dr. David Alan Gilbert
* zhenwei pi (pizhen...@bytedance.com) wrote: > v3 -> v4: > - Tweake a few document and output '\n' prefix. > > v2 -> v3: > - Add more document in help info. > - Use 'qemu_get_cpu()' to simplify code. > > v1 -> v2: > - Typo fix in commit message. > - Suggested by Darren, use '[-a|vcpu]' instea

Re: [PATCH v3 1/1] monitor/hmp: print trace as option in help for log command

2022-09-15 Thread Dr. David Alan Gilbert
* Dongli Zhang (dongli.zh...@oracle.com) wrote: > The below is printed when printing help information in qemu-system-x86_64 > command line, and when CONFIG_TRACE_LOG is enabled: > > > $ qemu-system-x86_64 -d help > ... ... > trace:PATTERN enable trace events > > Use

Re: [PATCH v2 3/6] vhost-net: vhost-user: update vhost_net_virtqueue_reset()

2022-09-15 Thread Xuan Zhuo
On Thu, 15 Sep 2022 10:12:11 +0800, Jason Wang wrote: > On Wed, Sep 14, 2022 at 2:21 PM Xuan Zhuo wrote: > > > > On Wed, 14 Sep 2022 11:13:29 +0800, Jason Wang wrote: > > > > > > 在 2022/9/12 11:10, Kangjie Xu 写道: > > > > Update vhost_net_virtqueue_reset() for vhost-user scenario. > > > > > > > >

Re: [PATCH] bugfix:migrate with block-dirty-bitmap (disk size is big enough) can't be finished

2022-09-15 Thread Vladimir Sementsov-Ogievskiy
Post-copy migration of dirty-bitmaps doesn't mean post-copy migration of RAM. To turn on post-copy migration of RAM, you should enable postcopy-ram capability. If you don't enable it, RAM is migrated in pre-copy (i.e. before starting VM on target). migrate-start-postcopy command doesn't enable

Re: [PATCH] hmp: Fix ordering of text

2022-09-15 Thread Daniel P . Berrangé
On Tue, Sep 13, 2022 at 11:10:41AM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > Fix the ordering of the help text so it's always after the commands > being defined. A few had got out of order. Keep 'info' at the end. > > Signed-off-by: Dr. David Alan Gilbert

Re: [PATCH V4 1/3] hw/arm, loongarch: Move load_image_to_fw_cfg() to common location

2022-09-15 Thread Sunil V L
Hi, Could maintainers of hw/arm and hw/loongarch to take a look at this? I have addressed Peter's earlier comment. Thanks Sunil On Thu, Sep 08, 2022 at 11:17:52AM +0200, Alistair Francis wrote: > On Tue, Sep 6, 2022 at 11:38 AM Sunil V L wrote: > > > > load_image_to_fw_cfg() is duplicated by bo

Re: [PATCH V4 1/3] hw/arm, loongarch: Move load_image_to_fw_cfg() to common location

2022-09-15 Thread gaosong
在 2022/9/15 下午7:59, Sunil V L 写道: Hi, Could maintainers of hw/arm and hw/loongarch to take a look at this? I have addressed Peter's earlier comment. Thanks Sunil On Thu, Sep 08, 2022 at 11:17:52AM +0200, Alistair Francis wrote: On Tue, Sep 6, 2022 at 11:38 AM Sunil V L wrote: load_image_t

[PATCH v3 3/5] tests/x86: Add 'q35' machine type to drive_del-test

2022-09-15 Thread Michael Labiuk via
Configure pci bridge setting Also run tests on 'q35' machine type. Signed-off-by: Michael Labiuk --- tests/qtest/drive_del-test.c | 111 +++ 1 file changed, 111 insertions(+) diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c index 5e6d58b4dd

[PATCH v3 4/5] tests/x86: Add 'q35' machine type to hotplug hd-geo-test

2022-09-15 Thread Michael Labiuk via
Add pci bridge setting to test hotplug. Duplicate tests for plugging scsi and virtio devices for q35 machine type. Signed-off-by: Michael Labiuk --- tests/qtest/hd-geo-test.c | 148 ++ 1 file changed, 148 insertions(+) diff --git a/tests/qtest/hd-geo-test.c b/

Re: [PATCH] hmp: Fix ordering of text

2022-09-15 Thread Dr. David Alan Gilbert
* Daniel P. Berrangé (berra...@redhat.com) wrote: > On Tue, Sep 13, 2022 at 11:10:41AM +0100, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > Fix the ordering of the help text so it's always after the commands > > being defined. A few had got out of order. Keep 'i

[PATCH v3 5/5] tests/x86: Add 'q35' machine type to override-tests in hd-geo-test

2022-09-15 Thread Michael Labiuk via
Signed-off-by: Michael Labiuk --- tests/qtest/hd-geo-test.c | 105 +++--- 1 file changed, 98 insertions(+), 7 deletions(-) diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c index 19354690ae..61a92bdbe1 100644 --- a/tests/qtest/hd-geo-test.c +++ b/

Re: [PATCH] hw/virtio/vhost-user: support obtain vdpa device's mac address automatically

2022-09-15 Thread ho...@yusur.tech
On Tue, Sep 13, 2022 at 17:08 PM Hao Chen wrote: >From: Hao Chen >Date: 2022-09-13 17:08 >To: mst; raphael.norwitz >CC: kwolf; hreitz; jasowang; qemu-block; qemu-devel; houyl; zy; Hao Chen >Subject: [PATCH] hw/virtio/vhost-user: support obtain vdpa device's mac >address automaticall

[PATCH v3 0/5] Add 'q35' machine type to hotplug tests

2022-09-15 Thread Michael Labiuk via
Add pci bridge setting to run hotplug tests on q35 machine type. Hotplug tests was bounded to 'pc' machine type by commit 7b172333f1b Michael Labiuk (5): tests/x86: Add subtest with 'q35' machine type to device-plug-test tests/x86: Add 'q35' machine type to ivshmem-test tests/x86: Add 'q35'

[PATCH v3 1/5] tests/x86: Add subtest with 'q35' machine type to device-plug-test

2022-09-15 Thread Michael Labiuk via
Configure pci bridge setting to plug pci device and unplug. Move common code for device removing to function. Signed-off-by: Michael Labiuk --- tests/qtest/device-plug-test.c | 83 -- 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/tests/qtest/devic

[PATCH v3 2/5] tests/x86: Add 'q35' machine type to ivshmem-test

2022-09-15 Thread Michael Labiuk via
Configure pci bridge setting to test ivshmem on 'q35'. Signed-off-by: Michael Labiuk --- tests/qtest/ivshmem-test.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/tests/qtest/ivshmem-test.c b/tests/qtest/ivshmem-test.c index 9611d05eb5..0f9755abc6 100644 --- a

Re: [PATCH v2 0/8] AArch64/HMAT support and tests

2022-09-15 Thread Yicong Yang via
On 2022/7/19 17:49, Hesham Almatary wrote: > This patchset adds support for AArch64/HMAT including a test. > It relies on other two patch sets from: > > Brice Goglin: to support -numa without initiators on q35/x86. > https://lore.kernel.org/all/ed23accb-2c8b-90f4-a7a3-f81cc57bf...@inria.fr/ > Xi

Cannot get Qemu to move past "Booting from ROM"?

2022-09-15 Thread Evan Sherlock
My custom build kernel 4.9.327 with gcc-11.2 is not booting in Qemu and it is stuck on "Booting from ROM". Just like the screenshot here: Custom 64bit 3.10.9 kernel not booting in qemu and stucks on Booting from ROM

[PATCH v8 1/8] mm/memfd: Introduce userspace inaccessible memfd

2022-09-15 Thread Chao Peng
From: "Kirill A. Shutemov" KVM can use memfd-provided memory for guest memory. For normal userspace accessible memory, KVM userspace (e.g. QEMU) mmaps the memfd into its virtual address space and then tells KVM to use the virtual address to setup the mapping in the secondary page table (e.g. EPT)

[PATCH v8 0/8] KVM: mm: fd-based approach for supporting KVM

2022-09-15 Thread Chao Peng
This patch series implements KVM guest private memory for confidential computing scenarios like Intel TDX[1]. If a TDX host accesses TDX-protected guest memory, machine check can happen which can further crash the running host system, this is terrible for multi-tenant configurations. The host acces

[PATCH v8 2/8] KVM: Extend the memslot to support fd-based private memory

2022-09-15 Thread Chao Peng
In memory encryption usage, guest memory may be encrypted with special key and can be accessed only by the VM itself. We call such memory private memory. It's valueless and sometimes can cause problem to allow userspace to access guest private memory. This patch extends the KVM memslot definition s

[PATCH v8 4/8] KVM: Use gfn instead of hva for mmu_notifier_retry

2022-09-15 Thread Chao Peng
Currently in mmu_notifier validate path, hva range is recorded and then checked against in the mmu_notifier_retry_hva() of the page fault path. However, for the to be introduced private memory, a page fault may not have a hva associated, checking gfn(gpa) makes more sense. For existing non private

[PATCH v8 6/8] KVM: Update lpage info when private/shared memory are mixed

2022-09-15 Thread Chao Peng
When private/shared memory are mixed in a large page, the lpage_info may not be accurate and should be updated with this mixed info. A large page has mixed pages can't be really mapped as large page since its private/shared pages are from different physical memory. This patch updates lpage_info wh

[PATCH v8 5/8] KVM: Register/unregister the guest private memory regions

2022-09-15 Thread Chao Peng
If CONFIG_HAVE_KVM_PRIVATE_MEM=y, userspace can register/unregister the guest private memory regions through KVM_MEMORY_ENCRYPT_{UN,}REG_REGION ioctls. The patch reuses existing SEV ioctl number but differs that the address in the region for KVM_PRIVATE_MEM case is gpa while for SEV case it's hva.

[PATCH v8 3/8] KVM: Add KVM_EXIT_MEMORY_FAULT exit

2022-09-15 Thread Chao Peng
This new KVM exit allows userspace to handle memory-related errors. It indicates an error happens in KVM at guest memory range [gpa, gpa+size). The flags includes additional information for userspace to handle the error. Currently bit 0 is defined as 'private memory' where '1' indicates error happe

[PATCH v8 8/8] KVM: Enable and expose KVM_MEM_PRIVATE

2022-09-15 Thread Chao Peng
Expose KVM_MEM_PRIVATE and memslot fields private_fd/offset to userspace. KVM will register/unregister private memslot to fd-based memory backing store and response to invalidation event from inaccessible_notifier to zap the existing memory mappings in the secondary page table. Whether KVM_MEM_PRI

[PATCH v8 7/8] KVM: Handle page fault for private memory

2022-09-15 Thread Chao Peng
A memslot with KVM_MEM_PRIVATE being set can include both fd-based private memory and hva-based shared memory. Architecture code (like TDX code) can tell whether the on-going fault is private or not. This patch adds a 'is_private' field to kvm_page_fault to indicate this and architecture code is ex

Re: [PATCH v11 18/21] job.c: enable job lock/unlock and remove Aiocontext locks

2022-09-15 Thread Vladimir Sementsov-Ogievskiy
On 8/26/22 16:21, Emanuele Giuseppe Esposito wrote: Change the job_{lock/unlock} and macros to use job_mutex. Now that they are not nop anymore, remove the aiocontext to avoid deadlocks. Therefore: - when possible, remove completely the aiocontext lock/unlock pair - if it is used by some other

Re: [PATCH v11 05/21] job.c: add job_lock/unlock while keeping job.h intact

2022-09-15 Thread Vladimir Sementsov-Ogievskiy
On 8/26/22 16:20, Emanuele Giuseppe Esposito wrote: With "intact" we mean that all job.h functions implicitly take the lock. Therefore API callers are unmodified. This means that: - many static functions that will be always called with job lock held become _locked, and call _locked functions

Re: Maximum QMP reply size

2022-09-15 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > On Tue, 6 Sept 2022 at 20:41, John Snow wrote: > > Hi, I suspect I have asked this before, but I didn't write it down in > > a comment, so I forget my justification... > > > > In the QMP lib, we need to set a buffering limit for how big a QMP > >

[PATCH 01/11] hw/ppc/meson: Allow e500 boards to be enabled separately

2022-09-15 Thread Bernhard Beschow
Gives users more fine-grained control over what should be compiled into QEMU. Signed-off-by: Bernhard Beschow --- configs/devices/ppc-softmmu/default.mak | 3 ++- hw/ppc/Kconfig | 8 hw/ppc/meson.build | 6 ++ 3 files changed, 12 inserti

[PATCH 02/11] hw/gpio/meson: Introduce dedicated config switch for hw/gpio/mpc8xxx

2022-09-15 Thread Bernhard Beschow
Having a dedicated config switch makes dependency handling cleaner. Signed-off-by: Bernhard Beschow --- hw/gpio/Kconfig | 3 +++ hw/gpio/meson.build | 2 +- hw/ppc/Kconfig | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/gpio/Kconfig b/hw/gpio/Kconfig index f0e740

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

2022-09-15 Thread Bernhard Beschow
This series adds support for -pflash and direct SD card access to the PPC e500 boards. The idea is to increase compatibility with "real" firmware images where only the bare minimum of drivers is compiled in. The series is structured as follows: Patches 1-3 perform some general cleanup which paves

[PATCH 06/11] hw/block/pflash_cfi01: Error out if device length isn't a power of two

2022-09-15 Thread Bernhard Beschow
According to the JEDEC standard the device length is communicated to an OS as an exponent (power of two). Signed-off-by: Bernhard Beschow --- hw/block/pflash_cfi01.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c inde

[PATCH 04/11] hw/ppc/mpc8544ds: Add platform bus

2022-09-15 Thread Bernhard Beschow
Models the real device more closely. Signed-off-by: Bernhard Beschow --- hw/ppc/mpc8544ds.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/ppc/mpc8544ds.c b/hw/ppc/mpc8544ds.c index 81177505f0..cd6cd04bef 100644 --- a/hw/ppc/mpc8544ds.c +++ b/hw/ppc/mpc8544ds.c @@ -14,6 +14,7 @@ #

[PATCH 10/11] hw/sd/sdhci: Implement Freescale eSDHC device model

2022-09-15 Thread Bernhard Beschow
Will allow e500 boards to access SD cards using just their own devices. Signed-off-by: Bernhard Beschow --- hw/sd/sdhci.c | 147 +- include/hw/sd/sdhci.h | 3 + 2 files changed, 149 insertions(+), 1 deletion(-) diff --git a/hw/sd/sdhci.c b/hw/sd

[PATCH 03/11] docs/system/ppc/ppce500: Add heading for networking chapter

2022-09-15 Thread Bernhard Beschow
The sudden change of topics is slightly confusing and makes the networking information less visible. So separate the networking chapter to improve comprehensibility. Signed-off-by: Bernhard Beschow --- docs/system/ppc/ppce500.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/system

[PATCH 11/11] hw/ppc/e500: Add Freescale eSDHC to e500 boards

2022-09-15 Thread Bernhard Beschow
Adds missing functionality to emulated e500 SOCs which increases the chance of given "real" firmware images to access SD cards. Signed-off-by: Bernhard Beschow --- docs/system/ppc/ppce500.rst | 13 + hw/ppc/Kconfig | 1 + hw/ppc/e500.c | 32 +++

[PATCH 07/11] hw/ppc/e500: Implement pflash handling

2022-09-15 Thread Bernhard Beschow
Allows e500 boards to have their root file system reside on flash using only builtin devices. Note that the flash memory area is only created when a -pflash argument is given, and that the size is determined by the given file. The idea is to put users into control. Signed-off-by: Bernhard Beschow

[PATCH 05/11] hw/ppc/e500: Remove if statement which is now always true

2022-09-15 Thread Bernhard Beschow
Now that the MPC8544DS board also has a platform bus, the if statement was always true. Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 30 ++ hw/ppc/e500.h | 1 - hw/ppc/e500plat.c | 1 - hw/ppc/mpc8544ds.c | 1 - 4 files changed, 14 insertions(+),

[PATCH 08/11] hw/sd/sdhci-internal: Unexport ESDHC defines

2022-09-15 Thread Bernhard Beschow
These defines aren't used outside of sdhci.c, so can be defined there. Signed-off-by: Bernhard Beschow --- hw/sd/sdhci-internal.h | 20 hw/sd/sdhci.c | 19 +++ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/hw/sd/sdhci-internal.h b/

[PATCH 09/11] hw/sd/sdhci: Rename ESDHC_* defines to USDHC_*

2022-09-15 Thread Bernhard Beschow
The device model's functions start with "usdhc_", so rename the defines accordingly for consistency. Signed-off-by: Bernhard Beschow --- hw/sd/sdhci.c | 68 +-- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/s

[PULL 0/3] hmp queue

2022-09-15 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit 79dfa177ae348bb5ab5f97c0915359b13d6186e2: Merge tag 'pull-qapi-2022-09-07' of git://repo.or.cz/qemu/armbru into staging (2022-09-07 13:13:30 -0400) are available in the Git repository at: https://gitlab.com/dagrh/qemu.git t

[PULL 2/3] monitor/hmp: print trace as option in help for log command

2022-09-15 Thread Dr. David Alan Gilbert (git)
From: Dongli Zhang The below is printed when printing help information in qemu-system-x86_64 command line, and when CONFIG_TRACE_LOG is enabled: $ qemu-system-x86_64 -d help ... ... trace:PATTERN enable trace events Use "-d trace:help" to get a list of trace event

[PULL 3/3] hmp: Fix ordering of text

2022-09-15 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Fix the ordering of the help text so it's always after the commands being defined. A few had got out of order. Keep 'info' at the end. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Daniel P. Berrangé --- hmp-commands.hx | 46 +++---

[PULL 1/3] monitor: Support specified vCPU registers

2022-09-15 Thread Dr. David Alan Gilbert (git)
From: zhenwei pi Originally we have to get all the vCPU registers and parse the specified one. To improve the performance of this usage, allow user specified vCPU id to query registers. Run a VM with 16 vCPU, use bcc tool to track the latency of 'hmp_info_registers': 'info registers -a' uses abo

Re: [PATCH v2 1/4] scripts/ci/setup: ninja missing from build-environment

2022-09-15 Thread Thomas Huth
On 14/09/2022 13.41, Lucas Mateus Castro(alqotel) wrote: From: "Lucas Mateus Castro (alqotel)" ninja-build is missing from the RHEL environment, so a system prepared with that script would still fail to compile QEMU. Tested on a Fedora 36 Signed-off-by: Lucas Mateus Castro (alqotel) --- scr

[PATCH] vfio/common: Fix vfio_iommu_type1_info use after free

2022-09-15 Thread Alex Williamson
On error, vfio_get_iommu_info() frees and clears *info, but vfio_connect_container() continues to use the pointer regardless of the return value. Restructure the code such that a failure of this function triggers an error and clean up the remainder of the function, including updating an outdated c

[PATCH] mem/cxl_type3: fix GPF DVSEC

2022-09-15 Thread Tong Zhang
The structure is for device dvsec not port dvsec. Change type to fix this issue. Signed-off-by: Tong Zhang --- hw/mem/cxl_type3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index 3bf2869573..ada2108fac 100644 --- a/hw/mem/cxl_type3

Re: [PATCH RFC 01/13] migration: Use non-atomic ops for clear log bitmap

2022-09-15 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Since we already have bitmap_mutex to protect either the dirty bitmap or > the clear log bitmap, we don't need atomic operations to set/clear/test on > the clear log bitmap. Switching all ops from atomic to non-atomic > versions, meanwhile touch up the comme

Re: [PATCH RFC 02/13] migration: Add postcopy_preempt_active()

2022-09-15 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Add the helper to show that postcopy preempt enabled, meanwhile active. > > Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert > --- > migration/ram.c | 9 +++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/migration/

Re: [PATCH RFC 01/13] migration: Use non-atomic ops for clear log bitmap

2022-09-15 Thread Peter Xu
On Thu, Sep 15, 2022 at 07:49:57PM +0100, Dr. David Alan Gilbert wrote: > * Peter Xu (pet...@redhat.com) wrote: > > Since we already have bitmap_mutex to protect either the dirty bitmap or > > the clear log bitmap, we don't need atomic operations to set/clear/test on > > the clear log bitmap. Swit

[PATCH 22/27] qapi stats: Elide redundant has_FOO in generated C

2022-09-15 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/stats.json. Said commit explains the transfor

[PATCH 09/27] qapi char: Elide redundant has_FOO in generated C

2022-09-15 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/char.json. Said commit explains the transform

[PATCH 05/27] qapi tests: Elide redundant has_FOO in generated C

2022-09-15 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for tests/qapi-schema/qapi-schema-test.json. Said comm

[PATCH 04/27] qapi: Start to elide redundant has_FOO in generated C

2022-09-15 Thread Markus Armbruster
In QAPI, absent optional members are distinct from any present value. We thus represent an optional schema member FOO as two C members: a FOO with the member's type, and a bool has_FOO. Likewise for function arguments. However, has_FOO is actually redundant for a pointer-valued FOO, which can be

[PATCH 14/27] qapi migration: Elide redundant has_FOO in generated C

2022-09-15 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/migration.json. Said commit explains the tran

[PATCH 27/27] qapi: Drop temporary logic to support conversion step by step

2022-09-15 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- scripts/qapi/schema.py | 6 -- 1 file changed, 6 deletions(-) diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index 4594c69d0b..cd8661125c 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -757,12 +757,6 @@ def __init__(self

[PATCH 02/27] qapi: Tidy up whitespace in generated code

2022-09-15 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- docs/devel/qapi-code-gen.rst | 1 - scripts/qapi/commands.py | 7 +++ scripts/qapi/events.py | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index 997313fce7..b56ea

[PATCH 24/27] qapi transaction: Elide redundant has_FOO in generated C

2022-09-15 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/transaction.json. Said commit explains the tr

[PATCH 03/27] docs/devel/qapi-code-gen: Extend example for next commit's change

2022-09-15 Thread Markus Armbruster
The next commit will change the code generated for some optional members. The example schema contains an optional member affected by the change. Add one that is not affected. Signed-off-by: Markus Armbruster --- docs/devel/qapi-code-gen.rst | 21 - 1 file changed, 20 insert

[PATCH 12/27] qapi job: Elide redundant has_FOO in generated C

2022-09-15 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/job.json. Said commit explains the transforma

[PATCH 11/27] qapi dump: Elide redundant has_FOO in generated C

2022-09-15 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/dump.json. Said commit explains the transform

[PATCH 00/27] qapi: Elide redundant has_FOO in generated C

2022-09-15 Thread Markus Armbruster
In QAPI, absent optional members are distinct from any present value. We thus represent an optional schema member FOO as two C members: a FOO with the member's type, and a bool has_FOO. Likewise for function arguments. However, the has_FOO is actually redundant for a pointer-valued FOO, which can

[PATCH 15/27] qapi misc: Elide redundant has_FOO in generated C

2022-09-15 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/misc.json. Said commit explains the transform

[PATCH 18/27] qapi qdev qom: Elide redundant has_FOO in generated C

2022-09-15 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/qdev.json and qapi/qom.json. Said commit expl

[PATCH 07/27] qapi audio: Elide redundant has_FOO in generated C

2022-09-15 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/audio.json. Said commit explains the transfor

[PATCH 01/27] docs/devel/qapi-code-gen: Update example to match current code

2022-09-15 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- docs/devel/qapi-code-gen.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index cd9b544376..997313fce7 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.r

[PATCH 20/27] qapi rocker: Elide redundant has_FOO in generated C

2022-09-15 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/rocker.json. Said commit explains the transfo

  1   2   >