[PATCH 5.15.y 1/1] xen/swiotlb: relax alignment requirements

2025-04-07 Thread Harshvardhan Jha
[ Upstream commit 099606a7b2d53e99ce31af42894c1fc9d77c6db9] When mapping a buffer for DMA via .map_page or .map_sg DMA operations, there is no need to check the machine frames to be aligned according to the mapped areas size. All what is needed in these cases is that the buffer is contiguous at ma

[PATCH 5.15.y 0/1] Manual Backport of 099606a7b2d5 to 5.15

2025-04-07 Thread Harshvardhan Jha
The patch 099606a7b2d5 didn't cleanly apply to 5.15 due to the significant difference in codebases. I've tried to manually bring it back to 5.15 via some minor conflict resolution but also invoking the newly introduced API using inverted logic as the conditional statements present in 5.15 are the

[PATCH v8 3/3] CHANGELOG.md: Mention stack-protector feature

2025-04-07 Thread Volodymyr Babchuk
Stack protector is meant to be enabled on all architectures, but currently it is tested (and enabled) only on ARM, so mention it in ARM section. Signed-off-by: Volodymyr Babchuk Acked-by: Oleksii Kurochko --- Changes in v7: - Moved the change to v4.21 - Added Oleksii's acked-by tag Changes

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

2025-04-07 Thread dmkhn
From: Denis Mukhin Use `asm goto()` in vmread_safe() to simplify the error handling logic. Update __vmread() to return `unsigned long` as per suggestion in [1]. Rename __vmread() to vmread_unsafe() to match the behavior. Update all call sites everywhere. Drop `UNLIKELY_*()`. Group all vmread*()

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

2025-04-07 Thread Jan Beulich
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 values to IRQ_NOTCONNECTED(0x8000) be

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

2025-04-07 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 v1 0/4] mm: Fix apply_to_pte_range() vs lazy MMU mode

2025-04-07 Thread Andrew Morton
On Mon, 7 Apr 2025 17:11:26 +0200 Alexander Gordeev wrote: > This series is an attempt to fix the violation of lazy MMU mode context > requirement as described for arch_enter_lazy_mmu_mode(): > > This mode can only be entered and left under the protection of > the page table locks for

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

2025-04-07 Thread Jason Andryuk
On 2025-03-27 09:32, Jan Beulich wrote: From their introduction all xc_hypercall_bounce_pre() uses, when they failed, would properly cause exit from the function including cleanup, yet without informing the caller of the failure. Purge the unlock_1 label for being both pointless and mis-named.

linux-next: manual merge of the xen-tip tree with the mm-hotfixes tree

2025-04-07 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the xen-tip tree got a conflict in: drivers/xen/xenbus/xenbus_probe_frontend.c between commit: 5be5772b1f96 ("xenbus: add module description") from the mm-hotfixes tree and commit: b40c54648158 ("xenbus: add module description") from the xen-tip tree

Re: [PATCH v2 08/12] CI: switch test kernel from 6.1.19 to 6.12.21

2025-04-07 Thread Andrew Cooper
On 07/04/2025 1:31 pm, Marek Marczykowski-Górecki wrote: > The jump is pretty big, but should be enough for a longer time. The > change right now is motivated adding new runner with AMD Zen4. > > Signed-off-by: Marek Marczykowski-Górecki > --- > automation/gitlab-ci/build.yaml

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

2025-04-07 Thread Ayan Kumar Halder
On 04/04/2025 10:11, Luca Fancellu wrote: Hi Ayan, Hi Luca, On 3 Apr 2025, at 18:12, 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.k

Re: [PATCH v2] xen: vm_event: do not do vm_event_op for an invalid domain

2025-04-07 Thread Tamas K Lengyel
On Mon, Mar 17, 2025 at 8:40 PM Volodymyr Babchuk wrote: > > A privileged domain can issue XEN_DOMCTL_vm_event_op with > op->domain == DOMID_INVALID. In this case vm_event_domctl() > function will get NULL as the first parameter and this will > cause hypervisor panic, as it tries to derefer this p

Re: [PATCH v2 02/12] CI: switch qubes runners to use console.exp

2025-04-07 Thread Andrew Cooper
On 07/04/2025 1:31 pm, Marek Marczykowski-Górecki wrote: > diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp > index 31ce97b91b63..d1689fa5bf7f 100755 > --- a/automation/scripts/console.exp > +++ b/automation/scripts/console.exp > @@ -28,21 +28,34 @@ if {[info exists env(

[PATCH v8 1/3] xen: common: add ability to enable stack protector

2025-04-07 Thread Volodymyr Babchuk
Both GCC and Clang support -fstack-protector feature, which add stack canaries to functions where stack corruption is possible. This patch makes general preparations to enable this feature on different supported architectures: - Added CONFIG_HAS_STACK_PROTECTOR option so each architecture can

[PATCH v8 0/3] Add/enable stack protector

2025-04-07 Thread Volodymyr Babchuk
Both GCC and Clang support -fstack-protector feature, which add stack canaries to functions where stack corruption is possible. This series makes possible to use this feature in Xen. I tested this on ARM64 and it is working as intended. Tested both with GCC and Clang. Also tested with "-fstack-pr

[PATCH v8 2/3] xen: arm: enable stack protector feature

2025-04-07 Thread Volodymyr Babchuk
Enable previously added CONFIG_STACK_PROTECTOR feature for ARM platform. Initialize stack protector magic value very early, at the very beginning of start_xen() function. We want to do this early because prior to that boot_stack_chk_guard_setup() call, default stack protector guard value is used.

[PATCH] arm/irq: Reduce size of irq_desc array to exclude local IRQs

2025-04-07 Thread Mykola Kvach
From: Mykola Kvach SGI and PPI descriptors are banked and stored in the per-CPU local_irq_desc array, so not all elements of the global irq_desc array are used. This is already accounted for in the descriptor lookup logic inside __irq_to_desc: return &irq_desc[irq - NR_LOCAL_IRQS]; Therefore

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

2025-04-07 Thread Jan Beulich
On 07.04.2025 18:46, Volodymyr Babchuk wrote: > --- a/xen/Rules.mk > +++ b/xen/Rules.mk > @@ -31,6 +31,7 @@ CFLAGS-y := > AFLAGS-y := > nocov-y := > noubsan-y := > +cov-flags-y := Personally I would have put this slightly higher up, at least ahead of the two no*-y. Thinking of it only now (sorr

Re: [PATCH v8 1/3] xen: common: add ability to enable stack protector

2025-04-07 Thread Jan Beulich
On 08.04.2025 00:40, Volodymyr Babchuk wrote: > Both GCC and Clang support -fstack-protector feature, which add stack > canaries to functions where stack corruption is possible. This patch > makes general preparations to enable this feature on different > supported architectures: > > - Added CONF

Re: [PATCH 5.15.y 1/1] xen/swiotlb: relax alignment requirements

2025-04-07 Thread Harshvardhan Jha
On 07/04/25 12:44 PM, Greg KH wrote: > On Mon, Apr 07, 2025 at 12:02:35AM -0700, Harshvardhan Jha wrote: >> [ Upstream commit 099606a7b2d53e99ce31af42894c1fc9d77c6db9] > Wrong git id :( Ah my bad is it 85fcb57c983f423180ba6ec5d0034242da05cc54 instead? Harshvardhan

Re: [PATCH] x86/vmx: Drop memory clobbers on VMX instruction wrappers

2025-04-07 Thread Jan Beulich
On 07.04.2025 12:45, Andrew Cooper wrote: > The use, or not, of memory clobbers on the VMX instructions is complicated. > > There are two separate aspects to consider: > > 1. Originally, the VMX instructions used hardcoded bytes, including memory >encodings. Therefore, the compiler couldn't

[PATCH v2 3/7] arm/mpu: Introduce utility functions for the pr_t type

2025-04-07 Thread Luca Fancellu
Introduce few utility function to manipulate and handle the pr_t type. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/mpu.h | 40 ++ 1 file changed, 40 insertions(+) diff --git a/xen/arch/arm/include/asm/mpu.h b/xen/arch/arm/include/asm/mpu.h index 59f

Re: [PATCH v3] x86/emulate: Remove HAVE_AS_RDRAND and HAVE_AS_RDSEED

2025-04-07 Thread Andrew Cooper
On 05/04/2025 2:25 am, dm...@proton.me wrote: > From: Denis Mukhin > > The new toolchain baseline knows the rdrand/rdseed instructions, > no need to carry the workaround in the code. A few minor notes.  Instructions in CAPITALS please to make them easier to parse in context.  The comma ought to b

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

2025-04-07 Thread Jan Beulich
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 default for MinGW (and by mistake for everything else as well), then i

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

2025-04-07 Thread Ayan Kumar Halder
On 07/04/2025 14:31, Luca Fancellu wrote: Hi Ayan, Hi, On 7 Apr 2025, at 14:18, Ayan Kumar Halder wrote: Hi Michal, On 07/04/2025 10:04, Orzel, Michal wrote: On 03/04/2025 19:12, Ayan Kumar Halder wrote: Added a new file prepare_xen_region.inc to hold the common earlyboot MPU regions c

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

2025-04-07 Thread Jan Beulich
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(XENLOG_G_ERR "Xen does not allow DomU creation on

[PATCH] tools/libxl: do not use `-c -E` compiler options together

2025-04-07 Thread Roger Pau Monne
It makes no sense to request for preprocessor only output and also request object file generation. Fix the _libxl.api-for-check target to only use -E (preprocessor output). Also Clang 20.0 reports an error if both options are used. Reported-by: Andrew Cooper Fixes: 2862bf5b6c81 ('libxl: enforce

Re: [PATCH] tools/libxl: do not use `-c -E` compiler options together

2025-04-07 Thread Andrew Cooper
On 07/04/2025 12:09 pm, Roger Pau Monne wrote: > It makes no sense to request for preprocessor only output and also request > object file generation. Fix the _libxl.api-for-check target to only use > -E (preprocessor output). > > Also Clang 20.0 reports an error if both options are used. > > Repor

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

2025-04-07 Thread Orzel, Michal
On 03/04/2025 19:12, Ayan Kumar Halder wrote: > Added a new file prepare_xen_region.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 to

[PATCH v2 4/7] arm/mpu: Provide a constructor for pr_t type

2025-04-07 Thread Luca Fancellu
Provide a function that creates a pr_t object from a memory range and some attributes. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/arm64/mpu.h | 11 + xen/arch/arm/include/asm/mpu.h | 4 ++ xen/arch/arm/include/asm/mpu/mm.h| 3 ++ xen/arch/arm/mpu/mm.c

[PATCH v2 1/7] arm/mpu: Introduce MPU memory region map structure

2025-04-07 Thread Luca Fancellu
From: Penny Zheng Introduce pr_t typedef which is a structure having the prbar and prlar members, each being structured as the registers of the aarch64 armv8-r architecture. Introduce the array 'xen_mpumap' that will store a view of the content of the MPU regions. Introduce MAX_MPU_REGIONS macr

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

2025-04-07 Thread Luca Fancellu
Implement some utility function in order to access the MPU regions from the C world. Signed-off-by: Luca Fancellu --- xen/arch/arm/include/asm/mpu.h| 1 + xen/arch/arm/include/asm/mpu/mm.h | 24 ++ xen/arch/arm/mpu/mm.c | 127 ++ 3 files changed

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

2025-04-07 Thread Luca Fancellu
Implement the function setup_mpu that will logically track the MPU regions defined by hardware registers, start introducing data structures and functions to track the status from the C world. The xen_mpumap_mask bitmap is used to track which MPU region are enabled at runtime. This function is cal

Re: [PATCH v3 3/3] xen: debug: gcov: add condition coverage support

2025-04-07 Thread Anthony PERARD
On Sat, Apr 05, 2025 at 03:30:49AM +, Volodymyr Babchuk wrote: > --- a/xen/Rules.mk > +++ b/xen/Rules.mk > @@ -133,18 +133,19 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): > CFLAGS-y += -DINIT_SECTIONS > > non-init-objects = $(filter-out %.init.o, $(obj-y) $(obj-bin-y) $(extra-y))

[PATCH] x86/vmx: Drop memory clobbers on VMX instruction wrappers

2025-04-07 Thread Andrew Cooper
The use, or not, of memory clobbers on the VMX instructions is complicated. There are two separate aspects to consider: 1. Originally, the VMX instructions used hardcoded bytes, including memory encodings. Therefore, the compiler couldn't see the correct relationship between parameters. T

[PATCH] libxl{,u}: replace TOSTRING()

2025-04-07 Thread Jan Beulich
Now that common-macros.h has STR() available, which is even slightly more flexible, use that and drop the custom macros. No difference in generated code (except for line numbers, of course, where embedded in code/data). Signed-off-by: Jan Beulich --- a/tools/libs/light/libxl_disk.c +++ b/tools/

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

2025-04-07 Thread Ayan Kumar Halder
Hi Michal, On 07/04/2025 10:04, Orzel, Michal wrote: On 03/04/2025 19:12, Ayan Kumar Halder wrote: Added a new file prepare_xen_region.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

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

2025-04-07 Thread Luca Fancellu
Hi Ayan, > On 7 Apr 2025, at 14:18, Ayan Kumar Halder wrote: > > Hi Michal, > > On 07/04/2025 10:04, Orzel, Michal wrote: >> >> On 03/04/2025 19:12, Ayan Kumar Halder wrote: >>> Added a new file prepare_xen_region.inc to hold the common earlyboot MPU >>> regions >>> configurations across arm6

Re: [PATCH v9 1/3] docs: update xenstore migration stream definition

2025-04-07 Thread Anthony PERARD
On Thu, Apr 03, 2025 at 01:45:32PM +0200, Juergen Gross wrote: > On 25.03.25 10:17, Juergen Gross wrote: > > On 14.03.25 13:18, Juergen Gross wrote: > > > In order to close a race window for Xenstore live update when using > > > the new unique_id of domains, the migration stream needs to contain >

Re: [PATCH v2 01/15] x86/boot: introduce boot domain

2025-04-07 Thread Jan Beulich
On 05.04.2025 02:04, Daniel P. Smith wrote: > On 1/30/25 08:45, Jan Beulich wrote: >> On 26.12.2024 17:57, Daniel P. Smith wrote: >>> @@ -596,9 +597,10 @@ int __init dom0_setup_permissions(struct domain *d) >>> return rc; >>> } >>> >>> -int __init construct_dom0(struct boot_info *bi, str

Re: [PATCH v3 3/3] xen: debug: gcov: add condition coverage support

2025-04-07 Thread Jan Beulich
On 05.04.2025 05:30, Volodymyr Babchuk wrote: > Jan Beulich writes: > >> On 01.04.2025 03:17, Volodymyr Babchuk wrote: >>> --- a/xen/Kconfig >>> +++ b/xen/Kconfig >>> @@ -41,6 +41,11 @@ config CC_SPLIT_SECTIONS >>> config CC_HAS_UBSAN >>> def_bool $(cc-option,-fsanitize=undefined) >>> >>>

Re: New Defects reported by Coverity Scan for XenProject

2025-04-07 Thread Jan Beulich
On 06.04.2025 13:36, scan-ad...@coverity.com wrote: > Hi, > > Please find the latest report on new defect(s) introduced to XenProject found > with Coverity Scan. > > 1 new defect(s) introduced to XenProject found with Coverity Scan. > > > New defect(s) Reported-by: Coverity Scan > Showing 1 of

[PATCH v3] x86/xen: fix balloon target initialization for PVH dom0

2025-04-07 Thread Roger Pau Monne
PVH dom0 re-uses logic from PV dom0, in which RAM ranges not assigned to dom0 are re-used as scratch memory to map foreign and grant pages. Such logic relies on reporting those unpopulated ranges as RAM to Linux, and mark them as reserved. This way Linux creates the underlying page structures req

Re: [PATCH v3] x86/vmx: Rework VMX wrappers using `asm goto()`

2025-04-07 Thread Andrew Cooper
On 05/04/2025 2:27 am, dm...@proton.me wrote: > diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h > b/xen/arch/x86/include/asm/hvm/vmx/vmx.h > index affb3a8bd6..6aa6e1f212 100644 > --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h > +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h > @@ -294,28 +294,30 @@

Re: [PATCH] sched/null: avoid another crash after failed domU creation

2025-04-07 Thread Jan Beulich
On 04.04.2025 09:38, Jürgen Groß wrote: > On 04.04.25 09:24, Jan Beulich wrote: >> On 03.04.2025 23:48, Stewart Hildebrand wrote: >>> The following sequence of events may lead a debug build of Xen to crash >>> when using the null scheduler: >>> >>> 1. domain creation (e.g. d1) failed due to bad con

Re: [PATCH 5.15.y 1/1] xen/swiotlb: relax alignment requirements

2025-04-07 Thread Greg KH
On Mon, Apr 07, 2025 at 12:02:35AM -0700, Harshvardhan Jha wrote: > [ Upstream commit 099606a7b2d53e99ce31af42894c1fc9d77c6db9] Wrong git id :(

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

2025-04-07 Thread Orzel, Michal
On 07/04/2025 16:07, Ayan Kumar Halder wrote: > > On 07/04/2025 14:31, Luca Fancellu wrote: >> Hi Ayan, > Hi, >> >>> On 7 Apr 2025, at 14:18, Ayan Kumar Halder wrote: >>> >>> Hi Michal, >>> >>> On 07/04/2025 10:04, Orzel, Michal wrote: On 03/04/2025 19:12, Ayan Kumar Halder wrote: > A

Re: [PATCH] x86/vmx: Drop memory clobbers on VMX instruction wrappers

2025-04-07 Thread Andrew Cooper
On 07/04/2025 1:00 pm, Jan Beulich wrote: > On 07.04.2025 12:45, Andrew Cooper wrote: >> The use, or not, of memory clobbers on the VMX instructions is complicated. >> >> There are two separate aspects to consider: >> >> 1. Originally, the VMX instructions used hardcoded bytes, including memory >>

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

2025-04-07 Thread Orzel, Michal
On 07/04/2025 16:34, Luca Fancellu wrote: > > > Hi Ayan, > > >> On 7 Apr 2025, at 15:29, Ayan Kumar Halder wrote: >> >> Hi Luca, >> >> On 04/04/2025 10:06, Luca Fancellu wrote: >>> Hi Ayan, >>> On 3 Apr 2025, at 18:12, Ayan Kumar Halder wrote: Added a new file prepare_

[PATCH v1 4/4] mm: Allow detection of wrong arch_enter_lazy_mmu_mode() context

2025-04-07 Thread Alexander Gordeev
The lazy MMU batching may be only be entered and left under the protection of the page table locks for all page tables which may be modified. Yet, there were cases arch_enter_lazy_mmu_mode() was called without the locks taken, e.g. commit b9ef323ea168 ("powerpc/64s: Disable preemption in hash lazy

[PATCH v1 0/4] mm: Fix apply_to_pte_range() vs lazy MMU mode

2025-04-07 Thread Alexander Gordeev
Hi All, This series is an attempt to fix the violation of lazy MMU mode context requirement as described for arch_enter_lazy_mmu_mode(): This mode can only be entered and left under the protection of the page table locks for all page tables which may be modified. On s390 if I make arch_e

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

2025-04-07 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 v1 2/4] mm: Cleanup apply_to_pte_range() routine

2025-04-07 Thread Alexander Gordeev
Reverse 'create' vs 'mm == &init_mm' conditions and move page table mask modification out of the atomic context. Signed-off-by: Alexander Gordeev --- mm/memory.c | 28 +--- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 2d8

[PATCH v1 1/4] kasan: Avoid sleepable page allocation from atomic context

2025-04-07 Thread Alexander Gordeev
apply_to_page_range() enters lazy MMU mode and then invokes kasan_populate_vmalloc_pte() callback on each page table walk iteration. The lazy MMU mode may only be entered only under protection of the page table lock. However, the callback can go into sleep when trying to allocate a single page. Ch

Re: [PATCH] xen/link: Drop .fixup section from non-x86 architectures

2025-04-07 Thread Orzel, Michal
On 03/04/2025 13:00, Andrew Cooper wrote: > > > The fixup section is only used by x86, and we're working to remove it there > too. Logic in the fixup section is unconnected to it's origin site, and > interferes with backtraces/etc. > > Remove the section from the architectures which don't us

Re: [PATCH test-artifacts v2 13/12] scripts: add rc_verbose=yes to /etc/rc.conf

2025-04-07 Thread Andrew Cooper
On 07/04/2025 1:31 pm, Marek Marczykowski-Górecki wrote: > This is done in every single test job, so do it at the initrd build > time. > > Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Andrew Cooper

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

2025-04-07 Thread Marek Marczykowski-Górecki
On Mon, Apr 07, 2025 at 06:11:29PM +0100, Andrew Cooper wrote: > On 07/04/2025 1:31 pm, Marek Marczykowski-Górecki wrote: > > Build initrd format directly digestable by the kernel. Additionally, > > include it itself inside as boot/initrd-domU file, for domU booting in > > tests. > > This should av

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

2025-04-07 Thread Andrew Cooper
On 07/04/2025 6:11 pm, Andrew Cooper wrote: > On 07/04/2025 1:31 pm, Marek Marczykowski-Górecki wrote: >> Build initrd format directly digestable by the kernel. Additionally, >> include it itself inside as boot/initrd-domU file, for domU booting in >> tests. >> This should avoid the need to repack

[PATCH] CI: Drop stale test-artifacts/alpine/3.18.dockerfile

2025-04-07 Thread Andrew Cooper
This should have been dropped too, as the authoritative copy lives in another repo now. Fixes: babe11b46c1a ("CI: Drop alpine-3.18-rootfs-export and use test-artefacts") Signed-off-by: Andrew Cooper --- CC: Roger Pau Monné CC: Stefano Stabellini CC: Michal Orzel CC: Marek Marczykowski-Górecki

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

2025-04-07 Thread Volodymyr Babchuk
Condition coverage, also known as MC/DC (modified condition/decision coverage) is a coverage metric that tracks separate outcomes in boolean expressions. This patch adds CONFIG_CONDITION_COVERAGE option to enable MC/DC for GCC. Clang is not supported right now. Also, use the opportunity to conver

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

2025-04-07 Thread Volodymyr Babchuk
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 [-Werror=maybe-uninitialized] 281 | ret = init_

Re: [PATCH] xen/link: Drop .fixup section from non-x86 architectures

2025-04-07 Thread Shawn Anastasio
Hi Andrew, On 4/3/25 6:00 AM, Andrew Cooper wrote: > The fixup section is only used by x86, and we're working to remove it there > too. Logic in the fixup section is unconnected to it's origin site, and > interferes with backtraces/etc. > > Remove the section from the architectures which don't u

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

2025-04-07 Thread Andrew Cooper
On 07/04/2025 1:31 pm, Marek Marczykowski-Górecki wrote: > Build initrd format directly digestable by the kernel. Additionally, > include it itself inside as boot/initrd-domU file, for domU booting in > tests. > This should avoid the need to repack tar -> cpio as part of the test > job. > > Keep ge

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

2025-04-07 Thread Andrew Cooper
On 07/04/2025 1:31 pm, Marek Marczykowski-Górecki wrote: > Build initrd format directly digestable by the kernel. Additionally, > include it itself inside as boot/initrd-domU file, for domU booting in > tests. > This should avoid the need to repack tar -> cpio as part of the test > job. > > Keep ge

Re: [PATCH v3] x86/emulate: Remove HAVE_AS_RDRAND and HAVE_AS_RDSEED

2025-04-07 Thread Denis Mukhin
On Monday, April 7th, 2025 at 2:17 AM, Andrew Cooper wrote: > > > On 05/04/2025 2:25 am, dm...@proton.me wrote: > > > From: Denis Mukhin dmuk...@ford.com > > > > The new toolchain baseline knows the rdrand/rdseed instructions, > > no need to carry the workaround in the code. > > > A few mi

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

2025-04-07 Thread Jason Andryuk
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 hardware domain. This allows more flexibility with domain crea

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

2025-04-07 Thread Jan Beulich
On 27.03.2025 14:32, Jan Beulich wrote: > From their introduction all xc_hypercall_bounce_pre() uses, when they > failed, would properly cause exit from the function including cleanup, > yet without informing the caller of the failure. Purge the unlock_1 > label for being both pointless and mis-nam

Re: [PATCH] x86/MTRR: make hold_mtrr_updates_on_aps static and bool

2025-04-07 Thread Andrew Cooper
On 07/04/2025 12:28 pm, Jan Beulich wrote: > It's not used outside of the CU defining it, and it is clearly of > boolean nature. > > Signed-off-by: Jan Beulich Acked-by: Andrew Cooper

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

2025-04-07 Thread Anthony PERARD
On Mon, Apr 07, 2025 at 03:23:48PM +0200, Jan Beulich wrote: > On 07.04.2025 14:45, Anthony PERARD wrote: > > On Mon, Apr 07, 2025 at 01:38:24PM +0200, Jan Beulich wrote: > >> On 27.03.2025 14:32, Jan Beulich wrote: > >>> From their introduction all xc_hypercall_bounce_pre() uses, when they > >>> f

Re: [PATCH v2] xen: Consistently use 'static' first

2025-04-07 Thread Orzel, Michal
On 03/04/2025 23:41, Andrew Cooper wrote: > > > MISRA C:2012 Amendment 3 (which is under consideration, but not used by Xen > yet) is more particular about having the storage class specifier first. > > No functional change. > > Signed-off-by: Andrew Cooper Reviewed-by: Michal Orzel #Arm ~

Re: [PATCH] x86/mem-sharing: short-circuit p2m_is_shared() when MEM_SHARING=n

2025-04-07 Thread Jan Beulich
On 07.04.2025 16:50, Andrew Cooper wrote: > On 03/04/2025 9:41 am, Jan Beulich wrote: >> Some of the uses of dom_cow aren't easily DCE-able (without extra >> #ifdef-ary), and hence it being constantly NULL when MEM_SHARING=n >> misguides Coverity into thinking that there may be a NULL deref in >> >

[PATCH v2 10/12] CI: add AMD Zen 4 HW runner

2025-04-07 Thread Marek Marczykowski-Górecki
This is AMD Ryzen 5 7640U in Framework Laptop AMD. It has several things different than the other runners. First of all, the console is using XHCI debug capability. And then, this system doesn't have normal wired ethernet. But is has one on USB, and this one is used for booting. For this, enable CO

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

2025-04-07 Thread Marek Marczykowski-Górecki
Build initrd format directly digestable by the kernel. Additionally, include it itself inside as boot/initrd-domU file, for domU booting in tests. This should avoid the need to repack tar -> cpio as part of the test job. Keep generating initrd.tar.gz as that's still used by older branches. Signed

[PATCH v2 11/12] CI: avoid repacking initrd as part of the test job

2025-04-07 Thread Marek Marczykowski-Górecki
The prerequisite for this is building initrd.cpio.gz, not only initrd.tar.gz. That's a change in the test-artifacts repository. Having that, do not repack the whole initrd, but only pack modified files and rely on Linux handling of concatenated archives. This allows packing just test-related files

Re: [PATCH] libxl{,u}: replace TOSTRING()

2025-04-07 Thread Anthony PERARD
On Mon, Apr 07, 2025 at 01:29:29PM +0200, Jan Beulich wrote: > Now that common-macros.h has STR() available, which is even slightly > more flexible, use that and drop the custom macros. > > No difference in generated code (except for line numbers, of course, > where embedded in code/data). > > Si

[PATCH v2 06/12] CI: consistently use DOCKER_CMD in makefiles

2025-04-07 Thread Marek Marczykowski-Górecki
This allows rebuilding containers using podman too. Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Stefano Stabellini --- automation/build/Makefile | 4 ++-- automation/tests-artifacts/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/automation

[PATCH v2 01/12] CI: prevent grub unpacking initramfs

2025-04-07 Thread Marek Marczykowski-Górecki
It fails on larger initramfs (~250MB one) and sometimes even smaller depending on memory size/memory map, let Linux do it. Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Stefano Stabellini --- automation/scripts/qubes-x86-64.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v2 02/12] CI: switch qubes runners to use console.exp

2025-04-07 Thread Marek Marczykowski-Górecki
It appears as sometimes it takes more time for Xen even start booting, mostly due to firmware and fetching large boot files by grub. In some jobs the current timeout is pretty close to the actual time needed, and sometimes (rarely for now) test fails due to timeout expiring in the middle of dom0 bo

[PATCH v2 05/12] CI: increase verbosity of starting a domain

2025-04-07 Thread Marek Marczykowski-Górecki
And start collecting qemu log earlier, so it isn't lost in case of a timeout during domain startup. Signed-off-by: Marek Marczykowski-Górecki --- Changes in v2: - adjust xilinx-smoke-dom0-x86_64.sh too --- automation/scripts/qemu-alpine-x86_64.sh | 2 +- automation/scripts/qemu-smoke-dom0-

[PATCH v2 07/12] CI: wait for the network interface in PCI passthrough tests

2025-04-07 Thread Marek Marczykowski-Górecki
The network driver initializes asynchronously, and it may not be ready yet by the time the startup script is called. This is especially the case for USB network adapter (where the PCI device is the USB controller) in the upcoming runner. Don't bother about separate timeout - test timeout will cove

[PATCH v2 09/12] CI: adjust resolving network interface into PCI device

2025-04-07 Thread Marek Marczykowski-Górecki
Change how PCI device lookup is done to handle also USB devices, in which case get the USB controller. Instead of taking basename of the 'device' symlink, resolve the full path (example: /sys/devices/pci:00/:00:09.0/usb4/4-7/4-7:1.0) and take the first part after pci:00. Theoretically i

[PATCH v2 04/12] CI: include domU kernel messages in the console output log

2025-04-07 Thread Marek Marczykowski-Górecki
Signed-off-by: Marek Marczykowski-Górecki Acked-by: Stefano Stabellini --- automation/scripts/qubes-x86-64.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh index 0eac410f4168..7bf42d2e3d31 100755 --- a/automation/sc

[PATCH v2 03/12] CI: enable XHCI console in Xen debug build on Alpine

2025-04-07 Thread Marek Marczykowski-Górecki
This build is used for hardware tests, and some runners use XHCI console Signed-off-by: Marek Marczykowski-Górecki Acked-by: Stefano Stabellini --- automation/gitlab-ci/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.ya

[PATCH v2 12/12] CI: save toolstack artifact as cpio.gz

2025-04-07 Thread Marek Marczykowski-Górecki
This avoids the need to re-compress it in every test job. Signed-off-by: Marek Marczykowski-Górecki --- New in v2 --- automation/scripts/build | 2 +- automation/scripts/qemu-alpine-x86_64.sh | 2 +- automation/scripts/qemu-smoke-dom0-arm64.sh | 2 +- auto

[PATCH v2 00/12] Several CI cleanups and improvements, plus yet another new runner

2025-04-07 Thread Marek Marczykowski-Górecki
Some of those patches are collected from my stubdomain test series, others are made while getting the new runner working. All of the cleanups can be applied independently, but most if not all are needed for the "CI: add AMD Zen 4 HW runner" patch adding new runner. Last two/four patches (including

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

2025-04-07 Thread Anthony PERARD
On Mon, Apr 07, 2025 at 01:38:24PM +0200, Jan Beulich wrote: > On 27.03.2025 14:32, Jan Beulich wrote: > > From their introduction all xc_hypercall_bounce_pre() uses, when they > > failed, would properly cause exit from the function including cleanup, > > yet without informing the caller of the fai

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

2025-04-07 Thread Jan Beulich
On 07.04.2025 14:45, Anthony PERARD wrote: > On Mon, Apr 07, 2025 at 01:38:24PM +0200, Jan Beulich wrote: >> On 27.03.2025 14:32, Jan Beulich wrote: >>> From their introduction all xc_hypercall_bounce_pre() uses, when they >>> failed, would properly cause exit from the function including cleanup, >

Re: [PATCH 1/1] x86/cpu/topology: Don't limit CPUs to 1 for Xen PV guests due to disabled APIC

2025-04-07 Thread Petr Vaněk
On Sun, Apr 06, 2025 at 12:08:29PM +0200, Thomas Gleixner wrote: > On Sat, Apr 05 2025 at 20:16, Petr Vaněk wrote: > > > Xen PV guests in DomU have APIC disabled by design, which causes > > topology_apply_cmdline_limits_early() to limit the number of possible > > CPUs to 1, regardless of the confi

[PATCH v2 1/1] x86/acpi: Don't limit CPUs to 1 for Xen PV guests due to disabled ACPI

2025-04-07 Thread Petr Vaněk
Xen disables ACPI for PV guests in DomU, which causes acpi_mps_check() to return 1 when CONFIG_X86_MPPARSE is not set. As a result, APIC is disabled and the guest is later limited to a single vCPU, despite being configured with more. This regression was introduced in version 6.9 in commit 7c0edad3

[PATCH] x86/AMD: Convert rdmsr_amd_safe() to use asm goto()

2025-04-07 Thread Andrew Cooper
Unlike the WRMSR side, we can't use asm goto() unconditionally, because our toolchain baseline doesn't support asm goto with outputs. Detect support, and use asm goto() when available. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné Condensing these two to a single Kconfi

Re: [PATCH v18 1/2] xen/arm: translate virtual PCI bus topology for guests

2025-04-07 Thread Stewart Hildebrand
On 3/30/25 17:59, Julien Grall wrote: > Hi Stewart, > > I realize this series is at v18, but there are a few bits security-wise > that concerns me. They don't have to be handled now because vPCI is > still in tech preview. But we probably want to keep track of any issues > if this hasn't yet been

Re: [PATCH v3] x86/vmx: Rework VMX wrappers using `asm goto()`

2025-04-07 Thread Denis Mukhin
On Monday, April 7th, 2025 at 2:46 AM, Andrew Cooper wrote: > > > On 05/04/2025 2:27 am, dm...@proton.me wrote: > > > diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h > > b/xen/arch/x86/include/asm/hvm/vmx/vmx.h > > index affb3a8bd6..6aa6e1f212 100644 > > --- a/xen/arch/x86/include/asm/hv

Re: [PATCH v3 4/7] xen/arm: dom0less seed xenstore grant table entry

2025-04-07 Thread Jason Andryuk
On 2025-04-04 03:34, Jan Beulich wrote: On 03.04.2025 23:46, Jason Andryuk wrote: xenstored maps other domains' xenstore pages. Currently this relies on init-dom0less or xl to seed the grants from Dom0. With split hardware/control/xenstore domains, this is problematic since we don't want the h

Re: [PATCH] x86/xen: disable CPU idle and frequency drivers for PVH dom0

2025-04-07 Thread Jason Andryuk
On 2025-04-07 06:18, Roger Pau Monne wrote: When running as a PVH dom0 the ACPI tables exposed to Linux are (mostly) the native ones, thus exposing the C and P states, that can lead to attachment of CPU idle and frequency drivers. However the entity in control of the CPU C and P states is Xen, a

[PATCH v4 3/7] xen/arm: dom0less delay xenstore initialization

2025-04-07 Thread Jason Andryuk
To allocate the xenstore event channel and initialize the grant table entry, the xenstore domid is neeed. A dom0 is created before the domUs, so it is normally available through hardware_domain. With capabilities and dom0less, the xenstore domain may not be created first. Keep the population of

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

2025-04-07 Thread Jason Andryuk
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->cdf is moved later so CDF_hardware is added for the late_

[PATCH v4 2/7] xen/arm: dom0less hwdom construction

2025-04-07 Thread Jason Andryuk
When creating a hardware domain, have the dom0less code call construct_hwdom() which is shared with the dom0 code. The hardware domain requires building that best matches the dom0 build path. Re-use it to keep them in sync. The device tree node of the dom0less config is now passed into construct

[PATCH v4 5/7] tools/init-dom0less: Only seed legacy xenstore grants

2025-04-07 Thread Jason Andryuk
The hardware domain is unable to seed a control domain, but we want the control domain to use xenstore. Rely on the hypervisor to seed dom0less grant table entries for Xenstore, so this seeding is unnecessary. However, that only works for the new xenstore late init. The legacy protocol which use

[PATCH v4 0/7] ARM split hardware and control domains

2025-04-07 Thread Jason Andryuk
This series implements separation of dom0 into separate hardware and control domains. It uses the capabilities idea from Hyperlaunch - hardware, control, and xenstore. It's been tested with dom1 as control, dom2 as a domU, and dom3 as hardware and xenstore. To keep things more managable, this v4

[PATCH v4 6/7] xen/arm: dom0less use has_dtb local variable

2025-04-07 Thread Jason Andryuk
Store the result of finding a "multiboot,device-tree" node. This will simplity adding hardware domain checks. Signed-off-by: Jason Andryuk Reviewed-by: Stefano Stabellini --- v4: Add Stefano R-b v3: New Could be squashed into the next patch, but this helps make the next one cleaner. --- xen/

  1   2   >