Re: [PATCH v5 3/3] xen/arm32: mpu: Stubs to build MPU for arm32

2025-04-08 Thread Luca Fancellu
Hi Ayan, > On 7 Apr 2025, at 19:44, Ayan Kumar Halder wrote: > > Add stubs to enable compilation > > Signed-off-by: Ayan Kumar Halder > --- > Changes from :- > > v1, v2 - > 1. New patch introduced in v3. > 2. Should be applied on top of > https://patchwork.kernel.org/project/xen-devel/cover/2

Re: [PATCH v5 0/3] Enable early bootup of Armv8-R AArch32 systems

2025-04-08 Thread Luca Fancellu
Hi Ayan, > On 7 Apr 2025, at 19:44, Ayan Kumar Halder wrote: > > Enable early booting of Armv8-R AArch32 based systems. > > Ayan Kumar Halder (3): > xen/arm: Move some of the functions to common file > xen/arm32: Create the same boot-time MPU regions as arm64 > xen/arm32: mpu: Stubs to build

Re: [PATCH v5 1/3] xen/arm: Move some of the functions to common file

2025-04-08 Thread Luca Fancellu
Hi Ayan, > On 7 Apr 2025, at 19:44, Ayan Kumar Halder wrote: > > Added a new file common.inc to hold the common earlyboot MPU regions > configurations across arm64 and arm32. > > prepare_xen_region, fail_insufficient_regions() will be used by both arm32 and > arm64. Thus, they have been moved t

Re: [PATCH v5 2/3] xen/arm32: Create the same boot-time MPU regions as arm64

2025-04-08 Thread Luca Fancellu
Hi Ayan, > On 7 Apr 2025, at 19:44, Ayan Kumar Halder wrote: > > We have created the same boot-time MPU protection regions as Armv8-R AArch64. > Also, we have defined *_PRBAR macros for arm32. The only difference from > arm64 is that XN is 1-bit for arm32. > The macros have been defined in mpu/c

Re: [PATCH v5 2/3] xen/arm32: Create the same boot-time MPU regions as arm64

2025-04-08 Thread Orzel, Michal
On 07/04/2025 20:44, Ayan Kumar Halder wrote: > We have created the same boot-time MPU protection regions as Armv8-R AArch64. > Also, we have defined *_PRBAR macros for arm32. The only difference from > arm64 is that XN is 1-bit for arm32. > The macros have been defined in mpu/cpregs.h. NIT: Des

Re: [PATCH v3 1/7] xen: introduce hardware domain create flag

2025-04-08 Thread Jan Beulich
On 07.04.2025 20:16, Jason Andryuk wrote: > On 2025-04-04 03:38, Jan Beulich wrote: >> On 03.04.2025 23:46, Jason Andryuk wrote: >>> From: "Daniel P. Smith" >>> >>> Add and use a new internal create domain flag to specify the hardware >>> domain. This removes the hardcoding of domid 0 as the hard

[PATCH 0/2] x86/hvm: fixes for RO MMIO emulation

2025-04-08 Thread Roger Pau Monne
Hello, Two small fixes for RO MMIO emulation for HVM guests. First one removes unreachable code from the HVM path, second fixes an issue in the mmio_ro_emulated_write() handler when used in HVM guests context. Thanks, Roger. Roger Pau Monne (2): x86/hvm: remove unreachable MMCFG write emulatio

Re: [PATCH v1] x86/vmx: Rework __vmread()/vmread_safe()/vmr()

2025-04-08 Thread Jan Beulich
On 08.04.2025 09:12, Jan Beulich wrote: > On 08.04.2025 03:15, dm...@proton.me wrote: >> +static inline enum vmx_insn_errno vmread_safe(unsigned long field, >> + unsigned long *value) >> +{ >> +asm goto ( "vmread %[field], %[value]\n\t" >> +

[PATCH 1/2] x86/hvm: remove unreachable MMCFG write emulation

2025-04-08 Thread Roger Pau Monne
The current implementation of PVH dom0 relies on vPCI to trap and handle accesses to the MMCFG area. Previous implementation of PVH dom0 (v1) didn't have vPCI, and as a classic PV dom0, relied on the MMCFG range being RO. As such hvm_emulate_one_mmio() had to special case write accesses to the MM

Re: [PATCH v5 3/3] xen/arm32: mpu: Stubs to build MPU for arm32

2025-04-08 Thread Orzel, Michal
On 07/04/2025 20:44, Ayan Kumar Halder wrote: > Add stubs to enable compilation NIT: missing dot at the end of sentence. > > Signed-off-by: Ayan Kumar Halder > --- > Changes from :- > > v1, v2 - > 1. New patch introduced in v3. > 2. Should be applied on top of > https://patchwork.kernel.org/

Re: [PATCH v5 1/3] xen/arm: Move some of the functions to common file

2025-04-08 Thread Orzel, Michal
On 07/04/2025 20:44, Ayan Kumar Halder wrote: > Added a new file common.inc to hold the common earlyboot MPU regions NIT: Describe your changes in imperative mood Also, my understanding was that this file will contain common constructs not only regions related. If this is just for regions, then

Re: [PATCH v2 00/11] x86/EFI: prevent write-execute sections

2025-04-08 Thread Roger Pau Monné
On Mon, Apr 07, 2025 at 04:04:18PM +0200, Jan Beulich wrote: > On 01.04.2025 15:26, Roger Pau Monné wrote: > > nxcompat should be enabled by default I think? I can of course make > > it explicit by adding to the PE link command line. > > --nxcompat wasn't the default originally, then was made the

Re: [PATCH v4 1/2] xen: x86: irq: initialize irq desc in create_irq()

2025-04-08 Thread Jan Beulich
On 07.04.2025 18:46, Volodymyr Babchuk wrote: > While building xen with GCC 14.2.1 with "-fcondition-coverage" option > or with "-Og", the compiler produces a false positive warning: > > arch/x86/irq.c: In function ‘create_irq’: > arch/x86/irq.c:281:11: error: ‘desc’ may be used uninitialized

Re: [PATCH v4 1/7] xen: introduce hardware domain create flag

2025-04-08 Thread Jan Beulich
On 07.04.2025 21:40, Jason Andryuk wrote: > From: "Daniel P. Smith" > > Add and use a new internal create domain flag to specify the hardware > domain. This removes the hardcoding of domid 0 as the hardware domain. > > This allows more flexibility with domain creation. > > The assignment of d-

Re: [PATCH v2 00/11] x86/EFI: prevent write-execute sections

2025-04-08 Thread Jan Beulich
On 08.04.2025 09:56, Roger Pau Monné wrote: > On Mon, Apr 07, 2025 at 04:04:18PM +0200, Jan Beulich wrote: >> On 01.04.2025 15:26, Roger Pau Monné wrote: >>> nxcompat should be enabled by default I think? I can of course make >>> it explicit by adding to the PE link command line. >> >> --nxcompat

Re: [PATCH v5 0/5] Switch more ARM plats to sys-off handler API

2025-04-08 Thread Krzysztof Kozlowski
On 07/04/2025 20:56, Andrew Davis wrote: > Hello all, > > Continuing the quest to remove the legacy pm_power_off() global > function handler. Remove uses from arch/arm/ using the helper > register_platform_power_off(). > > These have been sent for several cycles without feedback, not > sure if th

[PATCH v5 2/5] ARM: pxa: Switch to new sys-off handler API

2025-04-08 Thread Andrew Davis
Kernel now supports chained power-off handlers. Use register_platform_power_off() that registers a platform level power-off handler. Legacy pm_power_off() will be removed once all drivers and archs are converted to the new sys-off API. Signed-off-by: Andrew Davis --- arch/arm/mach-pxa/spitz.c |

Re: [PATCH v1] x86/vmx: Rework __vmread()/vmread_safe()/vmr()

2025-04-08 Thread Jan Beulich
On 08.04.2025 03:15, dm...@proton.me wrote: > From: Denis Mukhin > > Use `asm goto()` in vmread_safe() to simplify the error handling logic. This can't be quite right, considering we need to avoid outputs there. > Update __vmread() to return `unsigned long` as per suggestion in [1]. > Rename __

Re: [XEN PATCH v2 1/1] tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute

2025-04-08 Thread Jan Beulich
On 30.03.2025 18:03, Hongbo wrote: > --- a/tools/libs/light/libxl_dm.c > +++ b/tools/libs/light/libxl_dm.c > @@ -331,9 +331,43 @@ const char *libxl__domain_device_model(libxl__gc *gc, > case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: > dm = libxl__abs_path(gc, "qemu-dm",

Re: Ping: [PATCH] libxc/PM: correct (not just) error handling in xc_get_cpufreq_para()

2025-04-08 Thread Jan Beulich
On 08.04.2025 11:59, Anthony PERARD wrote: > On Mon, Apr 07, 2025 at 05:38:57PM +0200, Jan Beulich wrote: >> On 07.04.2025 17:23, Anthony PERARD wrote: >>> On Mon, Apr 07, 2025 at 03:23:48PM +0200, Jan Beulich wrote: On 07.04.2025 14:45, Anthony PERARD wrote: > Calling xc_get_cpufreq_para

Re: [PATCH test-artifacts v2 14/12] scripts: build initrd cpio

2025-04-08 Thread Anthony PERARD
On Mon, Apr 07, 2025 at 06:31:06PM +0200, Marek Marczykowski-Górecki wrote: > There is one more difference: the cpio.gz contains the whole thing > twice. Once as rootfs for dom0 and then another as boot/initrd-domU. > Dropping .tar.gz is probably a good idea at some point, so I'm okay with > such c

[PATCH v2 0/6] remove qemu-traditional

2025-04-08 Thread Juergen Gross
Remove the qemu-traditional support. This includes the Mini-OS based ioemu-stubdom. Don't remove ROMBIOS for now, as it can be used with qemu (XenServer is doing that). After adding the series a run of autoconf should be done. Changes in V2: - addressed comments Juergen Gross (6): SUPPORT.md:

Re: [PATCH] libxl+hvmloader: extend IGD check part 2

2025-04-08 Thread Jan Beulich
On 08.04.2025 15:23, Marek Marczykowski-Górecki wrote: > --- a/tools/libs/light/libxl_pci.c > +++ b/tools/libs/light/libxl_pci.c > @@ -2575,7 +2575,8 @@ int libxl__grant_vga_iomem_permission(libxl__gc *gc, > const uint32_t domid, > > if (sysfs_dev_get_class(gc, pci, &pci_device_class))

Re: [PATCH v2] xen/riscv: Increase XEN_VIRT_SIZE

2025-04-08 Thread Jan Beulich
On 08.04.2025 15:46, Oleksii Kurochko wrote: > On 4/8/25 2:02 PM, Jan Beulich wrote: >> On 08.04.2025 13:51, Oleksii Kurochko wrote: >>> On 4/7/25 12:09 PM, Jan Beulich wrote: On 04.04.2025 18:04, Oleksii Kurochko wrote: > --- a/xen/arch/riscv/include/asm/mm.h > +++ b/xen/arch/riscv/in

Re: Ping: [PATCH] libxc/PM: correct (not just) error handling in xc_get_cpufreq_para()

2025-04-08 Thread Anthony PERARD
On Mon, Apr 07, 2025 at 05:38:57PM +0200, Jan Beulich wrote: > On 07.04.2025 17:23, Anthony PERARD wrote: > > On Mon, Apr 07, 2025 at 03:23:48PM +0200, Jan Beulich wrote: > >> On 07.04.2025 14:45, Anthony PERARD wrote: > >>> Calling xc_get_cpufreq_para with: > >>> > >>> user_para = { > >>>

[PATCH] libxl+hvmloader: extend IGD check part 2

2025-04-08 Thread Marek Marczykowski-Górecki
Consider also "Display controller" an IGD, not only "VGA compatible controller" in few more places. Fixes: 4191619e0893 ("libxl: extend IGD check") Signed-off-by: Marek Marczykowski-Górecki --- Do you prefer this to be split into two patches (libxl, hvmloader)? tools/firmware/hvmloader/pci.c |

Re: [PATCH] x86emul/test: drop check for AVX512-4FMAPS

2025-04-08 Thread Andrew Cooper
On 08/04/2025 1:28 pm, Jan Beulich wrote: > Use of Xeon Phi features was dropped earlier on; this one was overlooked. > > Fixes: 85191cf32180 ("x86: drop Xeon Phi support") > Signed-off-by: Jan Beulich Acked-by: Andrew Cooper > --- > In principle it looks as if we could now drop all of this che

Re: [PATCH v2 7/7] arm/mpu: Implement setup_mpu for MPU system

2025-04-08 Thread Ayan Kumar Halder
Hi Luca, On 07/04/2025 10:14, Luca Fancellu wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. Implement the function setup_mpu that will logically track the MPU re

Re: [PATCH] libxl+hvmloader: extend IGD check part 2

2025-04-08 Thread Marek Marczykowski-Górecki
On Tue, Apr 08, 2025 at 02:31:10PM +0100, Andrew Cooper wrote: > On 08/04/2025 2:23 pm, Marek Marczykowski-Górecki wrote: > > Consider also "Display controller" an IGD, not only "VGA compatible > > controller" in few more places. > > > > Fixes: 4191619e0893 ("libxl: extend IGD check") > > Signed-of

Re: [PATCH 1/2] x86/hvm: remove unreachable MMCFG write emulation

2025-04-08 Thread Jan Beulich
On 08.04.2025 11:31, Roger Pau Monne wrote: > The current implementation of PVH dom0 relies on vPCI to trap and handle > accesses to the MMCFG area. Previous implementation of PVH dom0 (v1) > didn't have vPCI, and as a classic PV dom0, relied on the MMCFG range being > RO. As such hvm_emulate_one

Re: [PATCH test-artifacts v2 14/12] scripts: build initrd cpio

2025-04-08 Thread Marek Marczykowski-Górecki
On Tue, Apr 08, 2025 at 12:06:51PM +, Anthony PERARD wrote: > On Mon, Apr 07, 2025 at 06:31:06PM +0200, Marek Marczykowski-Górecki wrote: > > There is one more difference: the cpio.gz contains the whole thing > > twice. Once as rootfs for dom0 and then another as boot/initrd-domU. > > Dropping

Re: [PATCH v2 02/11] x86/mkreloc: fix obtaining PE image base address

2025-04-08 Thread Roger Pau Monné
On Wed, Apr 02, 2025 at 09:46:53AM +0200, Jan Beulich wrote: > On 01.04.2025 16:17, Jan Beulich wrote: > > On 01.04.2025 15:08, Roger Pau Monne wrote: > >> The base address is in the pe32_opt_hdr, not after it. > > Which is a result of pe.h munging both the optional and the NT header into > a sing

Re: [PATCH v2] xen/riscv: Increase XEN_VIRT_SIZE

2025-04-08 Thread Jan Beulich
On 08.04.2025 13:51, Oleksii Kurochko wrote: > On 4/7/25 12:09 PM, Jan Beulich wrote: >> On 04.04.2025 18:04, Oleksii Kurochko wrote: >>> --- a/xen/arch/riscv/include/asm/mm.h >>> +++ b/xen/arch/riscv/include/asm/mm.h >>> @@ -43,13 +43,19 @@ static inline void *maddr_to_virt(paddr_t ma) >>>*/ >

Re: [PATCH v5 0/5] Switch more ARM plats to sys-off handler API

2025-04-08 Thread Arnd Bergmann
On Mon, Apr 7, 2025, at 20:56, Andrew Davis wrote: > Hello all, > > Continuing the quest to remove the legacy pm_power_off() global > function handler. Remove uses from arch/arm/ using the helper > register_platform_power_off(). > > These have been sent for several cycles without feedback, not > su

Re: [PATCH v2] xen/riscv: Increase XEN_VIRT_SIZE

2025-04-08 Thread Oleksii Kurochko
On 4/7/25 12:09 PM, Jan Beulich wrote: On 04.04.2025 18:04, Oleksii Kurochko wrote: --- a/xen/arch/riscv/include/asm/config.h +++ b/xen/arch/riscv/include/asm/config.h @@ -41,11 +41,11 @@ * Start addr | End addr | Slot | area description * =

Re: [PATCH v1 2/3] x86/domain: add helpers to simplify emulation flags management

2025-04-08 Thread Jan Beulich
On 01.04.2025 02:52, dm...@proton.me wrote: > From: Denis Mukhin > > Introduce XEN_X86_EMU_BASELINE and XEN_X86_EMU_OPTIONAL to simplify > d->arch.emulation_flags management in the code. If the simplification is limited to ... > --- a/tools/python/xen/lowlevel/xc/xc.c > +++ b/tools/python/xen/l

Re: [PATCH v2 02/11] x86/mkreloc: fix obtaining PE image base address

2025-04-08 Thread Jan Beulich
On 08.04.2025 13:21, Roger Pau Monné wrote: > On Wed, Apr 02, 2025 at 09:46:53AM +0200, Jan Beulich wrote: >> x86/EFI: correct mkreloc header (field) reading >> >> With us now reading the full combined optional and NT headers, the >> subsequent reading of (and seeking to) NT header fields is wrong.

[PATCH v2 1/6] SUPPORT.md: make Linux based stubdom fully supported

2025-04-08 Thread Juergen Gross
All patches needed for running with a Linux stubdom device model are in the tree and QubesOS is using and testing Linux stubdoms nowadays. Switch support from "Tech Preview" to "Supported, with caveats". Signed-off-by: Juergen Gross --- V2: - switch to "Supported, with caveats" (security team) -

Re: [PATCH v2] xen/riscv: Increase XEN_VIRT_SIZE

2025-04-08 Thread Oleksii Kurochko
On 4/8/25 2:02 PM, Jan Beulich wrote: On 08.04.2025 13:51, Oleksii Kurochko wrote: On 4/7/25 12:09 PM, Jan Beulich wrote: On 04.04.2025 18:04, Oleksii Kurochko wrote: --- a/xen/arch/riscv/include/asm/mm.h +++ b/xen/arch/riscv/include/asm/mm.h @@ -43,13 +43,19 @@ static inline void *maddr_to_v

Re: [PATCH v2 7/7] arm/mpu: Implement setup_mpu for MPU system

2025-04-08 Thread Luca Fancellu
Hi Ayan, > On 8 Apr 2025, at 14:32, Ayan Kumar Halder wrote: > > Hi Luca, > > On 07/04/2025 10:14, Luca Fancellu wrote: >> CAUTION: This message has originated from an External Source. Please use >> proper judgment and caution when opening attachments, clicking links, or >> responding to this

Re: [PATCH v4 1/7] xen: introduce hardware domain create flag

2025-04-08 Thread Jason Andryuk
On 2025-04-08 02:37, Jan Beulich wrote: On 07.04.2025 21:40, Jason Andryuk wrote: From: "Daniel P. Smith" Add and use a new internal create domain flag to specify the hardware domain. This removes the hardcoding of domid 0 as the hardware domain. This allows more flexibility with domain crea

Re: [PATCH 2/2] x86/hvm: fix write emulation of RO ranges

2025-04-08 Thread Jan Beulich
On 08.04.2025 11:31, Roger Pau Monne wrote: > When running on AMD hardware in HVM mode the guest linear address (GLA) > will not be provided to hvm_emulate_one_mmio(), and instead is > unconditionally set of ~0. As a consequence mmio_ro_emulated_write() will > always report an error, as the fault

Re: [PATCH 2/2] x86/hvm: fix write emulation of RO ranges

2025-04-08 Thread Andrew Cooper
On 08/04/2025 10:31 am, Roger Pau Monne wrote: > When running on AMD hardware in HVM mode the guest linear address (GLA) > will not be provided to hvm_emulate_one_mmio(), and instead is > unconditionally set of ~0. As a consequence mmio_ro_emulated_write() will > always report an error, as the fau

Re: [PATCH v4 1/7] xen: introduce hardware domain create flag

2025-04-08 Thread Jan Beulich
On 08.04.2025 15:54, Jason Andryuk wrote: > On 2025-04-08 02:37, Jan Beulich wrote: >> On 07.04.2025 21:40, Jason Andryuk wrote: >>> From: "Daniel P. Smith" >>> >>> Add and use a new internal create domain flag to specify the hardware >>> domain. This removes the hardcoding of domid 0 as the hard

[PATCH v3 13/16] x86/hyperlaunch: specify dom0 mode with device tree

2025-04-08 Thread Alejandro Vallejo
From: "Daniel P. Smith" Enable selecting the mode in which the domain will be built and ran. This includes: - whether it will be either a 32/64 bit domain - if it will be run as a PV or HVM domain - and if it will require a device model (not applicable for dom0) In the device tree, this will be

[PATCH v1 08/14] xen/riscv: imsic_init() implementation

2025-04-08 Thread Oleksii Kurochko
imsic_init() is introduced to parse device tree node, which has the following bindings [2], and based on the parsed information update IMSIC configuration which is stored in imsic_cfg. The following helpers are introduces for imsic_init() usage: - imsic_parse_node() parses IMSIC node from DTS

Re: [RFC PATCH v2] xen: add libafl-qemu fuzzer support

2025-04-08 Thread Jan Beulich
On 15.03.2025 01:36, Volodymyr Babchuk wrote: > LibAFL, which is a part of AFL++ project is a instrument that allows > us to perform fuzzing on beremetal code (Xen hypervisor in this case) > using QEMU as an emulator. It employs QEMU's ability to create > snapshots to run many tests relatively quic

[PATCH v1 09/14] xen/riscv: aplic_init() implementation

2025-04-08 Thread Oleksii Kurochko
aplic_init() function does the following few things: - checks that IMSIC in device tree node ( by checking msi-parent property in APLIC node ) is present as current one implmenetaion of AIA is supported only MSI method. - initialize IMSIC based on IMSIC device tree node - Read value of AP

[PATCH v3 11/16] x86/hyperlaunch: locate dom0 initrd with hyperlaunch

2025-04-08 Thread Alejandro Vallejo
From: "Daniel P. Smith" Look for a subnode of type `multiboot,ramdisk` within a domain node and parse via the fdt_read_multiboot_module() helper. After a successful helper call, the module index is returned and the module is guaranteed to be in the module list. Fix unused typo in adjacent commen

[PATCH v3 02/16] x86/boot: introduce domid field to struct boot_domain

2025-04-08 Thread Alejandro Vallejo
From: "Daniel P. Smith" boot_domain stores the domid until it is used to create (and allocate) struct domain. d->domain_id is not available early enough. boot_domain domids are initialized to DOMID_INVALID. If not overridden by device tree, domids of DOMID_INVALID are assigned a valid value. The

[PATCH v3 14/16] x86/hyperlaunch: add memory parsing to domain config

2025-04-08 Thread Alejandro Vallejo
From: "Daniel P. Smith" Add three properties, memory, mem-min, and mem-max, to the domain node device tree parsing to define the memory allocation for a domain. All three fields are expressed in kb and written as a u64 in the device tree entries. Signed-off-by: Daniel P. Smith Reviewed-by: Jaso

Re: [PATCH v2 2/7] arm/mpu: Provide access to the MPU region from the C code

2025-04-08 Thread Ayan Kumar Halder
On 08/04/2025 15:29, Luca Fancellu wrote: Hi Ayan, Hi Luca, On 8 Apr 2025, at 15:02, Ayan Kumar Halder wrote: Hi Luca, +static void prepare_selector(uint8_t sel) +{ +/* + * {read,write}_protection_region works using the direct access to the 0..15 + * regions, so in order to

[PATCH v5] x86/domain: revisit logging in arch_domain_create()

2025-04-08 Thread dmkhn
From: Denis Mukhin Use %pd in all logs issued from arch_domain_create() and reword some of the messages. Also, expand error message in arch_domain_create() under !emulation_flags_ok() case to help debugging. Signed-off-by: Denis Mukhin --- Changes since v4: - updated wording in the messages as

Re: [PATCH v2 2/7] xen/domain: introduce domid_alloc()

2025-04-08 Thread Denis Mukhin
On Tuesday, April 8th, 2025 at 7:26 AM, Jan Beulich wrote: > > > On 01.04.2025 01:05, dm...@proton.me wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > Move domain ID allocation during domain creation to a dedicated > > function domid_alloc(). > > > > Allocation algorithm: > > - If an

Re: [PATCH v5] x86/domain: revisit logging in arch_domain_create()

2025-04-08 Thread Jan Beulich
On 09.04.2025 00:40, dm...@proton.me wrote: > From: Denis Mukhin > > Use %pd in all logs issued from arch_domain_create() and reword some of the > messages. > > Also, expand error message in arch_domain_create() under !emulation_flags_ok() > case to help debugging. > > Signed-off-by: Denis Mukh

Re: [PATCH v3 00/16] Hyperlaunch device tree for dom0

2025-04-08 Thread Jan Beulich
On 08.04.2025 18:07, Alejandro Vallejo wrote: > I've purposefully not added my S-by on anything I haven't touched > (besides rebasing) as most of the feedback had already been addressed by > Jason by the time I looked at it and it would be utterly nonsensical to > give myself authorship over it. M

[PATCH v2 7/8] vpci/msi: Free MSI resources when init_msi() fails

2025-04-08 Thread Jiqian Chen
When init_msi() fails, the previous new changes will hide MSI capability, it can't rely on vpci_deassign_device() to remove all MSI related resources anymore, those resources must be cleaned up in failure path of init_msi. To do that, add a new function to free MSI resources. Signed-off-by: Jiqia

[PATCH v2 0/8] Support hiding capability when its initialization fails

2025-04-08 Thread Jiqian Chen
Hi, This series is to emulate legacy and extended capability list for host, including patch #1, #2, #3, hide capability when its initialization fails, including patch #4, remove all related registers and other resources when failure, including patch #5, #6, #7, #8. Best regards, Jiqian Chen. --

Re: [PATCH v2 2/7] xen/domain: introduce domid_alloc()

2025-04-08 Thread Jan Beulich
On 09.04.2025 03:44, Denis Mukhin wrote: > On Tuesday, April 8th, 2025 at 7:26 AM, Jan Beulich wrote: >> On 01.04.2025 01:05, dm...@proton.me wrote: >> >>> From: Denis Mukhin dmuk...@ford.com >>> >>> Move domain ID allocation during domain creation to a dedicated >>> function domid_alloc(). >>> >>

[PATCH v2 4/8] vpci: Hide capability when it fails to initialize

2025-04-08 Thread Jiqian Chen
When vpci fails to initialize a capability of a device, it just return error instead of catching and processing exception. That makes the entire device unusable. So, refactor REGISTER_VPCI_INIT to contain more capability specific information, and use new functions to hide capability when initializ

[PATCH v2 5/8] vpci: Refactor vpci_remove_register to remove matched registers

2025-04-08 Thread Jiqian Chen
vpci_remove_register() only supports removing a register in a time, but the follow-on changes need to remove all registers within a range. And it is only used for test. So, refactor it to support removing all matched registers in a calling time. And it is no matter to remove a non exist register,

[PATCH v2 6/8] vpci/rebar: Remove registers when init_rebar() fails

2025-04-08 Thread Jiqian Chen
When init_rebar() fails, the previous new changes will hide Rebar capability, it can't rely on vpci_deassign_device() to remove all Rebar related registers anymore, those registers must be removed in failure path of init_rebar. To do that, call vpci_remove_registers() to remove all possible regist

Re: [PATCH v3 03/16] x86/boot: add cmdline to struct boot_domain

2025-04-08 Thread Jan Beulich
On 08.04.2025 18:07, Alejandro Vallejo wrote: > From: "Daniel P. Smith" > > Add a container for the "cooked" command line for a domain. This > provides for the backing memory to be directly associated with the > domain being constructed. This is done in anticipation that the domain > constructio

Re: [PATCH v4] x86/domain: revisit logging in arch_domain_create()

2025-04-08 Thread Denis Mukhin
On Monday, April 7th, 2025 at 7:21 AM, Jan Beulich wrote: > > > On 05.04.2025 01:21, dm...@proton.me wrote: > > > --- a/xen/arch/x86/domain.c > > +++ b/xen/arch/x86/domain.c > > @@ -791,13 +791,14 @@ int arch_domain_create(struct domain *d, > > { > > if ( !opt_allow_unsafe ) > > { > > - printk(XE

[PATCH] x86emul/test: drop check for AVX512-4FMAPS

2025-04-08 Thread Jan Beulich
Use of Xeon Phi features was dropped earlier on; this one was overlooked. Fixes: 85191cf32180 ("x86: drop Xeon Phi support") Signed-off-by: Jan Beulich --- In principle it looks as if we could now drop all of this checking, as gcc5 supports all of the features we check for. AVX512-4FMAPS is an ex

Re: [PATCH v2 2/7] arm/mpu: Provide access to the MPU region from the C code

2025-04-08 Thread Ayan Kumar Halder
Hi, On 08/04/2025 17:48, Luca Fancellu wrote: On 8 Apr 2025, at 17:33, Ayan Kumar Halder wrote: On 08/04/2025 15:29, Luca Fancellu wrote: Hi Ayan, Hi Luca, On 8 Apr 2025, at 15:02, Ayan Kumar Halder wrote: Hi Luca, +static void prepare_selector(uint8_t sel) +{ +/* + * {read,w

Re: [PATCH] libxl+hvmloader: extend IGD check part 2

2025-04-08 Thread Andrew Cooper
On 08/04/2025 2:23 pm, Marek Marczykowski-Górecki wrote: > Consider also "Display controller" an IGD, not only "VGA compatible > controller" in few more places. > > Fixes: 4191619e0893 ("libxl: extend IGD check") > Signed-off-by: Marek Marczykowski-Górecki > --- > Do you prefer this to be split in

Re: [RFC PATCH v1 01/15] x86/msr: Replace __wrmsr() with native_wrmsrl()

2025-04-08 Thread Xin Li
On 4/1/2025 9:10 PM, Ingo Molnar wrote: Yeah, I moved it over to: git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git WIP.x86/msr Hi Ingo, Are you going to merge it into tip in this development cycle for the v6.16 merge window? Thanks! Xin

Re: [PATCH v4 2/2] xen: debug: gcov: add condition coverage support

2025-04-08 Thread Jan Beulich
On 08.04.2025 17:38, Volodymyr Babchuk wrote: > Jan Beulich writes: >> On 07.04.2025 18:46, Volodymyr Babchuk wrote: >>> @@ -133,19 +134,18 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): >>> CFLAGS-y += -DINIT_SECTIONS >>> >>> non-init-objects = $(filter-out %.init.o, $(obj-y) $(obj-b

[PATCH v1 10/14] xen/riscv: implementation of aplic and imsic operations

2025-04-08 Thread Oleksii Kurochko
Introduce interrupt controller descriptor for host APLIC to describe the low-lovel hardare. It includes implementation of the following functions: - aplic_irq_startup() - aplic_irq_shutdown() - aplic_irq_enable() - aplic_irq_disable() - aplic_irq_ack() - aplic_host_irq_end() - aplic_set_irq_

[PATCH v1 11/14] xen/riscv: add external interrupt handling for hypervisor mode

2025-04-08 Thread Oleksii Kurochko
Implement functions necessarry to have working external interrupts in hypervisor mode. The following changes are done: - Add a common function intc_handle_external_irq() to call APLIC specific function to handle an interrupt. - Update do_trap() function to handle IRQ_S_EXT case; add the check

[PATCH v1 12/14] xen/riscv: implement setup_irq()

2025-04-08 Thread Oleksii Kurochko
Introduce support for IRQ setup on RISC-V by implementing `setup_irq()` and `__setup_irq()`, adapted and extended from an initial implementation by [1]. __setup_irq() does the following: - Sets up an IRQ action. - Validates that shared IRQs have non-NULL `dev_id` and are only used when exi

Re: [PATCH v1 3/3] xen/domain: rewrite emulation_flags_ok()

2025-04-08 Thread Jan Beulich
On 01.04.2025 02:52, dm...@proton.me wrote: > From: Denis Mukhin > > Rewrite emulation_flags_ok() using XEN_X86_EMU_{OPTIONAL,BASELINE} > to simplify future modifications. > > Signed-off-by: Denis Mukhin > --- > Came in the context of NS16550 emulator v3 series: > > https://lore.kernel.org/x

[PATCH v1 04/14] xen/riscv: introduce init_IRQ()

2025-04-08 Thread Oleksii Kurochko
Implement init_IRQ() to initalize various IRQs. Currently, this function initializes the irq_desc[] array, which stores IRQ descriptors containing various information about each IRQ, such as the type of hardware handling, whether the IRQ is disabled, etc. The initialization is basic at this point

[PATCH v1 13/14] xen/riscv: initialize interrupt controller

2025-04-08 Thread Oleksii Kurochko
Call intc_init() to do basic initialization steps for APLIC and IMISC. Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/setup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c index a3189697da..9765bcbb08 100644 --- a/xen/arch/riscv/setup.c

[PATCH v1 05/14] xen/riscv: introduce platform_get_irq()

2025-04-08 Thread Oleksii Kurochko
platform_get_irq() recieves information about device's irq ( type and irq number ) from device tree node and using this information update irq descriptor in irq_desc[] array. Introduce dt_irq_xlate and initialize with aplic_irq_xlate() as it is used by dt_device_get_irq() which is called by platfo

[PATCH v1 07/14] wqriscv/intc: Introduce intc_hw_operations abstraction

2025-04-08 Thread Oleksii Kurochko
Introduce the `intc_hw_operations` structure to encapsulate interrupt controller-specific data and operations. This structure includes: - A pointer to interrupt controller information (`intc_info`) - Callbacks to initialize the controller and set IRQ type/priority - A reference to an interupt contr

[PATCH v1 00/14] riscv: introduce basic UART support and interrupts for hypervisor mode

2025-04-08 Thread Oleksii Kurochko
The patch series introduces basic UART support (in interrupt mode) and support of interrupts for hypervisor mode. To implement this the following has been added: - APLIC and IMISC initialization. - Introduce of intc_hw_operations abstraction. - Introduce some APLIC and IMSIC operations. - Introdu

[PATCH v1 03/14] xen/riscv: introduce ioremap()

2025-04-08 Thread Oleksii Kurochko
Based on RISC-V unpriviliged spec ( Version 20240411 ): ``` For implementations that conform to the RISC-V Unix Platform Specification, I/O devices and DMA operations are required to access memory coherently and via strongly ordered I/O channels. Therefore, accesses to regular main memory regions t

[PATCH v1 02/14] xen/riscv: introduce smp_clear_cpu_maps()

2025-04-08 Thread Oleksii Kurochko
Initialize cpu_{possible, online, present}_map by using smp_clear_cpu_maps(). Drop DEFINE_PER_CPU(unsigned int, cpu_id) from stubs.c as this variable isn't expected to be used in RISC-V at all. Move declaration of cpu_{possible,online,present}_map from stubs.c to smpboot.c as now smpboot.c is now

[PATCH v1 07/14] xen/riscv: Introduce intc_hw_operations abstraction

2025-04-08 Thread Oleksii Kurochko
Introduce the `intc_hw_operations` structure to encapsulate interrupt controller-specific data and operations. This structure includes: - A pointer to interrupt controller information (`intc_info`) - Callbacks to initialize the controller and set IRQ type/priority - A reference to an interupt contr

[PATCH v2 3/3] mm: Protect kernel pgtables in apply_to_pte_range()

2025-04-08 Thread Alexander Gordeev
The lazy MMU mode can only be entered and left under the protection of the page table locks for all page tables which may be modified. Yet, when it comes to kernel mappings apply_to_pte_range() does not take any locks. That does not conform arch_enter|leave_lazy_mmu_mode() semantics and could poten

[PATCH v3 00/16] Hyperlaunch device tree for dom0

2025-04-08 Thread Alejandro Vallejo
Hi, This is an updated version of the hyperlaunch DTB series, with pending feedback addressed. Some parts (notably the way modules are located) has changed a little and is more generic with less duplication. I've purposefully not added my S-by on anything I haven't touched (besides rebasing) as m

[PATCH v3 04/16] kconfig: introduce option to independently enable libfdt

2025-04-08 Thread Alejandro Vallejo
From: "Daniel P. Smith" Currently, the inclusion of libfdt is controlled by the CONFIG_HAS_DEVICE_TREE kconfig flag. This flag also changes behavior in a few places, such as boot module processing for XSM. To support the ability to include libfdt without changing these behaviors, introduce CONFIG

[PATCH v3 06/16] x86/hyperlaunch: introduce the domain builder

2025-04-08 Thread Alejandro Vallejo
From: "Daniel P. Smith" Introduce the domain builder which is capable of consuming a device tree as the first boot module. If it finds a device tree as the first boot module, it will set its type to BOOTMOD_FDT. This change only detects the boot module and continues to boot with slight change to

[PATCH v3 08/16] x86/hyperlaunch: Add helpers to locate multiboot modules

2025-04-08 Thread Alejandro Vallejo
Hyperlaunch mandates either a reg or module-index DT prop on nodes that contain `multiboot,module" under their "compatible" prop. This patch introduces a helper to generically find such index, appending the module to the list of modules if it wasn't already (i.e: because it's given via the "reg" pr

[PATCH v3 01/16] x86/boot: introduce boot domain

2025-04-08 Thread Alejandro Vallejo
From: "Daniel P. Smith" To begin moving toward allowing the hypervisor to construct more than one domain at boot, a container is needed for a domain's build information. Introduce a new header, , that contains the initial struct boot_domain that encapsulate the build information for a domain. Ad

[PATCH v3 07/16] x86/hyperlaunch: initial support for hyperlaunch device tree

2025-04-08 Thread Alejandro Vallejo
From: "Daniel P. Smith" Add the ability to detect both a formal hyperlaunch device tree or a dom0less device tree. If the hyperlaunch device tree is found, then count the number of domain entries, reporting an error if more than one is found. Signed-off-by: Daniel P. Smith Signed-off-by: Jason

[PATCH v3 12/16] x86/hyperlaunch: add domain id parsing to domain config

2025-04-08 Thread Alejandro Vallejo
From: "Daniel P. Smith" Introduce the ability to specify the desired domain id for the domain definition. The domain id will be populated in the domid property of the domain node in the device tree configuration. Signed-off-by: Daniel P. Smith --- v3: * Remove ramdisk parsing * Add miss

[PATCH v3 09/16] x86/hyperlaunch: locate dom0 kernel with hyperlaunch

2025-04-08 Thread Alejandro Vallejo
From: "Daniel P. Smith" Look for a subnode of type `multiboot,kernel` within a domain node. If found, locate it using the multiboot module helper to generically ensure it lives in the module list. If the bootargs property is present and there was not an MB1 string, then use the command line from

[PATCH v2 5/6] stubdom: remove ancient stubdom-dm script

2025-04-08 Thread Juergen Gross
The stubdom-dm script is still using "xm" instead of "xl", so it is probably unused since more than 10 years now. Signed-off-by: Juergen Gross --- stubdom/stubdom-dm | 182 - 1 file changed, 182 deletions(-) delete mode 100644 stubdom/stubdom-dm diff

[PATCH v2 6/6] build: don't require full tools build for building stubdoms

2025-04-08 Thread Juergen Gross
With the drop of qemu-traditional "make stubdom" no longer requires "make tools" to have finished. It is enough to add "install-tools-public-headers" as a prereq of "install-stubdom". Signed-off-by: Juergen Gross --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M

[PATCH v2 3/6] tools: remove support for running a guest with qemu-traditional

2025-04-08 Thread Juergen Gross
Remove the code in tools for running a guest with qemu-traditional. This covers xl, libxl, libacpi, hvmloader and the related python and go bindings. Signed-off-by: Juergen Gross --- V2: - Keep most of the removed comment in hvmloader, while removing parts of another one (Jan Beulich) --- tool

[PATCH v2 4/6] tools: remove qemu-traditional

2025-04-08 Thread Juergen Gross
Remove qemu traditional from the tree. Signed-off-by: Juergen Gross --- .gitignore| 3 - CHANGELOG.md | 1 + Config.mk | 24 - INSTALL | 12 --- MA

Re: [PATCH v2 2/7] xen/domain: introduce domid_alloc()

2025-04-08 Thread Jan Beulich
On 01.04.2025 01:05, dm...@proton.me wrote: > From: Denis Mukhin > > Move domain ID allocation during domain creation to a dedicated > function domid_alloc(). > > Allocation algorithm: > - If an explicit domain ID is provided, verify its availability and > use it if ID is unused; > - Otherwise

Re: [PATCH v2 3/7] xen/domain: introduce domid_top()

2025-04-08 Thread Jan Beulich
On 01.04.2025 01:05, dm...@proton.me wrote: > From: Denis Mukhin > > Introduce domid_top() in architecture-independent location to retrieve > the highest non-system domain ID for use in console input switch logic. > > Replace max_init_domid with domid_top(), which obsoletes max_init_domid > in t

Re: [PATCH] tools/libxl: Skip invalid IRQs

2025-04-08 Thread Jason Andryuk
On 2025-04-08 02:24, Jan Beulich wrote: On 07.04.2025 21:26, Jason Andryuk wrote: A PCI device's irq field is an 8-bit number. A value of 0xff indicates that the device is not connected. Nit: "... that the device IRQ is not ..." Additionally, the Linux ACPI code can convert these 0xff val

Re: [PATCH v2 2/7] arm/mpu: Provide access to the MPU region from the C code

2025-04-08 Thread Luca Fancellu
> On 8 Apr 2025, at 17:33, Ayan Kumar Halder wrote: > > > On 08/04/2025 15:29, Luca Fancellu wrote: >> Hi Ayan, > Hi Luca, >> >>> On 8 Apr 2025, at 15:02, Ayan Kumar Halder wrote: >>> >>> Hi Luca, >>> +static void prepare_selector(uint8_t sel) +{ +/* + * {read,w

[PATCH v2 2/6] docs: remove qemu-traditional support from documentation

2025-04-08 Thread Juergen Gross
In preparation to no longer support qemu-traditional (including qemu-stubdom), remove it from documentation. Signed-off-by: Juergen Gross --- V2: - mention "qemu_xen_traditional" in xenstore-paths.pandoc as a removed device model variant (Andrew Cooper) - don't drop Config.mk related documentat

RE: [QUESTION] Minimal Xen Configuration

2025-04-08 Thread Kwon, Gihwan
Stefano and Nicola, > Stefano, Nicola > >> On Wed, 2 Apr 2025, Nicola Vetrini wrote: >>> On 2025-03-28 07:43, Kwon, Gihwan wrote: Dear Xen Community, I hope this message finds you well. I have heard that there exists a minimal Xen configuration optimized for safety

  1   2   >