[PATCH v2 15/18] colo: move stubs out of stubs/

2024-04-08 Thread Paolo Bonzini
Since the colo stubs are needed exactly when the build options are not enabled, move them together with the code they stub. Signed-off-by: Paolo Bonzini --- stubs/colo.c => migration/colo-stubs.c | 0 stubs/colo-compare.c => net/colo-stubs.c | 0 migration/meson.build

[PATCH v2 09/18] stubs: remove obsolete stubs

2024-04-08 Thread Paolo Bonzini
These file define functions are are not called from common code anymore. Delete those functions and, if applicable, the entire files. Signed-off-by: Paolo Bonzini --- include/sysemu/sysemu.h | 2 -- stubs/isa-bus.c | 7 --- stubs/module-opts.c | 2 -- stubs/monitor-core.c

[PATCH v2 03/18] ebpf: Restrict to system emulation

2024-04-08 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé eBPF is not used in user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-ID: <20240404194757.9343-2-phi...@linaro.org> Signed-off-by: Paolo Bonzini --- ebpf/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH v2 18/18] stubs: move monitor_fdsets_cleanup with other fdset stubs

2024-04-08 Thread Paolo Bonzini
Even though monitor_get_fd() has to remain separate because it is mocked by tests/unit/test-util-sockets, monitor_fdsets_cleanup() is logically part of the stubs for monitor/fds.c, so move it there. Signed-off-by: Paolo Bonzini --- stubs/fdset.c| 6 ++ stubs/monitor-internal.c

[PATCH v2 08/18] hw: Include minimal source set in user emulation build

2024-04-08 Thread Paolo Bonzini
. This removes about 10% from the time needed to run "../configure --disable-system --disable-tools --disable-guest-agent". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-ID: <20240404194757.9343-8-phi...@linaro.org> Signed-off-by: Paolo Bonzini ---

[PATCH v2 14/18] memory-device: move stubs out of stubs/

2024-04-08 Thread Paolo Bonzini
Since the memory-device stubs are needed exactly when the Kconfig symbols are not needed, move them to hw/mem/. Signed-off-by: Paolo Bonzini --- stubs/memory_device.c => hw/mem/memory-device-stubs.c | 0 hw/mem/meson.build| 1 + stubs/meson.bu

[PATCH v2 07/18] hw/core: Move system emulation files to system_ss

2024-04-08 Thread Paolo Bonzini
hotplug.c, qdev-hotplug.c and reset.c are not used by user emulation and need not be included in hwcore_ss. Move them to system_ss, where they belong, by letting the linker pull in the stubs when needed. Signed-off-by: Paolo Bonzini --- {hw/core => stubs}/hotplug-stubs.c | 0 hw/c

[PATCH v2 10/18] hw/usb: move stubs out of stubs/

2024-04-08 Thread Paolo Bonzini
Since the USB stubs are needed exactly when the Kconfig symbols are not enabled, they can be placed in hw/usb/ and conditionalized on CONFIG_USB. Signed-off-by: Paolo Bonzini --- stubs/usb-dev-stub.c => hw/usb/bus-stub.c | 0 hw/usb/meson.build| 2 +- stubs/meson.bu

[PATCH v2 06/18] util/qemu-config: Extract QMP commands to qemu-config-qmp.c

2024-04-08 Thread Paolo Bonzini
phi...@linaro.org> Signed-off-by: Paolo Bonzini --- include/qemu/config-file.h | 3 + monitor/qemu-config-qmp.c | 206 + util/qemu-config.c | 204 +--- monitor/meson.build| 1 + 4 files changed, 212 insertions(+

[PATCH v2 05/18] yank: only build if needed

2024-04-08 Thread Paolo Bonzini
The yank feature is not used in user emulation. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- util/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/meson.build b/util/meson.build index 0ef9886be04..2ad57b10ba2 100644 --- a/util

Re: [PATCH] kvm: error out of kvm_irqchip_add_msi_route() in case of full route table

2024-04-08 Thread Paolo Bonzini
Queued, thanks. Paolo

[PATCH for-9.0] nanomips: fix warnings with GCC 14

2024-04-08 Thread Paolo Bonzini
GCC 14 shows -Wshadow=local warnings if an enum conflicts with a local variable (including a parameter). To avoid this, move the problematic enum and all of its dependencies after the hundreds of functions that have a parameter named "instruction". Signed-off-by: Paolo Bonzini

Re: [PATCH-for-9.1 5/7] hw/core: Restrict reset handlers API to system emulation

2024-04-08 Thread Paolo Bonzini
On Thu, Apr 4, 2024 at 9:48 PM Philippe Mathieu-Daudé wrote: > > Headers in include/sysemu/ are specific to system > emulation and should not be used in user emulation. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/core/reset.c | 4 > 1 file changed, 4 insertions(+) > > diff --git

Re: [PATCH-for-9.1 3/7] monitor: Rework stubs to simplify user emulation linking

2024-04-08 Thread Paolo Bonzini
On Thu, Apr 4, 2024 at 9:48 PM Philippe Mathieu-Daudé wrote: > > Currently monitor stubs are scattered in 3 files. > > Merge these stubs in 2 files, a generic one (monitor-core) > included in all builds (in particular user emulation), and > a less generic one to be included by tools and system

Re: [PATCH-for-9.1 4/7] util/qemu-config: Extract QMP commands to qemu-config-qmp.c

2024-04-08 Thread Paolo Bonzini
On Thu, Apr 4, 2024 at 9:48 PM Philippe Mathieu-Daudé wrote: > > QMP is irrelevant for user emulation. Extract the code > related to QMP in a different source file, which won't > be build for user emulation binaries. This avoid pulling > pointless code. > > Signed-off-by: Philippe Mathieu-Daudé

Re: [PATCH-for-9.1 2/7] yank: Restrict to system emulation

2024-04-08 Thread Paolo Bonzini
On Thu, Apr 4, 2024 at 9:48 PM Philippe Mathieu-Daudé wrote: > > The yank feature is not used in user emulation. But it is used in block layer tools. The simplest thing here is probably to move it under have_block instead. Paolo > Signed-off-by: Philippe Mathieu-Daudé > --- >

Re: [PATCH] Makefile: preserve --jobserver-auth argument when calling ninja

2024-04-08 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH v3 00/17] [for-9.0] esp: avoid explicit setting of DRQ within ESP state machine

2024-04-04 Thread Paolo Bonzini
_fifo_push() is always called for PDMA writes to the FIFO, thereby ensuring > that esp_update_drq() remains correct even in the case of FIFO overflow. > > Finally patch 17 removes all manual calls to esp_raise_drq() and > esp_lower_drq() > since the DRQ signal is now updated correctly upon

[PULL v2 0/6] lsi, vga fixes for 2024-04-02

2024-04-03 Thread Paolo Bonzini
fix assertion failure with 4- and 16-color modes * remove unnecessary assignment v1->v2: dropped patch to reject invalid Block Move Paolo Bonzini (6): vga: merge conditionals on shift control register vga: move compu

[PULL 2/7] vga: move computation of dirty memory region later

2024-04-02 Thread Paolo Bonzini
Move the computation of region_start and region_end after the value of "bits" is known. This makes it possible to distinguish modes that support horizontal pel panning from modes that do not. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- hw/display/

[PULL 1/7] vga: merge conditionals on shift control register

2024-04-02 Thread Paolo Bonzini
n use it to compute region_end. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- hw/display/vga.c | 89 +++- 1 file changed, 42 insertions(+), 47 deletions(-) diff --git a/hw/display/vga.c b/hw/display/vga.c index bc5b83421bf..4795a0012e2

[PULL 4/7] vga: do not treat horiz pel panning value of 8 as "enabled"

2024-04-02 Thread Paolo Bonzini
Horizontal pel panning bit 3 is only used in text mode. In graphics mode, it can be treated as if it was zero, thus not extending the dirty memory region. Signed-off-by: Paolo Bonzini --- hw/display/vga.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/display/vga.c b

[PULL 3/7] vga: adjust dirty memory region if pel panning is active

2024-04-02 Thread Paolo Bonzini
+ length <= snap->end' failed. Reported-by: Helge Konetzka Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2244 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- hw/display/vga.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/display

[PULL 0/7] lsi, vga fixes for 2024-04-02

2024-04-02 Thread Paolo Bonzini
h 4- and 16-color modes * remove unnecessary assignment ---- Paolo Bonzini (7): vga: merge conditionals on shift control register vga: move computation of dirty memory region later vga: adjust dirty memory region if

[PULL 6/7] lsi53c895a: detect invalid Block Move instruction

2024-04-02 Thread Paolo Bonzini
interrupt unconditionally if the low 24 bits are 0x00. Reported-by: Chuhong Yuan Signed-off-by: Paolo Bonzini --- hw/scsi/lsi53c895a.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index eb9828dd5ef..1e18d88983b 100644 --- a/hw/scsi/ls

[PULL 7/7] pc_q35: remove unnecessary m->alias assignment

2024-04-02 Thread Paolo Bonzini
The assignment is already inherited from pc-q35-8.2. Signed-off-by: Paolo Bonzini --- hw/i386/pc_q35.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index b5922b44afa..c7bc8a2041f 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -393,7 +393,6

[PULL 5/7] lsi53c895a: avoid out of bounds access to s->msg[]

2024-04-02 Thread Paolo Bonzini
If no bytes are there to process in the message in phase, the input data latch (s->sidl) is set to s->msg[-1]. Just do nothing since no DMA is performed. Reported-by: Chuhong Yuan Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- hw/scsi/lsi53c895a.

[PATCH for-9.0 0/4] vga: fix assertion failure with 4- and 16-color modes

2024-04-02 Thread Paolo Bonzini
s computed. This is enabled by the availability of "bits" where the dirty memory region is computed; it is now possible for 8- and 15-bit modes to skip the slow path and only read dirty bits for a small part of VRAM. Paolo Bonzini (6): vga: merge conditionals on shift control register v

[PATCH for-9.1 6/4] vga: move dirty memory region code together

2024-04-02 Thread Paolo Bonzini
Take into account split screen mode close to wrap around, which is the other special case for dirty memory region computation. Signed-off-by: Paolo Bonzini --- hw/display/vga.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/display/vga.c b/hw/display/vga.c index

[PATCH for-9.0 4/4] vga: do not treat horiz pel panning value of 8 as "enabled"

2024-04-02 Thread Paolo Bonzini
Horizontal pel panning bit 3 is only used in text mode. In graphics mode, it can be treated as if it was zero, thus not extending the dirty memory region. Signed-off-by: Paolo Bonzini --- hw/display/vga.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/display/vga.c b

[PATCH for-9.1 5/4] vga: optimize computation of dirty memory region

2024-04-02 Thread Paolo Bonzini
me "bwidth" computation that is used later in the function, and that already takes into account pel panning), so that the slow path is restricted to the wraparound case. Signed-off-by: Paolo Bonzini --- hw/display/vga.c | 24 +++- 1 file changed, 7 insertions(+), 17 deletions

[PATCH for-9.0 1/4] vga: merge conditionals on shift control register

2024-04-02 Thread Paolo Bonzini
n use it to compute region_end. Signed-off-by: Paolo Bonzini --- hw/display/vga.c | 89 +++- 1 file changed, 42 insertions(+), 47 deletions(-) diff --git a/hw/display/vga.c b/hw/display/vga.c index bc5b83421bf..4795a0012e2 100644 --- a/hw/display/vga.c +++

[PATCH for-9.0 2/4] vga: move computation of dirty memory region later

2024-04-02 Thread Paolo Bonzini
Move the computation of region_start and region_end after the value of "bits" is known. This makes it possible to distinguish modes that support horizontal pel panning from modes that do not. Signed-off-by: Paolo Bonzini --- hw/display/

[PATCH for-9.0 3/4] vga: adjust dirty memory region if pel panning is active

2024-04-02 Thread Paolo Bonzini
+ length <= snap->end' failed. Reported-by: Helge Konetzka Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2244 Signed-off-by: Paolo Bonzini --- hw/display/vga.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/display/vga.c b/hw/display/vga.c index b4cef

[PATCH] lsi53c895a: avoid out of bounds access to s->msg[]

2024-03-31 Thread Paolo Bonzini
If no bytes are there to process in the message in phase, the input data latch (s->sidl) is set to s->msg[-1]. Just do nothing since no DMA is performed. Reported-by: Chuhong Yuan Signed-off-by: Paolo Bonzini --- hw/scsi/lsi53c895a.c | 19 --- 1 file changed, 12 inse

[PATCH] lsi53c895a: detect invalid Block Move instruction

2024-03-31 Thread Paolo Bonzini
interrupt unconditionally if the low 24 bits are 0x00. Reported-by: Chuhong Yuan Signed-off-by: Paolo Bonzini --- hw/scsi/lsi53c895a.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index eb9828dd5ef..1e18d88983b 100644 --- a/hw/scsi/ls

Backdoor in xz, should we switch compression format for tarballs?

2024-03-29 Thread Paolo Bonzini
For more info, see https://lwn.net/ml/oss-security/20240329155126.kjjfduxw2yrlx...@awork3.anarazel.de/ but, essentially, xz was backdoored and it seems like upstream was directly responsible for this. Based on this, should we switch our distribution from bz2+xz to bz2+zstd or bz2+lzip? Thanks,

Re: [PATCH for-9.1 v5 1/3] hw: Add compat machines for 9.1

2024-03-29 Thread Paolo Bonzini
On Thu, Mar 28, 2024 at 11:07 AM Zhao Liu wrote: > > Hi Paolo, > > Just meet typos when compiling ;-) Thank you very much! Fixed both. Paolo > On Mon, Mar 25, 2024 at 03:14:20PM +0100, Paolo Bonzini wrote: > > Date: Mon, 25 Mar 2024 15:14:20 +0100 > > From: Paolo B

Re: [RFC] util/error-report: Add "error: " prefix for error-level report

2024-03-29 Thread Paolo Bonzini
On Fri, Mar 29, 2024 at 10:37 AM wrote: > > This was done in the context of inheriting the original error_report() > > interface without the prefix style. And it was also useful to have a > > means of error handling, such as exit(), when error occurs, so that the > > error message - the most

Re: [PATCH for-9.0] docs/about: Mark the iaspc machine type as deprecated

2024-03-27 Thread Paolo Bonzini
Il mer 27 mar 2024, 14:09 Igor Mammedov ha scritto: > It's question of whether we are willing to do unthinkable, > i.e. to break QEMU <-> guest ABI for isapc case by removing > corresponding fwcfg entries. > It's not unthinkable since it's unversioned. we are loosing a chance to cleanup > QEMU

Re: [PATCH-for-9.0? v2 4/4] meson: Enable -Wstatic-in-inline

2024-03-27 Thread Paolo Bonzini
Il mer 27 mar 2024, 13:42 Philippe Mathieu-Daudé ha scritto: > IIUC your comment, you are worried about system headers declaring > non-static inline functions? > No, it's just that the flag (and thus the patch) is not doing what the commit message says. Perhaps you could instead add a

Re: [PATCH-for-9.0? v2 4/4] meson: Enable -Wstatic-in-inline

2024-03-27 Thread Paolo Bonzini
On 3/26/24 18:10, Philippe Mathieu-Daudé wrote: Compilers are clever enough to inline code when necessary. The only case we accept an inline function is static in header (we use C, not C++). Add the -Wstatic-in-inline CPPFLAG to prevent public and inline function to be added in the code base.

Re: [PATCH 12/26] KVM: track whether guest state is encrypted

2024-03-27 Thread Paolo Bonzini
On Tue, Mar 26, 2024 at 4:48 PM Xiaoyao Li wrote: > So, this requires confidential guests to call > kvm_mark_guest_state_protected() in its machine_init_done notifier callback? > > But for TDX, the guest_state is protected at the beginning, not some > time later when machine_init_done. Good

Re: [PATCH v4 1/2] kvm: add support for guest physical bits

2024-03-27 Thread Paolo Bonzini
On Wed, Mar 20, 2024 at 3:45 AM Xiaoyao Li wrote: > If users pass configuration like "-cpu > qemu64,phys-bits=52,host-phys-bits-limit=45", the cpu->guest_phys_bits > will be set to 45. I think this is not what we want, though the usage > seems insane. > > We can guard it as > > if

[PATCH for-9.1 v5 3/3] kvm: add support for guest physical bits

2024-03-25 Thread Paolo Bonzini
: <20240318155336.156197-2-kra...@redhat.com> Signed-off-by: Paolo Bonzini --- v4->v5: - only call new function if cpu->guest_phys_bits == -1 - guard more precisely the upper bound of cpu->guest_phys_bits target/i386/kvm/kvm-cpu.c | 34 +- 1 file changed, 33 i

[PATCH for-9.1 v5 1/3] hw: Add compat machines for 9.1

2024-03-25 Thread Paolo Bonzini
Add 9.1 machine types for arm/i440fx/m68k/q35/s390x/spapr. Cc: Cornelia Huck Cc: Thomas Huth Cc: Harsh Prateek Bora Cc: Gavin Shan Signed-off-by: Paolo Bonzini --- include/hw/boards.h| 3 +++ include/hw/i386/pc.h | 3 +++ hw/arm/virt.c | 11 +-- hw/core

[PATCH for-9.1 v5 2/3] target/i386: add guest-phys-bits cpu property

2024-03-25 Thread Paolo Bonzini
From: Gerd Hoffmann Allows to set guest-phys-bits (cpuid leaf 8008, eax[23:16]) via -cpu $model,guest-phys-bits=$nr. Signed-off-by: Gerd Hoffmann Message-ID: <20240318155336.156197-3-kra...@redhat.com> Signed-off-by: Paolo Bonzini --- v4->v5: - move here all non-KVM parts - a

[PATCH for-9.1 v5 0/3] kvm: add support for guest physical bits

2024-03-25 Thread Paolo Bonzini
The adjustments based on Gerd' v4 patches are small, the main change is the introduction of ABI-compatible machine types for 9.0 so that the new property is only available on 9.1. Gerd Hoffmann (2): target/i386: add guest-phys-bits cpu property kvm: add support for guest physical bits Paolo

[PATCH v2] pc_q35: remove unnecessary m->alias assignment

2024-03-25 Thread Paolo Bonzini
The assignment is already inherited from pc-q35-8.2. Signed-off-by: Paolo Bonzini --- hw/i386/pc_q35.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index b5922b44afa..c7bc8a2041f 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -393,7 +393,6

Re: [PATCH] pc_q35: remove unnecessary m->alias assignment

2024-03-25 Thread Paolo Bonzini
On Mon, Mar 25, 2024 at 3:02 PM Peter Maydell wrote: > > On Mon, 25 Mar 2024 at 13:59, Paolo Bonzini wrote: > > > > The assignment is already inherited from pc-q35-8.2. -s > > Missing signed-off-by and a stray "-s" in the commit message :-) You can proba

[PATCH] pc_q35: remove unnecessary m->alias assignment

2024-03-25 Thread Paolo Bonzini
The assignment is already inherited from pc-q35-8.2. -s --- hw/i386/pc_q35.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index b5922b44afa..c7bc8a2041f 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -393,7 +393,6 @@ static void

Re: [PATCH] qapi: document leftover members in qapi/run-state.json

2024-03-25 Thread Paolo Bonzini
Il lun 25 mar 2024, 12:36 Markus Armbruster ha scritto: > Paolo Bonzini writes: > > > Suggested-by: Markus Armbruster > > Signed-off-by: Paolo Bonzini > > --- > > qapi/run-state.json | 26 +- > > 1 file changed, 25 insertions(

Re: [PATCH 15/26] target/i386: Implement mc->kvm_type() to get VM type

2024-03-25 Thread Paolo Bonzini
On Mon, Mar 25, 2024 at 10:29 AM Philippe Mathieu-Daudé wrote: > > On 22/3/24 19:11, Paolo Bonzini wrote: > > KVM is introducing a new API to create confidential guests, which > > will be used by TDX and SEV-SNP but is also available for SEV and > > SEV-ES. The API u

Re: [PATCH 03/26] confidential guest support: Add kvm_init() and kvm_reset() in class

2024-03-25 Thread Paolo Bonzini
On Mon, Mar 25, 2024 at 9:33 AM Philippe Mathieu-Daudé wrote: > > Hi Xiaoyao, > > On 22/3/24 19:10, Paolo Bonzini wrote: > > From: Xiaoyao Li > > > > Different confidential VMs in different architectures all have the same > > needs to do their specific initial

[PATCH] qapi: document leftover members in qapi/run-state.json

2024-03-25 Thread Paolo Bonzini
Suggested-by: Markus Armbruster Signed-off-by: Paolo Bonzini --- qapi/run-state.json | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/qapi/run-state.json b/qapi/run-state.json index 789fc34559a..cb4a2b43293 100644 --- a/qapi/run-state.json +++ b

[PATCH] qapi: document leftover members in qapi/stats.json

2024-03-25 Thread Paolo Bonzini
Suggested-by: Markus Armbruster Signed-off-by: Paolo Bonzini --- qapi/stats.json | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/qapi/stats.json b/qapi/stats.json index ce9d8161ecb..578b52c7ef7 100644 --- a/qapi/stats.json +++ b/qapi/stats.json @@ -114,13

[PATCH] kvm: use configs/ definition to conditionalize debug support

2024-03-22 Thread Paolo Bonzini
If an architecture adds support for KVM_CAP_SET_GUEST_DEBUG but QEMU does not have the necessary code, QEMU will fail to build after updating kernel headers. Avoid this by using a #define in config-target.h instead of KVM_CAP_SET_GUEST_DEBUG. Signed-off-by: Paolo Bonzini --- configs/targets

[PATCH 10/26] [TO SQUASH] hw/i386: Remove redeclaration of struct setup_data

2024-03-22 Thread Paolo Bonzini
From: Michael Roth It is now provided by kernel headers. This needs to be squashed with the header update to avoid temporary build bisect breakage. Keeping it separate for reference. Signed-off-by: Michael Roth Message-ID: <20240320083945.991426-6-michael.r...@amd.com> Signed-off-by:

[PATCH 13/26] KVM: remove kvm_arch_cpu_check_are_resettable

2024-03-22 Thread Paolo Bonzini
Board reset requires writing a fresh CPU state. As far as KVM is concerned, the only thing that blocks reset is that CPU state is encrypted; therefore, kvm_cpus_are_resettable() can simply check if that is the case. Signed-off-by: Paolo Bonzini --- include/sysemu/kvm.h | 10

[PATCH 06/26] s390: Switch to use confidential_guest_kvm_init()

2024-03-22 Thread Paolo Bonzini
From: Xiaoyao Li Use unified confidential_guest_kvm_init() for consistency with other architectures. Signed-off-by: Xiaoyao Li Message-Id: <20240229060038.606591-1-xiaoyao...@intel.com> Signed-off-by: Paolo Bonzini --- target/s390x/kvm/pv.h | 14 -- hw/s390x/s390-

[PATCH 21/26] kvm/memory: Make memory type private by default if it has guest memfd backend

2024-03-22 Thread Paolo Bonzini
to private when memory region has valid guest memfd backend. Signed-off-by: Xiaoyao Li Signed-off-by: Michael Roth Message-ID: <20240320083945.991426-16-michael.r...@amd.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a

[PATCH 23/26] RAMBlock: make guest_memfd require uncoordinated discard

2024-03-22 Thread Paolo Bonzini
inated discard, i.e. use ram_block_coordinated_discard_require(). [Commit message mostly by Michael Roth ] Signed-off-by: Paolo Bonzini --- system/physmem.c | 8 1 file changed, 8 insertions(+) diff --git a/system/physmem.c b/system/physmem.c index f5dfa20e57e..5ebcf5be116 100644 --- a/

[PATCH 16/26] target/i386: SEV: use KVM_SEV_INIT2 if possible

2024-03-22 Thread Paolo Bonzini
type). Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 2 ++ target/i386/sev.c | 41 + 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index b599a7fae36..2577e345502 100644

[PATCH 15/26] target/i386: Implement mc->kvm_type() to get VM type

2024-03-22 Thread Paolo Bonzini
upport, but it will also enable support for VMSA features such as DebugSwap, which are only available via KVM_SEV_INIT2. Co-developed-by: Xiaoyao Li Signed-off-by: Xiaoyao Li Signed-off-by: Paolo Bonzini --- target/i386/confidential-guest.h | 19 ++ target/i386/kvm/kvm_i386.h | 2 ++ hw/i386

[PATCH 14/26] target/i386: introduce x86-confidential-guest

2024-03-22 Thread Paolo Bonzini
Introduce a common superclass for x86 confidential guest implementations. It will extend ConfidentialGuestSupportClass with a method that provides the VM type to be passed to KVM_CREATE_VM. Signed-off-by: Paolo Bonzini --- target/i386/confidential-guest.h | 40

[PATCH 09/26] [HACK] linux-headers: Update headers for 6.8 + kvm-coco-queue + SNP

2024-03-22 Thread Paolo Bonzini
From: Michael Roth Pull in 6.8 kvm-next + kvm-coco-queue + SNP headers. Signed-off-by: Michael Roth Signed-off-by: Paolo Bonzini --- include/standard-headers/asm-x86/bootparam.h | 17 +- include/standard-headers/asm-x86/kvm_para.h | 3 +- include/standard-headers/asm-x86/setup_data.h

[PATCH 22/26] HostMem: Add mechanism to opt in kvm guest memfd via MachineState

2024-03-22 Thread Paolo Bonzini
.r...@amd.com> Signed-off-by: Paolo Bonzini --- include/hw/boards.h | 2 ++ include/sysemu/hostmem.h | 1 + backends/hostmem-file.c | 1 + backends/hostmem-memfd.c | 1 + backends/hostmem-ram.c | 1 + backends/hostmem.c | 1 + hw/core/machine.c| 5 + 7 files changed, 12 ins

[PATCH 25/26] kvm: handle KVM_EXIT_MEMORY_FAULT

2024-03-22 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- include/sysemu/kvm.h | 2 + accel/kvm/kvm-all.c| 99 +- accel/kvm/trace-events | 2 + 3 files changed, 93 insertions(+), 10 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 2cb31

[PATCH 18/26] kvm: Introduce support for memory_attributes

2024-03-22 Thread Paolo Bonzini
or guest_memfd based private memory. Signed-off-by: Xiaoyao Li Message-ID: <20240320083945.991426-11-michael.r...@amd.com> Signed-off-by: Paolo Bonzini --- include/sysemu/kvm.h | 4 accel/kvm/kvm-all.c | 31 +++ 2 files changed, 35 insertions(+) diff --git a/i

[PATCH 24/26] physmem: Introduce ram_block_discard_guest_memfd_range()

2024-03-22 Thread Paolo Bonzini
Hildenbrand Signed-off-by: Michael Roth Message-ID: <20240320083945.991426-12-michael.r...@amd.com> Signed-off-by: Paolo Bonzini --- include/exec/cpu-common.h | 2 ++ system/physmem.c | 23 +++ 2 files changed, 25 insertions(+) diff --git a/include/ex

[PATCH 26/26] i386/kvm: Move architectural CPUID leaf generation to separate helper

2024-03-22 Thread Paolo Bonzini
. Signed-off-by: Sean Christopherson Signed-off-by: Xiaoyao Li Message-ID: <20240229063726.610065-23-xiaoyao...@intel.com> [Unify error reporting, rename function. - Paolo] Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 446 +- 1 file change

[PATCH 20/26] kvm: Enable KVM_SET_USER_MEMORY_REGION2 for memslot

2024-03-22 Thread Paolo Bonzini
-by: Xiaoyao Li Message-ID: <20240320083945.991426-10-michael.r...@amd.com> Signed-off-by: Paolo Bonzini --- include/sysemu/kvm_int.h | 2 ++ accel/kvm/kvm-all.c | 46 +--- accel/kvm/trace-events | 2 +- 3 files changed, 41 insertions(+), 9 del

[PATCH 19/26] RAMBlock: Add support of KVM private guest memfd

2024-03-22 Thread Paolo Bonzini
. Signed-off-by: Xiaoyao Li Reviewed-by: David Hildenbrand Message-ID: <20240320083945.991426-7-michael.r...@amd.com> Signed-off-by: Paolo Bonzini --- include/exec/memory.h | 20 +--- include/exec/ram_addr.h | 2 +- include/exec/ramblock.h | 1 + include/sysemu/kvm.h

[PATCH 05/26] ppc/pef: switch to use confidential_guest_kvm_init/reset()

2024-03-22 Thread Paolo Bonzini
-by: Paolo Bonzini --- include/hw/ppc/pef.h | 17 - hw/ppc/pef.c | 9 ++--- hw/ppc/spapr.c | 10 +++--- 3 files changed, 13 insertions(+), 23 deletions(-) delete mode 100644 include/hw/ppc/pef.h diff --git a/include/hw/ppc/pef.h b/include/hw/ppc/pef.h deleted file

[PATCH 02/26] q35: Introduce smm_ranges property for q35-pci-host

2024-03-22 Thread Paolo Bonzini
Signed-off-by: Sean Christopherson Signed-off-by: Xiaoyao Li Signed-off-by: Michael Roth Message-ID: <20240320083945.991426-19-michael.r...@amd.com> Signed-off-by: Paolo Bonzini --- include/hw/i386/pc.h | 1 + include/hw/pci-host/q35.h | 1 + hw/i386/pc_q35.c | 2 ++

[PATCH for-9.1 00/26] x86, kvm: common confidential computing subset

2024-03-22 Thread Paolo Bonzini
rs: Update headers for 6.8 + kvm-coco-queue + SNP [TO SQUASH] hw/i386: Remove redeclaration of struct setup_data RAMBlock: Add support of KVM private guest memfd Paolo Bonzini (7): runstate: skip initial CPU reset if reset is not actually possible KVM: track whether guest state is encry

[PATCH 04/26] i386/sev: Switch to use confidential_guest_kvm_init()

2024-03-22 Thread Paolo Bonzini
/kvm/kvm.c to SEV code. Signed-off-by: Xiaoyao Li Message-Id: <20240229060038.606591-1-xiaoyao...@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/sev.h | 2 - target/i386/kvm/kvm.c | 10 +-- target/i386/kvm/sev-stub.c | 21 -- target/i386/sev.c

[PATCH 08/26] scripts/update-linux-headers: Add bits.h to file imports

2024-03-22 Thread Paolo Bonzini
From: Michael Roth Signed-off-by: Michael Roth Signed-off-by: Paolo Bonzini --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index d48856f9e24..5f20434d5c5 100755

[PATCH 11/26] runstate: skip initial CPU reset if reset is not actually possible

2024-03-22 Thread Paolo Bonzini
do not touch CPU state and that all such setup is done before, at the time of cpu_synchronize_all_post_init(). Signed-off-by: Paolo Bonzini --- system/runstate.c | 15 ++- roms/edk2 | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/system/runstate.c b

[PATCH 17/26] trace/kvm: Split address space and slot id in trace_kvm_set_user_memory()

2024-03-22 Thread Paolo Bonzini
From: Xiaoyao Li The upper 16 bits of kvm_userspace_memory_region::slot are address space id. Parse it separately in trace_kvm_set_user_memory(). Signed-off-by: Xiaoyao Li Message-ID: <20240229063726.610065-5-xiaoyao...@intel.com> Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c

[PATCH 07/26] scripts/update-linux-headers: Add setup_data.h to import list

2024-03-22 Thread Paolo Bonzini
the list of allowed includes: it does not have a matching substitution, and therefore it would not be possible to use it on non-Linux systems where there is no /usr/include/asm-generic/ directory. Signed-off-by: Michael Roth Signed-off-by: Paolo Bonzini --- scripts/update-linux-headers.sh | 6

[PATCH 12/26] KVM: track whether guest state is encrypted

2024-03-22 Thread Paolo Bonzini
rom that point, skip reading registers so that cpu->vcpu_dirty is never true: if it ever becomes true, kvm_arch_put_registers() will fail miserably. Signed-off-by: Paolo Bonzini --- include/sysemu/kvm.h | 2 ++ include/sysemu/kvm_int.h | 1 + accel/kvm/kvm-all.c | 14 -- targe

[PATCH 03/26] confidential guest support: Add kvm_init() and kvm_reset() in class

2024-03-22 Thread Paolo Bonzini
yao...@intel.com> Signed-off-by: Paolo Bonzini --- include/exec/confidential-guest-support.h | 34 ++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/include/exec/confidential-guest-support.h b/include/exec/confidential-guest-support.h index ba2dd4b5dfc..e5b188cffbf

[PATCH 01/26] pci-host/q35: Move PAM initialization above SMRAM initialization

2024-03-22 Thread Paolo Bonzini
-18-michael.r...@amd.com> Signed-off-by: Paolo Bonzini --- hw/pci-host/q35.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 0d7d4e3f086..98d4a7c253a 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@

[PATCH] virtio: move logging definitions to hw/virtio/virtio.h

2024-03-22 Thread Paolo Bonzini
They are not included in upstream Linux, and therefore should not be in standard-headers. Otherwise, the next update to the headers would eliminate them. Cc: Michael S. Tsirkin Signed-off-by: Paolo Bonzini --- include/hw/virtio/virtio.h | 7 +++ include/standard-headers

Re: [PATCH v3 37/49] i386/sev: Add the SNP launch start context

2024-03-21 Thread Paolo Bonzini
Il mer 20 mar 2024, 23:33 Michael Roth ha scritto: > On Wed, Mar 20, 2024 at 10:58:30AM +0100, Paolo Bonzini wrote: > > On 3/20/24 09:39, Michael Roth wrote: > > > From: Brijesh Singh > > > > > > The SNP_LAUNCH_START is called first to create a crypt

Re: [PATCH RFC v3 00/49] Add AMD Secure Nested Paging (SEV-SNP) support

2024-03-20 Thread Paolo Bonzini
On Wed, Mar 20, 2024 at 10:59 AM Paolo Bonzini wrote: > I will now focus on reviewing patches 6-20. This way we can prepare a > common tree for SEV_INIT2/SNP/TDX, for both vendors to build upon. Ok, the attachment is the delta that I have. The only major change is requiring discard

Re: [PATCH v3 06/49] RAMBlock: Add support of KVM private guest memfd

2024-03-20 Thread Paolo Bonzini
On 3/20/24 09:39, Michael Roth wrote: @@ -1842,6 +1842,17 @@ static void ram_block_add(RAMBlock *new_block, Error **errp) } } +if (kvm_enabled() && (new_block->flags & RAM_GUEST_MEMFD)) { +assert(new_block->guest_memfd < 0); + +new_block->guest_memfd =

Re: [PATCH v3 19/49] kvm: Make kvm_convert_memory() obey ram_block_discard_is_enabled()

2024-03-20 Thread Paolo Bonzini
On 3/20/24 09:39, Michael Roth wrote: Some subsystems like VFIO might disable ram block discard for uncoordinated cases. Since kvm_convert_memory()/guest_memfd don't implement a RamDiscardManager handler to convey discard operations to various listeners like VFIO. > Because of this, sequences

Re: [PATCH v3 10/49] kvm: Introduce support for memory_attributes

2024-03-20 Thread Paolo Bonzini
On 3/20/24 09:39, Michael Roth wrote: From: Xiaoyao Li Introduce the helper functions to set the attributes of a range of memory to private or shared. This is necessary to notify KVM the private/shared attribute of each gpa range. KVM needs the information to decide the GPA needs to be mapped

Re: [PATCH v3 09/49] kvm: Enable KVM_SET_USER_MEMORY_REGION2 for memslot

2024-03-20 Thread Paolo Bonzini
On 3/20/24 09:39, Michael Roth wrote: +if (cap_user_memory2 == -1) { +cap_user_memory2 = kvm_check_extension(s, KVM_CAP_USER_MEMORY2); +} + +if (!cap_user_memory2 && slot->guest_memfd >= 0) { +error_report("%s, KVM doesn't support KVM_CAP_USER_MEMORY2," +

Re: [PATCH] target/i386: Export RFDS bit to guests

2024-03-20 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH v2] target/i386: Add new CPU model SierraForest

2024-03-20 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH v3 0/1] Introduce Icelake-Server-v7 to enable TSX

2024-03-20 Thread Paolo Bonzini
Queued, thanks. Paolo

[PULL 2/6] vl: convert qemu_machine_creation_done() to Error **

2024-03-20 Thread Paolo Bonzini
Allow using Error ** to pass an error string up to qmp_x_exit_preconfig() and possibly main(). Signed-off-by: Paolo Bonzini --- system/vl.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/system/vl.c b/system/vl.c index 70f4cece7f9..0c970cf0203 100644 --- a/system

[PULL 5/6] tests/plugins: fix use-after-free bug

2024-03-20 Thread Paolo Bonzini
rec->count.score is inside rec, which is freed before rec->count.score is. Reorder the instructions Reported by Coverity as CID 1539967. Cc: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- contrib/plugins/howvec.c | 2 +- 1 file changed, 1 insertion

[PULL 6/6] meson: remove dead dictionary access

2024-03-20 Thread Paolo Bonzini
uot;, 2023-02-16). So, remove it for a very small simplification of meson.build. Signed-off-by: Paolo Bonzini --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index b375248a761..c9c3217ba4b 100644 --- a/meson.build +++ b/meson.build @@ -39

[PULL 3/6] vl: do not assert if sev-guest is used together with TCG

2024-03-20 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- system/vl.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/system/vl.c b/system/vl.c index 0c970cf0203..c6442229824 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2676,11 +2676,10 @@ static bool qemu_machine_creation_done(Error

[PULL 1/6] target/i386: fix direction of "32-bit MMU" test

2024-03-20 Thread Paolo Bonzini
Fixes: b1661801c18 ("target/i386: Fix physical address truncation", 2024-02-28) Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2206 Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 2 +- target/i386/cpu.c | 2 +- 2 files changed, 2 insertions(+), 2

[PULL 0/6] QEMU bug fixes for 20240320

2024-03-20 Thread Paolo Bonzini
-support argument * fix NULL pointer dereference in x86 MCE injection Paolo Bonzini (5): target/i386: fix direction of "32-bit MMU" test vl: convert qemu_machine_creation_done() to Error ** vl: do not ass

<    1   2   3   4   5   6   7   8   9   10   >