Re: [PATCH v5 00/15] Remove the directmap

2025-02-06 Thread Alejandro Vallejo
On Wed Jan 8, 2025 at 3:18 PM GMT, Alejandro Vallejo wrote: > Hi, > > I picked v4 of this series and run it through XenRT extensively, fixing > crashes > and errors as I hit them. Likewise, I've run it through Gitlab, fixing various > CI failures. I listed all changes pe

Re: [RFC] enable UBSAN for automation tests

2025-02-05 Thread Alejandro Vallejo
On Wed Feb 5, 2025 at 12:44 AM GMT, Stefano Stabellini wrote: > Hi all, > > I would like to propose to enable the UBSAN config option in our Gitlab > pipelines. The attached patch (just for testing, do not commit) enables > UBSAN on the Xen build jobs used for most of the ARM and x86 tests. The > p

[PATCH v3 0/2] tools/hvmloader: Decouple APIC IDs from vCPU IDs

2025-02-04 Thread Alejandro Vallejo
uch assumption from hvmloader, by making it read the APIC ID of each vCPU and storing it for later use. Alejandro Vallejo (2): tools/hvmloader: Retrieve APIC IDs from the APs themselves tools/hvmloader: Replace LAPIC_ID() with cpu_to_apicid[] tools/firmware/hvmloader/config.h| 3 +- tools

[PATCH v3 2/2] tools/hvmloader: Replace LAPIC_ID() with cpu_to_apicid[]

2025-02-04 Thread Alejandro Vallejo
using it uninitialised. Note that bringing up the APs doesn't need the APIC in hvmloader becasue it always runs virtualized and uses the PV interface. Signed-off-by: Alejandro Vallejo --- v2->v3: * Moved extern in config.h to patch1 for (transient) MISRA compliance. v1->v2: *

[PATCH v3 1/2] tools/hvmloader: Retrieve APIC IDs from the APs themselves

2025-02-04 Thread Alejandro Vallejo
used for the vcpu id. Signed-off-by: Alejandro Vallejo --- v2->v3: * Moved extern from patch2 into patch1 for (transient) MISRA compliance. v1->v2: * Removed "(x2)" from the comment of cpu_to_apicid. * Added "APIC ID" to the printed string on AP boot up. Chan

Re: [PATCH v2 2/2] tools/hvmloader: Replace LAPIC_ID() with cpu_to_apicid[]

2025-02-04 Thread Alejandro Vallejo
On Tue Feb 4, 2025 at 3:46 PM GMT, Jan Beulich wrote: > On 04.02.2025 16:25, Alejandro Vallejo wrote: > > On Tue Feb 4, 2025 at 3:07 PM GMT, Jan Beulich wrote: > >> On 04.02.2025 15:45, Alejandro Vallejo wrote: > >>> --- a/tools/firmware/hvmloader/config.h > &

Re: [PATCH v2 2/2] tools/hvmloader: Replace LAPIC_ID() with cpu_to_apicid[]

2025-02-04 Thread Alejandro Vallejo
On Tue Feb 4, 2025 at 3:07 PM GMT, Jan Beulich wrote: > On 04.02.2025 15:45, Alejandro Vallejo wrote: > > --- a/tools/firmware/hvmloader/config.h > > +++ b/tools/firmware/hvmloader/config.h > > @@ -48,8 +48,9 @@ extern uint8_t ioapic_version; > > > >

[PATCH v2 1/2] tools/hvmloader: Retrieve APIC IDs from the APs themselves

2025-02-04 Thread Alejandro Vallejo
used for the vcpu id. Signed-off-by: Alejandro Vallejo --- v1->v2: * Removed "(x2)" from the comment of cpu_to_apicid. * Added "APIC ID" to the printed string on AP boot up. Changes from the v7 version of this patch in the longer topology series: * s/cpu_to

[PATCH v2 0/2] tools/hvmloader: Decouple APIC IDs from vCPU IDs

2025-02-04 Thread Alejandro Vallejo
er and the toolstack currently engage in a shared assumption that for every vCPU apicid == 2 * vcpuid. This series removes such assumption from hvmloader, by making it read the APIC ID of each vCPU and storing it for later use. Alejandro Vallejo (2): tools/hvmloader: Retrieve APIC IDs from t

[PATCH v2 2/2] tools/hvmloader: Replace LAPIC_ID() with cpu_to_apicid[]

2025-02-04 Thread Alejandro Vallejo
using it uninitialised. Note that bringing up the APs doesn't need the APIC in hvmloader becasue it always runs virtualized and uses the PV interface. Signed-off-by: Alejandro Vallejo --- v1->v2: * No changes Changes wrt original series * No changes (it was wrongly stated in v1 that s

Re: [PATCH 0/3] tools/hvmloader: Decouple APIC IDs from vCPU IDs

2025-02-04 Thread Alejandro Vallejo
On Thu Jan 30, 2025 at 9:17 AM GMT, Jan Beulich wrote: > On 29.01.2025 17:25, Roger Pau Monné wrote: > > On Tue, Jan 28, 2025 at 06:42:38PM +, Alejandro Vallejo wrote: > >> On Tue Jan 28, 2025 at 5:45 PM GMT, Roger Pau Monné wrote: > >>> On Tue, Jan 28, 2025

Re: [for-4.20][PATCH 2/2] xen/arm: Fix build issue when CONFIG_PHYS_ADDR_T_32=y

2025-01-28 Thread Alejandro Vallejo
On Mon Jan 27, 2025 at 5:14 PM GMT, Michal Orzel wrote: > > > On 27/01/2025 18:03, Alejandro Vallejo wrote: > > > > > > Hi, > > > > On Mon Jan 27, 2025 at 10:45 AM GMT, Michal Orzel wrote: > >> On Arm32, when CONFIG_PHYS_ADDR_T_32 is set, a bu

Re: [PATCH 1/3] tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselves

2025-01-28 Thread Alejandro Vallejo
On Tue Jan 28, 2025 at 5:59 PM GMT, Roger Pau Monné wrote: > On Tue, Jan 28, 2025 at 04:33:40PM +0000, Alejandro Vallejo wrote: > > Make it so the APs expose their own APIC IDs in a lookup table (LUT). We > > can use that LUT to populate the MADT, decoupling the algorithm that >

Re: [PATCH 0/3] tools/hvmloader: Decouple APIC IDs from vCPU IDs

2025-01-28 Thread Alejandro Vallejo
On Tue Jan 28, 2025 at 5:45 PM GMT, Roger Pau Monné wrote: > On Tue, Jan 28, 2025 at 04:33:39PM +0000, Alejandro Vallejo wrote: > > The hypervisor, hvmloader and the toolstack currently engage in a shared > > assumption that for every vCPU apicid == 2 * vcpuid. This series re

[PATCH 0/3] tools/hvmloader: Decouple APIC IDs from vCPU IDs

2025-01-28 Thread Alejandro Vallejo
much longer "Expose consistent topology to guests". https://lore.kernel.org/xen-devel/20241021154600.11745-5-alejandro.vall...@cloud.com/ Changes with respect to the original patch on each individual patch. Alejandro Vallejo (3): tools/hvmloader: Retrieve (x2)APIC IDs from the

[PATCH 3/3] tools/hvmloader: Skip writing MP tables if any CPU has an APIC ID >= 255

2025-01-28 Thread Alejandro Vallejo
x27;s just not worth the work. Any OS that needs such adjustments should not have been booted with that many vCPUs to begin with. Signed-off-by: Alejandro Vallejo --- Changes with respect to v7 in the longer topology series: * This patch replaces the previous assert in hvmloader/mp_tables.c ---

[PATCH 1/3] tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselves

2025-01-28 Thread Alejandro Vallejo
used for the vcpu id. Signed-off-by: Alejandro Vallejo --- Changes from the v7 version of this patch in the longer topology series: * s/cpu_to_x2apicid/cpu_to_apicid/ * Though, as I already stated, I don't think this is a good idea. * Dynamically size cpu_to_apicid rather than

[PATCH 2/3] tools/hvmloader: Replace LAPIC_ID() with cpu_to_apicid[]

2025-01-28 Thread Alejandro Vallejo
using it uninitialised. Note that bringing up the APs doesn't need the APIC in hvmloader becasue it always runs virtualized and uses the PV interface. Signed-off-by: Alejandro Vallejo --- Changes from v7 of the longer topology series: * Removed ASSERT() for the MP tables and merely sk

Re: [for-4.20][PATCH 2/2] xen/arm: Fix build issue when CONFIG_PHYS_ADDR_T_32=y

2025-01-27 Thread Alejandro Vallejo
Hi, On Mon Jan 27, 2025 at 10:45 AM GMT, Michal Orzel wrote: > On Arm32, when CONFIG_PHYS_ADDR_T_32 is set, a build failure is observed: > arch/arm/platforms/vexpress.c: In function 'vexpress_smp_init': > arch/arm/platforms/vexpress.c:102:12: error: format '%lx' expects argument of > type 'long u

Re: [PATCH v3 11/12] x86/fpu: Pass explicit xsave areas to fpu_(f)xrstor()

2025-01-27 Thread Alejandro Vallejo
Hi, On Mon Jan 27, 2025 at 11:05 AM GMT, Jan Beulich wrote: > On 10.01.2025 14:28, Alejandro Vallejo wrote: > > No functional change. > > > > Signed-off-by: Alejandro Vallejo > > Acked-by: Jan Beulich > > > --- > > v2->v3: > > * const-ified

Re: [PATCH v3 10/12] x86/fpu: Pass explicit xsave areas to fpu_(f)xsave()

2025-01-27 Thread Alejandro Vallejo
On Mon Jan 27, 2025 at 11:01 AM GMT, Jan Beulich wrote: > On 10.01.2025 14:28, Alejandro Vallejo wrote: > > No functional change. > > > > Signed-off-by: Alejandro Vallejo > > --- > > v2->v3: > > * const-ified v in fpu_fxsave() (missing in v2) >

Re: [PATCH v3 08/12] x86/emulator: Refactor FXSAVE_AREA to use wrappers

2025-01-27 Thread Alejandro Vallejo
On Mon Jan 27, 2025 at 10:52 AM GMT, Jan Beulich wrote: > On 10.01.2025 14:28, Alejandro Vallejo wrote: > > Adds an UNMAP primitive to make use of vcpu_unmap_xsave_area() when > > linked into xen. unmap is a no-op during tests. > > > > Signed-off-by: Alejandro Vallejo

Re: [PATCH v3 01/12] x86/xstate: Create map/unmap primitives for xsave areas

2025-01-27 Thread Alejandro Vallejo
Hi, On Mon Jan 27, 2025 at 10:44 AM GMT, Jan Beulich wrote: > On 10.01.2025 14:28, Alejandro Vallejo wrote: > > Add infrastructure to simplify ASI handling. With ASI in the picture > > we'll have several different means of accessing the XSAVE area of a > > given vC

Re: [PATCH v3 09/12] x86/mpx: Map/unmap xsave area in in read_bndcfgu()

2025-01-27 Thread Alejandro Vallejo
Hi, Thanks for reviewing this and the other patches. On Mon Jan 27, 2025 at 10:57 AM GMT, Jan Beulich wrote: > On 10.01.2025 14:28, Alejandro Vallejo wrote: > > --- a/xen/arch/x86/xstate.c > > +++ b/xen/arch/x86/xstate.c > > @@ -1024,9 +1024,10 @@ int handle_xsetbv(

Re: [PATCH v2 1/4] x86: provide an inverted Kconfig control for shim-exclusive mode

2025-01-17 Thread Alejandro Vallejo
On Fri Jan 17, 2025 at 10:31 AM GMT, Roger Pau Monné wrote: > On Thu, Jan 16, 2025 at 04:31:46PM -0800, Stefano Stabellini wrote: > > On Wed, 1 Mar 2023, Jan Beulich wrote: > > > While we want certain things turned off in shim-exclusive mode, doing > > > so via "depends on !PV_SHIM_EXCLUSIVE" badly

Re: [PATCH] docs: Punctuation: Add missing commas after linking adverbs as intros

2025-01-16 Thread Alejandro Vallejo
On Thu Jan 16, 2025 at 9:46 AM GMT, Jan Beulich wrote: > On 15.01.2025 19:06, Bernhard Kaindl wrote: > > Fix missing commas after linking adverbs such as currently, fortunately, > > hence, instead, and thus, when used as linking adverbs at the beginning > > of sentences. I saw them with LTeX; other

Re: [PATCH] CI: Add an x86_64 Clang Randconfig job

2025-01-10 Thread Alejandro Vallejo
ebian:12-x86_64 > +RANDCONFIG: y > + > debian-12-x86_64-gcc: >extends: .gcc-x86-64-build >variables: Reviewed-by: Alejandro Vallejo Cheers, Alejandro

Re: [PATCH v2 15/18] x86/mm: introduce a per-vCPU mapcache when using ASI

2025-01-10 Thread Alejandro Vallejo
On Fri Jan 10, 2025 at 3:02 PM GMT, Roger Pau Monné wrote: > On Thu, Jan 09, 2025 at 03:08:15PM +0000, Alejandro Vallejo wrote: > > On Wed Jan 8, 2025 at 2:26 PM GMT, Roger Pau Monne wrote: > > > When using a unique per-vCPU root page table the per-domain region becomes > &g

Re: [PATCH v2 15/18] x86/mm: introduce a per-vCPU mapcache when using ASI

2025-01-10 Thread Alejandro Vallejo
On Fri Jan 10, 2025 at 3:02 PM GMT, Roger Pau Monné wrote: > On Thu, Jan 09, 2025 at 03:08:15PM +0000, Alejandro Vallejo wrote: > > On Wed Jan 8, 2025 at 2:26 PM GMT, Roger Pau Monne wrote: > > > When using a unique per-vCPU root page table the per-domain region becomes > &g

Re: [PATCH v2 04/18] x86/pv: introduce function to populate perdomain area and use it to map Xen GDT

2025-01-10 Thread Alejandro Vallejo
On Fri Jan 10, 2025 at 2:29 PM GMT, Roger Pau Monné wrote: > On Thu, Jan 09, 2025 at 09:55:44AM +0000, Alejandro Vallejo wrote: > > On Wed Jan 8, 2025 at 2:26 PM GMT, Roger Pau Monne wrote: > > > The current code to update the Xen part of the GDT when running a PV guest > >

Re: [PATCH v2 13/18] x86/spec-ctrl: introduce Address Space Isolation command line option

2025-01-10 Thread Alejandro Vallejo
On Fri Jan 10, 2025 at 2:55 PM GMT, Roger Pau Monné wrote: > On Thu, Jan 09, 2025 at 02:58:29PM +0000, Alejandro Vallejo wrote: > > On Wed Jan 8, 2025 at 2:26 PM GMT, Roger Pau Monne wrote: > > > No functional change, as the option is not used. > > > > >

Re: [PATCH v2 07/18] x86/pv: update guest LDT mappings using the linear entries

2025-01-10 Thread Alejandro Vallejo
On Fri Jan 10, 2025 at 2:44 PM GMT, Roger Pau Monné wrote: > On Thu, Jan 09, 2025 at 02:34:05PM +0000, Alejandro Vallejo wrote: > > On Wed Jan 8, 2025 at 2:26 PM GMT, Roger Pau Monne wrote: > > > The pv_map_ldt_shadow_page() and pv_destroy_ldt() functions rely on the L1 > >

[PATCH v3 12/12] x86/xstate: Make xstate_all() and vcpu_xsave_mask() take explicit xstate

2025-01-10 Thread Alejandro Vallejo
No functional change. Signed-off-by: Alejandro Vallejo Acked-by: Jan Beulich --- v2->v3: * Added A-by --- xen/arch/x86/i387.c | 9 + xen/arch/x86/include/asm/xstate.h | 5 +++-- xen/arch/x86/xstate.c | 2 +- 3 files changed, 9 insertions(+), 7 deleti

[PATCH v3 09/12] x86/mpx: Map/unmap xsave area in in read_bndcfgu()

2025-01-10 Thread Alejandro Vallejo
No functional change. Signed-off-by: Alejandro Vallejo --- v2->v3: * No change v1->v2: * s/ret/bndcfgu --- xen/arch/x86/xstate.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c index 3d249518a1b7..2003ba

[PATCH v3 03/12] x86/fpu: Map/umap xsave area in vcpu_{reset,setup}_fpu()

2025-01-10 Thread Alejandro Vallejo
No functional change. Signed-off-by: Alejandro Vallejo Acked-by: Jan Beulich --- v2->v3: * Added A-by v1->v2: * No change --- xen/arch/x86/i387.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c

[PATCH v3 05/12] x86/hvm: Map/unmap xsave area in hvmemul_{get,put}_fpu()

2025-01-10 Thread Alejandro Vallejo
No functional change. Signed-off-by: Alejandro Vallejo Acked-by: Jan Beulich --- v2->v3: * style: Capitalized first letter of the fastpath comment * Added A-by v1->v2: * Added comments highlighting fastpath for current --- xen/arch/x86/hvm/emulate.c | 12 ++-- 1 file chang

[PATCH v3 08/12] x86/emulator: Refactor FXSAVE_AREA to use wrappers

2025-01-10 Thread Alejandro Vallejo
Adds an UNMAP primitive to make use of vcpu_unmap_xsave_area() when linked into xen. unmap is a no-op during tests. Signed-off-by: Alejandro Vallejo --- v2->v3: * Fixed typo in first parameter of UNMAP_FXSAVE_AREA. * Added Parenthesis around "x" in #else's UNMAP_FXSA

[PATCH v3 11/12] x86/fpu: Pass explicit xsave areas to fpu_(f)xrstor()

2025-01-10 Thread Alejandro Vallejo
No functional change. Signed-off-by: Alejandro Vallejo --- v2->v3: * const-ified v in fpu_xrstor() * Removed v in fpu_fxrstor() v1->v2: * const-ified v in xrstor() ( it was incorrectly reported in v2 as it being fpu_xrstor() ) --- xen/arch/x86/i387.c

[PATCH v3 01/12] x86/xstate: Create map/unmap primitives for xsave areas

2025-01-10 Thread Alejandro Vallejo
unmap is required (e.g: when there's no ASI) and remove the transient maping if one was required. Follow-up patches replace all uses of raw v->arch.xsave_area by this mechanism in preparation to add the beforementioned dispatch logic to be added at a later time. Signed-off-by: Alejandro Va

[PATCH v3 10/12] x86/fpu: Pass explicit xsave areas to fpu_(f)xsave()

2025-01-10 Thread Alejandro Vallejo
No functional change. Signed-off-by: Alejandro Vallejo --- v2->v3: * const-ified v in fpu_fxsave() (missing in v2) v1->v2: * const-ified v --- xen/arch/x86/i387.c | 16 ++-- xen/arch/x86/include/asm/xstate.h | 2 +- xen/arch/x86/xstate.c | 3

[PATCH v3 07/12] x86/xstate: Map/unmap xsave area in {compress,expand}_xsave_states()

2025-01-10 Thread Alejandro Vallejo
No functional change. Signed-off-by: Alejandro Vallejo --- v2->v3: * Unmap xsave area also before the early return. v1->v2: * No change --- xen/arch/x86/xstate.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/xstate.c b/xen/ar

[PATCH v3 06/12] x86/domctl: Map/unmap xsave area in arch_get_info_guest()

2025-01-10 Thread Alejandro Vallejo
No functional change. Signed-off-by: Alejandro Vallejo Acked-by: Jan Beulich --- v1->v2: * Added A-by v1->v2: * No change --- xen/arch/x86/domctl.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 5f0111

[PATCH v3 04/12] x86/xstate: Map/unmap xsave area in xstate_set_init() and handle_setbv()

2025-01-10 Thread Alejandro Vallejo
No functional change. Signed-off-by: Alejandro Vallejo Acked-by: Jan Beulich --- v2->v3: * style: Capitalized first letter of the comment. * Added A-by v1->v2: * Added comment highlighting fastpath for current --- xen/arch/x86/xstate.c | 12 ++-- 1 file changed, 10 inse

[PATCH v3 02/12] x86/hvm: Map/unmap xsave area in hvm_save_cpu_ctxt()

2025-01-10 Thread Alejandro Vallejo
No functional change. Signed-off-by: Alejandro Vallejo Acked-by: Jan Beulich --- v2->v3: * Added A-by v1->v2: * No change --- xen/arch/x86/hvm/hvm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c

[PATCH v3 00/12] x86: Address Space Isolation FPU preparations

2025-01-10 Thread Alejandro Vallejo
out of feedback. Explained in each patch. Alejandro Vallejo (12): x86/xstate: Create map/unmap primitives for xsave areas x86/hvm: Map/unmap xsave area in hvm_save_cpu_ctxt() x86/fpu: Map/umap xsave area in vcpu_{reset,setup}_fpu() x86/xstate: Map/unmap xsave area in xstate_set_init() and

Re: [PATCH v2 10/13] x86/mpx: Map/unmap xsave area in in read_bndcfgu()

2025-01-10 Thread Alejandro Vallejo
On Mon Dec 16, 2024 at 2:02 PM GMT, Alejandro Vallejo wrote: > On Mon Dec 16, 2024 at 12:03 PM GMT, Jan Beulich wrote: > > On 16.12.2024 13:00, Alejandro Vallejo wrote: > > > On Mon Dec 9, 2024 at 4:30 PM GMT, Jan Beulich wrote: > > >> On 05.11.2024 15:33, Alejandr

Re: [PATCH v2 15/18] x86/mm: introduce a per-vCPU mapcache when using ASI

2025-01-09 Thread Alejandro Vallejo
On Wed Jan 8, 2025 at 2:26 PM GMT, Roger Pau Monne wrote: > When using a unique per-vCPU root page table the per-domain region becomes > per-vCPU, and hence the mapcache is no longer shared between all vCPUs of a > domain. Introduce per-vCPU mapcache structures, and modify map_domain_page() > to c

Re: [PATCH v2 13/18] x86/spec-ctrl: introduce Address Space Isolation command line option

2025-01-09 Thread Alejandro Vallejo
On Wed Jan 8, 2025 at 2:26 PM GMT, Roger Pau Monne wrote: > No functional change, as the option is not used. > > Introduced new so newly added functionality is keyed on the option being > enabled, even if the feature is non-functional. > > When ASI is enabled for PV domains, printing the usage of X

Re: [PATCH v2 07/18] x86/pv: update guest LDT mappings using the linear entries

2025-01-09 Thread Alejandro Vallejo
On Wed Jan 8, 2025 at 2:26 PM GMT, Roger Pau Monne wrote: > The pv_map_ldt_shadow_page() and pv_destroy_ldt() functions rely on the L1 > table(s) that contain such mappings being stashed in the domain structure, and > thus such mappings being modified by merely updating the require L1 entries. > >

Re: [PATCH v2 09/18] x86/mm: simplify create_perdomain_mapping() interface

2025-01-09 Thread Alejandro Vallejo
On Wed Jan 8, 2025 at 2:26 PM GMT, Roger Pau Monne wrote: > diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h > index 65cd751087dc..0c57442c9593 100644 > --- a/xen/arch/x86/include/asm/mm.h > +++ b/xen/arch/x86/include/asm/mm.h > @@ -601,8 +601,7 @@ int compat_arch_memory_o

Re: [PATCH v2.1 06/18] x86/pv: set/clear guest GDT mappings using {populate,destroy}_perdomain_mapping()

2025-01-09 Thread Alejandro Vallejo
On Wed Jan 8, 2025 at 3:11 PM GMT, Roger Pau Monne wrote: > The pv_{set,destroy}_gdt() functions rely on the L1 table(s) that contain such > mappings being stashed in the domain structure, and thus such mappings being > modified by merely updating the L1 entries. > > Switch both pv_{set,destroy}_gd

Re: [PATCH v2 05/18] x86/mm: switch destroy_perdomain_mapping() parameter from domain to vCPU

2025-01-09 Thread Alejandro Vallejo
On Wed Jan 8, 2025 at 2:26 PM GMT, Roger Pau Monne wrote: > In preparation for the per-domain area being populated with per-vCPU mappings > change the parameter of destroy_perdomain_mapping() to be a vCPU instead of a > domain, and also update the function logic to allow manipulation of per-domain

Re: [PATCH v2 04/18] x86/pv: introduce function to populate perdomain area and use it to map Xen GDT

2025-01-09 Thread Alejandro Vallejo
On Wed Jan 8, 2025 at 2:26 PM GMT, Roger Pau Monne wrote: > The current code to update the Xen part of the GDT when running a PV guest > relies on caching the direct map address of all the L1 tables used to map the > GDT and LDT, so that entries can be modified. > > Introduce a new function that po

Re: [PATCH v2 02/18] x86/domain: limit window where curr_vcpu != current on context switch

2025-01-08 Thread Alejandro Vallejo
This is a net gain even without ASI. Having "current" hold the previous vCPU on __context_switch() makes it _a lot_ easier to follow the lazy switch path. On Wed Jan 8, 2025 at 2:26 PM GMT, Roger Pau Monne wrote: > On x86 Xen will perform lazy context switches to the idle vCPU, where the > previou

Re: [PATCH v2 01/18] x86/mm: purge unneeded destroy_perdomain_mapping()

2025-01-08 Thread Alejandro Vallejo
oy(struct domain *d) > { > pv_l1tf_domain_destroy(d); > > -destroy_perdomain_mapping(d, GDT_LDT_VIRT_START, > - GDT_LDT_MBYTES << (20 - PAGE_SHIFT)); > - > XFREE(d->arch.pv.cpuidmasks); > > FREE_XENHEAP_PAGE(d->arch.pv.gdt_ldt_l1tab); Reviewed-by: Alejandro Vallejo Cheers, Alejandro

Re: [PATCH v5 00/15] Remove the directmap

2025-01-08 Thread Alejandro Vallejo
Hi, Bah, I forgot to remove Wei from the CC list. Sorry, and beware the bounces when replying on patches 2 and 4... Cheers, Alejandro

Re: [PATCH] xen/arm: ffa: fix build with clang

2025-01-08 Thread Alejandro Vallejo
Hi, On Wed Jan 8, 2025 at 3:23 PM GMT, Stewart Hildebrand wrote: > Clang 16 reports: > > In file included from arch/arm/tee/ffa.c:72: > arch/arm/tee/ffa_private.h:329:17: error: 'used' attribute ignored on a > non-definition declaration [-Werror,-Wignored-attributes] > extern uint32_t __ro_after_

[PATCH v5 00/15] Remove the directmap

2025-01-08 Thread Alejandro Vallejo
=== There are some information in an e-mail from Andrew a few years ago: https://lore.kernel.org/xen-devel/e3219697-0759-39fc-2486-715cdec1c...@citrix.com/ Cheers, [1] https://lore.kernel.org/xen-devel/cover.1588278317.git.hongy...@amazon.com/ Alejandro Vallejo (1): xen/arm32: Hardwire zeroet

[PATCH v5 15/15] xen/arm64: Allow the admin to enable/disable the directmap

2025-01-08 Thread Alejandro Vallejo
Signed-off-by: Alejandro Vallejo --- v4->v5: * Fixed typo in comment. s/fdirect/direct/ * Adjusted comment so 's/directmap=no/asi=true' * Adjusted printk() so 's/on/full' and 's/off/on demand' * s/HAS_SECRET_HIDING/HAS_ONDEMAND_DIRECTMAP. Otherwise CONFIG_O

[PATCH v5 09/15] x86/setup: Leave early boot slightly earlier

2025-01-08 Thread Alejandro Vallejo
, we already have enough memory in the heap allocator in the 1st node. Signed-off-by: Hongyan Xia Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Signed-off-by: Alejandro Vallejo --- v4->v5: * No changes. v3->v4: * Fix indentation * Refactor the code to reduce code dupli

[PATCH v5 12/15] xen/arm64: mm: Use per-pCPU page-tables

2025-01-08 Thread Alejandro Vallejo
ified. Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Signed-off-by: Alejandro Vallejo --- v4->v5: * Added missing asm/domain_page.h header to arm32. Compilation fails otherwise. * NOTE: I rebased this patch over the LLC coloring as best as I could and may have mess

[PATCH v5 10/15] xen/page_alloc: vmap heap nodes when they are outside the direct map

2025-01-08 Thread Alejandro Vallejo
allocation. Since we now have early vmap, vmap the metadata locally in the new node. Signed-off-by: Hongyan Xia Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Signed-off-by: Alejandro Vallejo --- v4->v5: * Fix bug introduced in v4 by which node metadata would

[PATCH v5 13/15] xen/arm32: Hardwire zeroeth_table_offset to 0 on ARM_32

2025-01-08 Thread Alejandro Vallejo
Include arm32 in 7c72147baa22("xen/arm: Restrict zeroeth_table_offset for ARM_64"). Otherwise `va` overflows on shift in DECLARE_OFFSETS(). Fixes: 7c72147baa22("xen/arm: Restrict zeroeth_table_offset for ARM_64") Signed-off-by: Alejandro Vallejo --- xen/arch/arm/include/

[PATCH v5 01/15] x86: Create per-domain mapping for guest_root_pt

2025-01-08 Thread Alejandro Vallejo
. Signed-off-by: Hongyan Xia Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Signed-off-by: Alejandro Vallejo --- v4->v5: * bugfix: s/FREE_XENHEAP_PAGE/XFREE/ on destroying root_pt_l1tab. * Add a few extra comments to the declarations for sanity's sake. * Refactor pv_root_

[PATCH v5 02/15] x86/pv: Use copy_domain_page() to manage domheap pages during initrd relocation

2025-01-08 Thread Alejandro Vallejo
From: Wei Liu Replace the manual copying logic with a call to `copy_domain_page()` while relocating intird which map and unmap pages accordingly. Signed-off-by: Wei Liu Signed-off-by: Wei Wang Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Signed-off-by: Alejandro Vallejo

[PATCH v5 05/15] x86: Add a boot option to enable and disable the direct map

2025-01-08 Thread Alejandro Vallejo
-up patches. Signed-off-by: Hongyan Xia Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Signed-off-by: Alejandro Vallejo --- There's a major change compared with v4. directmap= turned into asi= for compatibility with Roger's ASI series. In particular, after everything

[PATCH v5 07/15] x86/domain_page: Remove the fast paths when mfn is not in the directmap

2025-01-08 Thread Alejandro Vallejo
but because DIRECTMAP_VIRT_END is always higher, it does not make any difference. Lastly, domain_page_map_to_mfn() needs to gain to a special case for the PMAP. Signed-off-by: Hongyan Xia Signed-off-by: Julien Grall Signed-off-by: Alejandro Vallejo --- v4->v5: * s/BUILD_BUG_ON/ASSERT/,

[PATCH v5 14/15] xen/arm64: Implement a mapcache for arm64

2025-01-08 Thread Alejandro Vallejo
. This will change in a follow-up patch. Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Signed-off-by: Alejandro Vallejo --- v4->v5: * Add missing "select ARCH_MAP_DOMAIN_PAGE". It was weirdly dropped from v2. * Bugfix: Unwrap mfn_t before passing it to mfn

[PATCH v5 11/15] x86/setup: Do not create valid mappings when directmap=no

2025-01-08 Thread Alejandro Vallejo
ongyan Xia Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Signed-off-by: Alejandro Vallejo --- v4->v5: * No changes. --- xen/arch/x86/setup.c | 73 +++- 1 file changed, 66 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/setup

[PATCH v5 08/15] xen/page_alloc: Add a path for xenheap when there is no direct map

2025-01-08 Thread Alejandro Vallejo
From: Hongyan Xia When there is not an always-mapped direct map, xenheap allocations need to be mapped and unmapped on-demand. Signed-off-by: Hongyan Xia Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Signed-off-by: Alejandro Vallejo --- v4->v5: * Remove stray comma

[PATCH v5 03/15] x86/pv: Rewrite how building PV dom0 handles domheap mappings

2025-01-08 Thread Alejandro Vallejo
From: Hongyan Xia Building a PV dom0 is allocating from the domheap but uses it like the xenheap. Use the pages as they should be. Signed-off-by: Hongyan Xia Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Signed-off-by: Alejandro Vallejo --- v4->v5: * Bugfix: Don&#x

[PATCH v5 06/15] xen/x86: Add support for the PMAP

2025-01-08 Thread Alejandro Vallejo
Signed-off-by: Elias El Yandouzi Signed-off-by: Alejandro Vallejo --- v4->v5: * No changes. v3->v4: * Select PMAP KConfig option iff ONDEMAND_DIRECTMAP is used v2->v3: * No changes. v1->v2: * Declare PMAP entries earlier in fixed_addresses * Reword the commit message

[PATCH v5 04/15] x86: Initialize mapcache for PV, HVM, and idle domains

2025-01-08 Thread Alejandro Vallejo
ff-by: Wei Liu Signed-off-by: Wei Wang Signed-off-by: Hongyan Xia Signed-off-by: Julien Grall Signed-off-by: Elias El Yandouzi Signed-off-by: Alejandro Vallejo --- v4->v5: * Move mapcache initialization and cleanup back to arch-specific code and reword commit message to reflect it. Since

Re: [PATCH V4 01/15] x86: Create per-domain mapping for guest_root_pt

2024-12-16 Thread Alejandro Vallejo
On Mon Nov 11, 2024 at 1:11 PM GMT, Elias El Yandouzi wrote: > From: Hongyan Xia > > This patch introduces a per-domain mapping for the `guest_root_pt` in PV > guests as part of the effort to remove the direct map in Xen. > > For the time being, the `root_pgt` is not mapped or unmapped, as it rema

Re: [PATCH v2 09/13] x86/emulator: Refactor FXSAVE_AREA to use wrappers

2024-12-16 Thread Alejandro Vallejo
On Mon Dec 16, 2024 at 12:01 PM GMT, Jan Beulich wrote: > On 16.12.2024 12:58, Alejandro Vallejo wrote: > > On Mon Dec 9, 2024 at 4:26 PM GMT, Jan Beulich wrote: > >> On 05.11.2024 15:33, Alejandro Vallejo wrote: > >>> --- a/xen/arch/x86/x86_emulate/blk.c > >>

Re: [PATCH v2 10/13] x86/mpx: Map/unmap xsave area in in read_bndcfgu()

2024-12-16 Thread Alejandro Vallejo
On Mon Dec 16, 2024 at 12:03 PM GMT, Jan Beulich wrote: > On 16.12.2024 13:00, Alejandro Vallejo wrote: > > On Mon Dec 9, 2024 at 4:30 PM GMT, Jan Beulich wrote: > >> On 05.11.2024 15:33, Alejandro Vallejo wrote: > >>> --- a/xen/arch/x86/xstate.c > >>> ++

Re: [PATCH v2 10/13] x86/mpx: Map/unmap xsave area in in read_bndcfgu()

2024-12-16 Thread Alejandro Vallejo
On Mon Dec 9, 2024 at 4:30 PM GMT, Jan Beulich wrote: > On 05.11.2024 15:33, Alejandro Vallejo wrote: > > --- a/xen/arch/x86/xstate.c > > +++ b/xen/arch/x86/xstate.c > > @@ -1022,9 +1022,10 @@ int handle_xsetbv(u32 index, u64 new_bv) > > > > uint64_t read_bndcf

Re: [PATCH v2 09/13] x86/emulator: Refactor FXSAVE_AREA to use wrappers

2024-12-16 Thread Alejandro Vallejo
On Mon Dec 9, 2024 at 4:26 PM GMT, Jan Beulich wrote: > On 05.11.2024 15:33, Alejandro Vallejo wrote: > > --- a/xen/arch/x86/x86_emulate/blk.c > > +++ b/xen/arch/x86/x86_emulate/blk.c > > @@ -11,9 +11,12 @@ > > !defined(X86EMUL_NO_SIMD) > > # ifdef __XEN_

Re: [PATCH v2 08/13] x86/xstate: Map/unmap xsave area in {compress,expand}_xsave_states()

2024-12-16 Thread Alejandro Vallejo
On Mon Dec 9, 2024 at 4:20 PM GMT, Jan Beulich wrote: > On 05.11.2024 15:33, Alejandro Vallejo wrote: > > No functional change. > > > > Signed-off-by: Alejandro Vallejo > > --- > > v2: > > * No change > > --- > > xen/arch/x86/xstate.c |

Re: [PATCH v2 05/13] x86/xstate: Map/unmap xsave area in xstate_set_init() and handle_setbv()

2024-12-16 Thread Alejandro Vallejo
On Mon Dec 9, 2024 at 4:16 PM GMT, Jan Beulich wrote: > On 05.11.2024 15:33, Alejandro Vallejo wrote: > > No functional change. > > > > Signed-off-by: Alejandro Vallejo > > Acked-by: Jan Beulich Thanks (for this one and the others). > with ... > > > --

Re: [PATCH v2 02/13] x86/xstate: Create map/unmap primitives for xsave areas

2024-12-16 Thread Alejandro Vallejo
On Mon Dec 9, 2024 at 4:11 PM GMT, Jan Beulich wrote: > On 05.11.2024 15:32, Alejandro Vallejo wrote: > > --- a/xen/arch/x86/include/asm/xstate.h > > +++ b/xen/arch/x86/include/asm/xstate.h > > @@ -143,4 +143,46 @@ static inline bool xstate_all(const struct vcpu *

Re: [PATCH V4 10/15] xen/page_alloc: vmap heap nodes when they are outside the direct map

2024-12-13 Thread Alejandro Vallejo
On Mon Nov 11, 2024 at 1:11 PM GMT, Elias El Yandouzi wrote: > From: Hongyan Xia > > When we do not have a direct map, archs_mfn_in_direct_map() will always > return false, thus init_node_heap() will allocate xenheap pages from an > existing node for the metadata of a new node. This means that the

Re: [PATCH V4 10/15] xen/page_alloc: vmap heap nodes when they are outside the direct map

2024-12-13 Thread Alejandro Vallejo
Hi, I'm seeing crashes on NUMA machines, which can be attributed to a bug below: On Mon Nov 11, 2024 at 1:11 PM GMT, Elias El Yandouzi wrote: > From: Hongyan Xia > > When we do not have a direct map, archs_mfn_in_direct_map() will always > return false, thus init_node_heap() will allocate xenhea

Re: [RFC PATCH] SYSCTL_numainfo.memsize: Switch spanned to present memory

2024-12-12 Thread Alejandro Vallejo
On Mon Dec 9, 2024 at 8:23 AM GMT, Jan Beulich wrote: > On 05.12.2024 11:55, Bernhard Kaindl wrote: > > On 03/12/2024 12:37, Jan Beulich wrote: > >> On 03.12.2024 12:12, Bernhard Kaindl wrote: > >>> This the 2nd part of my submission to fix the NUMA node memsize > >>> retured in xen_sysctl_meminfo[

Re: [PATCH] x86/FPU: make vcpu_reset_fpu() build again with old gcc

2024-12-10 Thread Alejandro Vallejo
On Tue, Dec 10, 2024 at 4:14 PM Jan Beulich wrote: > > On 10.12.2024 16:12, Alejandro Vallejo wrote: > > On Tue Dec 10, 2024 at 2:34 PM GMT, Jan Beulich wrote: > >> On 10.12.2024 15:25, Alejandro Vallejo wrote: > >>> On Mon Dec 9, 2024 at 3:13 PM GMT, Jan Beulich

Re: [PATCH] x86/FPU: make vcpu_reset_fpu() build again with old gcc

2024-12-10 Thread Alejandro Vallejo
On Tue Dec 10, 2024 at 2:34 PM GMT, Jan Beulich wrote: > On 10.12.2024 15:25, Alejandro Vallejo wrote: > > On Mon Dec 9, 2024 at 3:13 PM GMT, Jan Beulich wrote: > >> Fields of anonymous structs/unions may not be part of an initializer for > >> rather old gcc. > &

Re: [PATCH] x86/FPU: make vcpu_reset_fpu() build again with old gcc

2024-12-10 Thread Alejandro Vallejo
On Mon Dec 9, 2024 at 3:13 PM GMT, Jan Beulich wrote: > Fields of anonymous structs/unions may not be part of an initializer for > rather old gcc. Can you add the specific version for tracking purposes? > > Fixes: 49a068471d77 ("x86/fpu: Rework fpu_setup_fpu() uses to split it in > two") > Signe

Re: [PATCH V4 03/15] x86/pv: Rewrite how building PV dom0 handles domheap mappings

2024-12-09 Thread Alejandro Vallejo
Hi, I've been trying to run this series for a while, but it crashes very frequentyly starting from the patch that generalizes the mapcache. I think I've tracked it down to this patch. On Mon Nov 11, 2024 at 1:11 PM GMT, Elias El Yandouzi wrote: > From: Hongyan Xia > > Building a PV dom0 is alloc

Re: [RFC PATCH 12/25] xen: Replace sysctl/readconsole with autogenerated version

2024-11-26 Thread Alejandro Vallejo
On Tue Nov 26, 2024 at 1:20 PM GMT, Jan Beulich wrote: > On 26.11.2024 13:27, Alejandro Vallejo wrote: > > On Tue Nov 26, 2024 at 9:40 AM GMT, Jan Beulich wrote: > >> On 25.11.2024 19:51, Alejandro Vallejo wrote: > >>> On Mon Nov 25, 2024 at 12:05 PM GMT, Jan Beulich

Re: [RFC PATCH 12/25] xen: Replace sysctl/readconsole with autogenerated version

2024-11-26 Thread Alejandro Vallejo
On Tue Nov 26, 2024 at 9:40 AM GMT, Jan Beulich wrote: > On 25.11.2024 19:51, Alejandro Vallejo wrote: > > On Mon Nov 25, 2024 at 12:05 PM GMT, Jan Beulich wrote: > >> On 15.11.2024 12:51, Alejandro Vallejo wrote: > >>> Describe sysctl/readconsole as a TOML specif

Re: [RFC PATCH 16/25] xen/x86: Replace hand-crafted xen_arch_domainconfig with autogenerated one

2024-11-25 Thread Alejandro Vallejo
On Mon Nov 25, 2024 at 12:09 PM GMT, Jan Beulich wrote: > On 15.11.2024 12:51, Alejandro Vallejo wrote: > > Signed-off-by: Alejandro Vallejo > > --- > > tools/libs/light/libxl_x86.c | 4 +- > > tools/ocaml/libs/xc/xenctrl_stubs.c | 4

Re: [RFC PATCH 12/25] xen: Replace sysctl/readconsole with autogenerated version

2024-11-25 Thread Alejandro Vallejo
Hi Jan, Thanks for having a look. On Mon Nov 25, 2024 at 12:05 PM GMT, Jan Beulich wrote: > On 15.11.2024 12:51, Alejandro Vallejo wrote: > > Describe sysctl/readconsole as a TOML specification, remove old > > hand-coded version and replace it with autogenerated file. >

Re: [RFC PATCH 08/25] tools/xenbindgen: Add support for enums in TOML specs

2024-11-25 Thread Alejandro Vallejo
On Mon Nov 25, 2024 at 4:39 PM GMT, Teddy Astie wrote: > Hello, > > > + > > /// A language-agnostic specification. > > #[derive(Debug, serde::Deserialize)] > > struct InFileDef { > > /// List of structs described in this input specification. > > structs: Option>, > > +/// List

Re: [RFC PATCH 07/25] tools/xenbindgen: Add support for structs in TOML specs

2024-11-25 Thread Alejandro Vallejo
On Mon Nov 25, 2024 at 3:03 PM GMT, Teddy Astie wrote: > Hi, > > > +/// An IDL type. A type may be a primitive integer, a pointer to an IDL > > type, > > +/// an array of IDL types or a struct composed of IDL types. Every integer > > must > > +/// be aligned to its size. > > +/// > > +/// FIXME:

Re: [RFC PATCH 07/25] tools/xenbindgen: Add support for structs in TOML specs

2024-11-25 Thread Alejandro Vallejo
On Mon Nov 25, 2024 at 12:39 PM GMT, Teddy Astie wrote: > Hi Alejandro, > > Le 15/11/2024 à 12:51, Alejandro Vallejo a écrit : > > Signed-off-by: Alejandro Vallejo > > --- > > tools/rust/xenbindgen/src/c_lang.rs | 56 - > > tools/r

Re: [RFC PATCH 04/25] tools/xenbindgen: Add a TOML spec reader

2024-11-25 Thread Alejandro Vallejo
On Mon Nov 25, 2024 at 3:13 PM GMT, Teddy Astie wrote: > Hi, > > > +let _specification = match spec::Spec::new(&cli.indir) { > > +Ok(x) => x, > > +Err(spec::Error::Toml(x)) => { > > +error!("TOML parsing error:"); > > +error!("{x:#?}"); > > +s

Re: [RFC PATCH 00/25] Introduce xenbindgen to autogen hypercall structs

2024-11-22 Thread Alejandro Vallejo
On Fri Nov 22, 2024 at 10:52 AM GMT, Teddy Astie wrote: > Le 21/11/2024 à 18:46, Anthony PERARD a écrit : > > Instead of creating your own IDL specification, did you look for > > existing project that would do just that? That is been able to describe > > the existing ABI in IDL and use an existing

Re: [RFC PATCH 00/25] Introduce xenbindgen to autogen hypercall structs

2024-11-22 Thread Alejandro Vallejo
On Thu Nov 21, 2024 at 5:47 PM GMT, Anthony PERARD wrote: Hi, > Hi Alejandro, > > Nice work :-). Cheers! And thanks for having a look. > > On Fri, Nov 15, 2024 at 11:51:29AM +0000, Alejandro Vallejo wrote: > > This series is the result of my "Interfacing Rust with Xe

Re: [PATCH V4 07/15] x86/domain_page: Remove the fast paths when mfn is not in the directmap

2024-11-18 Thread Alejandro Vallejo
I'm still headscratching about various things, but the build errors are on release builds without pmap enabled. I'm highlighted them here. On Mon Nov 11, 2024 at 1:11 PM GMT, Elias El Yandouzi wrote: > From: Hongyan Xia > > When mfn is not in direct map, never use mfn_to_virt for any mappings. >

[RFC PATCH 24/25] tools/rust: Add deny.toml

2024-11-15 Thread Alejandro Vallejo
deny.toml allows auditing transitive dependencies and allowed licences. In particular it allows the use of cargo-deny for all Rust project. Signed-off-by: Alejandro Vallejo --- tools/rust/deny.toml | 236 +++ 1 file changed, 236 insertions(+) create mode

  1   2   3   4   5   6   7   >