[PATCH] x86/hvmloader: fix usage of NULL with cpuid_count()

2025-04-24 Thread Roger Pau Monne
The commit that added support for retrieving the APIC IDs from the APs introduced several usages of cpuid() with NULL parameters, which is not handled by the underlying implementation. For GCC I expect this results in writes to the physical address at 0, however for Clang the generated code in smp

Re: [PATCH] xen: fix buffer over-read in bitmap_to_xenctl_bitmap()

2025-04-24 Thread Roger Pau Monné
On Thu, Apr 24, 2025 at 12:41:43PM +0100, Andrew Cooper wrote: > On 24/04/2025 11:38 am, Roger Pau Monne wrote: > > There's an off-by-one when calculating the last byte in the input array to > > bitmap_to_xenctl_bitmap(), which leads to bitmaps with sizes multiple of 8 > > to over-read and incorrec

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

2025-04-24 Thread Anthony PERARD
On Tue, Apr 08, 2025 at 02:35:22PM +0200, Juergen Gross wrote: > diff --git a/INSTALL b/INSTALL > index 88c1464816..786e3da996 100644 > --- a/INSTALL > +++ b/INSTALL There's one "--enable-ioemu-stubdom" left in this file. > diff --git a/stubdom/Makefile b/stubdom/Makefile > index 724ce40365..82fc

Re: [PATCH] x86/hvmloader: fix usage of NULL with cpuid_count()

2025-04-24 Thread Roger Pau Monné
On Thu, Apr 24, 2025 at 03:21:05PM +0100, Andrew Cooper wrote: > On 24/04/2025 1:58 pm, Roger Pau Monne wrote: > > The commit that added support for retrieving the APIC IDs from the APs > > introduced several usages of cpuid() with NULL parameters, which is not > > handled by the underlying impleme

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

2025-04-24 Thread Anthony PERARD
On Tue, Apr 08, 2025 at 02:35:23PM +0200, Juergen Gross wrote: > 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 Reviewed-by: Anthony PERARD Thanks, -- Anthony PERARD

Re: [PATCH 00/21] x86: Trenchboot Secure Launch DRTM (Xen)

2025-04-24 Thread Nicola Vetrini
On 4/23/25 23:53, Sergii Dmytruk wrote: On Wed, Apr 23, 2025 at 10:11:35PM +0200, Nicola Vetrini wrote: On 2025-04-23 20:45, Sergii Dmytruk wrote: On Wed, Apr 23, 2025 at 02:38:37PM +0100, Andrew Cooper wrote: On 22/04/2025 6:14 pm, Andrew Cooper wrote: I've stripped out the sha2 patch and f

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

2025-04-24 Thread Oleksii Kurochko
On 4/22/25 11:14 AM, Jan Beulich wrote: On 22.04.2025 10:40, Oleksii Kurochko wrote: On 4/17/25 4:49 PM, Jan Beulich wrote: On 17.04.2025 16:37, Oleksii Kurochko wrote: On 4/17/25 4:24 PM, Jan Beulich wrote: On 17.04.2025 16:20, Oleksii Kurochko wrote: On 4/15/25 1:02 PM, Jan Beulich wrote:

Re: [PATCH] x86/hyperv: Adjust hypercall page placement

2025-04-24 Thread Alejandro Vallejo
On Thu Apr 24, 2025 at 1:45 PM BST, Alejandro Vallejo wrote: > Xen nowadays crashes under some Hyper-V configurations when > paddr_bits>36. At the 44bit boundary we reach an edge case in which the > end of the guest physical address space is not representable using 32bit > MFNs. Furthermore, it's a

Re: [PATCH v4 3/4] xen/arm: add support for PCI child bus

2025-04-24 Thread Stewart Hildebrand
On 4/23/25 07:08, Mykyta Poturai wrote: > diff --git a/xen/arch/arm/pci/pci-access.c b/xen/arch/arm/pci/pci-access.c > index 9f9aac43d7..91271973fb 100644 > --- a/xen/arch/arm/pci/pci-access.c > +++ b/xen/arch/arm/pci/pci-access.c > @@ -18,10 +18,31 @@ > #define INVALID_VALUE (~0U) > #define PCI_

[PATCH] x86/hyperv: Adjust hypercall page placement

2025-04-24 Thread Alejandro Vallejo
Xen nowadays crashes under some Hyper-V configurations when paddr_bits>36. At the 44bit boundary we reach an edge case in which the end of the guest physical address space is not representable using 32bit MFNs. Furthermore, it's an act of faith that the tail of the physical address space has no res

Re: [PATCH] x86/hvmloader: fix usage of NULL with cpuid_count()

2025-04-24 Thread Andrew Cooper
On 24/04/2025 1:58 pm, Roger Pau Monne wrote: > The commit that added support for retrieving the APIC IDs from the APs > introduced several usages of cpuid() with NULL parameters, which is not > handled by the underlying implementation. For GCC I expect this results in > writes to the physical add

Re: [PATCH] xen: fix buffer over-read in bitmap_to_xenctl_bitmap()

2025-04-24 Thread Andrew Cooper
On 24/04/2025 11:38 am, Roger Pau Monne wrote: > There's an off-by-one when calculating the last byte in the input array to > bitmap_to_xenctl_bitmap(), which leads to bitmaps with sizes multiple of 8 > to over-read and incorrectly use a byte past the end of the array. /sigh > While there also en

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

2025-04-24 Thread Oleksii Kurochko
On 4/8/25 2:35 PM, Juergen Gross wrote: 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 "

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

2025-04-24 Thread Anthony PERARD
On Tue, Apr 08, 2025 at 02:35:24PM +0200, Juergen Gross wrote: > 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 Once

Re: [PATCH 1/2] tools/xen-hptool: Add missing newlines

2025-04-24 Thread Anthony PERARD
On Wed, Apr 23, 2025 at 05:28:20PM -0400, Jason Andryuk wrote: > Add some missing newlines to error messages. > > Fixes: 284d5633be37 ("Tools: add online/offline hotplug user interfaces") > Signed-off-by: Jason Andryuk Acked-by: Anthony PERARD Thanks, -- Anthony PERARD

Re: [PATCH 2/2] tools/xen-hptool: Replace hard tabs

2025-04-24 Thread Anthony PERARD
On Wed, Apr 23, 2025 at 05:28:21PM -0400, Jason Andryuk wrote: > With a tab stop of 8, the alignment is off. Replace the hard tabs with > spaces to match the file. > > Fixes: 284d5633be37 ("Tools: add online/offline hotplug user interfaces") > Signed-off-by: Jason Andryuk Acked-by: Anthony PERA

Re: UBSan bug in real mode fpu emulation

2025-04-24 Thread Fabian Specht
> > if ( !s->rex_prefix ) > > { > > /* Convert 32-bit real/vm86 to 32-bit prot format. */ > > unsigned int fip = fpstate.env.mode.real.fip_lo + > >(fpstate.env.mode.real.fip_hi << 16); > > unsigned int fdp = fpstate.env.mode.real.fdp_lo + > >

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

2025-04-24 Thread Anthony PERARD
On Tue, Apr 08, 2025 at 02:35:21PM +0200, Juergen Gross wrote: > diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c > index c3c61ca060..a00acdd45b 100644 > --- a/tools/firmware/hvmloader/pci.c > +++ b/tools/firmware/hvmloader/pci.c > @@ -113,19 +113,9 @@ void pci_setup(voi

Re: [PATCH] xen/vpci: Fix msix existing mapping printk

2025-04-24 Thread Jason Andryuk
On 2025-04-24 02:18, Jan Beulich wrote: On 23.04.2025 23:22, Jason Andryuk wrote: --- a/xen/drivers/vpci/msix.c +++ b/xen/drivers/vpci/msix.c @@ -666,7 +666,7 @@ int vpci_make_msix_hole(const struct pci_dev *pdev) put_gfn(d, start); gprintk(XENLOG_WARNING,

Re: UBSan bug in real mode fpu emulation

2025-04-24 Thread Andrew Cooper
On 24/04/2025 2:13 pm, Fabian Specht wrote: >>> if ( !s->rex_prefix ) >>> { >>> /* Convert 32-bit real/vm86 to 32-bit prot format. */ >>> unsigned int fip = fpstate.env.mode.real.fip_lo + >>>(fpstate.env.mode.real.fip_hi << 16); >>> unsigned int f

Re: [PATCH 00/21] x86: Trenchboot Secure Launch DRTM (Xen)

2025-04-24 Thread Andrew Cooper
On 24/04/2025 7:47 pm, Sergii Dmytruk wrote: >> Alignment that large is unexpected, and I suspect we want to fix it.  Is >> it pre-existing, or something introduced by your series? >> >> ~Andrew > Pre-existing one. I can see `-N` is already passed to `ld`: > > -N, --omagic Do not page align da

[PATCH v5 05/12] x86/hyperlaunch: locate dom0 kernel with hyperlaunch

2025-04-24 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

Re: [PATCH v4 4/4] xen/arm: add support for R-Car Gen4 PCI host controller

2025-04-24 Thread Stewart Hildebrand
On 4/23/25 07:08, Mykyta Poturai wrote: > From: Oleksandr Andrushchenko > > Add support for Renesas R-Car Gen4 PCI host controller, specifically > targeting the S4 and V4H SoCs. The implementation includes configuration > read/write operations for both root and child buses. For accessing the > ch

Re: [RFC PATCH v2 21/34] x86/msr: Utilize the alternatives mechanism to write MSR

2025-04-24 Thread Xin Li
On 4/23/2025 9:05 AM, Jürgen Groß wrote: It's not a major change, but when it is patched to use the immediate form MSR write instruction, it's straightforwardly streamlined. It should be rather easy to switch the current wrmsr/rdmsr paravirt patching locations to use the rdmsr/wrmsr instructi

Re: [RFC] xen/x86: allow overlaps with non-RAM regions

2025-04-24 Thread Roger Pau Monné
On Wed, Apr 23, 2025 at 04:51:16PM -0700, Lira, Victor M wrote: > [4.570354] Intel(R) 2.5G Ethernet Linux Driver > > [4.579535] Copyright(c) 2018 Intel Corporation. > > [4.588898] sky2: driver version 1.30 > > (XEN) [ 21.644361] d0v3 unable to fixup memory read from 0xfe91000c size

Re: [RFC PATCH v2 21/34] x86/msr: Utilize the alternatives mechanism to write MSR

2025-04-24 Thread Jürgen Groß
On 24.04.25 10:06, Xin Li wrote: On 4/23/2025 9:05 AM, Jürgen Groß wrote: It's not a major change, but when it is patched to use the immediate form MSR write instruction, it's straightforwardly streamlined. It should be rather easy to switch the current wrmsr/rdmsr paravirt patching locations

Re: [PATCH v2 0/6] remove qemu-traditional

2025-04-24 Thread Juergen Gross
Ping? On 08.04.25 14:35, Juergen Gross wrote: 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: - add

Re: [RFC PATCH v2 14/34] x86/msr: refactor pv_cpu_ops.write_msr{_safe}()

2025-04-24 Thread Jürgen Groß
On 22.04.25 10:21, Xin Li (Intel) wrote: An MSR value is represented as a 64-bit unsigned integer, with existing MSR instructions storing it in EDX:EAX as two 32-bit segments. The new immediate form MSR instructions, however, utilize a 64-bit general-purpose register to store the MSR value. To

Re: [RFC] xen/x86: allow overlaps with non-RAM regions

2025-04-24 Thread Marek Marczykowski-Górecki
On Thu, Apr 24, 2025 at 09:59:00AM +0200, Roger Pau Monné wrote: > On Wed, Apr 23, 2025 at 04:51:16PM -0700, Lira, Victor M wrote: > > [4.570354] Intel(R) 2.5G Ethernet Linux Driver > > > > [4.579535] Copyright(c) 2018 Intel Corporation. > > > > [4.588898] sky2: driver version 1.30 >

Re: [RFC PATCH v2 12/34] x86/msr: Remove pmu_msr_{read,write}()

2025-04-24 Thread Mi, Dapeng
On 4/24/2025 3:21 PM, Xin Li wrote: > On 4/23/2025 11:33 PM, Mi, Dapeng wrote: >> Could we merge this patch and previous patch into a single patch? It's >> unnecessary to just modify the pmu_msr_read()/pmu_msr_write() in previous >> patch and delete them immediately. It just wastes the effort. >

Re: UBSan bug in real mode fpu emulation

2025-04-24 Thread Fabian Specht
On Thu, Apr 24, 2025 at 08:34:42AM +0200, Jan Beulich wrote: > Since ... > > > Similar code resides in the same file in lines 87, 125 and 127. > > ... all of these are shifts by 16, could you clarify what it is that you > want to shift by 4? Imo what we need to do here is add casts to unsigned >

Re: [RFC PATCH v2 12/34] x86/msr: Remove pmu_msr_{read,write}()

2025-04-24 Thread Jürgen Groß
On 22.04.25 10:21, Xin Li (Intel) wrote: As pmu_msr_{read,write}() are now wrappers of pmu_msr_chk_emulated(), remove them and use pmu_msr_chk_emulated() directly. While at it, convert the data type of MSR index to u32 in functions called in pmu_msr_chk_emulated(). Suggested-by: H. Peter Anvin

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

2025-04-24 Thread Oleksii Kurochko
On 4/8/25 2:35 PM, Juergen Gross wrote: Remove qemu traditional from the tree. Signed-off-by: Juergen Gross --- .gitignore| 3 - CHANGELOG.md | 1 + For CHANGELOG.md changes LGTM: Acked-by: Oleksii Kurochko ~ Oleksii

Re: [RFC PATCH v2 13/34] x86/xen/msr: Remove the error pointer argument from set_reg()

2025-04-24 Thread Jürgen Groß
On 22.04.25 10:21, Xin Li (Intel) wrote: set_reg() is used to write the following MSRs on Xen: MSR_FS_BASE MSR_KERNEL_GS_BASE MSR_GS_BASE But none of these MSRs are written using any MSR write safe API. Therefore there is no need to pass an error pointer argument to set_reg() for

Re: [RFC PATCH v2 11/34] x86/msr: Remove calling native_{read,write}_msr{,_safe}() in pmu_msr_{read,write}()

2025-04-24 Thread Xin Li
On 4/23/2025 11:25 PM, Mi, Dapeng wrote: -bool pmu_msr_read(unsigned int msr, uint64_t *val, int *err) +bool pmu_msr_read(u32 msr, u64 *val) The function name is some kind of misleading right now. With the change, this function only read PMU MSR's value if it's emulated, otherwise it won't rea

Re: [RFC PATCH v2 12/34] x86/msr: Remove pmu_msr_{read,write}()

2025-04-24 Thread Xin Li
On 4/23/2025 11:33 PM, Mi, Dapeng wrote: Could we merge this patch and previous patch into a single patch? It's unnecessary to just modify the pmu_msr_read()/pmu_msr_write() in previous patch and delete them immediately. It just wastes the effort. No, it's not wasting effort, it's for easier re

Re: [XEN PATCH] misra: update list of GCC extensions used by Xen

2025-04-24 Thread Nicola Vetrini
On 2025-04-24 00:46, Andrew Cooper wrote: On 23/04/2025 9:55 pm, Stefano Stabellini wrote: On Wed, 23 Apr 2025, Nicola Vetrini wrote: __inline was not mentioned in C-language-toolchain.rst, while __inline__ is not used in code under xen/. __inline is kept because it may be used in Xen. The ECL

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

2025-04-24 Thread Anthony PERARD
On Tue, Apr 08, 2025 at 02:35:20PM +0200, Juergen Gross wrote: > diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in > index 7339c44efd..ccf0c58895 100644 > --- a/docs/man/xl.cfg.5.pod.in > +++ b/docs/man/xl.cfg.5.pod.in > @@ -895,12 +895,6 @@ is used. > Specifies the path to the X au

Re: UBSan bug in real mode fpu emulation

2025-04-24 Thread Fabian Specht
On Thu, Apr 24, 2025 at 08:34:42AM +0200, Jan Beulich wrote: > Since ... > > > Similar code resides in the same file in lines 87, 125 and 127. > > ... all of these are shifts by 16, could you clarify what it is that you > want to shift by 4? Imo what we need to do here is add casts to unsigned >

Re: [RFC PATCH v2 11/34] x86/msr: Remove calling native_{read,write}_msr{,_safe}() in pmu_msr_{read,write}()

2025-04-24 Thread Mi, Dapeng
On 4/22/2025 4:21 PM, Xin Li (Intel) wrote: > hpa found that pmu_msr_write() is actually a completely pointless > function [1]: all it does is shuffle some arguments, then calls > pmu_msr_chk_emulated() and if it returns true AND the emulated flag > is clear then does *exactly the same thing* tha

Re: [RFC PATCH v2 12/34] x86/msr: Remove pmu_msr_{read,write}()

2025-04-24 Thread Mi, Dapeng
On 4/22/2025 4:21 PM, Xin Li (Intel) wrote: > As pmu_msr_{read,write}() are now wrappers of pmu_msr_chk_emulated(), > remove them and use pmu_msr_chk_emulated() directly. > > While at it, convert the data type of MSR index to u32 in functions > called in pmu_msr_chk_emulated(). > > Suggested-by:

Re: [RFC PATCH v2 12/34] x86/msr: Remove pmu_msr_{read,write}()

2025-04-24 Thread Xin Li
On 4/24/2025 12:43 AM, Mi, Dapeng wrote: These 2 patches are not complicated, it won't be difficult to review if merging them into one as long as the commit message mentions it clearly. Anyway I'm fine if you hope to keep them into two patches. Simple Small Steps...

[PATCH] xen: fix buffer over-read in bitmap_to_xenctl_bitmap()

2025-04-24 Thread Roger Pau Monne
There's an off-by-one when calculating the last byte in the input array to bitmap_to_xenctl_bitmap(), which leads to bitmaps with sizes multiple of 8 to over-read and incorrectly use a byte past the end of the array. While there also ensure that bitmap_to_xenctl_bitmap() is not called with a bitma

Re: UBSan bug in real mode fpu emulation

2025-04-24 Thread Andrew Cooper
On 24/04/2025 2:08 am, Fabian Specht wrote: > Dear Xen-Devel team, > > we discovered a bug regarding undefined behaviour in the FPU emulation > unit. > > if ( !s->rex_prefix ) > { > /* Convert 32-bit real/vm86 to 32-bit prot format. */ > unsigned int fip = fpstate.env.mode.real.fip_lo +

Re: [RFC] xen/x86: allow overlaps with non-RAM regions

2025-04-24 Thread Roger Pau Monné
On Thu, Apr 24, 2025 at 12:15:17PM +0200, Marek Marczykowski-Górecki wrote: > On Thu, Apr 24, 2025 at 09:59:00AM +0200, Roger Pau Monné wrote: > > On Wed, Apr 23, 2025 at 04:51:16PM -0700, Lira, Victor M wrote: > > > [4.570354] Intel(R) 2.5G Ethernet Linux Driver > > > > > > [4.579535] Cop

Re: [PATCH v5 08/12] x86/hyperlaunch: add domain id parsing to domain config

2025-04-24 Thread Jason Andryuk
On 2025-04-24 12:10, Alejandro Vallejo wrote: 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 Sig

Re: [PATCH 00/21] x86: Trenchboot Secure Launch DRTM (Xen)

2025-04-24 Thread Sergii Dmytruk
On Wed, Apr 23, 2025 at 11:43:15PM +0100, Andrew Cooper wrote: > On 23/04/2025 7:45 pm, Sergii Dmytruk wrote: > > On Wed, Apr 23, 2025 at 02:38:37PM +0100, Andrew Cooper wrote: > >> On 22/04/2025 6:14 pm, Andrew Cooper wrote: > >>> I've stripped out the sha2 patch and fixed up to use the existing s

Re: [PATCH v5 01/12] kconfig: introduce domain builder config options

2025-04-24 Thread Jason Andryuk
On 2025-04-24 12:10, Alejandro Vallejo wrote: From: "Daniel P. Smith" Hyperlaunch domain builder will be the consolidated boot time domain building logic framework. Introduces the config option to enable this "Introduce the" domain builder to eventually turn on the ability to load the domai

Re: [RFC PATCH v2 12/34] x86/msr: Remove pmu_msr_{read,write}()

2025-04-24 Thread H. Peter Anvin
On April 24, 2025 10:49:59 AM PDT, Xin Li wrote: >On 4/24/2025 3:05 AM, Jürgen Groß wrote: >> >> May I suggest to get rid of the "emul" parameter of pmu_msr_chk_emulated()? >> It has no real value, as pmu_msr_chk_emulated() could easily return false in >> the cases where it would set *emul to fal

Re: [RFC PATCH v2 21/34] x86/msr: Utilize the alternatives mechanism to write MSR

2025-04-24 Thread Jürgen Groß
On 25.04.25 03:15, H. Peter Anvin wrote: On 4/24/25 01:14, Jürgen Groß wrote: Actually, that is how we get this patch with the existing alternatives infrastructure.  And we took a step further to also remove the pv_ops MSR APIs... And this is what I'm questioning. IMHO this approach is adding

Re: [PATCH] x86/hyperv: Adjust hypercall page placement

2025-04-24 Thread Trolle Selander
I worked on Xen-on-Azure last summer in my previous position. Allocating a heap page was how we solved this particular issue in our branch as well. I see you say you're still 'working on bringing Xen up on Azure', so I'm not sure how far along your branch / patch set is, but for what it's worth, w

[PATCH v2] xen/vpci: Fix msix existing mapping printk

2025-04-24 Thread Jason Andryuk
The format string lacks a space, so mfn and type run together: (XEN) d0v0 :06:00.7: existing mapping (mfn: 753037type: 0) at 0x1 clobbers MSIX MMIO area Add a space. Additionally, move the format string to a single long line to improve grep-ability. Fixes: 677053fac17a ("vpci/msix: carve p2

Re: [RFC] xen/x86: allow overlaps with non-RAM regions

2025-04-24 Thread Jason Andryuk
On 2025-04-24 06:48, Roger Pau Monné wrote: On Thu, Apr 24, 2025 at 12:15:17PM +0200, Marek Marczykowski-Górecki wrote: On Thu, Apr 24, 2025 at 09:59:00AM +0200, Roger Pau Monné wrote: On Wed, Apr 23, 2025 at 04:51:16PM -0700, Lira, Victor M wrote: [4.570354] Intel(R) 2.5G Ethernet Linux D

Re: [RFC] xen/x86: allow overlaps with non-RAM regions

2025-04-24 Thread Lira, Victor M
Hello all, Here is the output from Roger's patch. This is the section of interest: (XEN) [ 7.547326] d0 has maximum 3328PIRQs (XEN) [ 7.555644] *** Building a PVH Dom0 *** (XEN) [ 7.567780] d0: identity mappings for IOMMU: (XEN) [ 7.577312]  [a0, ff] RW (XEN) [ 7.586153]  [0

Re: [PATCH v1] misra: add deviation for rules 21.1 and 21.2

2025-04-24 Thread Stefano Stabellini
On Thu, 24 Apr 2025, Jan Beulich wrote: > On 23.04.2025 19:54, victorm.l...@amd.com wrote: > > From: Nicola Vetrini > > > > MISRA C Rules 21.1 ("#define and #undef shall not be used on a > > reserved identifier or reserved macro name") and R21.2 ("A reserved > > identifier or reserved macro name

Re: [PATCH v5 00/12] Hyperlaunch device tree for dom0

2025-04-24 Thread dmkhn
On Thu, Apr 24, 2025 at 05:10:10PM +0100, Alejandro Vallejo wrote: > Hi, > > v4: https://lore.kernel.org/xen-devel/20250417124844.11143-1-agarc...@amd.com/ > v3: https://lore.kernel.org/xen-devel/20250408160802.49870-1-agarc...@amd.com/ > v2: > https://lore.kernel.org/xen-devel/20241226165740.298

Re: [RFC PATCH v2 12/34] x86/msr: Remove pmu_msr_{read,write}()

2025-04-24 Thread Xin Li
By the way, this patch should have "xen" in its subject tag. Right, I should add it.

Re: [RFC PATCH v2 21/34] x86/msr: Utilize the alternatives mechanism to write MSR

2025-04-24 Thread H. Peter Anvin
On 4/24/25 18:15, H. Peter Anvin wrote: On 4/24/25 01:14, Jürgen Groß wrote: Actually, that is how we get this patch with the existing alternatives infrastructure.  And we took a step further to also remove the pv_ops MSR APIs... And this is what I'm questioning. IMHO this approach is adding

Re: [PATCH v5] uboot-script-gen: Dynamically compute addr and size when loading binaries

2025-04-24 Thread Orzel, Michal
On 25/04/2025 03:16, Stefano Stabellini wrote: > From: Andrei Cherechesu > > Normally, the Imagebuilder would precompute the sizes of the loaded > binaries and addresses where they are loaded before generating the > script, and the sizes and addresses that needed to be provided to > Xen via /c

Re: [PATCH 00/21] x86: Trenchboot Secure Launch DRTM (Xen)

2025-04-24 Thread Sergii Dmytruk
On Thu, Apr 24, 2025 at 12:54:41PM +0200, Nicola Vetrini wrote: > > On 4/23/25 23:53, Sergii Dmytruk wrote: > > On Wed, Apr 23, 2025 at 10:11:35PM +0200, Nicola Vetrini wrote: > > > On 2025-04-23 20:45, Sergii Dmytruk wrote: > > > > On Wed, Apr 23, 2025 at 02:38:37PM +0100, Andrew Cooper wrote: > >

Re: [PATCH v1] misra: add deviation of Rule 5.5

2025-04-24 Thread Andrew Cooper
On 23/04/2025 7:16 pm, Lira, Victor M wrote: > Continuing a discussion from before: > > On 4/22/2025 11:44 PM, Jan Beulich wrote: >> Caution: This message originated from an External Source. Use proper >> caution when opening attachments, clicking links, or responding. >> >> >> On 23.04.2025 01:43,

[PATCH v5 08/12] x86/hyperlaunch: add domain id parsing to domain config

2025-04-24 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 Signed-off-by: Alejandro Vallejo --- v5: * Added

[PATCH v5 12/12] x86/hyperlaunch: add capabilities to boot domain

2025-04-24 Thread Alejandro Vallejo
From: "Daniel P. Smith" Introduce the ability to assign capabilities to a domain via its definition in device tree. The first capability enabled to select is the control domain capability. The capability property is a bitfield in both the device tree and `struct boot_domain`. Signed-off-by: Dani

[PATCH v5 09/12] x86/hyperlaunch: specify dom0 mode with device tree

2025-04-24 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 w

[PATCH v5 07/12] x86/hyperlaunch: locate dom0 initrd with hyperlaunch

2025-04-24 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 v5 11/12] x86/hyperlaunch: add max vcpu parsing of hyperlaunch device tree

2025-04-24 Thread Alejandro Vallejo
From: "Daniel P. Smith" Introduce the `cpus` property, named as such for dom0less compatibility, that represents the maximum number of vcpus to allocate for a domain. In the device tree, it will be encoded as a u32 value. Signed-off-by: Daniel P. Smith Reviewed-by: Jason Andryuk Signed-off-by:

[PATCH v5 06/12] x86/hyperlaunch: obtain cmdline from device tree

2025-04-24 Thread Alejandro Vallejo
From: "Daniel P. Smith" Add support to read the command line from the hyperlaunch device tree. The device tree command line is located in the "bootargs" property of the "multiboot,kernel" node. A boot loader command line, e.g. a grub module string field, takes precendence over the device tree on

[PATCH v5 04/12] x86/hyperlaunch: Add helpers to locate multiboot modules

2025-04-24 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 v5 02/12] common/hyperlaunch: introduce the domain builder

2025-04-24 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 v5 01/12] kconfig: introduce domain builder config options

2025-04-24 Thread Alejandro Vallejo
From: "Daniel P. Smith" Hyperlaunch domain builder will be the consolidated boot time domain building logic framework. Introduces the config option to enable this domain builder to eventually turn on the ability to load the domain configuration via a flattened device tree. Signed-off-by: Daniel

Re: [PATCH] x86/hyperv: Adjust hypercall page placement

2025-04-24 Thread Ariadne Conill
Hi, > On Apr 24, 2025, at 6:48 AM, Alejandro Vallejo wrote: > > On Thu Apr 24, 2025 at 1:45 PM BST, Alejandro Vallejo wrote: >> Xen nowadays crashes under some Hyper-V configurations when >> paddr_bits>36. At the 44bit boundary we reach an edge case in which the >> end of the guest physical add

Re: [XEN PATCH] misra: update list of GCC extensions used by Xen

2025-04-24 Thread Andrew Cooper
On 24/04/2025 8:27 am, Nicola Vetrini wrote: > On 2025-04-24 00:46, Andrew Cooper wrote: >> On 23/04/2025 9:55 pm, Stefano Stabellini wrote: >>> On Wed, 23 Apr 2025, Nicola Vetrini wrote: __inline was not mentioned in C-language-toolchain.rst, while __inline__ is not used in code under xe

[PATCH v5 03/12] x86/hyperlaunch: initial support for hyperlaunch device tree

2025-04-24 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 v5 00/12] Hyperlaunch device tree for dom0

2025-04-24 Thread Alejandro Vallejo
Hi, v4: https://lore.kernel.org/xen-devel/20250417124844.11143-1-agarc...@amd.com/ v3: https://lore.kernel.org/xen-devel/20250408160802.49870-1-agarc...@amd.com/ v2: https://lore.kernel.org/xen-devel/20241226165740.29812-1-dpsm...@apertussolutions.com/ v1: https://lore.kernel.org/xen-devel/20241

Re: [PATCH] x86/hyperv: Adjust hypercall page placement

2025-04-24 Thread Alejandro Vallejo
On Thu Apr 24, 2025 at 7:22 PM BST, Ariadne Conill wrote: > Hi, > >> On Apr 24, 2025, at 6:48 AM, Alejandro Vallejo wrote: >> >> On Thu Apr 24, 2025 at 1:45 PM BST, Alejandro Vallejo wrote: >>> Xen nowadays crashes under some Hyper-V configurations when >>> paddr_bits>36. At the 44bit boundary w

[PATCH v5 10/12] x86/hyperlaunch: add memory parsing to domain config

2025-04-24 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: [RFC PATCH v2 12/34] x86/msr: Remove pmu_msr_{read,write}()

2025-04-24 Thread Xin Li
On 4/24/2025 3:05 AM, Jürgen Groß wrote: May I suggest to get rid of the "emul" parameter of pmu_msr_chk_emulated()? It has no real value, as pmu_msr_chk_emulated() could easily return false in the cases where it would set *emul to false. Good idea! The function type is a bit of weird but I

Re: [RFC PATCH v2 13/34] x86/xen/msr: Remove the error pointer argument from set_reg()

2025-04-24 Thread Xin Li
On 4/24/2025 3:11 AM, Jürgen Groß wrote: set_seg(), please (further up, too). Good catch, thanks a lot!

[PATCH v5] uboot-script-gen: Dynamically compute addr and size when loading binaries

2025-04-24 Thread Stefano Stabellini
From: Andrei Cherechesu Normally, the Imagebuilder would precompute the sizes of the loaded binaries and addresses where they are loaded before generating the script, and the sizes and addresses that needed to be provided to Xen via /chosen would be hardcoded in the boot script. Added an option

Re: [RFC PATCH v2 21/34] x86/msr: Utilize the alternatives mechanism to write MSR

2025-04-24 Thread H. Peter Anvin
On 4/24/25 01:14, Jürgen Groß wrote: Actually, that is how we get this patch with the existing alternatives infrastructure.  And we took a step further to also remove the pv_ops MSR APIs... And this is what I'm questioning. IMHO this approach is adding more code by removing the pv_ops MSR_APIs