Re: [PATCH v49 00/11] hw/sd/sdcard: Add eMMC support

2024-07-12 Thread Cédric Le Goater
On 7/12/24 18:27, Philippe Mathieu-Daudé wrote: Tag to test Aspeed tree: https://gitlab.com/philmd/qemu/-/tags/aspeed_emmc-v9 Updated aspeed9.1 branch. LGTM. Thanks, C. Since v48: - Dropped "Implement 'boot-mode' reset timing" patch - Re-introduce Joel "Support boot area in emmc image"

Re: [PULL v1 0/3] Xen queue

2024-07-12 Thread Richard Henderson
On 7/12/24 04:02, Edgar E. Iglesias wrote: From: "Edgar E. Iglesias" The following changes since commit 23901b2b721c0576007ab7580da8aa855d6042a9: Merge tag 'pull-target-arm-20240711' ofhttps://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-07-11 12:00:00 -0700) are available

Re: [PULL v2 0/8] loongarch-to-apply queue

2024-07-12 Thread Richard Henderson
https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-20240712 for you to fetch changes up to 3ef4b21a5c767ff0b15047e709762abef490ad07: target/loongarch: Fix cpu_reset set wrong CSR_CRMD (2024-07-12 09:41:18 +0800) pull

Re: [PATCH v3] plugins/stoptrigger: TCG plugin to stop execution under conditions

2024-07-12 Thread Pierrick Bouvier
On 7/12/24 01:03, Simon Hamelin wrote: This new plugin allows to stop emulation using conditions on the emulation state. By setting this plugin arguments, it is possible to set an instruction count limit and/or trigger address(es) to stop at. The code returned at emulation exit can be customized.

Re: [PATCH v2] plugins/stoptrigger: TCG plugin to stop execution under conditions

2024-07-12 Thread Pierrick Bouvier
Hello Simon, On 7/12/24 00:53, Simon Hamelin wrote: On 7/11/24 12:03, Alex Bennée wrote: +static void exit_emulation(int return_code) +{ +exit(return_code); +} + +static void exit_icount_reached(unsigned int cpu_index, void *udata) +{ +qemu_plugin_outs("icount reached, exiting\n"); +

Re: [PATCH v6 7/7] tests/tcg/x86_64: add test for plugin memory access

2024-07-12 Thread Pierrick Bouvier
On 7/12/24 07:51, Alex Bennée wrote: Pierrick Bouvier writes: On 7/8/24 12:15, Alex Bennée wrote: Pierrick Bouvier writes: Add an explicit test to check expected memory values are read/written. For sizes 8, 16, 32, 64 and 128, we generate a load/store operation. For size 8 -> 64, we genera

Re: [PULL 0/7] hw/nvme patches

2024-07-12 Thread Richard Henderson
On 7/11/24 11:04, Klaus Jensen wrote: From: Klaus Jensen Hi, The following changes since commit 59084feb256c617063e0dbe7e64821ae8852d7cf: Merge tag 'pull-aspeed-20240709' ofhttps://github.com/legoater/qemu into staging (2024-07-09 07:13:55 -0700) are available in the Git repository at:

Re: [PATCH] aspeed/smc: Fix possible integer overflow

2024-07-12 Thread Peter Maydell
On Fri, 12 Jul 2024 at 17:36, Cédric Le Goater wrote: > > Coverity reports a possible integer overflow because routine > aspeeed_smc_hclk_divisor() has a codepath returning 0, which could > lead to an integer overflow when computing variable 'hclk_shift' in > the caller aspeed_smc_dma_calibration(

[PATCH] aspeed/smc: Fix possible integer overflow

2024-07-12 Thread Cédric Le Goater
Coverity reports a possible integer overflow because routine aspeeed_smc_hclk_divisor() has a codepath returning 0, which could lead to an integer overflow when computing variable 'hclk_shift' in the caller aspeed_smc_dma_calibration(). The value passed to aspeed_smc_hclk_divisor() is always betwe

Re: [PATCH v4] hw/core/loader: allow loading larger ROMs

2024-07-12 Thread Philippe Mathieu-Daudé
On 28/6/24 20:27, Gregor Haas wrote: The read() syscall is not guaranteed to return all data from a file. The default ROM loader implementation currently does not take this into account, instead failing if all bytes are not read at once. This change loads the ROM using g_file_get_contents() inste

Re: [PATCH] include/hw/qdev-core.h: Correct and clarify gpio doc comments

2024-07-12 Thread Philippe Mathieu-Daudé
On 8/7/24 17:33, Peter Maydell wrote: The doc comments for the functions for named GPIO inputs and outputs had a couple of problems: * some copy-and-paste errors meant the qdev_connect_gpio_out_named() doc comment had references to input GPIOs that should be to output GPIOs * it wasn'

[PATCH v49 04/11] hw/sd/sdcard: Add emmc_cmd_SET_RELATIVE_ADDR handler (CMD3)

2024-07-12 Thread Philippe Mathieu-Daudé
From: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater Tested-by: Andrew Jeffery Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater --- hw/sd/sd.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c

[PATCH v49 06/11] hw/sd/sdcard: Add emmc_cmd_PROGRAM_CID handler (CMD26)

2024-07-12 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater Reviewed-by: Cédric Le Goater Tested-by: Andrew Jeffery --- hw/sd/sd.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 09077f0154..a90612af58 100644 --- a/hw/sd/sd.c +

[PATCH v49 11/11] hw/sd/sdcard: Support boot area in emmc image

2024-07-12 Thread Philippe Mathieu-Daudé
From: Joel Stanley This assumes a specially constructed image: dd if=/dev/zero of=mmc-bootarea.img count=2 bs=1M dd if=u-boot-spl.bin of=mmc-bootarea.img conv=notrunc dd if=u-boot.bin of=mmc-bootarea.img conv=notrunc count=64 bs=1K cat mmc-bootarea.img obmc-phosphor-image.wic > mmc.img

[PATCH v49 00/11] hw/sd/sdcard: Add eMMC support

2024-07-12 Thread Philippe Mathieu-Daudé
Tag to test Aspeed tree: https://gitlab.com/philmd/qemu/-/tags/aspeed_emmc-v9 Since v48: - Dropped "Implement 'boot-mode' reset timing" patch - Re-introduce Joel "Support boot area in emmc image" patch - Comment magic CSD values Cédric Le Goater (2): hw/sd/sdcard: Add emmc_cmd_SET_RELATIVE_AD

[PATCH v49 09/11] hw/sd/sdcard: Add eMMC 'boot-partition-size' property

2024-07-12 Thread Philippe Mathieu-Daudé
Avoid hardcoding 1MiB boot size in EXT_CSD_BOOT_MULT, expose it as 'boot-partition-size' QOM property. By default, do not use any size. The board is responsible to set the boot partition size property. Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater --- hw/sd/sd.c | 5 -

[PATCH v49 10/11] hw/sd/sdcard: Add mmc SWITCH function support (CMD6)

2024-07-12 Thread Philippe Mathieu-Daudé
From: Sai Pavan Boddu switch operation in mmc cards, updated the ext_csd register to request changes in card operations. Here we implement similar sequence but requests are mostly dummy and make no change. Implement SWITCH_ERROR if the write operation offset goes beyond length of ext_csd. Signe

[PATCH v49 01/11] hw/sd/sdcard: Basis for eMMC support

2024-07-12 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Since eMMC are soldered on boards, it is not user-creatable. RCA register is initialized to 0x0001, per spec v4.3, chapter 8.5 "RCA register": The default value of the RCA register is 0x0001. The value 0x is reserved to set all cards into the Stand-by Stat

[PATCH v49 08/11] hw/sd/sdcard: Add emmc_cmd_SEND_EXT_CSD handler (CMD8)

2024-07-12 Thread Philippe Mathieu-Daudé
From: Vincent Palatin The parameters mimick a real 4GB eMMC, but it can be set to various sizes. Signed-off-by: Vincent Palatin Signed-off-by: Cédric Le Goater Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias Signed-off-by: Cédric Le Goater EXT_CSD values from Vincent's patc

[PATCH v49 07/11] hw/sd/sdcard: Implement eMMC sleep state (CMD5)

2024-07-12 Thread Philippe Mathieu-Daudé
From: Luc Michel The JEDEC standards specifies a sleep state where the eMMC won't answer any command appart from RESET and WAKEUP and go to low power state. Implement this state and the corresponding command number 5. Signed-off-by: Luc Michel Signed-off-by: Francisco Iglesias Signed-off-by:

[PATCH v49 05/11] hw/sd/sdcard: Fix SET_BLOCK_COUNT command argument on eMMC (CMD23)

2024-07-12 Thread Philippe Mathieu-Daudé
From: Cédric Le Goater The number of blocks is defined in the lower bits [15:0]. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater Tested-by: Andrew Jeffery Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater --- hw/sd/sd.c | 3 +++ 1 file changed, 3 inserti

[PATCH v49 03/11] hw/sd/sdcard: Register unimplemented command handlers

2024-07-12 Thread Philippe Mathieu-Daudé
Per the spec v4.3 these commands are mandatory, but we don't implement them. Reviewed-by: Cédric Le Goater Tested-by: Cédric Le Goater Tested-by: Andrew Jeffery Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater --- hw/sd/sd.c | 9 + 1 file changed, 9 insertions(+) di

[PATCH v49 02/11] hw/sd/sdcard: Register generic command handlers

2024-07-12 Thread Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater Reviewed-by: Cédric Le Goater Tested-by: Andrew Jeffery Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater --- hw/sd/sd.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index ea01bf6e28..0093bbab3

Re: [PULL 06/12] aspeed/smc: Add DMA calibration settings

2024-07-12 Thread Cédric Le Goater
On 7/12/24 16:39, Peter Maydell wrote: On Fri, 13 Sept 2019 at 16:50, Peter Maydell wrote: From: Cédric Le Goater When doing calibration, the SPI clock rate in the CE0 Control Register and the read delay cycles in the Read Timing Compensation Register are set using bit[11:4] of the DMA Contr

Re: [PATCH] contrib/vhost-user-blk: fix overflowing expression

2024-07-12 Thread Peter Maydell
On Fri, 12 Jul 2024 at 16:39, Stefano Garzarella wrote: > > Coverity reported: > > >>> CID 1549454: Integer handling issues (OVERFLOW_BEFORE_WIDEN) > >>> Potentially overflowing expression > "le32_to_cpu(desc->num_sectors) << 9" with type "uint32_t" > (32 bits, un

[PATCH] contrib/vhost-user-blk: fix overflowing expression

2024-07-12 Thread Stefano Garzarella
Coverity reported: >>> CID 1549454: Integer handling issues (OVERFLOW_BEFORE_WIDEN) >>> Potentially overflowing expression "le32_to_cpu(desc->num_sectors) << 9" with type "uint32_t" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used

Re: [RFC PATCH 6/7] migration/multifd: Move payload storage out of the channel parameters

2024-07-12 Thread Peter Xu
On Fri, Jul 12, 2024 at 09:44:02AM -0300, Fabiano Rosas wrote: > Do you have a reference for that kubevirt issue I could look at? It > maybe interesting to investigate further. Where's the throttling coming > from? And doesn't less vcpu time imply less dirtying and therefore > faster convergence?

Re: [PATCH v2 16/19] system/cpus: Add cpu_pause() function

2024-07-12 Thread Peter Xu
On Fri, Jul 12, 2024 at 10:02:43PM +1000, Nicholas Piggin wrote: > This factors the CPU pause function from pause_all_vcpus() into a > new cpu_pause() function, similarly to cpu_resume(). cpu_resume() > is moved to keep it next to cpu_pause(). > > Cc: Philippe Mathieu-Daudé > Cc: Peter Xu > Cc:

Re: [PULL v3 52/85] contrib/vhost-user-*: use QEMU bswap helper functions

2024-07-12 Thread Peter Maydell
On Fri, 12 Jul 2024 at 16:18, Stefano Garzarella wrote: > > On Fri, Jul 12, 2024 at 03:24:47PM GMT, Peter Maydell wrote: > >On Wed, 3 Jul 2024 at 23:48, Michael S. Tsirkin wrote: > >> #if defined(__linux__) && defined(BLKDISCARD) && defined(BLKZEROOUT) > >> VubDev *vdev_blk = req->vdev_

Re: [PULL v3 52/85] contrib/vhost-user-*: use QEMU bswap helper functions

2024-07-12 Thread Stefano Garzarella
On Fri, Jul 12, 2024 at 03:24:47PM GMT, Peter Maydell wrote: On Wed, 3 Jul 2024 at 23:48, Michael S. Tsirkin wrote: From: Stefano Garzarella Let's replace the calls to le*toh() and htole*() with qemu/bswap.h helpers to make the code more portable. Suggested-by: Philippe Mathieu-Daudé Revie

Re: [PATCH v2] block/reqlist: allow adding overlapping requests

2024-07-12 Thread Vladimir Sementsov-Ogievskiy
On 12.07.24 17:07, Fiona Ebner wrote: Allow overlapping request by removing the assert that made it impossible. There are only two callers: 1. block_copy_task_create() It already asserts the very same condition before calling reqlist_init_req(). 2. cbw_snapshot_read_lock() There is no need to

Re: [PATCH v2] osdep: add a qemu_close_all_open_fd() helper

2024-07-12 Thread Daniel P . Berrangé
On Tue, Jun 18, 2024 at 01:17:03PM +0200, Clément Léger wrote: > Since commit 03e471c41d8b ("qemu_init: increase NOFILE soft limit on > POSIX"), the maximum number of file descriptors that can be opened are > raised to nofile.rlim_max. On recent debian distro, this yield a maximum > of 1073741816 f

Re: [PATCH] accel/tcg: Make cpu_exec_interrupt hook mandatory

2024-07-12 Thread Richard Henderson
On 7/12/24 04:39, Peter Maydell wrote: TheTCGCPUOps::cpu_exec_interrupt hook is currently not mandatory; if it is left NULL then we treat it as if it had returned false. However since pretty much every architecture needs to handle interrupts, almost every target we have provides the hook. The on

Re: [PATCH] accel/tcg: Make cpu_exec_interrupt hook mandatory

2024-07-12 Thread Alex Bennée
Peter Maydell writes: > The TCGCPUOps::cpu_exec_interrupt hook is currently not mandatory; if > it is left NULL then we treat it as if it had returned false. However > since pretty much every architecture needs to handle interrupts, > almost every target we have provides the hook. The one excepti

Re: [PATCH v6 7/7] tests/tcg/x86_64: add test for plugin memory access

2024-07-12 Thread Alex Bennée
Pierrick Bouvier writes: > On 7/8/24 12:15, Alex Bennée wrote: >> Pierrick Bouvier writes: >> >>> Add an explicit test to check expected memory values are read/written. >>> For sizes 8, 16, 32, 64 and 128, we generate a load/store operation. >>> For size 8 -> 64, we generate an atomic __sync_va

Re: [PULL 06/12] aspeed/smc: Add DMA calibration settings

2024-07-12 Thread Peter Maydell
On Fri, 13 Sept 2019 at 16:50, Peter Maydell wrote: > > From: Cédric Le Goater > > When doing calibration, the SPI clock rate in the CE0 Control Register > and the read delay cycles in the Read Timing Compensation Register are > set using bit[11:4] of the DMA Control Register. > > Signed-off-by:

Re: [PATCH v2 16/19] system/cpus: Add cpu_pause() function

2024-07-12 Thread Philippe Mathieu-Daudé
On 12/7/24 14:02, Nicholas Piggin wrote: This factors the CPU pause function from pause_all_vcpus() into a new cpu_pause() function, similarly to cpu_resume(). cpu_resume() is moved to keep it next to cpu_pause(). Cc: Philippe Mathieu-Daudé Cc: Peter Xu Cc: Richard Henderson Signed-off-by: Ni

Re: [RFC PATCH 0/8] Convert avocado tests to normal Python unittests

2024-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2024 at 03:25:23PM +0100, Alex Bennée wrote: > Daniel P. Berrangé writes: > > > On Thu, Jul 11, 2024 at 07:44:39PM +0200, Thomas Huth wrote: > >> On 11/07/2024 16.39, Fabiano Rosas wrote: > >> > Thomas Huth writes: > >> ... > >> > > Things that need further attention though: > >>

Re: [PATCH] accel/tcg: Make cpu_exec_interrupt hook mandatory

2024-07-12 Thread Philippe Mathieu-Daudé
On 12/7/24 13:39, Peter Maydell wrote: The TCGCPUOps::cpu_exec_interrupt hook is currently not mandatory; if it is left NULL then we treat it as if it had returned false. However since pretty much every architecture needs to handle interrupts, almost every target we have provides the hook. The on

Re: [RFC PATCH 0/8] Convert avocado tests to normal Python unittests

2024-07-12 Thread Alex Bennée
Daniel P. Berrangé writes: > On Thu, Jul 11, 2024 at 07:44:39PM +0200, Thomas Huth wrote: >> On 11/07/2024 16.39, Fabiano Rosas wrote: >> > Thomas Huth writes: >> ... >> > > Things that need further attention though: >> > > >> > > - All tests that use the LinuxTest / LinuxDistro classes (e.g. b

Re: [PULL v3 52/85] contrib/vhost-user-*: use QEMU bswap helper functions

2024-07-12 Thread Peter Maydell
On Wed, 3 Jul 2024 at 23:48, Michael S. Tsirkin wrote: > > From: Stefano Garzarella > > Let's replace the calls to le*toh() and htole*() with qemu/bswap.h > helpers to make the code more portable. > > Suggested-by: Philippe Mathieu-Daudé > Reviewed-by: Philippe Mathieu-Daudé > Tested-by: Philip

Re: [RFC PATCH] build deps: update lcitool to include rust bits

2024-07-12 Thread Alex Bennée
Manos Pitsidianakis writes: > Hi Daniel, Alex, > > I will pick this patch up with all the reviewed-by trailers for my > next Rust RFC series if that's alright with you, Absolutely - I made it for you ;-) -- Alex Bennée Virtualisation Tech Lead @ Linaro

Re: [PULL 39/40] gdbstub: Add support for MTE in user mode

2024-07-12 Thread Peter Maydell
On Fri, 5 Jul 2024 at 16:37, Alex Bennée wrote: > > From: Gustavo Romero > > This commit implements the stubs to handle the qIsAddressTagged, > qMemTag, and QMemTag GDB packets, allowing all GDB 'memory-tag' > subcommands to work with QEMU gdbstub on aarch64 user mode. It also > implements the ge

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

2024-07-12 Thread Fabiano Rosas
Yichen Wang writes: > From: Bryan Zhang > > Adds support for 'qatzip' as an option for the multifd compression > method parameter, and implements using QAT for 'qatzip' compression and > decompression. > > Signed-off-by: Bryan Zhang > Signed-off-by: Hao Xiang > Signed-off-by: Yichen Wang > --

[PATCH v2] block/reqlist: allow adding overlapping requests

2024-07-12 Thread Fiona Ebner
Allow overlapping request by removing the assert that made it impossible. There are only two callers: 1. block_copy_task_create() It already asserts the very same condition before calling reqlist_init_req(). 2. cbw_snapshot_read_lock() There is no need to have read requests be non-overlapping i

[RFC V1 4/7] vdpa/cpr: kernel interfaces

2024-07-12 Thread Steve Sistare
Add the proposed vdpa kernel interfaces for CPR: VHOST_NEW_OWNER: new ioctl VHOST_BACKEND_F_NEW_OWNER: new capability VHOST_IOTLB_REMAP: new iotlb message VHOST_BACKEND_F_IOTLB_REMAP: new capability Signed-off-by: Steve Sistare --- include/standard-headers/linux/vhost_types.h | 7 +++

[RFC V1 0/7] Live update: vdpa

2024-07-12 Thread Steve Sistare
Support vdpa devices with the cpr-exec live migration mode. This series depends on the QEMU series Live update: cpr-exec https://lore.kernel.org/qemu-devel/1719776434-435013-1-git-send-email-steven.sist...@oracle.com/ and depends on the kernel series: vdpa live update https://lore.ker

[RFC V1 1/7] migration: cpr_needed_for_reuse

2024-07-12 Thread Steve Sistare
Define a vmstate "needed" helper. This will be moved to the preceding patch series "Live update: cpr-exec" because it is needed by multiple devices. Signed-off-by: Steve Sistare --- include/migration/cpr.h | 1 + migration/cpr.c | 5 + 2 files changed, 6 insertions(+) diff --git a/

[RFC V1 6/7] vdpa/cpr: pass shadow parameter to dma functions

2024-07-12 Thread Steve Sistare
Pass a parameter to the dma mapping functions that indicates if the memory backs rings or buffers for svq's. No functional change. Signed-off-by: Steve Sistare --- hw/virtio/vhost-vdpa.c | 19 ++- include/hw/virtio/vhost-vdpa.h | 4 ++-- net/vhost-vdpa.c |

[RFC V1 7/7] vdpa/cpr: preserve dma mappings

2024-07-12 Thread Steve Sistare
Preserve dma mappings during CPR restart by suppressing dma_map and dma_unmap calls. For devices with capability VHOST_BACKEND_F_IOTLB_REMAP, convert dma_map calls to VHOST_IOTLB_REMAP to set the new userland VA for the existing mapping. However, map and unmap shadow vq buffers normally. Their p

[RFC V1 3/7] vdpa/cpr: preserve device fd

2024-07-12 Thread Steve Sistare
Save the vdpa device fd in CPR state when it is created, and fetch the fd from that state after CPR. Remember that the fd was reused, for subsequent patches. Signed-off-by: Steve Sistare --- include/hw/virtio/vhost-vdpa.h | 3 +++ net/vhost-vdpa.c | 24 ++-- 2

[RFC V1 5/7] vdpa/cpr: use VHOST_NEW_OWNER

2024-07-12 Thread Steve Sistare
Block CPR if the kernel does not support VHOST_NEW_OWNER. After CPR, call VHOST_NEW_OWNER in new QEMU. Signed-off-by: Steve Sistare --- hw/virtio/trace-events| 1 + hw/virtio/vhost-vdpa.c| 24 ++-- include/hw/virtio/vhost.h | 1 + 3 files changed, 24 insertions(+),

[RFC V1 2/7] migration: skip dirty memory tracking for cpr

2024-07-12 Thread Steve Sistare
CPR preserves memory in place, so there is no need to track dirty memory. By skipping it, CPR can support devices that do not support tracking. Signed-off-by: Steve Sistare --- system/memory.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/system/memory.c b/system/memory.c inde

Re: [PATCH] meson.build: fix libgcrypt detection on system without libgcrypt-config

2024-07-12 Thread Daniel P . Berrangé
On Sat, Jul 06, 2024 at 08:12:26PM +, Yao Zi wrote: > libgcrypt starts providing correct pkg-config configuration and dropping > libgcrypt-config since 1.11.0. So use auto method for detection of > libgcrypt, in which meson will try both pkg-config and libgcrypt-config. The pkg-config file see

Re: [PULL 08/16] hw/sd/sdcard: Add sd_cmd_GEN_CMD handler (CMD56)

2024-07-12 Thread Peter Maydell
On Fri, 5 Jul 2024 at 23:06, Philippe Mathieu-Daudé wrote: > > "General command" (GEN_CMD, CMD56) is described as: > > GEN_CMD is the same as the single block read or write > commands (CMD24 or CMD17). The difference is that [...] > the data block is not a memory payload data but has a > v

Re: [PATCH v2 0/9] RISC-V: ACPI: Namespace updates

2024-07-12 Thread Igor Mammedov
On Fri, 12 Jul 2024 13:51:04 +0100 Daniel P. Berrangé wrote: > On Fri, Jul 12, 2024 at 02:43:19PM +0200, Igor Mammedov wrote: > > On Mon, 8 Jul 2024 17:17:32 +0530 > > Sunil V L wrote: > > > > > This series adds few updates to RISC-V ACPI namespace for virt platform. > > > Additionally, it h

[PATCH V14 7/7] gdbstub: Add helper function to unregister GDB register space

2024-07-12 Thread Salil Mehta via
Add common function to help unregister the GDB register space. This shall be done in context to the CPU unrealization. Note: These are common functions exported to arch specific code. For example, for ARM this code is being referred in associated arch specific patch-set: Link: https://lore.kerne

[PATCH V14 6/7] physmem: Add helper function to destroy CPU AddressSpace

2024-07-12 Thread Salil Mehta via
Virtual CPU Hot-unplug leads to unrealization of a CPU object. This also involves destruction of the CPU AddressSpace. Add common function to help destroy the CPU AddressSpace. Signed-off-by: Salil Mehta Tested-by: Vishnu Pajjuri Reviewed-by: Gavin Shan Tested-by: Xianglai Li Tested-by: Miguel

[PATCH V14 5/7] hw/acpi: Update CPUs AML with cpu-(ctrl)dev change

2024-07-12 Thread Salil Mehta via
CPUs Control device(\\_SB.PCI0) register interface for the x86 arch is IO port based and existing CPUs AML code assumes _CRS objects would evaluate to a system resource which describes IO Port address. But on ARM arch CPUs control device(\\_SB.PRES) register interface is memory-mapped hence _CRS ob

[PATCH V14 4/7] hw/acpi: Update GED _EVT method AML with CPU scan

2024-07-12 Thread Salil Mehta via
OSPM evaluates _EVT method to map the event. The CPU hotplug event eventually results in start of the CPU scan. Scan figures out the CPU and the kind of event(plug/unplug) and notifies it back to the guest. Update the GED AML _EVT method with the call to method \\_SB.CPUS.CSCN (via \\_SB.GED.CSCN)

[PATCH V14 3/7] hw/acpi: Update ACPI GED framework to support vCPU Hotplug

2024-07-12 Thread Salil Mehta via
ACPI GED (as described in the ACPI 6.4 spec) uses an interrupt listed in the _CRS object of GED to intimate OSPM about an event. Later then demultiplexes the notified event by evaluating ACPI _EVT method to know the type of event. Use ACPI GED to also notify the guest kernel about any CPU hot(un)pl

[PATCH V14 1/7] accel/kvm: Extract common KVM vCPU {creation, parking} code

2024-07-12 Thread Salil Mehta via
KVM vCPU creation is done once during the vCPU realization when Qemu vCPU thread is spawned. This is common to all the architectures as of now. Hot-unplug of vCPU results in destruction of the vCPU object in QOM but the corresponding KVM vCPU object in the Host KVM is not destroyed as KVM doesn't

[PATCH V14 2/7] hw/acpi: Move CPU ctrl-dev MMIO region len macro to common header file

2024-07-12 Thread Salil Mehta via
CPU ctrl-dev MMIO region length could be used in ACPI GED and various other architecture specific places. Move ACPI_CPU_HOTPLUG_REG_LEN macro to more appropriate common header file. Signed-off-by: Salil Mehta Reviewed-by: Alex Bennée Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Review

[PATCH V14 0/7] Add architecture agnostic code to support vCPU Hotplug

2024-07-12 Thread Salil Mehta via
[Note: References are present at the last after the revision history] Virtual CPU hotplug support is being added across various architectures [1][3]. This series adds various code bits common across all architectures: 1. vCPU creation and Parking code refactor [Patch 1] 2. Update ACPI GED framewo

Re: [PATCH v2 03/19] ppc/pnv: Move timebase state into PnvCore

2024-07-12 Thread Cédric Le Goater
On 7/12/24 14:02, Nicholas Piggin wrote: The timebase state machine is per per-core state and can be driven by any thread in the core. It is currently implemented as a hack where the state is in a CPU structure and only thread 0's state is accessed by the chiptod, which limits programming the tim

Re: [PATCH] docs/devel: Add introduction to LUKS volume with detached header

2024-07-12 Thread Daniel P . Berrangé
On Tue, Feb 20, 2024 at 12:04:42AM +0800, Hyman Huang wrote: > Signed-off-by: Hyman Huang > --- > MAINTAINERS | 1 + > docs/devel/luks-detached-header.rst | 182 > 2 files changed, 183 insertions(+) > create mode 100644 docs/devel/luks-detac

[PATCH] target/i386: Add Bus Lock Detect support

2024-07-12 Thread Ravi Bangoria
Upcoming AMD uarch will support Bus Lock Detect (called Bus Lock Trap in AMD docs). Bus Lock Detect is enumerated with cpuid Fn_0007_ECX_x0 bit [24 / BUSLOCKTRAP]. It can be enabled through MSR_IA32_DEBUGCTLMSR. When enabled, hardware clears DR6[11] and raises a #DB exception on occurrence of B

[PATCH v3 10/22] qga: conditionalize schema for commands requiring getifaddrs

2024-07-12 Thread Daniel P . Berrangé
Rather than creating stubs for every comamnd that just return QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to fully exclude generation of the network interface command on POSIX platforms lacking getifaddrs(). The command will be rejected at QMP dispatch time instead, avoiding reimpleme

[PATCH v3 05/22] qga: move linux disk/cpu stats command impls to commands-linux.c

2024-07-12 Thread Daniel P . Berrangé
The qmp_guest_{diskstats,cpustats} command impls in commands-posix.c are surrounded by '#ifdef __linux__' so should instead live in commands-linux.c This also removes a "#ifdef CONFIG_LINUX" that was nested inside a "#ifdef __linux__". Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Konstantin

[PATCH v3 06/22] qga: move linux memory block command impls to commands-linux.c

2024-07-12 Thread Daniel P . Berrangé
The qmp_guest_{set,get}_{memory_blocks,block_info} command impls in commands-posix.c are surrounded by '#ifdef __linux__' so should instead live in commands-linux.c This also removes a "#ifdef CONFIG_LINUX" that was nested inside a "#ifdef __linux__". Reviewed-by: Philippe Mathieu-Daudé Reviewed

[PATCH v3 13/22] qga: conditionalize schema for commands requiring fsfreeze

2024-07-12 Thread Daniel P . Berrangé
Rather than creating stubs for every command that just return QERR_UNSUPPORTED, use 'if' conditions in the schema to fully exclude generation of the filesystem freezing commands on POSIX platforms lacking the required APIs. The command will be rejected at QMP dispatch time instead, avoiding reimpl

[PATCH v3 16/22] qga: conditionalize schema for commands requiring utmpx

2024-07-12 Thread Daniel P . Berrangé
Rather than creating stubs for every command that just return QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to fully exclude generation of the get-users command on POSIX platforms lacking required APIs. The command will be rejected at QMP dispatch time instead, avoiding reimplementing r

[PATCH v3 08/22] qga: conditionalize schema for commands unsupported on Windows

2024-07-12 Thread Daniel P . Berrangé
Rather than creating stubs for every command that just return QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to fully exclude generation of the commands on Windows. The command will be rejected at QMP dispatch time instead, avoiding reimplementing rejection by blocking the stub commands.

[PATCH v3 21/22] qga: allow configuration file path via the cli

2024-07-12 Thread Daniel P . Berrangé
Allowing the user to set the QGA_CONF environment variable to change the default configuration file path is very unusual practice, made more obscure since this ability is not documented. This introduces the more normal '-c PATH' / '--config=PATH' command line argument approach. This requires that

[PATCH v3 22/22] qga: centralize logic for disabling/enabling commands

2024-07-12 Thread Daniel P . Berrangé
It is confusing having many different pieces of code enabling and disabling commands, and it is not clear that they all have the same semantics, especially wrt prioritization of the block/allow lists. The code attempted to prevent the user from setting both the block and allow lists concurrently, h

[PATCH v3 15/22] qga: conditionalize schema for commands requiring libudev

2024-07-12 Thread Daniel P . Berrangé
Rather than creating stubs for every command that just return QERR_UNSUPPORTED, use 'if' conditions in the schema to fully exclude generation of the filesystem trimming commands on POSIX platforms lacking required APIs. The command will be rejected at QMP dispatch time instead, avoiding reimplemen

[PATCH v3 18/22] qga: don't disable fsfreeze commands if vss_init fails

2024-07-12 Thread Daniel P . Berrangé
The fsfreeze commands are already written to report an error if vss_init() fails. Reporting a more specific error message is more helpful than a generic "command is disabled" message, which cannot between an admin config decision and lack of platform support. Reviewed-by: Manos Pitsidianakis Sign

[PATCH v3 20/22] qga: remove pointless 'blockrpcs_key' variable

2024-07-12 Thread Daniel P . Berrangé
This variable was used to support back compat for the old config file key name, and became redundant after the following change: commit a7a2d636ae4549ef0551134d4bf8e084a14431c4 Author: Philippe Mathieu-Daudé Date: Thu May 30 08:36:43 2024 +0200 qga: Remove deprecated 'blacklist' argu

[PATCH v3 11/22] qga: conditionalize schema for commands requiring linux/win32

2024-07-12 Thread Daniel P . Berrangé
Some commands were blocked based on CONFIG_FSFREEZE, but their impl had nothing todo with CONFIG_FSFREEZE, and were instead either Linux-only, or Win+Linux-only. Rather than creating stubs for every command that just return QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to fully exclude

[PATCH v3 17/22] qga: conditionalize schema for commands not supported on other UNIX

2024-07-12 Thread Daniel P . Berrangé
Rather than creating stubs for every command that just return QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to fully exclude generation of the commands on other UNIX. The command will be rejected at QMP dispatch time instead, avoiding reimplementing rejection by blocking the stub comma

[PATCH v3 12/22] qga: conditionalize schema for commands only supported on Windows

2024-07-12 Thread Daniel P . Berrangé
Rather than creating stubs for every command that just return QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to fully exclude generation of the commands on non-Windows. The command will be rejected at QMP dispatch time instead, avoiding reimplementing rejection by blocking the stub comma

[PATCH v3 19/22] qga: move declare of QGAConfig struct to top of file

2024-07-12 Thread Daniel P . Berrangé
It is referenced by QGAState already, and it is clearer to declare all data types at the top of the file, rather than have them mixed with code later. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Konstantin Kostiuk Signed-off-by: Daniel P. Berrangé --- qga/main.c | 44 +

[PATCH v3 09/22] qga: conditionalize schema for commands unsupported on non-Linux POSIX

2024-07-12 Thread Daniel P . Berrangé
Rather than creating stubs for every command that just return QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to fully exclude generation of the commands on non-Linux POSIX platforms The command will be rejected at QMP dispatch time instead, avoiding reimplementing rejection by blocking t

[PATCH v3 03/22] qga: move linux suspend command impls to commands-linux.c

2024-07-12 Thread Daniel P . Berrangé
The qmp_guest_suspend_{disk,ram,hybrid} command impls in commands-posix.c are surrounded by '#ifdef __linux__' so should instead live in commands-linux.c Reviewed-by: Manos Pitsidianakis Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Konstantin Kostiuk Signed-off-by: Daniel P. Berrangé ---

[PATCH v3 04/22] qga: move linux fs/disk command impls to commands-linux.c

2024-07-12 Thread Daniel P . Berrangé
The qmp_guest_{fstrim, get_fsinfo, get_disks} command impls in commands-posix.c are surrounded by '#ifdef __linux__' so should instead live in commands-linux.c Reviewed-by: Manos Pitsidianakis Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Konstantin Kostiuk Signed-off-by: Daniel P. Berrangé

[PATCH v3 14/22] qga: conditionalize schema for commands requiring fstrim

2024-07-12 Thread Daniel P . Berrangé
Rather than creating stubs for every command that just return QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to fully exclude generation of the filesystem trimming commands on POSIX platforms lacking required APIs. The command will be rejected at QMP dispatch time instead, avoiding reimp

[PATCH v3 02/22] qga: move linux vcpu command impls to commands-linux.c

2024-07-12 Thread Daniel P . Berrangé
The qmp_guest_set_vcpus and qmp_guest_get_vcpus command impls in commands-posix.c are surrounded by '#ifdef __linux__' so should instead live in commands-linux.c Reviewed-by: Manos Pitsidianakis Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Konstantin Kostiuk Signed-off-by: Daniel P. Berrang

[PATCH v3 07/22] qga: move CONFIG_FSFREEZE/TRIM to be meson defined options

2024-07-12 Thread Daniel P . Berrangé
Defining these at the meson level allows them to be used a conditional tests in the QAPI schemas. Signed-off-by: Daniel P. Berrangé --- meson.build | 15 +++ qga/commands-common.h | 9 - 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/meson.build b/

[PATCH v3 01/22] qga: drop blocking of guest-get-memory-block-size command

2024-07-12 Thread Daniel P . Berrangé
This command has never existed in tree, since it was renamed to guest-get-memory-block-info before being merged. Reviewed-by: Manos Pitsidianakis Reviewed-by: Konstantin Kostiuk Signed-off-by: Daniel P. Berrangé --- qga/commands-posix.c | 2 +- qga/commands-win32.c | 2 +- 2 files changed, 2 i

[PATCH v3 00/22] qga: clean up command source locations and conditionals

2024-07-12 Thread Daniel P . Berrangé
This series is a side effect of other work I started, to attempt to make the QGA safe to use in confidential VMs by automatically restricting the permitted commands. Since this cleanup stands on its own, I'm sending it now. The QGA codebase has a very complicated maze of #ifdefs to create stubs fo

Re: [RFC PATCH] build deps: update lcitool to include rust bits

2024-07-12 Thread Manos Pitsidianakis
Hi Daniel, Alex, I will pick this patch up with all the reviewed-by trailers for my next Rust RFC series if that's alright with you, Manos On Fri, 12 Jul 2024 at 13:12, Daniel P. Berrangé wrote: > > On Wed, Jul 10, 2024 at 04:43:35PM +0100, Alex Bennée wrote: > > For rust development we need ca

Re: [PATCH v6 4/4] hw/cxl/cxl-mailbox-utils: Add device DDR5 ECS control feature

2024-07-12 Thread Jonathan Cameron via
On Fri, 5 Jul 2024 13:30:38 +0100 Jonathan Cameron wrote: > From: Shiju Jose > > CXL spec 3.1 section 8.2.9.9.11.2 describes the DDR5 Error Check Scrub (ECS) > control feature. Hi Michael / all, Silly stray white space issue inline that checkpatch will catch. > diff --git a/hw/mem/cxl_type3.

[PATCH v2 0/7] Add ACPI CPER firmware first error injection for Arm Processor

2024-07-12 Thread Mauro Carvalho Chehab
Testing OS kernel ACPI APEI CPER support is tricky, as one depends on having hardware with special-purpose BIOS and/or hardware. With QEMU, it becomes a lot easier, as it can be done via QMP. This series add support for ARM Processor CPER error injection, according with ACPI 6.x and UEFI 2.9A/2.1

[PATCH v2 2/7] arm/virt: Wire up GPIO error source for ACPI / GHES

2024-07-12 Thread Mauro Carvalho Chehab
From: Jonathan Cameron Creates a GED - Generic Event Device and set a GPIO to be used or error injection. [mchehab: use a define for the generic event pin number and do some cleanups] Signed-off-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/arm/virt-acpi-build.c | 30 ++

[PATCH v2 4/7] acpi/ghes: Add a logic to handle block addresses and FW first ARM processor error injection

2024-07-12 Thread Mauro Carvalho Chehab
From: Jonathan Cameron 1. Some GHES functions require handling addresses. Add a helper function to support it. 2. Add support for ACPI CPER (firmware-first) ARM processor error injection. Compliance with N.2.4.4 ARM Processor Error Section in UEFI 2.6 and upper specs, using error type bit en

[PATCH v2 1/7] arm/virt: place power button pin number on a define

2024-07-12 Thread Mauro Carvalho Chehab
Having magic numbers inside the code is not a good idea, as it is error-prone. So, instead, create a macro with the number definition. Signed-off-by: Mauro Carvalho Chehab --- hw/arm/virt-acpi-build.c | 6 +++--- hw/arm/virt.c| 3 ++- include/hw/arm/virt.h| 3 +++ 3 files changed

[PATCH v2 6/7] acpi/ghes: update comments to point to newer ACPI specs

2024-07-12 Thread Mauro Carvalho Chehab
There is one reference to ACPI 4.0 and several references to ACPI 6.x versions. Update them to point to ACPI 6.5 whenever possible. There's one reference that was kept pointing to ACPI 6.4, though, with HEST revision 1. ACPI 6.5 now defines HEST revision 2, and defined a new way to handle source

[PATCH v2 7/7] acpi/ghes: extend arm error injection logic

2024-07-12 Thread Mauro Carvalho Chehab
Enrich CPER error injection logic for ARM processor to allow setting values to from UEFI 2.10 tables N.16 and N.17. It should be noticed that, with such change, all arguments are now optional, so, once QMP is negotiated with: { "execute": "qmp_capabilities" } the simplest way to generat

[PATCH v2 5/7] target/arm: preserve mpidr value

2024-07-12 Thread Mauro Carvalho Chehab
There is a logic at helper to properly fill the mpidr information. This is needed for ARM Processor error injection, so store the value inside a cpu opaque value, to allow it to be used. Signed-off-by: Mauro Carvalho Chehab --- target/arm/cpu.h| 1 + target/arm/helper.c | 10 -- 2 f

[PATCH v2 3/7] acpi/ghes: Support GPIO error source.

2024-07-12 Thread Mauro Carvalho Chehab
From: Jonathan Cameron Add error notification to GHES v2 using the GPIO source. Signed-off-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 8 ++-- include/hw/acpi/ghes.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/acpi/gh

  1   2   3   >