Re: [PATCH] tests/avocado: Allow running user-mode tests

2024-08-22 Thread Thomas Huth
On 21/08/2024 17.38, Philippe Mathieu-Daudé wrote: Commit 816d4201ea ("tests/avocado: Move LinuxTest related code into a separate file") removed the Avocado 'process' import which is used by the QemuUserTest class, restore it. Fixes: 816d4201ea ("tests/avocado: Move LinuxTest ...") Signed-off-by

[PATCH v3] hw/acpi: Add vmclock device

2024-08-22 Thread David Woodhouse
From: David Woodhouse The vmclock device addresses the problem of live migration with precision clocks. The tolerances of a hardware counter (e.g. TSC) are typically around ±50PPM. A guest will use NTP/PTP/PPS to discipline that counter against an external source of 'real' time, and track the pre

[PATCH v2 0/4] hw/ufs: ufs device testing function added and modified

2024-08-22 Thread Yoochan Jeong
Previously, it was only able to test virtual UFS devices if they properly read and write storage data. In this patch, three test functions are added to test if virtual UFS devices properly read and write its metadata. Each functions test reading and writing flags, attributes and descriptors. Relate

[PATCH v2 1/4] hw/ufs: minor bug fixes related to ufs-test

2024-08-22 Thread Yoochan Jeong
Minor bugs and errors related to ufs-test are resolved. Some permissions and code implementations that are not synchronized with the ufs spec are edited. Based on: 20240802051902epcms2p319bc095a15eaef8de4e6955f6718371d@epcms2p3 Signed-off-by: Yoochan Jeong --- hw/ufs/ufs.c | 19 +++

[PATCH v2 2/4] hw/ufs: ufs flag read/write test implemented

2024-08-22 Thread Yoochan Jeong
New test function "ufstest_flag_request" added, which can check one's virtual UFS device can properly read and write its flag data. It tests if reading, setting, clearing and toggling flags work properly. There are some testcases that are intended to make an error caused by permission issues. Base

[PATCH v2 3/4] hw/ufs: ufs attribute read/write test implemented

2024-08-22 Thread Yoochan Jeong
New test function "ufstest_query_attr_request" added, which can check one's virtual UFS device can properly read and write its attribute data. It tests if reading and writing attributes work properly. There are some testcases that are intended to make an error caused by writing an invalid value, al

[PATCH v2 4/4] hw/ufs: ufs descriptor read test implemented

2024-08-22 Thread Yoochan Jeong
New test function "ufstest_query_desc_request" added, which can check one's virtual UFS device can properly read and its descriptor data. (Writing descriptors are not implemented yet.) The testcases attempt to read all kinds of descriptors at least once, except for configuration descriptors (which

[PATCH v7 14/17] target/riscv: implement zicfiss instructions

2024-08-22 Thread Deepak Gupta
zicfiss has following instructions - sspopchk: pops a value from shadow stack and compares with x1/x5. If they dont match, reports a sw check exception with tval = 3. - sspush: pushes value in x1/x5 on shadow stack - ssrdp: reads current shadow stack - ssamoswap: swaps contents of shadow sta

[PATCH v7 17/17] disas/riscv: enable disassembly for compressed sspush/sspopchk

2024-08-22 Thread Deepak Gupta
sspush and sspopchk have equivalent compressed encoding taken from zcmop. cmop.1 is sspush x1 while cmop.5 is sspopchk x5. Due to unusual encoding for both rs1 and rs2 from space bitfield, this required a new codec. Signed-off-by: Deepak Gupta --- disas/riscv.c | 19 ++- disas/ri

[PATCH v7 05/17] target/riscv: tracking indirect branches (fcfi) for zicfilp

2024-08-22 Thread Deepak Gupta
zicfilp protects forward control flow (if enabled) by enforcing all indirect call and jmp must land on a landing pad instruction `lpad`. If target of an indirect call or jmp is not `lpad` then cpu/hart must raise a sw check exception with tval = 2. This patch implements the mechanism using TCG. Ta

[PATCH v7 12/17] target/riscv: AMO operations always raise store/AMO fault

2024-08-22 Thread Deepak Gupta
This patch adds one more word for tcg compile which can be obtained during unwind time to determine fault type for original operation (example AMO). Depending on that, fault can be promoted to store/AMO fault. Signed-off-by: Deepak Gupta Suggested-by: Richard Henderson --- target/riscv/cpu.h

[PATCH v7 09/17] target/riscv: introduce ssp and enabling controls for zicfiss

2024-08-22 Thread Deepak Gupta
zicfiss introduces a new state ssp ("shadow stack register") in cpu. ssp is expressed as a new unprivileged csr (CSR_SSP=0x11) and holds virtual address for shadow stack as programmed by software. Shadow stack (for each mode) is enabled via bit3 in *envcfg CSRs. Shadow stack can be enabled for a m

[PATCH v7 06/17] target/riscv: zicfilp `lpad` impl and branch tracking

2024-08-22 Thread Deepak Gupta
Implements setting lp expected when `jalr` is encountered and implements `lpad` instruction of zicfilp. `lpad` instruction is taken out of auipc x0, . This is an existing HINTNOP space. If `lpad` is target of an indirect branch, cpu checks for 20 bit value in x7 upper with 20 bit value embedded in

[PATCH v7 11/17] target/riscv: mmu changes for zicfiss shadow stack protection

2024-08-22 Thread Deepak Gupta
zicfiss protects shadow stack using new page table encodings PTE.W=0, PTE.R=0 and PTE.X=0. This encoding is reserved if zicfiss is not implemented or if shadow stack are not enabled. Loads on shadow stack memory are allowed while stores to shadow stack memory leads to access faults. Shadow stack ac

[PATCH v7 08/17] target/riscv: Add zicfiss extension

2024-08-22 Thread Deepak Gupta
zicfiss [1] riscv cpu extension enables backward control flow integrity. This patch sets up space for zicfiss extension in cpuconfig. And imple- ments dependency on A, zicsr, zimop and zcmop extensions. [1] - https://github.com/riscv/riscv-cfi Signed-off-by: Deepak Gupta Co-developed-by: Jim Sh

[PATCH v7 00/17] riscv support for control flow integrity extensions

2024-08-22 Thread Deepak Gupta
v7 for riscv zicfilp and zicfiss extensions support in qemu. Links for previous versions [1] - v1 https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg06017.html [2] - v2 https://lore.kernel.org/all/ed23bcbc-fdc4-4492-803c-daa958803...@linaro.org/T/ [3] - v3 https://lists.nongnu.org/archiv

[PATCH v7 03/17] target/riscv: save and restore elp state on priv transitions

2024-08-22 Thread Deepak Gupta
elp state is recorded in *status on trap entry (less privilege to higher privilege) and restored in elp from *status on trap exit (higher to less privilege). Additionally this patch introduces a forward cfi helper function to determine if current privilege has forward cfi is enabled or not based o

[PATCH v7 13/17] target/riscv: update `decode_save_opc` to store extra word2

2024-08-22 Thread Deepak Gupta
Extra word 2 is stored during tcg compile and `decode_save_opc` needs additional argument in order to pass the value. This will be used during unwind to get extra information about instruction like how to massage exceptions. Updated all callsites as well. Signed-off-by: Deepak Gupta --- target/r

[PATCH v7 07/17] disas/riscv: enable `lpad` disassembly

2024-08-22 Thread Deepak Gupta
Signed-off-by: Deepak Gupta Co-developed-by: Jim Shu Co-developed-by: Andy Chiu Reviewed-by: Richard Henderson --- disas/riscv.c | 18 +- disas/riscv.h | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/disas/riscv.c b/disas/riscv.c index c8364c2b07..c7c92a

[PATCH v7 10/17] target/riscv: tb flag for shadow stack instructions

2024-08-22 Thread Deepak Gupta
Shadow stack instructions can be decoded as zimop / zcmop or shadow stack instructions depending on whether shadow stack are enabled at current privilege. This requires a TB flag so that correct TB generation and correct TB lookup happens. `DisasContext` gets a field indicating whether bcfi is enab

[PATCH v7 16/17] disas/riscv: enable disassembly for zicfiss instructions

2024-08-22 Thread Deepak Gupta
Enable disassembly for sspush, sspopchk, ssrdp & ssamoswap. Disasembly is only enabled if zimop and zicfiss ext is set to true. Signed-off-by: Deepak Gupta --- disas/riscv.c | 40 +++- disas/riscv.h | 1 + 2 files changed, 40 insertions(+), 1 deletion(-) dif

[PATCH v7 04/17] target/riscv: additional code information for sw check

2024-08-22 Thread Deepak Gupta
sw check exception support was recently added. This patch further augments sw check exception by providing support for additional code which is provided in *tval. Adds `sw_check_code` field in cpuarchstate. Whenever sw check exception is raised *tval gets the value deposited in `sw_check_code`. Si

[PATCH v7 15/17] target/riscv: compressed encodings for sspush and sspopchk

2024-08-22 Thread Deepak Gupta
sspush/sspopchk have compressed encodings carved out of zcmops. compressed sspush is designated as c.mop.1 while compressed sspopchk is designated as c.mop.5. Note that c.sspush x1 exists while c.sspush x5 doesn't. Similarly c.sspopchk x5 exists while c.sspopchk x1 doesn't. Signed-off-by: Deepak

[PATCH v7 02/17] target/riscv: Introduce elp state and enabling controls for zicfilp

2024-08-22 Thread Deepak Gupta
zicfilp introduces a new state elp ("expected landing pad") in cpu. During normal execution, elp is idle (NO_LP_EXPECTED) i.e not expecting landing pad. On an indirect call, elp moves LP_EXPECTED. When elp is LP_EXPECTED, only a subsquent landing pad instruction can set state back to NO_LP_EXPECTED

[PATCH v7 01/17] target/riscv: Add zicfilp extension

2024-08-22 Thread Deepak Gupta
zicfilp [1] riscv cpu extension enables forward control flow integrity. If enabled, all indirect calls must land on a landing pad instruction. This patch sets up space for zicfilp extension in cpuconfig. zicfilp is dependend on zicsr. [1] - https://github.com/riscv/riscv-cfi Signed-off-by: Deepa

Re: [PATCH v2 3/3] tests/functional: Convert mipsel Malta YAMON avocado test

2024-08-22 Thread Thomas Huth
On 21/08/2024 15.33, Philippe Mathieu-Daudé wrote: Straight forward conversion using the Python standard zipfile module instead of avocado.utils package. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINE

Re: [PATCH] tests/avocado: Allow running user-mode tests

2024-08-22 Thread Philippe Mathieu-Daudé
On 22/8/24 09:21, Thomas Huth wrote: On 21/08/2024 17.38, Philippe Mathieu-Daudé wrote: Commit 816d4201ea ("tests/avocado: Move LinuxTest related code into a separate file") removed the Avocado 'process' import which is used by the QemuUserTest class, restore it. Fixes: 816d4201ea ("tests/avoca

[PATCH v2 1/4] accel/tcg: Make page_set_flags() documentation public

2024-08-22 Thread Philippe Mathieu-Daudé
Commit e505a063ba ("translate-all: Add assert_(memory|tb)_lock annotations") states page_set_flags() is "public APIs and [is] documented as needing them held for linux-user mode". Document the prototype. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h | 13 + accel/t

[PATCH v2 4/4] tests/avocado: Run STM32 bFLT busybox binary in current directory

2024-08-22 Thread Philippe Mathieu-Daudé
When this test was added in commit 8011837a01, self.workdir was set to the test directory. As of this commit, it is not set anymore. Rather than using a full path to the busybox binary, we can run it in the current directory, effectively kludging the fact that self.workdir is not set. Good enough t

[PATCH v2 2/4] linux-user/flatload: Take mmap_lock in load_flt_binary()

2024-08-22 Thread Philippe Mathieu-Daudé
load_flt_binary() calls load_flat_file() -> page_set_flags(). page_set_flags() must be called with the mmap_lock held, otherwise it aborts: $ qemu-arm -L stm32/lib/ stm32/bin/busybox qemu-arm: ../accel/tcg/user-exec.c:505: page_set_flags: Assertion `have_mmap_lock()' failed. Aborted (core

[PATCH v2 3/4] tests/avocado: Allow running user-mode tests

2024-08-22 Thread Philippe Mathieu-Daudé
Commit 816d4201ea ("tests/avocado: Move LinuxTest related code into a separate file") removed the Avocado 'process' import which is used by the QemuUserTest class, restore it. Fixes: 816d4201ea ("tests/avocado: Move LinuxTest ...") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth -

[PATCH v2 0/4] linux-user/flatload: Take mmap_lock in load_flt_binary()

2024-08-22 Thread Philippe Mathieu-Daudé
Fix for https://gitlab.com/qemu-project/qemu/-/issues/2525 Supersedes: <20240821153836.67987-1-phi...@linaro.org> Philippe Mathieu-Daudé (4): accel/tcg: Make page_set_flags() documentation public linux-user/flatload: Take mmap_lock in load_flt_binary() tests/avocado: Allow running user-mode

Re: [External] Re: [PATCH v8 3/5] migration: Add migration parameters for QATzip

2024-08-22 Thread Prasad Pandit
Hi, On Thu, 22 Aug 2024 at 02:13, Yichen Wang wrote: > After discussing with Intel folks, I decided to align to the existing > QPL behavior. In QPL, the code path of compression will always go > through regardless. When acceleration hardware is initialized > properly, use it. If failed, fallback

Re: [PATCH for-9.2 00/10] s390: Convert virtio-ccw, cpu to three-phase reset, and followup cleanup

2024-08-22 Thread Nina Schoetterl-Glausch
On Wed, 2024-08-14 at 21:06 +0100, Peter Maydell wrote: > On Wed, 14 Aug 2024 at 15:22, Christian Borntraeger > wrote: > > > > Am 13.08.24 um 18:52 schrieb Peter Maydell: > > > The main aim of this patchseries is to remove the two remaining uses > > > of device_class_set_parent_reset() in the tre

[PATCH 0/3] tests/functional: Convert ARM bFLT linux-user avocado test

2024-08-22 Thread Philippe Mathieu-Daudé
Convert the single user-mode test. Warning, missing rework in tests/functional/meson.build, however dirty tested using: -- >8 -- diff --git a/tests/functional/meson.build b/tests/functional/meson.build index f8e482a87c..44f8c2aa48 100644 --- a/tests/functional/meson.build +++ b/tests/functional/m

[PATCH 2/3] tests/functional: Convert ARM bFLT linux-user avocado test

2024-08-22 Thread Philippe Mathieu-Daudé
Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Expose cpio_extract() in qemu_test.utils for possible reuse. Signed-off-by: Philippe Mathieu-Daudé --- Missing meson plumbing, i.e. adding to tests_arm_thorough[] --- tests/avocad

[PATCH 1/3] tests/functional: Add QemuUserTest class

2024-08-22 Thread Philippe Mathieu-Daudé
Per commit 5334df4822 ("tests/avocado: Introduce QemuUserTest base class"): Similarly to the 'System' Test base class with methods for testing system emulation, the QemuUserTest class contains methods useful to test user-mode emulation. Signed-off-by: Philippe Mathieu-Daudé --- tests/func

[PATCH 3/3] tests/avocado: Remove unused QemuUserTest class

2024-08-22 Thread Philippe Mathieu-Daudé
The single test that was using the QemuUserTest class has been converted to the functional test framework. This class is now unused, remove it. Signed-off-by: Philippe Mathieu-Daudé --- tests/avocado/avocado_qemu/__init__.py | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(

[PATCH] vmdk:truncate more one sector in init extent

2024-08-22 Thread luzhipeng
issue:https://gitlab.com/qemu-project/qemu/-/issues/1357 empty vmdk only contains metadata, ovftool failed. So it allocates more one sector for empty disk. the ovftool command line: ovftool input.ovf output.ova Signed-off-by: luzhipeng --- block/vmdk.c | 2 +- 1 file changed, 1 insertion(+), 1 d

Re: [PATCH for-9.1 v4 0/7] CVE-2024-7409

2024-08-22 Thread Denis V. Lunev
On 8/7/24 19:43, Eric Blake wrote: v3 was here: https://lists.gnu.org/archive/html/qemu-devel/2024-08/msg00818.html since then: - re-add a minor patch from v2 (now patch 1) - refactor how the client opaque pointer is handled (patch 2) - add two new patches to prevent malicious clients from

RE: [PATCH RFC V3 17/29] arm/virt: Release objects for *disabled* possible vCPUs after init

2024-08-22 Thread Salil Mehta via
Hi Gavin, > From: qemu-arm-bounces+salil.mehta=huawei@nongnu.org arm-bounces+salil.mehta=huawei@nongnu.org> On Behalf Of Gavin Shan > Sent: Wednesday, August 21, 2024 2:33 PM > To: Salil Mehta ; qemu-devel@nongnu.org; > qemu-...@nongnu.org; m...@redhat.com > > Hi Salil, > > On

[PATCH] tests/functional: Convert ARM Integrator/CP avocado tests

2024-08-22 Thread Philippe Mathieu-Daudé
Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. $ QEMU_TEST_ALLOW_UNTRUSTED_CODE=1 make check-functional-arm ... 6/6 qemu:func-thorough+func-arm-thorough+thorough / func-arm-arm_integratorcp OK 3.90s 2 subtests passe

Re: [PATCH v8 4/5] migration: Introduce 'qatzip' compression method

2024-08-22 Thread Prasad Pandit
Hello, On Tue, 20 Aug 2024 at 22:40, Yichen Wang wrote: > +static int qatzip_send_setup(MultiFDSendParams *p, Error **errp) > +{ > +QatzipData *q; > +QzSessionParamsDeflate_T params; > +const char *err_msg; > +int ret; > + > +q = g_new0(QatzipData, 1); > +p->compress_data

Re: [PATCH v2 4/4] tests/avocado: Run STM32 bFLT busybox binary in current directory

2024-08-22 Thread Thomas Huth
On 22/08/2024 11.50, Philippe Mathieu-Daudé wrote: When this test was added in commit 8011837a01, self.workdir was set to the test directory. As of this commit, it is not set anymore. Rather than using a full path to the busybox binary, we can run it in the current directory, effectively kludging

Re: [PATCH] tests/functional: Convert ARM Integrator/CP avocado tests

2024-08-22 Thread Thomas Huth
On 22/08/2024 13.02, Philippe Mathieu-Daudé wrote: Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. $ QEMU_TEST_ALLOW_UNTRUSTED_CODE=1 make check-functional-arm ... 6/6 qemu:func-thorough+func-arm-thorough+thorough / f

[PATCH 1/7] vfio/igd: return an invalid generation for unknown devices

2024-08-22 Thread Corvin Köhne
Intel changes it's specification quite often e.g. the location and size of the BDSM register has change for gen 11 devices and later. This causes our emulation to fail on those devices. So, it's impossible for us to use a suitable default value for unknown devices. Instead of returning a random ge

[PATCH 0/7] vfio/igd: add passthrough support for IGDs of gen 11 and later

2024-08-22 Thread Corvin Köhne
Hi, Qemu has experimental support for GPU passthrough of Intels integrated graphic devices. Unfortunately, Intel has changed some bits for their gen 11 devices and later. To support these devices, we have to account for those changes. This patch series adds the missing bits on the Qemu side. I'v

[PATCH 3/7] vfio/igd: use new BDSM register location and size for gen 11 and later

2024-08-22 Thread Corvin Köhne
Intel changed the location and size of the BDSM register for gen 11 devices and later. We have to adjust our emulation for these devices to properly support them. Signed-off-by: Corvin Köhne --- hw/vfio/igd.c | 31 --- 1 file changed, 24 insertions(+), 7 deletions(-)

[PATCH 4/7] vfio/igd: add new bar0 quirk to emulate BDSM mirror

2024-08-22 Thread Corvin Köhne
The BDSM register is mirrored into MMIO space at least for gen 11 and later devices. Unfortunately, the Windows driver reads the register value from MMIO space instead of PCI config space for those devices [1]. Therefore, we either have to keep a 1:1 mapping for the host and guest address or we ha

[PATCH 2/7] vfio/igd: support legacy mode for all known generations

2024-08-22 Thread Corvin Köhne
We're soon going to add support for legacy mode to ElkhartLake and TigerLake devices. Those are gen 11 and 12 devices. At the moment, all devices identified by our igd_gen function do support legacy mode. This won't change when adding our new devices of gen 11 and 12. Therefore, it makes more sens

[PATCH] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Philippe Mathieu-Daudé
Straight forward conversion. Since SBSA_FLASH files are not tarballs, use lzma_uncompress() method. Signed-off-by: Philippe Mathieu-Daudé --- Based-on: <20240821082748.65853-1-th...@redhat.com> --- MAINTAINERS | 2 +- tests/functional/meson.build

Re: [PATCH] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Philippe Mathieu-Daudé
On 22/8/24 13:36, Philippe Mathieu-Daudé wrote: Straight forward conversion. Since SBSA_FLASH files are not tarballs, use lzma_uncompress() method. Signed-off-by: Philippe Mathieu-Daudé --- Based-on: <20240821082748.65853-1-th...@redhat.com> --- MAINTAINERS |

[PATCH v2] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Philippe Mathieu-Daudé
Straight forward conversion. Since SBSA_FLASH files are not tarballs, use lzma_uncompress() method. Signed-off-by: Philippe Mathieu-Daudé --- Based-on: <20240821082748.65853-1-th...@redhat.com> --- MAINTAINERS | 2 +- tests/functional/meson.build

Re: [PATCH v4] ptp: Add vDSO-style vmclock support

2024-08-22 Thread Simon Horman
On Wed, Aug 21, 2024 at 10:50:47PM +0100, David Woodhouse wrote: ... > diff --git a/drivers/ptp/ptp_vmclock.c b/drivers/ptp/ptp_vmclock.c ... > +#define VMCLOCK_FIELD_PRESENT(_c, _f) \ > + (_c)->size >= (offsetof(struct vmclock_abi, _f) + \ > +si

[PATCH] tests/functional: Convert Aarch64 Virt machine avocado tests

2024-08-22 Thread Philippe Mathieu-Daudé
Straight forward conversion. Update the SHA1 hash to SHA256 since SHA1 should not be used anymore nowadays. Use has_cmd() and run_cmd() methods from qemu_test. $ make check-functional-aarch64 V=1 ... ▶ 1/4 test_aarch64_virt.Aarch64VirtMachine.test_aarch64_virt_gicv2 OK ▶ 1

Re: [PULL 15/16] vl.c: select_machine(): add selected machine type to error message

2024-08-22 Thread Peter Maydell
On Sun, 30 Jun 2024 at 17:57, Michael Tokarev wrote: > > From: Vladimir Sementsov-Ogievskiy > > Signed-off-by: Vladimir Sementsov-Ogievskiy > Reviewed-by: Philippe Mathieu-Daudé > Reviewed-by: Michael Tokarev > Signed-off-by: Michael Tokarev > --- > system/vl.c | 2 +- > 1 file changed, 1 in

[PATCH for-9.1?] system/vl.c: Print machine name, not "(null)", for unknown machine types

2024-08-22 Thread Peter Maydell
In commit 412d294ffdc we tried to improve the error message printed when the machine type is unknown, but we used the wrong variable, resulting in: $ ./build/x86/qemu-system-aarch64 -M bang qemu-system-aarch64: unsupported machine type: "(null)" Use -machine help to list supported machines Use th

Re: [PATCH for-9.2 4/9] tests/qtest/migration-helpers: Fix migrate_get_socket_address() leak

2024-08-22 Thread Fabiano Rosas
Peter Maydell writes: > In migrate_get_socket_address() we leak the SocketAddressList: > (cd build/asan && \ > > ASAN_OPTIONS="fast_unwind_on_malloc=0:strip_path_prefix=/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/asan/../../" > QTEST_QEMU_BINARY=./qemu-system-x86_64 \ > ./tests/qtest

Re: [PATCH for-9.2 7/9] tests/qtest/migration-helpers: Don't dup argument to qdict_put_str()

2024-08-22 Thread Fabiano Rosas
Peter Maydell writes: > In migrate_set_ports() we call qdict_put_str() with a value string > which we g_strdup(). However qdict_put_str() takes a copy of the > value string, it doesn't take ownership of it, so the g_strdup() > only results in a leak: > > Direct leak of 6 byte(s) in 1 object(s) al

Re: [PATCH for-9.2 8/9] tests/qtest/migration-test: Don't strdup in get_dirty_rate()

2024-08-22 Thread Fabiano Rosas
Peter Maydell writes: > We g_strdup() the "status" string we get out of the qdict in > get_dirty_rate(), but we never free it. Since we only use this > string while the dictionary is still valid, we don't need to strdup > at all; drop the unnecessary call to avoid this leak: > > Direct leak of 1

Re: [PATCH for-9.2 9/9] tests/qtest/migration-test: Don't leak QTestState in test_multifd_tcp_cancel()

2024-08-22 Thread Fabiano Rosas
Peter Maydell writes: > In test_multifd_tcp_cancel() we create three QEMU processes: 'from', > 'to' and 'to2'. We clean up (via qtest_quit()) 'from' and 'to2' when > we call test_migrate_end(), but never clean up 'to', which results in > this leak: > > Direct leak of 336 byte(s) in 1 object(s) a

Re: [PATCH v4] ptp: Add vDSO-style vmclock support

2024-08-22 Thread David Woodhouse
On Thu, 2024-08-22 at 12:49 +0100, Simon Horman wrote: > Hi David, > > Sorry to be always the one with the nit-pick. > Sparse complains about the line above, I believe because the > type of st->clk->size is __le32. > > .../ptp_vmclock.c:562:13: warning: restricted __le32 degrades to integer Oops

Re: [PATCH v2] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Thomas Huth
On 22/08/2024 13.41, Philippe Mathieu-Daudé wrote: Straight forward conversion. Since SBSA_FLASH files are not tarballs, use lzma_uncompress() method. Signed-off-by: Philippe Mathieu-Daudé --- Based-on: <20240821082748.65853-1-th...@redhat.com> --- MAINTAINERS

Re: [PATCH] tests/functional: Convert Aarch64 Virt machine avocado tests

2024-08-22 Thread Thomas Huth
On 22/08/2024 14.07, Philippe Mathieu-Daudé wrote: Straight forward conversion. Update the SHA1 hash to SHA256 since SHA1 should not be used anymore nowadays. Use has_cmd() and run_cmd() methods from qemu_test. $ make check-functional-aarch64 V=1 ... ▶ 1/4 test_aarch64_virt.Aarch64VirtM

Re: [PATCH for-9.2 5/9] tests/qtest/migration-test: Free QCRyptoTLSTestCertReq objects

2024-08-22 Thread Fabiano Rosas
Peter Maydell writes: > In the migration test we create several TLS certificates with > the TLS_* macros from crypto-tls-x509-helpers.h. These macros > create both a QCryptoTLSCertReq object which must be deinitialized > and also an on-disk certificate file. The migration test currently > removes

Re: [PATCH for-9.2 6/9] tests/unit/crypto-tls-x509-helpers: deinit privkey in test_tls_cleanup

2024-08-22 Thread Fabiano Rosas
Peter Maydell writes: > We create a gnutls_x509_privkey_t in test_tls_init(), but forget > to deinit it in test_tls_cleanup(), resulting in leaks > reported in hte migration test such as: > > Indirect leak of 8 byte(s) in 1 object(s) allocated from: > #0 0x55fa6d11c12e in malloc > (/mnt/nvme

Re: [PATCH v8 1/5] docs/migration: add qatzip compression feature

2024-08-22 Thread Fabiano Rosas
Yichen Wang writes: > From: Yuan Liu > > add Intel QATzip compression method introduction > > Reviewed-by: Nanhai Zou > Reviewed-by: Peter Xu > Signed-off-by: Yuan Liu > Signed-off-by: Yichen Wang Reviewed-by: Fabiano Rosas

Re: [PATCH] ppc: fixed incorrect name filed in vmstate_tlbemb_entry

2024-08-22 Thread Peter Maydell
On Wed, 21 Aug 2024 at 20:33, Peter Maydell wrote: > > On Wed, 21 Aug 2024 at 19:56, Arman Nabiev wrote: > > > > In my example in https://gitlab.com/qemu-project/qemu/-/issues/2522 the > > .needed function returns true for vmstate_tlbemb, but not for > > vmstate_tlb6xx. I tried to do some tests

Re: [PATCH v16 00/13] Support blob memory and venus on qemu

2024-08-22 Thread Alex Bennée
"Michael S. Tsirkin" writes: > On Sun, Jun 23, 2024 at 06:23:30PM +0300, Dmitry Osipenko wrote: >> Hello, >> >> This series enables Vulkan Venus context support on virtio-gpu. >> >> All virglrender and almost all Linux kernel prerequisite changes >> needed by Venus are already in upstream. For

Re: [RFC PATCH v2 00/23] NXP i.MX RT595, ARM SVD and device model unit tests

2024-08-22 Thread Peter Maydell
On Sat, 17 Aug 2024 at 11:26, Octavian Purdila wrote: > > This patch set adds support for NXP's RT500 MCU [1] and the RT595 > EVK[2]. More RT500 device models will be submitted in future patch sets. > > The goal of this first patch set is to provide a minimal set that > allows running the NXP MCU

Re: [PATCH] ppc: fixed incorrect name filed in vmstate_tlbemb_entry

2024-08-22 Thread Arman Nabiev
Thank you. Do I need to resend the patch with the specified corrections, or will you do it and all I need is the name in signed-off? In the second case, you need to specify Arman Nabiev. Just in case I'll attach the fixed patch here. On Thu, 22 Aug 2024 at 16:12, Peter Maydell wrote: > On Wed, 2

Re: Issue with QEMU Live Migration

2024-08-22 Thread Fabiano Rosas
"Arisetty, Chakri" writes: Ugh, it seems I messed up the CC addresses, let's see if this time they go out right. For those new to the thread, we're discussing this bug: https://gitlab.com/qemu-project/qemu/-/issues/2482 > Hi, > > Thank you for getting back to me. > > Yes, I have opened the tick

Re: [PATCH v16 00/13] Support blob memory and venus on qemu

2024-08-22 Thread Dmitry Osipenko
On 8/22/24 16:13, Alex Bennée wrote: > "Michael S. Tsirkin" writes: > >> On Sun, Jun 23, 2024 at 06:23:30PM +0300, Dmitry Osipenko wrote: >>> Hello, >>> >>> This series enables Vulkan Venus context support on virtio-gpu. >>> >>> All virglrender and almost all Linux kernel prerequisite changes >>>

Re: [PATCH for-9.1?] system/vl.c: Print machine name, not "(null)", for unknown machine types

2024-08-22 Thread Philippe Mathieu-Daudé
On 22/8/24 14:23, Peter Maydell wrote: In commit 412d294ffdc we tried to improve the error message printed when the machine type is unknown, but we used the wrong variable, resulting in: $ ./build/x86/qemu-system-aarch64 -M bang qemu-system-aarch64: unsupported machine type: "(null)" Use -machin

[PATCH 7/7] vfio/igd: correctly calculate stolen memory size for gen 9 and later

2024-08-22 Thread Corvin Köhne
We have to update the calculation of the stolen memory size because we've seen devices using values of 0xf0 and above for the graphics mode select field. The new calculation was taken from the linux kernel [1]. [1] https://github.com/torvalds/linux/blob/7c626ce4bae1ac14f60076d00eafe71af30450ba/a

[PATCH 5/7] vfio/igd: add ID's for ElkhartLake and TigerLake

2024-08-22 Thread Corvin Köhne
ElkhartLake and TigerLake devices were tested in legacy mode with Linux and Windows VMs. Both are working properly. It's likely that other Intel GPUs of gen 11 and 12 like IceLake device are working too. However, we're only adding known good devices for now. Signed-off-by: Corvin Köhne --- hw/v

Re: [PATCH 3/3] tests/avocado: Remove unused QemuUserTest class

2024-08-22 Thread Thomas Huth
On 22/08/2024 12.42, Philippe Mathieu-Daudé wrote: The single test that was using the QemuUserTest class has been converted to the functional test framework. This class is now unused, remove it. Signed-off-by: Philippe Mathieu-Daudé --- tests/avocado/avocado_qemu/__init__.py | 19 +---

Re: [PATCH 1/3] tests/functional: Add QemuUserTest class

2024-08-22 Thread Thomas Huth
On 22/08/2024 12.42, Philippe Mathieu-Daudé wrote: Per commit 5334df4822 ("tests/avocado: Introduce QemuUserTest base class"): Similarly to the 'System' Test base class with methods for testing system emulation, the QemuUserTest class contains methods useful to test user-mode emulation.

[PATCH 6/7] vfio/igd: don't set stolen memory size to zero

2024-08-22 Thread Corvin Köhne
The stolen memory is required for the GOP (EFI) driver and the Windows driver. While the GOP driver seems to work with any stolen memory size, the Windows driver will crash if the size doesn't match the size allocated by the host BIOS. For that reason, it doesn't make sense to overwrite the stolen

Re: [PATCH v2] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Marcin Juszkiewicz
On 22.08.2024 13:41, Philippe Mathieu-Daudé wrote: # Timeouts for individual tests that can be slow e.g. with debugging enabled test_timeouts = { + 'aarch64_sbsaref' : 180, What kind of machine is able to run those tests in 180s? I bumped them to 2400s and got timeout (Macbook with M1 Pro

Re: [PATCH v3 09/14] migration/multifd: Isolate ram pages packet data

2024-08-22 Thread Fabiano Rosas
Peter Xu writes: > On Thu, Aug 01, 2024 at 09:35:11AM -0300, Fabiano Rosas wrote: >> @@ -1554,7 +1577,6 @@ static void *multifd_recv_thread(void *opaque) >> qemu_sem_wait(&p->sem_sync); >> } >> } else { >> -p->total_normal_pages += p->data->size

Re: [PATCH v3 09/14] migration/multifd: Isolate ram pages packet data

2024-08-22 Thread Peter Xu
On Thu, Aug 22, 2024 at 11:13:36AM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Thu, Aug 01, 2024 at 09:35:11AM -0300, Fabiano Rosas wrote: > >> @@ -1554,7 +1577,6 @@ static void *multifd_recv_thread(void *opaque) > >> qemu_sem_wait(&p->sem_sync); > >> } >

[PATCH for-9.1] nbd/server: CVE-2024-7409: Avoid use-after-free when closing server

2024-08-22 Thread Eric Blake
Commit 3e7ef738 plugged the use-after-free of the global nbd_server object, but overlooked a use-after-free of nbd_server->listener. Although this race is harder to hit, notice that our shutdown path first drops the reference count of nbd_server->listener, then triggers actions that can result in a

Re: [PATCH v2] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Thomas Huth
On 22/08/2024 16.06, Marcin Juszkiewicz wrote: On 22.08.2024 13:41, Philippe Mathieu-Daudé wrote:   # Timeouts for individual tests that can be slow e.g. with debugging enabled   test_timeouts = { +  'aarch64_sbsaref' : 180, What kind of machine is able to run those tests in 180s? I bumped th

Re: [PATCH v2] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Philippe Mathieu-Daudé
On 22/8/24 16:06, Marcin Juszkiewicz wrote: On 22.08.2024 13:41, Philippe Mathieu-Daudé wrote:   # Timeouts for individual tests that can be slow e.g. with debugging enabled   test_timeouts = { +  'aarch64_sbsaref' : 180, What kind of machine is able to run those tests in 180s? I bumped them

Re: [PATCH v2] tests/functional: Convert Aarch64 SBSA-Ref avocado tests

2024-08-22 Thread Thomas Huth
On 22/08/2024 16.39, Philippe Mathieu-Daudé wrote: On 22/8/24 16:06, Marcin Juszkiewicz wrote: On 22.08.2024 13:41, Philippe Mathieu-Daudé wrote:   # Timeouts for individual tests that can be slow e.g. with debugging enabled   test_timeouts = { +  'aarch64_sbsaref' : 180, What kind of machin

Re: [PATCH v3 09/14] migration/multifd: Isolate ram pages packet data

2024-08-22 Thread Fabiano Rosas
Peter Xu writes: > On Thu, Aug 22, 2024 at 11:13:36AM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > On Thu, Aug 01, 2024 at 09:35:11AM -0300, Fabiano Rosas wrote: >> >> @@ -1554,7 +1577,6 @@ static void *multifd_recv_thread(void *opaque) >> >> qemu_sem_wait(&p->sem_sy

[PATCH v5 2/8] crypto: Support SHA384 hash when using glib

2024-08-22 Thread Dorjoy Chowdhury
QEMU requires minimum glib version 2.66.0 as per the root meson.build file and per glib documentation[1] G_CHECKSUM_SHA384 is available since 2.51. [1] https://docs.gtk.org/glib/enum.ChecksumType.html Reviewed-by: Daniel P. Berrangé Signed-off-by: Dorjoy Chowdhury --- crypto/hash-glib.c | 2 +-

[PATCH v5 0/8] AWS Nitro Enclave emulation support

2024-08-22 Thread Dorjoy Chowdhury
This is v5 submission for AWS Nitro Enclave emulation in QEMU. From the QEMU side the implementation for nitro enclaves is complete. v4 is at: https://mail.gnu.org/archive/html/qemu-devel/2024-08/msg02675.html Changes in v5: - bunch of use of glib utilities like g_autofree, g_memdup2, GList e

[PATCH v5 7/8] machine/nitro-enclave: New machine type for AWS Nitro Enclaves

2024-08-22 Thread Dorjoy Chowdhury
AWS nitro enclaves[1] is an Amazon EC2[2] feature that allows creating isolated execution environments, called enclaves, from Amazon EC2 instances which are used for processing highly sensitive data. Enclaves have no persistent storage and no external networking. The enclave VMs are based on the Fi

[PATCH v5 4/8] tests/lcitool: Update libvirt-ci and add libcbor dependency

2024-08-22 Thread Dorjoy Chowdhury
libcbor dependecy is necessary for adding virtio-nsm and nitro-enclave machine support in the following commits. libvirt-ci has already been updated with the dependency upstream and this commit updates libvirt-ci submodule in QEMU to latest upstream. Also the libcbor dependency has been added to te

[PATCH v5 3/8] crypto: Introduce x509 utils

2024-08-22 Thread Dorjoy Chowdhury
An utility function for getting fingerprint from X.509 certificate has been introduced. Implementation only provided using gnutls. Signed-off-by: Dorjoy Chowdhury --- crypto/meson.build | 4 ++ crypto/x509-utils.c | 75 + include/crypto/x509-

[PATCH v5 5/8] device/virtio-nsm: Support for Nitro Secure Module device

2024-08-22 Thread Dorjoy Chowdhury
Nitro Secure Module (NSM)[1] device is used in AWS Nitro Enclaves[2] for stripped down TPM functionality like cryptographic attestation. The requests to and responses from NSM device are CBOR[3] encoded. This commit adds support for NSM device in QEMU. Although related to AWS Nitro Enclaves, the v

[PATCH v5 8/8] docs/nitro-enclave: Documentation for nitro-enclave machine type

2024-08-22 Thread Dorjoy Chowdhury
Signed-off-by: Dorjoy Chowdhury --- docs/system/i386/nitro-enclave.rst | 85 ++ 1 file changed, 85 insertions(+) create mode 100644 docs/system/i386/nitro-enclave.rst diff --git a/docs/system/i386/nitro-enclave.rst b/docs/system/i386/nitro-enclave.rst new file mode

[PATCH v5 1/8] crypto: Define macros for hash algorithm digest lengths

2024-08-22 Thread Dorjoy Chowdhury
Signed-off-by: Dorjoy Chowdhury --- crypto/hash.c | 14 +++--- include/crypto/hash.h | 8 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/crypto/hash.c b/crypto/hash.c index b0f8228bdc..8087f5dae6 100644 --- a/crypto/hash.c +++ b/crypto/hash.c @@ -23,13 +

[PATCH v5 6/8] hw/core: Add Enclave Image Format (EIF) related helpers

2024-08-22 Thread Dorjoy Chowdhury
An EIF (Enclave Image Format)[1] file is used to boot an AWS nitro enclave[2] virtual machine. The EIF file contains the necessary kernel, cmdline, ramdisk(s) sections to boot. Some helper functions have been introduced for extracting the necessary sections from an EIF file and then writing them t

Re: [PATCH v4 4/6] machine/nitro-enclave: Add built-in Nitro Secure Module device

2024-08-22 Thread Dorjoy Chowdhury
Hi Daniel, On Mon, Aug 19, 2024 at 4:37 PM Daniel P. Berrangé wrote: > > On Sun, Aug 18, 2024 at 05:42:55PM +0600, Dorjoy Chowdhury wrote: > > AWS Nitro Enclaves have built-in Nitro Secure Module (NSM) device which > > is used for stripped down TPM functionality like attestation. This commit > >

Re: [PATCH v4 0/6] AWS Nitro Enclave emulation support

2024-08-22 Thread Dorjoy Chowdhury
Thanks for taking the time to review. v5 posted now: https://lists.gnu.org/archive/html/qemu-devel/2024-08/msg03251.html Regards, Dorjoy

Re: [PATCH] scripts/coccinelle: New range.cocci

2024-08-22 Thread Peter Maydell
On Wed, 21 Aug 2024 at 01:21, Xingtao Yao (Fujitsu) wrote: > > > > > -Original Message- > > From: Peter Maydell > > Sent: Tuesday, August 20, 2024 4:41 PM > > To: Yao, Xingtao/姚 幸涛 > > Cc: qemu-devel@nongnu.org > > Subject: Re: [PATCH] scripts/coccinelle: New range.cocci > > > > On Thu,

Re: [PATCH v3 10/14] migration/multifd: Don't send ram data during SYNC

2024-08-22 Thread Peter Xu
On Thu, Aug 01, 2024 at 09:35:12AM -0300, Fabiano Rosas wrote: > Skip saving and loading any ram data in the packet in the case of a > SYNC. This fixes a shortcoming of the current code which requires a > reset of the MultiFDPages_t fields right after the previous > pending_job finishes, otherwise

  1   2   >