[PULL 05/16] Revert "meson: Propagate gnutls dependency"

2024-07-04 Thread Paolo Bonzini
. Signed-off-by: Akihiko Odaki Message-ID: <20240524-objects-v1-2-07cbbe961...@daynix.com> Signed-off-by: Paolo Bonzini --- meson.build| 4 ++-- block/meson.build | 2 +- io/meson.build | 2 +- storage-daemon/meson.build | 2 +- ui/meson.build

[PULL 12/16] i386/sev: Fallback to the default SEV device if none provided in sev_get_capabilities()

2024-07-04 Thread Paolo Bonzini
edhat.com Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 054366878aa..2f3dbe289f4 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -587,13 +587,13 @@

[PULL 11/16] i386/sev: Fix error message in sev_get_capabilities()

2024-07-04 Thread Paolo Bonzini
Signed-off-by: Michal Privoznik Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/b4648905d399780063dc70851d3d6a3cd28719a5.1719218926.git.mpriv...@redhat.com Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i3

[PULL 03/16] meson: merge plugin_ldflags into emulator_link_args

2024-07-04 Thread Paolo Bonzini
These serve the same purpose, except plugin_ldflags ends up in the linker command line in a more roundabout way (through specific_ss). Simplify. Signed-off-by: Paolo Bonzini --- plugins/meson.build | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/meson.build b

[PULL 06/16] meson: Drop the .fa library suffix

2024-07-04 Thread Paolo Bonzini
ide search with 'fa' and .fa (note the quotes and dot). Signed-off-by: Akihiko Odaki Message-ID: <20240524-xkb-v4-4-2de564e5c...@daynix.com> Signed-off-by: Paolo Bonzini --- docs/devel/build-system.rst | 5 - meson.build | 17 ++--- stubs/blk

[PULL 01/16] meson: move shared_module() calls where modules are already walked

2024-07-04 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- meson.build | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/meson.build b/meson.build index 54e6b09f4fb..8909f8c87d9 100644 --- a/meson.build +++ b/meson.build @@ -3602,6 +3602,7 @@ modinfo_files

Re: [PATCH] i386/sev: Don't allow automatic fallback to legacy KVM_SEV*_INIT

2024-07-04 Thread Paolo Bonzini
On Thu, Jul 4, 2024 at 11:39 AM Daniel P. Berrangé wrote: > > The debug_swap parameter simply could not be enabled in the old API > > without breaking measurements. The new API *is the fix* to allow using > > it (though QEMU doesn't have the option plumbed in yet). There is no > > extensibility.

Re: [PATCH] i386/sev: Don't allow automatic fallback to legacy KVM_SEV*_INIT

2024-07-04 Thread Paolo Bonzini
On Thu, Jul 4, 2024 at 10:42 AM Daniel P. Berrangé wrote: > > On Thu, Jul 04, 2024 at 08:51:05AM +0200, Paolo Bonzini wrote: > > On Thu, Jul 4, 2024 at 2:01 AM Michael Roth wrote: > > > Currently if the 'legacy-vm-type' property of the sev-guest object is > > >

Re: [PATCH] i386/sev: Don't allow automatic fallback to legacy KVM_SEV*_INIT

2024-07-04 Thread Paolo Bonzini
SEV-ES is the better choice for upstream. On the other hand, I think it makes no difference for SEV? Should we always use KVM_SEV_INIT, or alternatively fall back as it was before this patch? Paolo > Cc: Daniel P. Berrangé > Cc: Paolo Bonzini > cc: k...@vger.kernel.org > Signed-off-b

Re: [RFC PATCH 0/2] target/i386: SEV: allow running SNP guests with "-cpu host"

2024-07-03 Thread Paolo Bonzini
On Thu, Jul 4, 2024 at 2:26 AM Michael Roth wrote: > > Michael, any ideas? Is there a way for the host to retrieve the supported > > CPUID bits for SEV-SNP guests? > > If we want to support -cpu host, then I don't really see a way around > needing to maintain a filter of some sort sanitize what

Re: [PATCH v4 20/31] i386/sev: Add support for SNP CPUID validation

2024-07-03 Thread Paolo Bonzini
On Thu, Jul 4, 2024 at 6:10 AM Xiaoyao Li wrote: > > So there are specific ranges that are checked, mainly ones where there > > is potential for guests to misbehave if they are being lied to. But > > hypervisor-ranges are paravirtual in a sense so there's no assumptions > > being made about what

Re: [PATCH] char-stdio: Restore blocking mode of stdout on exit

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

Re: [PATCH 1/2] Python: bump minimum sphinx version to 3.4.3

2024-07-03 Thread Paolo Bonzini
On Wed, Jul 3, 2024 at 5:25 PM John Snow wrote: > To be clear I mean offline, isolated RPM builds under RHEL9 where I don't > think we can utilize PyPI at all; and vendoring Sphinx is I think not a > practical option due to the number of dependencies and non-pure Python deps. > > It's not a

Re: [PATCH 03/14] rust: define traits and pointer wrappers to convert from/to C representations

2024-07-03 Thread Paolo Bonzini
[warning: long email] On Wed, Jul 3, 2024 at 2:48 PM Marc-André Lureau wrote: > > Hi > > (adding Sebastian, one of the glib-rs developers in CC) > > On Mon, Jul 1, 2024 at 7:02 PM Paolo Bonzini wrote: >> >> The qemu::util::foreign module provides: >&g

Re: [PATCH 1/2] Python: bump minimum sphinx version to 3.4.3

2024-07-03 Thread Paolo Bonzini
On Wed, Jul 3, 2024 at 2:06 PM John Snow wrote: > On Wed, Jul 3, 2024, 4:00 AM Paolo Bonzini wrote: >> On 7/2/24 21:59, John Snow wrote: >> > With RHEL 8 support retired (It's been two years today since RHEL 9 >> > came out), our very oldest build platform version

[PATCH] target/i386: add avx-vnni-int16 feature

2024-07-03 Thread Paolo Bonzini
AVX-VNNI-INT16 (CPUID[EAX=7,ECX=1).EDX[10]) is supported by Clearwater Forest processor, add it to QEMU as it does not need any specific enablement. Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target

Re: [PATCH 0/2] i386/sev: Two trivial improvements to sev_get_capabilities()

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

[RFC PATCH 2/2] target/i386/SEV: implement mask_cpuid_features

2024-07-03 Thread Paolo Bonzini
these bits, this is going to break (tsc_deadline and tsc_adjust are the most likely one). Including the bits if they are present in host CPUID is not super safe either, since the firmware might not be updated to follow suit. Reported-by: Zixi Chen Not-quite-signed-off-by: Paolo Bonzini --- target/

[RFC PATCH 0/2] target/i386: SEV: allow running SNP guests with "-cpu host"

2024-07-03 Thread Paolo Bonzini
: edx: 0x even though the FSRM bit (0x10) is supported. That might be just a firmware bug however. Paolo Based-on: <20240627140628.1025317-1-pbonz...@redhat.com> Paolo Bonzini (4): target/i386: add support for masking CPUID features in confidential guests target/i386/SEV:

[RFC PATCH 1/2] target/i386: add support for masking CPUID features in confidential guests

2024-07-03 Thread Paolo Bonzini
;-cpu host". Signed-off-by: Paolo Bonzini --- target/i386/confidential-guest.h | 24 target/i386/cpu.c| 9 + target/i386/kvm/kvm.c| 5 + 3 files changed, 38 insertions(+) diff --git a/target/i386/confidential-guest.h b/t

[PATCH] target/i386: SEV: fix formatting of CPUID mismatch message

2024-07-03 Thread Paolo Bonzini
Fixes: 70943ad8e4d ("i386/sev: Add support for SNP CPUID validation", 2024-06-05) Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 3ab8b3c28b7..2a0f94d390d 100644 --

[PATCH] target/i386: do not include undefined bits in the AMD topoext leaf

2024-07-03 Thread Paolo Bonzini
Reimplement that commit using a CPU feature, so that it can be applied to all guests using a new machine type, independent of the CPU model. Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 3 +++ hw/i386/pc.c | 1 + target/i386/cpu.c | 4 3 files changed, 8 insertions(+) diff --gi

Re: [PATCH 1/2] Python: bump minimum sphinx version to 3.4.3

2024-07-03 Thread Paolo Bonzini
sphinx-build" } sphinx_rtd_theme = { accepted = ">=0.5", installed = "1.1.1" } [avocado] Acked-by: Paolo Bonzini Paolo

Re: [RFC PATCH v3 1/5] build-sys: Add rust feature option

2024-07-02 Thread Paolo Bonzini
On Tue, Jul 2, 2024 at 4:44 PM Manos Pitsidianakis wrote: > >Normally you'd see either --enable-XXX or --with-XXX and their > >corresponding --disable-XXX or --without-XXX. > > True. As the commit message says, `rust` is a reserved meson feature > name, so the auto-generated

Re: [PATCH 0/5] target/i386: CCOp cleanups

2024-07-01 Thread Paolo Bonzini
On Mon, Jul 1, 2024 at 9:05 PM Richard Henderson wrote: > > no objections at all to introducing more asserts. I think keeping the > > array is a better underlying implementation for cc_op_live() however. > > Hmm. I had an implementation that would detect missing entries at runtime, > but this

Re: [PATCH 0/5] target/i386: CCOp cleanups

2024-07-01 Thread Paolo Bonzini
On Mon, Jul 1, 2024 at 4:51 AM Richard Henderson wrote: > While debugging #2413, I spent quite a bit of time trying to work > out if the CCOp value was incorrect. I think the following is a > worthwhile cleanup, isolating potential problems to asserts. Hi Richard, no objections at all to

Re: [PATCH 2/2] system/vl.c: parse all -accel options

2024-07-01 Thread Paolo Bonzini
On Mon, Jul 1, 2024 at 4:34 PM Philippe Mathieu-Daudé wrote: > Reviewed-by: Philippe Mathieu-Daudé In principle, a Reviewed-by tag is just stating that you don't know of any issues that would prevent the patch being included. However, as a frequent participant to the project, your Reviewed-by

Re: [PATCH 0/2] system/vl.c: parse all '-accel' opts

2024-07-01 Thread Paolo Bonzini
On Mon, Jul 1, 2024 at 3:30 PM Daniel Henrique Barboza wrote: > My initial intention was to fix a problem we're having with libvirt and > RISC-V where we can't set 'riscv-aia' by appending '-accel kvm,riscv-aia=val' > via in the domain XML. libvirt will add a leading > '-accel kvm' in the

Re: [PATCH 1/2] system/vl.c: do not allow mixed -accel opts

2024-07-01 Thread Paolo Bonzini
On Mon, Jul 1, 2024 at 5:53 PM Daniel Henrique Barboza wrote: > > We use '-accel kvm -accel tcg' to allow kvm to fail (e.g. no /dev/kvm > > permission) and proceed with tcg. > > > > This patch will cause testsuite failures. > > For the issue I want to fix patch 2 alone is enough. I'll re-send.

Re: [PATCH 0/2] change some odd-looking atomic uses

2024-07-01 Thread Paolo Bonzini
On Mon, Jul 1, 2024 at 1:52 PM Wolfgang Bumiller wrote: > > I spotted the weird-looking pattern of: > atomic_set(atomic_load() N) > in a few palces and one variable in the graph-lock code which was used with > atomics except for a single case, which also seemed suspicious. > > I'm not sure

[PATCH 05/14] rust: define wrappers for Error

2024-07-01 Thread Paolo Bonzini
for Rust wrappers of C functions Signed-off-by: Paolo Bonzini --- qemu/src/lib.rs| 2 + qemu/src/util/error.rs | 241 + qemu/src/util/mod.rs | 1 + 3 files changed, 244 insertions(+) create mode 100644 qemu/src/util/error.rs diff --git a/qemu

[PATCH 14/14] rust: use version of toml_edit that does not require new Rust

2024-07-01 Thread Paolo Bonzini
toml_edit is quite aggressive in bumping the minimum required version of Rust. Force usage of an old version that runs with 1.63.0. Signed-off-by: Paolo Bonzini --- qemu/Cargo.toml | 3 +++ 2 files changed, 71 insertions(+), 3 deletions(-) diff --git a/qemu/Cargo.toml b/qemu/Cargo.toml index

[PATCH 12/14] rust: replace c"" literals with cstr crate

2024-07-01 Thread Paolo Bonzini
Part of what's needed to work with Rust versions prior to 1.77. Signed-off-by: Paolo Bonzini --- qemu/Cargo.toml| 3 +++ qemu/qom-rust.txt | 2 +- qemu/src/hw/core/device.rs | 4 +++- qemu/src/qom/object.rs | 4 +++- qemu/src/util/error.rs | 4 +++- qemu/src

[PATCH 00/14] rust: example of bindings code for Rust in QEMU

2024-07-01 Thread Paolo Bonzini
ber function, into an extern "C" function. Anyhow: I think we can do it, otherwise I would not have written 2000 lines of code (some of it two or three times). But if people are now scared and think we shouldn't, well, that's also a success of its own kind. Paolo Paolo Bonzini (14): add

[PATCH 06/14] rust: define wrappers for basic QOM concepts

2024-07-01 Thread Paolo Bonzini
This provides type-safe object casts, and automatic reference counting. Signed-off-by: Paolo Bonzini --- qemu/qom-rust.txt | 82 qemu/src/lib.rs| 6 + qemu/src/qom/mod.rs| 2 + qemu/src/qom/object.rs | 34 + qemu/src/qom/refs.rs | 274

[PATCH 08/14] rust: define wrappers for methods of the QOM Device class

2024-07-01 Thread Paolo Bonzini
Provide a trait that can be used to invoke methods of the QOM Device class. The trait extends Deref and has a blanket implementation for any type that dereferences to IsA. This way, it can be used on any struct that dereferences to Object or a subclass. Signed-off-by: Paolo Bonzini --- qemu

[PATCH 13/14] rust: introduce alternative to offset_of!

2024-07-01 Thread Paolo Bonzini
Allow working with Rust versions prior to 1.77. The code was taken from Rust's Discourse platform and is used with permission of the author. Signed-off-by: Paolo Bonzini --- qemu/Cargo.toml | 3 + qemu/build.rs | 5 ++ qemu/src/hw/core/device_impl.rs | 4

[PATCH 03/14] rust: define traits and pointer wrappers to convert from/to C representations

2024-07-01 Thread Paolo Bonzini
can build an OwnedPointer and it will free the contents automatically unless you retrieve it with owned_ptr.into_inner() Signed-off-by: Paolo Bonzini --- qemu/src/lib.rs | 6 + qemu/src/util/foreign.rs | 247 +++ qemu/src/util/mod.rs | 1 + 3 fil

[PATCH 11/14] rust: replace std::ffi::c_char with libc::c_char

2024-07-01 Thread Paolo Bonzini
Allow working with Rust versions prior to 1.64. Signed-off-by: Paolo Bonzini --- qemu/src/bindings/mod.rs | 3 ++- qemu/src/util/foreign.rs | 7 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/qemu/src/bindings/mod.rs b/qemu/src/bindings/mod.rs index a49447b..0ad3828

[PATCH 04/14] rust: add tests for util::foreign

2024-07-01 Thread Paolo Bonzini
Provide sample implementations in util::foreign for strings and elementary integer types, and use them to test the code. Signed-off-by: Paolo Bonzini --- qemu/Cargo.toml | 4 + qemu/src/util/foreign.rs | 456 +++ 3 files changed, 474 insertions

[PATCH 09/14] rust: add idiomatic bindings to define Object subclasses

2024-07-01 Thread Paolo Bonzini
-by: Paolo Bonzini --- qemu/src/lib.rs | 4 + qemu/src/qom/mod.rs | 1 + qemu/src/qom/object_impl.rs | 146 qemu/src/util/mod.rs| 1 + qemu/src/util/zeroed.rs | 21 ++ qemu/tests/main.rs | 32 6 files

[PATCH 01/14] add skeleton

2024-07-01 Thread Paolo Bonzini
qemu/ is where target-independent code goes. This code should not use constructors and will be brought in as needed. qemu-hw/ is where the target-dependent code goes, which is going to be built depending on Kconfig symbols. Signed-off-by: Paolo Bonzini --- .gitignore | 2

[PATCH 10/14] rust: add idiomatic bindings to define Device subclasses

2024-07-01 Thread Paolo Bonzini
Provide a macro to register a type and automatically define qdev properties. Subclasses of DeviceState must define a trait DeviceImpl, to point the type definition machinery to the implementation of virtual functions in DeviceState. Signed-off-by: Paolo Bonzini --- qemu/src/hw/core

[PATCH 02/14] set expectations

2024-07-01 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000..5ef6f0d --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +This is very experimental and barely compiles -- 2.45.2

[PATCH 07/14] rust: define wrappers for methods of the QOM Object class

2024-07-01 Thread Paolo Bonzini
Provide a trait that can be used to invoke methods of the QOM object class. The trait extends Deref and has a blanket implementation for any type that dereferences to IsA. This way, it can be used on any struct that dereferences to Object or a subclass. Signed-off-by: Paolo Bonzini --- qemu

Re: [PATCH 2/2] target/i386: drop AMD machine check bits from Intel CPUID

2024-07-01 Thread Paolo Bonzini
On Mon, Jul 1, 2024 at 6:08 AM Zhao Liu wrote: > > > It seems to adjust it based on vendor in kvm_arch_get_supported_cpuid() > > > is better than in x86_cpu_get_supported_feature_word(). Otherwise > > > kvm_arch_get_supported_cpuid() still returns "risky" value for Intel VMs. > > > > But the

Re: [RFC PATCH v3 2/5] rust: add bindgen step as a meson dependency

2024-06-28 Thread Paolo Bonzini
On Fri, Jun 28, 2024 at 9:12 PM Pierrick Bouvier wrote: > However, even tough I can build the executable, I get this error: > $ ./build/qemu-system-aarch64 -M virt > C:\w\qemu\build\qemu-system-aarch64.exe: unknown type 'x-pl011-rust' > > Any idea of what could be missing here? Maybe the

[PULL 06/23] meson: remove dead optimization option

2024-06-28 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- meson.build | 13 - meson_options.txt | 2 -- scripts/meson-buildoptions.sh | 3 --- 3 files changed, 18 deletions(-) diff --git a/meson.build b/meson.build index 6e694ecd9fe

[PULL 03/23] Revert "host/i386: assume presence of SSSE3"

2024-06-28 Thread Paolo Bonzini
This reverts commit 433cd6d94a8256af70a5200f236dc8047c3c1468. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- util/cpuinfo-i386.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/cpuinfo-i386.c b

[PULL 07/23] block: make assertion more generic

2024-06-28 Thread Paolo Bonzini
.bdrv_needs_filename is only set for drivers that also set bdrv_file_open, i.e. protocol drivers. So we can make the assertion always, it will always pass for those drivers that use bdrv_open. Signed-off-by: Paolo Bonzini --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PULL 15/23] target/i386: use cpu_cc_dst for CC_OP_POPCNT

2024-06-28 Thread Paolo Bonzini
It is the only CCOp, among those that compute ZF from one of the cc_op_* registers, that uses cpu_cc_src. Do not make it the odd one off, instead use cpu_cc_dst like the others. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 2 +- target/i386/tcg

[PULL 19/23] target/i386: SEV: store pointer to decoded id_block in SevSnpGuest

2024-06-28 Thread Paolo Bonzini
Do not rely on finish->id_block_uaddr, so that there are no casts from pointer to uint64_t. They break on 32-bit hosts. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/target/i

[PULL 18/23] target/i386: SEV: rename sev_snp_guest->id_block

2024-06-28 Thread Paolo Bonzini
Free the "id_block" name for the binary version of the data. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 30b83f1d77d..6

[PULL 20/23] target/i386: SEV: rename sev_snp_guest->id_auth

2024-06-28 Thread Paolo Bonzini
Free the "id_auth" name for the binary version of the data. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 2d4cfd41e83..a

[PULL 17/23] target/i386: remove unused enum

2024-06-28 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 16 1 file changed, 16 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 934c514e64f..95bad55bf46 100644 --- a/target/i386/tcg/translate.c

[PULL 05/23] meson: allow configuring the x86-64 baseline

2024-06-28 Thread Paolo Bonzini
. Acked-by: Richard Henderson Signed-off-by: Paolo Bonzini --- meson.build | 41 --- meson_options.txt | 3 +++ scripts/meson-buildoptions.sh | 3 +++ 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/meson.build b

[PULL 14/23] target/i386: fix CC_OP dump

2024-06-28 Thread Paolo Bonzini
X", 2024-06-11) Signed-off-by: Paolo Bonzini --- target/i386/cpu-dump.c | 101 + 1 file changed, 51 insertions(+), 50 deletions(-) diff --git a/target/i386/cpu-dump.c b/target/i386/cpu-dump.c index 40697064d92..3bb8e440916 100644 --- a/target/i386/cpu

[PULL 11/23] exec: avoid using C++ keywords in function parameters

2024-06-28 Thread Paolo Bonzini
From: Roman Kiryanov to use the QEMU headers with a C++ compiler. Signed-off-by: Roman Kiryanov Link: https://lore.kernel.org/r/20240618224553.878869-1-r...@google.com Signed-off-by: Paolo Bonzini --- include/exec/memory.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PULL 04/23] Revert "host/i386: assume presence of SSE2"

2024-06-28 Thread Paolo Bonzini
This reverts commit b18236897ca15c3db1506d8edb9a191dfe51429c. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 + util/cpuinfo-i386.c | 1 + host/include/i386

[PULL 16/23] target/i386: give CC_OP_POPCNT low bits corresponding to MO_TL

2024-06-28 Thread Paolo Bonzini
Handle it like the other arithmetic cc_ops. This simplifies a bit the implementation of bit test instructions. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 13 +++-- target/i386/tcg/translate.c | 3 +-- 2 files changed, 12 insertions

[PULL 02/23] Revert "host/i386: assume presence of POPCNT"

2024-06-28 Thread Paolo Bonzini
This reverts commit 45ccdbcb24baf99667997fac5cf60318e5e7db51. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 + tcg/i386/tcg-target.h| 5 +++-- util/cpuinfo-i386.c

[PULL 23/23] target/i386/sev: Fix printf formats

2024-06-28 Thread Paolo Bonzini
From: Richard Henderson hwaddr uses HWADDR_PRIx, sizeof yields size_t so uses %zu, and gsize uses G_GSIZE_FORMAT. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20240626194950.1725800-4-richard.hender...@linaro.org Signed-off-by: Paolo

[PULL 22/23] target/i386/sev: Use size_t for object sizes

2024-06-28 Thread Paolo Bonzini
From: Richard Henderson This code was using both uint32_t and uint64_t for len. Consistently use size_t instead. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20240626194950.1725800-3-richard.hender...@linaro.org Signed-off-by: Paolo

[PULL 21/23] target/i386: SEV: store pointer to decoded id_auth in SevSnpGuest

2024-06-28 Thread Paolo Bonzini
Do not rely on finish->id_auth_uaddr, so that there are no casts from pointer to uint64_t. They break on 32-bit hosts. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tar

[PULL 13/23] include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH()

2024-06-28 Thread Paolo Bonzini
Pitsidianakis Tested-by: Manos Pitsidianakis Signed-off-by: Paolo Bonzini --- include/qapi/util.h | 2 +- include/qemu/atomic.h | 42 - include/qemu/compiler.h | 46 + 3 files changed, 47 insertions(+), 43 deletions

[PULL 08/23] block: do not check bdrv_file_open

2024-06-28 Thread Paolo Bonzini
The set of BlockDrivers that have .bdrv_file_open coincides with those that have .protocol_name and guess what---checking drv->bdrv_file_open is done to see if the driver is a protocol. So check drv->protocol_name instead. Signed-off-by: Paolo Bonzini --- block.c | 11 +--

[PULL 09/23] block: remove separate bdrv_file_open callback

2024-06-28 Thread Paolo Bonzini
bdrv_file_open and bdrv_open are completely equivalent, they are never checked except to see which one to invoke. So merge them into a single one. Signed-off-by: Paolo Bonzini --- include/block/block_int-common.h | 3 --- block.c | 4 +--- block/blkdebug.c

[PULL 10/23] block: rename former bdrv_file_open callbacks

2024-06-28 Thread Paolo Bonzini
Since there is no bdrv_file_open callback anymore, rename the implementations so that they end with "_open" instead of "_file_open". NFS is the exception because all the functions are named nfs_file_*. Suggested-by: Kevin Wolf Signed-off-by: Paolo Bonzini --- block/blkio.c

[PULL 12/23] exec: don't use void* in pointer arithmetic in headers

2024-06-28 Thread Paolo Bonzini
From: Roman Kiryanov void* pointer arithmetic is a GCC extentension which could not be available in other build tools (e.g. C++). This changes removes this assumption. Signed-off-by: Roman Kiryanov Suggested-by: Paolo Bonzini Link: https://lore.kernel.org/r/20240620201654.598024-1-r

[PULL v3 00/23] Misc changes for 2024-06-28

2024-06-28 Thread Paolo Bonzini
e dead optimization option * exec: small changes to allow compilation with C++ in Android emulator * fix SEV compilation on 32-bit systems ---- Paolo Bonzini (19): configure: detect --cpu=mipsisa64r6 Revert "host/i386: assu

[PULL 01/23] configure: detect --cpu=mipsisa64r6

2024-06-28 Thread Paolo Bonzini
Treat it as a MIPS64 machine. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 5ad1674ca5f..8b6a2f16ceb 100755 --- a/configure +++ b/configure

Re: [PATCH 2/2] target/i386: drop AMD machine check bits from Intel CPUID

2024-06-28 Thread Paolo Bonzini
Il ven 28 giu 2024, 10:32 Xiaoyao Li ha scritto: > On 6/27/2024 10:06 PM, Paolo Bonzini wrote: > > The recent addition of the SUCCOR bit to kvm_arch_get_supported_cpuid() > > causes the bit to be visible when "-cpu host" VMs are started on Intel > > proces

Re: [PATCH v3] timer: Fix a race condition between timer's callback and destroying code

2024-06-27 Thread Paolo Bonzini
On Thu, Jun 27, 2024 at 6:12 PM Roman Kiryanov wrote: > > On Thu, Jun 27, 2024 at 6:27 AM Paolo Bonzini wrote: > > > > On Thu, Jun 27, 2024 at 2:32 AM Roman Kiryanov wrote: > > > +if (qatomic_read(>cb_running)) { > > > +

Re: [PATCH 0/3] target/i386/sev: Fix 32-bit host build issues

2024-06-27 Thread Paolo Bonzini
On Wed, Jun 26, 2024 at 9:49 PM Richard Henderson wrote: > I separated the fixes into 3 smaller patches > that may be easier to review. Oops, I missed this. I queued patches 2-3, while for the first one I prefer the version I sent at

[PATCH 3/5] target/i386: SEV: rename sev_snp_guest->id_auth

2024-06-27 Thread Paolo Bonzini
Free the "id_auth" name for the binary version of the data. Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 2d4cfd41e83..a6b063b762c 100644 --- a/target/

[PATCH 1/5] target/i386: SEV: rename sev_snp_guest->id_block

2024-06-27 Thread Paolo Bonzini
Free the "id_block" name for the binary version of the data. Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 30b83f1d77d..6daa8c264cd 100644 --- a/target/

[PATCH 4/5] target/i386: SEV: store pointer to decoded id_auth in SevSnpGuest

2024-06-27 Thread Paolo Bonzini
Do not rely on finish->id_auth_uaddr, so that there are no casts from pointer to uint64_t. They break on 32-bit hosts. Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/target/i386/sev.c b/target/i386/se

[PATCH 5/5] target/i386: SEV: fix format strings for 32-bit hosts

2024-06-27 Thread Paolo Bonzini
Use PRIx64 for uint64_t and %zu for size_t/gsize. Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 28d6bd3adfa..77ff908ab17 100644 --- a/target/i386/sev.c +++ b

[PATCH 2/5] target/i386: SEV: store pointer to decoded id_block in SevSnpGuest

2024-06-27 Thread Paolo Bonzini
Do not rely on finish->id_block_uaddr, so that there are no casts from pointer to uint64_t. They break on 32-bit hosts. Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c in

[PATCH 0/5] target/i386: SEV: fix compiler warnings on 32-bit hosts

2024-06-27 Thread Paolo Bonzini
While SEV in practice is unlikely to be used when compiling for 32-bit environments (it is not even supported by 32-bit kernels), it is easier and/or nicer to clean up the warts that block compilation, than to add conditionals in the build system to limit it to 64-bit hosts. Paolo Paolo Bonzini

[PATCH 0/2] target/i386: drop AMD machine check bits from Intel CPUID

2024-06-27 Thread Paolo Bonzini
OS to take unexpected paths. So plumb in a mechanism for x86_cpu_get_supported_feature_word() to return different values depending on the *guest* CPU vendor (which, for KVM, is by default the same as the host vendor); and then use it to hide the SUCCOR bit if the guest has non-AMD vendor. Paolo Bonzini (2)

[PATCH 1/2] target/i386: pass X86CPU to x86_cpu_get_supported_feature_word

2024-06-27 Thread Paolo Bonzini
onfiguring the guest for an Intel model. Cc: Xiaoyao Li Cc: John Allen Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 3 +-- target/i386/cpu.c | 13 ++--- target/i386/kvm/kvm-cpu.c | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/target/i386

[PATCH 2/2] target/i386: drop AMD machine check bits from Intel CPUID

2024-06-27 Thread Paolo Bonzini
OS to take unexpected paths. Since x86_cpu_get_supported_feature_word() can return different different values depending on the guest, adjust it to hide the SUCCOR bit if the guest has non-AMD vendor. Suggested-by: Xiaoyao Li Cc: John Allen Signed-off-by: Paolo Bonzini --- target/i386/

Re: [PULL 39/42] i386: Add support for SUCCOR feature

2024-06-27 Thread Paolo Bonzini
On 6/13/24 11:50, Xiaoyao Li wrote: On 6/8/2024 4:34 PM, Paolo Bonzini wrote: From: John Allen Add cpuid bit definition for the SUCCOR feature. This cpuid bit is required to be exposed to guests to allow them to handle machine check exceptions on AMD hosts. v2:    - Add "s

Re: [PATCH v3] timer: Fix a race condition between timer's callback and destroying code

2024-06-27 Thread Paolo Bonzini
On Thu, Jun 27, 2024 at 2:32 AM Roman Kiryanov wrote: > +if (qatomic_read(>cb_running)) { > +qemu_event_wait(_list->timers_done_ev); > +} qemu_event_wait() already has the right atomic magic, and ts->cb_running is both redundant (in general), and I think racy (as

[PATCH] target/i386/tcg: remove unused enum

2024-06-27 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 16 1 file changed, 16 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 257110ac703..aeb7bc4d51b 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c

Re: [PATCH] include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH()

2024-06-27 Thread Paolo Bonzini
On Thu, Jun 27, 2024 at 10:38 AM Manos Pitsidianakis wrote: > > On Thu, 27 Jun 2024 00:32, Paolo Bonzini wrote: > >On Tue, Jun 25, 2024 at 9:17 PM Manos Pitsidianakis > > wrote: > >> >Move the macro to compiler.h and, while at it, move it under #ifndef > >>

Re: [RFC PATCH] target/i386: restrict SEV to 64 bit host builds

2024-06-26 Thread Paolo Bonzini
On 6/26/24 16:03, Alex Bennée wrote: Re-enabling the 32 bit host build on i686 showed the recently merged SEV code doesn't take enough care over its types. While the format strings could use more portable types there isn't much we can do about casting uint64_t into a pointer. The easiest

Re: [PATCH v2] timer: Fix a race condition between timer's callback and destroying code

2024-06-26 Thread Paolo Bonzini
On 6/26/24 23:52, Roman Kiryanov wrote: `timerlist_run_timers` provides no mechanism to make sure the data pointed by `opaque` is valid when calling timer's callback: there could be another thread running which is destroying timer's opaque data. With this change `timer_del` becomes blocking if

Re: [PATCH] include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH()

2024-06-26 Thread Paolo Bonzini
On Tue, Jun 25, 2024 at 9:17 PM Manos Pitsidianakis wrote: > >Move the macro to compiler.h and, while at it, move it under #ifndef > >__cplusplus to emphasize that it uses C-only constructs. A C++ version > >of typeof_strip_qual() using type traits is possible[1], but beyond the > >scope of this

Re: [RFC PATCH v3 1/5] build-sys: Add rust feature option

2024-06-26 Thread Paolo Bonzini
On 6/25/24 23:47, Manos Pitsidianakis wrote: On Mon, 24 Jun 2024 20:14, Paolo Bonzini wrote: Yes, I agree. However, considering we haven't even checked the situation with what language features are required by any idiomatic bindings vs the 1.63 version that we need to support for Debian, I

[PATCH] include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH()

2024-06-25 Thread Paolo Bonzini
of strv_from_str_list() in qapi/qapi-type-helpers.c to: char **strv_from_str_list(const strList *const list) This is valid C code, and it fails to compile without this change. [1] https://lore.kernel.org/qemu-devel/20240624205647.112034-1-f...@google.com/ Signed-off-by: Paolo Bonzini --- include/qapi

Re: [PATCH 1/1] include/qemu: Provide a C++ compatible version of typeof_strip_qual

2024-06-25 Thread Paolo Bonzini
Il mar 25 giu 2024, 04:32 Roman Kiryanov ha scritto: > Hi Philippe, thank you for looking. > > On Mon, Jun 24, 2024 at 7:27 PM Philippe Mathieu-Daudé > wrote: > > In particular this patch seems contained well enough > > to be carried in forks were C++ _is_ used. > > Will you agree to take

Re: [RFC PATCH v3 1/5] build-sys: Add rust feature option

2024-06-24 Thread Paolo Bonzini
Il lun 24 giu 2024, 18:52 Daniel P. Berrangé ha scritto: > On Wed, Jun 19, 2024 at 11:13:58PM +0300, Manos Pitsidianakis wrote: > > Add options for Rust in meson_options.txt, meson.build, configure to > > prepare for adding Rust code in the followup commits. > > > > `rust` is a reserved meson

Re: [RFC PATCH v3 1/5] build-sys: Add rust feature option

2024-06-24 Thread Paolo Bonzini
Il lun 24 giu 2024, 10:36 Zhao Liu ha scritto: > [snip] > > > diff --git a/meson.build b/meson.build > > index c5360fbd299..ad7dbc0d641 100644 > > --- a/meson.build > > +++ b/meson.build > > @@ -290,6 +290,11 @@ foreach lang : all_languages > >endif > > endforeach > > +cargo = not_found > >

[PULL v2 15/23] Revert "host/i386: assume presence of SSE2"

2024-06-24 Thread Paolo Bonzini
This reverts commit b18236897ca15c3db1506d8edb9a191dfe51429c. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 + util/cpuinfo-i386.c | 1 + host/include/i386

[PULL v2 00/23] Misc changes for 2024-06-22

2024-06-24 Thread Paolo Bonzini
address before going back to translate.c * meson: allow configuring the x86-64 baseline * meson: remove dead optimization option * exec: small changes to allow compilation with C++ in Android emulator Paolo Bonzini (21): configure

[PULL 21/23] block: rename former bdrv_file_open callbacks

2024-06-22 Thread Paolo Bonzini
Since there is no bdrv_file_open callback anymore, rename the implementations so that they end with "_open" instead of "_file_open". NFS is the exception because all the functions are named nfs_file_*. Suggested-by: Kevin Wolf Signed-off-by: Paolo Bonzini --- block/blkio.c

[PULL 15/23] Revert "host/i386: assume presence of SSE2"

2024-06-22 Thread Paolo Bonzini
This reverts commit b18236897ca15c3db1506d8edb9a191dfe51429c. The x86-64 instruction set can now be tuned down to x86-64 v1 or i386 Pentium Pro. Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 + util/bufferiszero.c | 4 ++-- util/cpuinfo-i386.c

[PULL 17/23] meson: remove dead optimization option

2024-06-22 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- meson.build | 13 - meson_options.txt | 2 -- scripts/meson-buildoptions.sh | 3 --- 3 files changed, 18 deletions(-) diff --git a/meson.build b/meson.build index 6e694ecd9fe

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