Re: [PATCH v7] ui/cocoa: Use NSWindow's ability to resize

2023-12-18 Thread Akihiko Odaki
On 2023/12/17 18:46, Rene Engel wrote: --- Ursprüngliche Nachricht --- Von: Akihiko Odaki Datum: 17.12.2023 07:25:52 An: Peter Maydell , Philippe Mathieu-Daudé , Gerd Hoffmann , Marc-André Lureau , Marek Glogowski Betreff: [PATCH v7] ui/cocoa: Use NSWindow's ability to resize Tested-by:

Re: [PATCH 1/1] target/riscv: SMBIOS support for RISC-V virt machine

2023-12-18 Thread Sunil V L
Hi Heinrich, Thanks for the patch!. On Mon, Dec 18, 2023 at 08:40:18AM +0100, Heinrich Schuchardt wrote: > Generate SMBIOS tables for the RISC-V mach-virt. > Add CONFIG_SMBIOS=y to the RISC-V default config. > > The implementation is based on the corresponding ARM and Loongson code. > > With th

[PATCH 1/1] target/riscv/kvm.c: remove group setting of KVM AIA if the machine only has 1 socket

2023-12-18 Thread Yong-Xuan Wang
The emulated AIA within the Linux kernel restores the HART index of the IMSICs according to the configured AIA settings. During this process, the group setting is used only when the machine partitions harts into groups. It's unnecessary to set the group configuration if the machine has only one soc

[PATCH 1/1] hw/riscv/virt.c: fix the interrupts-extended property format of PLIC

2023-12-18 Thread Yong-Xuan Wang
The interrupts-extended property of PLIC only has 2 * hart number fields when KVM enabled, copy 4 * hart number fields to fdt will expose some uninitialized value. In this patch, I also refactor the code about the setting of interrupts-extended property of PLIC for improved readability. Signed-of

[PATCH v2 01/17] hw/loongarch: Move boot fucntions to boot.c

2023-12-18 Thread Song Gao
Move some boot functions to boot.c and struct loongarch_boot_info into struct LoongArchMachineState. Signed-off-by: Song Gao --- hw/loongarch/boot.c | 127 hw/loongarch/meson.build| 1 + hw/loongarch/virt.c | 118 ++--

[PATCH v2 07/17] hw/loongarch: Init efi_initrd table

2023-12-18 Thread Song Gao
Signed-off-by: Song Gao --- hw/loongarch/boot.c | 29 +++-- include/hw/loongarch/boot.h | 9 + 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index 5d963176bd..1600ae6e55 100644 --- a/hw/loongarch/

[PATCH v2 05/17] hw/loongarch: Init efi_system_table

2023-12-18 Thread Song Gao
Add init_systab and set boot_info->a2 Signed-off-by: Song Gao --- hw/loongarch/boot.c | 39 + include/hw/loongarch/boot.h | 50 + 2 files changed, 89 insertions(+) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c inde

[PATCH v2 09/17] hw/loongarch: Fix fdt memory node wrong 'reg'

2023-12-18 Thread Song Gao
The right fdt memory node like [1], not [2] [1] memory@0 { device_type = "memory"; reg = <0x00 0x00 0x00 0x1000>; }; [2] memory@0 { device_type = "memory"; reg = <0x02 0x00 0x02 0x1000>; };

[PATCH v2 06/17] hw/loongarch: Init efi_boot_memmap table

2023-12-18 Thread Song Gao
Signed-off-by: Song Gao --- hw/loongarch/boot.c | 45 + hw/loongarch/virt.c | 11 ++--- include/hw/loongarch/boot.h | 27 ++ include/hw/loongarch/virt.h | 10 + 4 files changed, 84 insertions(+), 9 deletions(-) d

[PATCH v2 16/17] hw/loongarch: Add cells missing from uart node

2023-12-18 Thread Song Gao
uart node need interrupts and interrupt-parent cells. Signed-off-by: Song Gao --- hw/loongarch/virt.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 02a3af3b5e..e1a6ec86c8 100644 --- a/hw/loongarch/virt.c +++ b/hw/loon

[PATCH v2 13/17] hw/loongarch: fdt adds pch_msi Controller

2023-12-18 Thread Song Gao
fdt adds pch msi controller, we use 'loongson,pch-msi-1.0'. See: drivers/irqchip/irq-loongson-pch-msi.c Signed-off-by: Song Gao --- hw/loongarch/virt.c| 33 - include/hw/pci-host/ls7a.h | 1 + 2 files changed, 33 insertions(+), 1 deletion(-) diff --git

[PATCH v2 15/17] hw/loongarch: fdt remove unused irqchip node

2023-12-18 Thread Song Gao
Signed-off-by: Song Gao --- hw/loongarch/virt.c | 31 +-- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 74cac07e8a..02a3af3b5e 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -410,34 +410,6 @

[PATCH v2 04/17] hw/loongarch: Add slave cpu boot_code

2023-12-18 Thread Song Gao
Signed-off-by: Song Gao --- hw/loongarch/boot.c | 65 - 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index 4bfe24274a..076e795714 100644 --- a/hw/loongarch/boot.c +++ b/hw/loongarch/boot.c @@ -1

[PATCH v2 14/17] hw/loongarch: fdt adds pcie irq_map node

2023-12-18 Thread Song Gao
Signed-off-by: Song Gao --- hw/loongarch/virt.c | 73 ++--- 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 859f17c2f6..74cac07e8a 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -

[PATCH v2 03/17] hw/loongarch: Add init_cmdline

2023-12-18 Thread Song Gao
Add init_cmline and set boot_info->a0, a1 Signed-off-by: Song Gao --- hw/loongarch/boot.c | 21 + include/hw/loongarch/virt.h | 2 ++ target/loongarch/cpu.h | 2 ++ 3 files changed, 25 insertions(+) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index

[PATCH v2 00/17] Add boot LoongArch elf kernel with FDT

2023-12-18 Thread Song Gao
Hi, All We already support boot efi kernel with bios, but not support boot elf kernel. This series adds boot elf kernel with FDT. 'LoongArch supports ACPI and FDT. The information that needs to be passed to the kernel includes the memmap, the initrd, the command line, optionally the ACPI/FDT ta

[PATCH v2 10/17] hw/loongarch: fdt adds cpu interrupt controller node

2023-12-18 Thread Song Gao
fdt adds cpu interrupt controller node, we use 'loongson,cpu-interrupt-controller'. See: drivers/irqchip/irq-loongarch-cpu.c Signed-off-by: Song Gao --- hw/loongarch/virt.c | 21 + 1 file changed, 21 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c ind

[PATCH v2 02/17] hw/loongarch: Add load initrd

2023-12-18 Thread Song Gao
we load initrd ramdisk after kernel_high address Signed-off-by: Song Gao --- hw/loongarch/boot.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index 9f25ea5847..2be6dfb037 100644 --- a/hw/loongarch/boot

[PATCH v2 11/17] hw/loongarch: fdt adds Extend I/O Interrupt Controller

2023-12-18 Thread Song Gao
fdt adds Extend I/O Interrupt Controller, we use 'loongson,ls2k2000-eiointc'. See: drivers/irqchip/irq-loongson-eiointc.c Signed-off-by: Song Gao --- hw/loongarch/virt.c| 30 +- include/hw/intc/loongarch_extioi.h | 1 + 2 files changed, 30 insertio

[PATCH v2 12/17] hw/loongarch: fdt adds pch_pic Controller

2023-12-18 Thread Song Gao
fdt adds pch pic controller, we use 'loongson,pch-pic-1.0' See: drivers/irqchip/irq-loongson-pch-pic.c Signed-off-by: Song Gao --- hw/loongarch/virt.c| 30 +- include/hw/pci-host/ls7a.h | 1 + 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/

[PATCH v2 17/17] hw/loongarch: Add cells missing from rtc node

2023-12-18 Thread Song Gao
rtc node need interrupts and interrupt-parent cells. Signed-off-by: Song Gao --- hw/loongarch/virt.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index e1a6ec86c8..c122d86048 100644 --- a/hw/loongarch/virt.c +++ b/hw/l

[PATCH v2 08/17] hw/loongarch: Init efi_fdt table

2023-12-18 Thread Song Gao
Signed-off-by: Song Gao --- hw/loongarch/boot.c | 11 +++ include/hw/loongarch/boot.h | 4 2 files changed, 15 insertions(+) diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c index 1600ae6e55..8c28a0ef6f 100644 --- a/hw/loongarch/boot.c +++ b/hw/loongarch/boot.c @@ -14

[PATCH qemu v3 3/3] hw/arm: Connect STM32L4x5 EXTI to STM32L4x5 SoC

2023-12-18 Thread ~inesvarhol
From: Inès Varhol Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/arm/Kconfig | 1 + hw/arm/stm32l4x5_soc.c | 56 -- include/hw/arm/stm32l4x5_soc.h | 3 ++ 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/h

[PATCH qemu v3 1/3] hw/misc: Implement STM32L4x5 EXTI

2023-12-18 Thread ~inesvarhol
From: Inès Varhol Although very similar to the STM32F4xx EXTI, STM32L4x5 EXTI generates more than 32 event/interrupt requests and thus uses more registers than STM32F4xx EXTI which generates 23 event/interrupt requests. Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/misc/Kconf

[PATCH qemu v3 2/3] tests/qtest: Add STM32L4x5 EXTI QTest testcase

2023-12-18 Thread ~inesvarhol
From: Inès Varhol Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- tests/qtest/meson.build | 5 + tests/qtest/stm32l4x5_exti-test.c | 485 ++ 2 files changed, 490 insertions(+) create mode 100644 tests/qtest/stm32l4x5_exti-test.c diff --git

[PATCH qemu v3 0/3] Add device STM32L4x5 EXTI

2023-12-18 Thread ~inesvarhol
Changes from non-RFC v2 to non-RFC v3: - corrected the license Changes from non-RFC v1 to non-RFC v2: - correct the commit messages - remove a misleading comment Changes from v3 to non-RFC v1: - separating the patch in 3 commits - justifying in the commit message why we implement a new model inst

Re: [PATCH 1/1] target/riscv: SMBIOS support for RISC-V virt machine

2023-12-18 Thread Heinrich Schuchardt
On 12/18/23 09:49, Sunil V L wrote: Hi Heinrich, Thanks for the patch!. On Mon, Dec 18, 2023 at 08:40:18AM +0100, Heinrich Schuchardt wrote: Generate SMBIOS tables for the RISC-V mach-virt. Add CONFIG_SMBIOS=y to the RISC-V default config. The implementation is based on the corresponding ARM

Re: [RFC PATCH] hw/arm: Prefer arm_feature() over object_property_find()

2023-12-18 Thread Peter Maydell
On Mon, 18 Dec 2023 at 07:26, Markus Armbruster wrote: > > Peter Maydell writes: > > > On Thu, 14 Dec 2023 at 17:14, Philippe Mathieu-Daudé > > wrote: > >> > >> QOM properties are added on the ARM vCPU object when a > >> feature is present. Rather than checking the property > >> is present, che

Re: [PATCH 2/2] hw/usb/hcd-xhci.c: allow unaligned access to Capability Registers

2023-12-18 Thread Tomoyuki Hirose
On Tue, Dec 12, 2023 at 7:26 PM Peter Maydell wrote: > > On Tue, 12 Dec 2023 at 01:43, Tomoyuki Hirose > wrote: > > > > Thanks for comment. > > > > On Mon, Dec 11, 2023 at 10:57 PM Peter Maydell > > wrote: > > > We should definitely look at fixing the unaligned access > > > stuff, but the linke

Re: [RFC PATCH] hw/arm: Prefer arm_feature() over object_property_find()

2023-12-18 Thread Peter Maydell
On Thu, 14 Dec 2023 at 17:14, Philippe Mathieu-Daudé wrote: > > QOM properties are added on the ARM vCPU object when a > feature is present. Rather than checking the property > is present, check the feature. > > Suggested-by: Markus Armbruster > Signed-off-by: Philippe Mathieu-Daudé > --- > RFC:

Re: [PATCH 12/12] hw/isa/vt82c686: Implement relocation of SuperI/O functions

2023-12-18 Thread Bernhard Beschow
Am 17. Dezember 2023 15:40:58 UTC schrieb BALATON Zoltan : >On Sun, 17 Dec 2023, Bernhard Beschow wrote: >> The VIA south bridges are able to relocate and enable or disable their >> SuperI/O >> functions. So far this is hardcoded such that all functions are always >> enabled >> and are located

[PATCH v2] qemu_init: increase NOFILE soft limit on POSIX

2023-12-18 Thread Fiona Ebner
In many configurations, e.g. multiple vNICs with multiple queues or with many Ceph OSDs, the default soft limit of 1024 is not enough. QEMU is supposed to work fine with file descriptors >= 1024 and does not use select() on POSIX. Bump the soft limit to the allowed hard limit to avoid issues with t

Re: [PATCH v2 0/4] scsi: eliminate AioContext lock

2023-12-18 Thread Kevin Wolf
[ Cc: qemu-block ] Am 04.12.2023 um 17:42 hat Stefan Hajnoczi geschrieben: > v2: > - Reschedule BH in new AioContext if change is detected [Kevin] > - Drop stray "remember" in Patch 2's commit description [Eric] > > The SCSI subsystem uses the AioContext lock to protect internal state. This is >

Re: [PATCH v3] hw/usb: fix xhci port notify

2023-12-18 Thread Nikita Ostrenkov
ping https://patchew.org/QEMU/20231117173916.3658-1-n.ostren...@gmail.com/ пт, 17 нояб. 2023 г., 20:39 Nikita Ostrenkov : > From MCF5253 Reference manual > https://www.nxp.com/docs/en/reference-manual/MCF5253RM.pdf > > Host mode: Port Change Detect. The controller sets this bit to a one when > on

Re: [PATCH 04/12] hw/block/fdc: Expose internal header

2023-12-18 Thread BALATON Zoltan
On Sun, 17 Dec 2023, Bernhard Beschow wrote: Am 17. Dezember 2023 15:47:33 UTC schrieb BALATON Zoltan : On Sun, 17 Dec 2023, Bernhard Beschow wrote: Exposing the internal header allows for exposing struct FDCtrlISABus which is encuraged by qdev guidelines. Hopefully the guidelines don't encou

Re: [v2 3/4] crypto: Support generic LUKS encryption

2023-12-18 Thread Daniel P . Berrangé
On Thu, Dec 07, 2023 at 12:37:44AM +0800, Hyman Huang wrote: > By enhancing the LUKS driver, it is possible to enable > the detachable LUKS header and, as a result, achieve > general encryption for any disk format that QEMU has > supported. > > Take the qcow2 as an example, the usage of the generi

[PATCH qemu v2 2/3] tests/qtest: Add STM32L4x5 SYSCFG QTest testcase

2023-12-18 Thread ~inesvarhol
From: Inès Varhol Acked-by: Alistair Francis Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- tests/qtest/meson.build | 3 +- tests/qtest/stm32l4x5_syscfg-test.c | 408 2 files changed, 410 insertions(+), 1 deletion(-) create mode 100644

[PATCH qemu v2 3/3] hw/arm: Connect STM32L4x5 SYSCFG to STM32L4x5 SoC

2023-12-18 Thread ~inesvarhol
From: Inès Varhol The SYSCFG input GPIOs aren't connected yet. When the STM32L4x5 GPIO device will be implemented, its output GPIOs will be connected to the SYSCFG input GPIOs. Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/arm/Kconfig | 1 + hw/arm/stm32l4x5_

[PATCH qemu v2 1/3] hw/misc: Implement STM32L4x5 SYSCFG

2023-12-18 Thread ~inesvarhol
From: Inès Varhol Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/misc/Kconfig| 3 + hw/misc/meson.build| 1 + hw/misc/stm32l4x5_syscfg.c | 265 + hw/misc/trace-events | 6 + include/hw/m

Re: [v2 1/4] crypto: Introduce option and structure for detached LUKS header

2023-12-18 Thread Daniel P . Berrangé
On Thu, Dec 07, 2023 at 12:37:42AM +0800, Hyman Huang wrote: > Add the "header" option for the LUKS format. This field would be > used to identify the blockdev's position where a detachable LUKS > header is stored. > > In addition, introduce header field in struct BlockCrypto > > Signed-off-by: H

Re: [v2 2/4] crypto: Introduce payload offset set function

2023-12-18 Thread Daniel P . Berrangé
On Thu, Dec 07, 2023 at 12:37:43AM +0800, Hyman Huang wrote: > Signed-off-by: Hyman Huang > --- > crypto/block.c | 4 > include/crypto/block.h | 1 + > 2 files changed, 5 insertions(+) Reviewed-by: Daniel P. Berrangé however, based on my comment in patch #3, I'm not convinced this

[PATCH qemu v2 0/3] Add device STM32L4x5 SYSCFG

2023-12-18 Thread ~inesvarhol
Hello Alistair, thank you for your comments. Changes from v1 to v2: - explain in 3rd commit why SYSCFG input GPIOs aren't connected and add a TODO comment in stm32l4x5_soc.c - use macros `NUM_GPIOS` and `GPIO_NUM_PINS` in `stm32l4x5_syscfg_set_irq` - rename STM32L4XX to STM32L4X5, Stm32l4xx to Stm

Re: [PATCH v7] ui/cocoa: Use NSWindow's ability to resize

2023-12-18 Thread BALATON Zoltan
On Mon, 18 Dec 2023, Akihiko Odaki wrote: On 2023/12/17 20:39, BALATON Zoltan wrote: On Sun, 17 Dec 2023, Akihiko Odaki wrote: This change brings two new features: - The window will be resizable if "Zoom To Fit" is eanbled - The window can be made full screen by clicking full screen button  pro

Re: [v2 4/4] block: Support detached LUKS header creation for blockdev-create

2023-12-18 Thread Daniel P . Berrangé
On Thu, Dec 07, 2023 at 12:37:45AM +0800, Hyman Huang wrote: > Provide the "detached-mode" option for detached LUKS header > formatting. > > To format the LUKS header on the pre-creating disk, example > as follows: > > 1. add a protocol blockdev node of LUKS header > $ virsh qemu-monitor-command

Re: [v2 0/4] Support generic Luks encryption

2023-12-18 Thread Daniel P . Berrangé
On Thu, Dec 07, 2023 at 12:37:41AM +0800, Hyman Huang wrote: > v2: > - Simplify the design by reusing the LUKS driver to implement > the generic Luks encryption, thank Daniel for the insightful > advice. > - rebase on master. > > Hyman Huang (4): > crypto: Introduce option and structure f

[PATCH 26/35] target/arm: Implement FEAT_NV2 redirection of sysregs to RAM

2023-12-18 Thread Peter Maydell
FEAT_NV2 requires that when HCR_EL2.{NV,NV2} == 0b11 then accesses by EL1 to certain system registers are redirected to RAM. The full list of affected registers is in the table in rule R_CSRPQ in the Arm ARM. The registers may be normally accessible at EL1 (like ACTLR_EL1), or normally UNDEF at EL

[PATCH 10/35] target/arm: *_EL12 registers should UNDEF when HCR_EL2.E2H is 0

2023-12-18 Thread Peter Maydell
The alias registers like SCTLR_EL12 only exist when HCR_EL2.E2H is 1; they should UNDEF otherwise. We weren't implementing this. Add an intercept of the accessfn for these aliases, and implement the UNDEF check. Signed-off-by: Peter Maydell --- target/arm/cpregs.h | 3 ++- target/arm/helper.c |

[PATCH 05/35] target/arm: Implement HCR_EL2.AT handling

2023-12-18 Thread Peter Maydell
The FEAT_NV HCR_EL2.AT bit enables trapping of some address translation instructions from EL1 to EL2. Implement this behaviour. Signed-off-by: Peter Maydell --- target/arm/helper.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/target/arm/helper.c b/t

[PATCH 12/35] target/arm: Move FPU/SVE/SME access checks up above ARM_CP_SPECIAL_MASK check

2023-12-18 Thread Peter Maydell
In handle_sys() we don't do the check for whether the register is marked as needing an FPU/SVE/SME access check until after we've handled the special cases covered by ARM_CP_SPECIAL_MASK. This is conceptually the wrong way around, because if for example we happen to implement an FPU-access-checked

[PATCH 15/35] target/arm: Set SPSR_EL1.M correctly when nested virt is enabled

2023-12-18 Thread Peter Maydell
FEAT_NV requires that when HCR_EL2.{NV,NV1} == {1,0} and an exception is taken from EL1 to EL1 then the reported EL in SPSR_EL1.M should be EL2, not EL1. Implement this behaviour. Signed-off-by: Peter Maydell --- target/arm/helper.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/targ

[PATCH 00/35] target/arm: Implement emulation of nested virtualization

2023-12-18 Thread Peter Maydell
This patchset adds support for emulating the Arm architectural features FEAT_NV and FEAT_NV2 which allow nested virtualization, i.e. where a hypervisor can run a guest which thinks it is running at EL2. Nominally FEAT_NV is sufficient for this and FEAT_NV2 merely improves the performance in the ne

[PATCH 30/35] target/arm: Mark up VNCR offsets (offsets 0x168..0x1f8)

2023-12-18 Thread Peter Maydell
Mark up the cpreginfo structs to indicate offsets for system registers from VNCR_EL2, as defined in table D8-66 in rule R_CSRPQ in the Arm ARM. This commit covers offsets 0x168 to 0x1f8. Signed-off-by: Peter Maydell --- target/arm/helper.c | 18 ++ 1 file changed, 18 insertions(

[PATCH 34/35] target/arm: Enhance CPU_LOG_INT to show SPSR on AArch64 exception-entry

2023-12-18 Thread Peter Maydell
We already print various lines of information when we take an exception, including the ELR and (if relevant) the FAR. Now that FEAT_NV means that we might report something other than the old PSTATE to the guest as the SPSR, it's worth logging this as well. Signed-off-by: Peter Maydell --- target

[PATCH 27/35] target/arm: Report VNCR_EL2 based faults correctly

2023-12-18 Thread Peter Maydell
If FEAT_NV2 redirects a system register access to a memory offset from VNCR_EL2, that access might fault. In this case we need to report the correct syndrome information: * Data Abort, from same-EL * no ISS information * the VNCR bit (bit 13) is set and the exception must be taken to EL2. Sav

[PATCH 06/35] target/arm: Enable trapping of ERET for FEAT_NV

2023-12-18 Thread Peter Maydell
When FEAT_NV is turned on via the HCR_EL2.NV bit, ERET instructions are trapped, with the same syndrome information as for the existing FEAT_FGT fine-grained trap (in the pseudocode this is handled in AArch64.CheckForEretTrap()). Rename the DisasContext and tbflag bits to reflect that they are no

[PATCH 32/35] hw/intc/arm_gicv3_cpuif: Mark up VNCR offsets for GIC CPU registers

2023-12-18 Thread Peter Maydell
Mark up the cpreginfo structs for the GIC CPU registers to indicate the offsets from VNCR_EL2, as defined in table D8-66 in rule R_CSRPQ in the Arm ARM. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_cpuif.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/hw/intc/arm_gicv3_c

[PATCH 03/35] hw/intc/arm_gicv3_cpuif: handle LPIs in in the list registers

2023-12-18 Thread Peter Maydell
The hypervisor can deliver (virtual) LPIs to a guest by setting up a list register to have an intid which is an LPI. The GIC has to treat these a little differently to standard interrupt IDs, because LPIs have no Active state, and so the guest will only EOI them, it will not also deactivate them.

[PATCH 18/35] target/arm: Don't honour PSTATE.PAN when HCR_EL2.{NV, NV1} == {1, 1}

2023-12-18 Thread Peter Maydell
For FEAT_NV, when HCR_EL2.{NV,NV1} is {1,1} PAN is always disabled even when the PSTATE.PAN bit is set. Implement this by having arm_pan_enabled() return false in this situation. Signed-off-by: Peter Maydell --- target/arm/helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/ar

[PATCH 16/35] target/arm: Trap registers when HCR_EL2.{NV, NV1} == {1, 1}

2023-12-18 Thread Peter Maydell
When HCR_EL2.{NV,NV1} is {1,1} we must trap five extra registers to EL2: VBAR_EL1, ELR_EL1, SPSR_EL1, SCXTNUM_EL1 and TFSR_EL1. Implement these traps. This trap does not apply when FEAT_NV2 is implemented and enabled; include the check that HCR_EL2.NV2 is 0 here, to save us having to come back and

[PATCH 01/35] target/arm: Don't implement *32_EL2 registers when EL1 is AArch64 only

2023-12-18 Thread Peter Maydell
The system registers DBGVCR32_EL2, FPEXC32_EL2, DACR32_EL2 and IFSR32_EL2 are present only to allow an AArch64 EL2 or EL3 to read and write the contents of an AArch32-only system register. The architecture requires that they are present only when EL1 can be AArch32, but we implement them unconditi

[PATCH 02/35] target/arm: Set CTR_EL0.{IDC,DIC} for the 'max' CPU

2023-12-18 Thread Peter Maydell
The CTR_EL0 register has some bits which allow the implementation to tell the guest that it does not need to do cache maintenance for data-to-instruction coherence and instruction-to-data coherence. QEMU doesn't emulate caches and so our cache maintenance insns are all NOPs. We already have some m

[PATCH 29/35] target/arm: Mark up VNCR offsets (offsets 0x100..0x160)

2023-12-18 Thread Peter Maydell
Mark up the cpreginfo structs to indicate offsets for system registers from VNCR_EL2, as defined in table D8-66 in rule R_CSRPQ in the Arm ARM. This commit covers offsets 0x100 to 0x160. Many (but not all) of the registers in this range have _EL12 aliases, and the slot in memory is shared between

[PATCH 20/35] target/arm: Handle FEAT_NV page table attribute changes

2023-12-18 Thread Peter Maydell
FEAT_NV requires that when HCR_EL2.{NV,NV1} == {1,1} the handling of some of the page table attribute bits changes for the EL1&0 translation regime: * for block and page descriptors: - bit [54] holds PXN, not UXN - bit [53] is RES0, and the effective value of UXN is 0 - bit [6], AP[1], is t

[PATCH 11/35] target/arm: Make EL2 cpreg accessfns safe for FEAT_NV EL1 accesses

2023-12-18 Thread Peter Maydell
FEAT_NV and FEAT_NV2 will allow EL1 to attempt to access cpregs that only exist at EL2. This means we're going to want to run their accessfns when the CPU is at EL1. In almost all cases, the behaviour we want is "the accessfn returns OK if at EL1". Mostly the accessfn already does the right thing;

[PATCH 13/35] target/arm: Trap sysreg accesses for FEAT_NV

2023-12-18 Thread Peter Maydell
For FEAT_NV, accesses to system registers and instructions from EL1 which would normally UNDEF there but which work in EL2 need to instead be trapped to EL2. Detect this both for "we know this will UNDEF at translate time" and "we found this UNDEFs at runtime", and make the affected registers trap

[PATCH 25/35] target/arm: Handle FEAT_NV2 redirection of SPSR_EL2, ELR_EL2, ESR_EL2, FAR_EL2

2023-12-18 Thread Peter Maydell
Under FEAT_NV2, when HCR_EL2.{NV,NV2} == 0b11 at EL1, accesses to the registers SPSR_EL2, ELR_EL2, ESR_EL2, FAR_EL2 and TFSR_EL2 (which would UNDEF without FEAT_NV or FEAT_NV2) should instead access the equivalent EL1 registers SPSR_EL1, ELR_EL1, ESR_EL1, FAR_EL1 and TFSR_EL1. Because there are on

[PATCH 33/35] target/arm: Report HCR_EL2.{NV,NV1,NV2} in cpu dumps

2023-12-18 Thread Peter Maydell
When interpreting CPU dumps where FEAT_NV and FEAT_NV2 are in use, it's helpful to include the values of HCR_EL2.{NV,NV1,NV2} in the CPU dump format, as a way of distinguishing when we are in EL1 as part of executing guest-EL2 and when we are just in normal EL1. Add the bits to the end of the log

[PATCH 19/35] target/arm: Treat LDTR* and STTR* as LDR/STR when NV, NV1 is 1, 1

2023-12-18 Thread Peter Maydell
FEAT_NV requires (per I_JKLJK) that when HCR_EL2.{NV,NV1} is {1,1} the unprivileged-access instructions LDTR, STTR etc behave as normal loads and stores. Implement the check that handles this. Signed-off-by: Peter Maydell --- target/arm/tcg/hflags.c | 6 -- 1 file changed, 4 insertions(+), 2

[PATCH 04/35] target/arm: Handle HCR_EL2 accesses for bits introduced with FEAT_NV

2023-12-18 Thread Peter Maydell
FEAT_NV defines three new bits in HCR_EL2: NV, NV1 and AT. When the feature is enabled, allow these bits to be written, and flush the TLBs for the bits which affect page table interpretation. Signed-off-by: Peter Maydell --- target/arm/cpu-features.h | 5 + target/arm/helper.c | 6 +++

[PATCH 09/35] target/arm: Record correct opcode fields in cpreg for E2H aliases

2023-12-18 Thread Peter Maydell
For FEAT_VHE, we define a set of register aliases, so that for instance: * the SCTLR_EL1 either accesses the real SCTLR_EL1, or (if E2H is 1) SCTLR_EL2 * a new SCTLR_EL12 register accesses SCTLR_EL1 if E2H is 1 However when we create the 'new_reg' cpreg struct for the SCTLR_EL12 register, we

[PATCH 22/35] target/arm: Handle HCR_EL2 accesses for FEAT_NV2 bits

2023-12-18 Thread Peter Maydell
FEAT_NV2 defines another new bit in HCR_EL2: NV2. When the feature is enabled, allow this bit to be written in HCR_EL2. Signed-off-by: Peter Maydell --- target/arm/cpu-features.h | 5 + target/arm/helper.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/target/arm/cpu-features.

[PATCH 23/35] target/arm: Implement VNCR_EL2 register

2023-12-18 Thread Peter Maydell
For FEAT_NV2, a new system register VNCR_EL2 holds the base address of the memory which nested-guest system register accesses are redirected to. Implement this register. Signed-off-by: Peter Maydell --- target/arm/cpu.h| 3 +++ target/arm/helper.c | 26 ++ 2 files ch

[PATCH 08/35] target/arm: Allow use of upper 32 bits of TBFLAG_A64

2023-12-18 Thread Peter Maydell
The TBFLAG_A64 TB flag bits go in flags2, which for AArch64 guests we know is 64 bits. However at the moment we use FIELD_EX32() and FIELD_DP32() to read and write these bits, which only works for bits 0 to 31. Since we're about to add a flag that uses bit 32, switch to FIELD_EX64() and FIELD_DP64(

[PATCH 28/35] target/arm: Mark up VNCR offsets (offsets 0x0..0xff)

2023-12-18 Thread Peter Maydell
Mark up the cpreginfo structs to indicate offsets for system registers from VNCR_EL2, as defined in table D8-66 in rule R_CSRPQ in the Arm ARM. This commit covers offsets below 0x100; all of these registers are redirected to memory regardless of the value of HCR_EL2.NV1. Signed-off-by: Peter Mayde

[PATCH 31/35] target/arm: Mark up VNCR offsets (offsets >= 0x200, except GIC)

2023-12-18 Thread Peter Maydell
Mark up the cpreginfo structs to indicate offsets for system registers from VNCR_EL2, as defined in table D8-66 in rule R_CSRPQ in the Arm ARM. This covers all the remaining offsets at 0x200 and above, except for the GIC ICH_* registers. (Note that because we don't implement FEAT_SPE, FEAT_TRF, F

[PATCH 07/35] target/arm: Always honour HCR_EL2.TSC when HCR_EL2.NV is set

2023-12-18 Thread Peter Maydell
The HCR_EL2.TSC trap for trapping EL1 execution of SMC instructions has a behaviour change for FEAT_NV when EL3 is not implemented: * in older architecture versions TSC was required to have no effect (i.e. the SMC insn UNDEFs) * with FEAT_NV, when HCR_EL2.NV == 1 the trap must apply (i.e.

[PATCH 21/35] target/arm: Add FEAT_NV to max, neoverse-n2, neoverse-v1 CPUs

2023-12-18 Thread Peter Maydell
Enable FEAT_NV on the 'max' CPU, and stop filtering it out for the Neoverse N2 and Neoverse V1 CPUs. We continue to downgrade FEAT_NV2 support to FEAT_NV for the latter two CPU types. Signed-off-by: Peter Maydell --- docs/system/arm/emulation.rst | 1 + target/arm/cpu.c | 8 +--

[PATCH 35/35] target/arm: Add FEAT_NV2 to max, neoverse-n2, neoverse-v1 CPUs

2023-12-18 Thread Peter Maydell
Enable FEAT_NV2 on the 'max' CPU, and stop filtering it out for the Neoverse N2 and Neoverse V1 CPUs. Signed-off-by: Peter Maydell --- docs/system/arm/emulation.rst | 1 + target/arm/cpu.c | 5 - target/arm/tcg/cpu64.c| 2 +- 3 files changed, 2 insertions(+), 6 deletions

[PATCH 14/35] target/arm: Make NV reads of CurrentEL return EL2

2023-12-18 Thread Peter Maydell
FEAT_NV requires that when HCR_EL2.NV is set reads of the CurrentEL register from EL1 always report EL2 rather than the real EL. Implement this. Signed-off-by: Peter Maydell --- target/arm/tcg/translate-a64.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/target/arm

[PATCH 24/35] target/arm: Handle FEAT_NV2 changes to when SPSR_EL1.M reports EL2

2023-12-18 Thread Peter Maydell
With FEAT_NV2, the condition for when SPSR_EL1.M should report that an exception was taken from EL2 changes. Signed-off-by: Peter Maydell --- target/arm/helper.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index

[PATCH 17/35] target/arm: Always use arm_pan_enabled() when checking if PAN is enabled

2023-12-18 Thread Peter Maydell
Currently the code in target/arm/helper.c mostly checks the PAN bits in env->pstate or env->uncached_cpsr directly when it wants to know if PAN is enabled, because in most callsites we know whether we are in AArch64 or AArch32. We do have an arm_pan_enabled() function, but we only use it in a few p

Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler

2023-12-18 Thread Fiona Ebner
Am 14.12.23 um 20:53 schrieb Stefan Hajnoczi: > > I will still try the other approach that Hanna and Paolo have suggested. > It seems more palatable. I will send a v2. > FYI, what I already tried downstream (for VirtIO SCSI): > diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c > index

[PATCH v13 04/26] target/riscv: add rv64i CPU

2023-12-18 Thread Daniel Henrique Barboza
We don't have any form of a 'bare bones' CPU. rv64, our default CPUs, comes with a lot of defaults. This is fine for most regular uses but it's not suitable when more control of what is actually loaded in the CPU is required. A bare-bones CPU would be annoying to deal with if not by profile suppor

[PATCH v13 06/26] target/riscv/tcg: add 'zic64b' support

2023-12-18 Thread Daniel Henrique Barboza
zic64b is defined in the RVA22U64 profile [1] as a named feature for "Cache blocks must be 64 bytes in size, naturally aligned in the address space". It's a fantasy name for 64 bytes cache blocks. The RVA22U64 profile mandates this feature, meaning that applications using this profile expects 64 by

[PATCH v13 05/26] target/riscv: add zicbop extension flag

2023-12-18 Thread Daniel Henrique Barboza
QEMU already implements zicbom (Cache Block Management Operations) and zicboz (Cache Block Zero Operations). Commit 59cb29d6a5 ("target/riscv: add Zicbop cbo.prefetch{i, r, m} placeholder") added placeholders for what would be the instructions for zicbop (Cache Block Prefetch Operations), which are

[PATCH v13 00/26] riscv: RVA22 profiles support

2023-12-18 Thread Daniel Henrique Barboza
Hi, This is a merge of the two profile series: "[PATCH for-9.0 v12 00/18] riscv: rv64i/rva22u64 CPUs, RVA22U64 profile support" "[PATCH for-9.0 v2 0/8] target/riscv: implement RVA22S64 profile" I'm sending them together since the second series is dependent on the first. Quick summary of the maj

[PATCH v13 12/26] target/riscv/tcg: add riscv_cpu_write_misa_bit()

2023-12-18 Thread Daniel Henrique Barboza
We have two instances of the setting/clearing a MISA bit from env->misa_ext and env->misa_ext_mask pattern. And the next patch will end up adding one more. Create a helper to avoid code repetition. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Reviewed-by: LIU Zhiwei Rev

[PATCH v13 09/26] target/riscv/kvm: add 'rva22u64' flag as unavailable

2023-12-18 Thread Daniel Henrique Barboza
KVM does not have the means to support enabling the rva22u64 profile. The main reasons are: - we're missing support for some mandatory rva22u64 extensions in the KVM module; - we can't make promises about enabling a profile since it all depends on host support in the end. We'll revisit this

[PATCH v13 20/26] target/riscv: add priv ver restriction to profiles

2023-12-18 Thread Daniel Henrique Barboza
Some profiles, like RVA22S64, has a priv_spec requirement. Make this requirement explicit for all profiles. We'll validate this requirement finalize() time and, in case the user chooses an incompatible priv_spec while activating a profile, a warning will be shown. Signed-off-by: Daniel Henrique B

[PATCH v13 08/26] target/riscv: add rva22u64 profile definition

2023-12-18 Thread Daniel Henrique Barboza
The rva22U64 profile, described in: https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc#rva22-profiles Contains a set of CPU extensions aimed for 64-bit userspace applications. Enabling this set to be enabled via a single user flag makes it convenient to enable a predictable set of fe

[PATCH v13 15/26] target/riscv/tcg: honor user choice for G MISA bits

2023-12-18 Thread Daniel Henrique Barboza
RVG behaves like a profile: a single flag enables a set of bits. Right now we're considering user choice when handling RVG and zicsr/zifencei and ignoring user choice on MISA bits. We'll add user warnings for profiles when the user disables its mandatory extensions in the next patch. We'll do the

[PATCH v13 23/26] target/riscv: add satp_mode profile support

2023-12-18 Thread Daniel Henrique Barboza
'satp_mode' is a requirement for supervisor profiles like RVA22S64. User-mode/application profiles like RVA22U64 doesn't care. Add 'satp_mode' to the profile description. If a profile requires it, set it during cpu_set_profile(). We'll also check it during finalize() to validate if the running con

[PATCH v13 18/26] target/riscv: add 'rva22u64' CPU

2023-12-18 Thread Daniel Henrique Barboza
This CPU was suggested by Alistair [1] and others during the profile design discussions. It consists of the bare 'rv64i' CPU with rva22u64 enabled by default, like an alias of '-cpu rv64i,rva22u64=true'. Users now have an even easier way of consuming this user-mode profile by doing '-cpu rva22u64'

[PATCH v13 14/26] target/riscv/tcg: add hash table insert helpers

2023-12-18 Thread Daniel Henrique Barboza
Previous patches added several g_hash_table_insert() patterns. Add two helpers, one for each user hash, to make the code cleaner. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- target/riscv/tcg/tcg-cpu.c | 28 1 file changed, 16 insertions(+),

[PATCH v13 25/26] target/riscv: add RVA22S64 profile

2023-12-18 Thread Daniel Henrique Barboza
The RVA22S64 profile consists of the following: - all mandatory extensions of RVA22U64; - priv spec v1.12.0; - satp mode sv39; - Ssccptr, a cache related named feature that we're assuming always enable since we don't implement a cache; - Other named features already implemented: Sstvecd, Sstvala

[PATCH v13 10/26] target/riscv/tcg: add user flag for profile support

2023-12-18 Thread Daniel Henrique Barboza
The TCG emulation implements all the extensions described in the RVA22U64 profile, both mandatory and optional. The mandatory extensions will be enabled via the profile flag. We'll leave the optional extensions to be enabled by hand. Given that this is the first profile we're implementing in TCG w

[PATCH v13 16/26] target/riscv/tcg: validate profiles during finalize

2023-12-18 Thread Daniel Henrique Barboza
Enabling a profile and then disabling some of its mandatory extensions is a valid use. It can be useful for debugging and testing. But the common expected use of enabling a profile is to enable all its mandatory extensions. Add an user warning when mandatory extensions from an enabled profile are

[PATCH v13 07/26] riscv-qmp-cmds.c: expose named features in cpu_model_expansion

2023-12-18 Thread Daniel Henrique Barboza
Named features (zic64b the sole example at this moment) aren't expose to users, thus we need another way to expose them. Go through each named feature, get its boolean value, do the needed conversions (bool to qbool, qbool to QObject) and add it to output dict. Another adjustment is needed: named

[PATCH v13 19/26] target/riscv: implement svade

2023-12-18 Thread Daniel Henrique Barboza
'svade' is a RVA22S64 profile requirement, a profile we're going to add shortly. It is a named feature (i.e. not a formal extension, not defined in riscv,isa DT at this moment) defined in [1] as: "Page-fault exceptions are raised when a page is accessed when A bit is clear, or written when D bit i

[PATCH v13 24/26] target/riscv: add 'parent' in profile description

2023-12-18 Thread Daniel Henrique Barboza
Certain S-mode profiles, like RVA22S64 and RVA23S64, mandate all the mandatory extensions of their respective U-mode profiles. RVA22S64 includes all mandatory extensions of RVA22U64, and the same happens with RVA23 profiles. Add a 'parent' field to allow profiles to enable other profiles. This wil

  1   2   3   >