[PATCH 1/2] xen/version: Fold print_build_id() into print_version()

2025-07-31 Thread Andrew Cooper
Both callsites call them as a pair, and the buildid really is as much a part of the version as the changeset. This involves rearranging console_init_preirq() to ensure xen_build_init() is ahead of print_version(). No functional change. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC

[PATCH 2/2] xen/version: Remove xen_build_id() and export the variable instead

2025-07-31 Thread Andrew Cooper
: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Ross Lagerwall Both the code diffstat, and the binary on x86 speaks for themselves: add/remove: 1/2 grow/shrink: 0/6 up/down: 4/-348 (-344) Function

[PATCH 0/2] xen/version: Improvements to buildid handling

2025-07-31 Thread Andrew Cooper
Mostly for patch 2. Andrew Cooper (2): xen/version: Fold print_build_id() into print_version() xen/version: Remove xen_build_id() and export the variable instead xen/common/kernel.c| 14 -- xen/common/keyhandler.c| 1 - xen/common/livepatch.c | 23

Re: [PATCH] x86/vmx: Avoid pausing on HVM_PARAM_IDENT_PT in additional cases

2025-07-30 Thread Andrew Cooper
On 30/07/2025 5:40 pm, Teddy Astie wrote: > When settings HVM_PARAM_IDENT_PT, skip domain pausing when : > - there is no vcpu > - unrestricted guest capability is used > > Signed-off-by: Teddy Astie > --- > xen/arch/x86/hvm/hvm.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff

Re: [PATCH] automation/eclair: deviate intentionally unreachable code

2025-07-30 Thread Andrew Cooper
On 30/07/2025 3:06 pm, Dmytro Prokopchuk1 wrote: > diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst > index e78179fcb8..fba75be2ee 100644 > --- a/docs/misra/deviations.rst > +++ b/docs/misra/deviations.rst > @@ -86,6 +86,14 @@ Deviations related to MISRA C:2012 Rules: > ge

Re: [PATCH] CI: list failed tests at the end of tools job

2025-07-30 Thread Andrew Cooper
and repeate the failed tests list and the > end. > > Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Andrew Cooper

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

2025-07-30 Thread Andrew Cooper
On 28/07/2025 6:03 am, Jiqian Chen wrote: > vpci_remove_register() only supports removing a register in a time, > but the follow-on changes need to remove all registers within a range. > So, refactor it to support removing all registers in a given region. > > And it is no issue to remove a non exis

Re: [PATCH v9 4/8] vpci: Hide extended capability when it fails to initialize

2025-07-30 Thread Andrew Cooper
On 30/07/2025 10:50 am, Jan Beulich wrote: > On 28.07.2025 07:03, Jiqian Chen wrote: >> +static int vpci_ext_capability_hide( >> +const struct pci_dev *pdev, unsigned int cap) >> +{ >> +const unsigned int offset = pci_find_ext_capability(pdev->sbdf, cap); >> +struct vpci_register *r, *p

Re: [PATCH] lib: drop size parameter from sort()'s swap callback

2025-07-30 Thread Andrew Cooper
On 29/07/2025 3:44 pm, Jan Beulich wrote: > On 29.07.2025 16:29, Andrew Cooper wrote: >> On 29/07/2025 3:26 pm, Jan Beulich wrote: >>> This was needed only for generic_swap(), which disappeared in >>> 8cb0341a61fa ("xen/sort: Switch to an extern inline implementati

[PATCH] xen/irq: Delete the pirq_cleanup_check() macro

2025-07-29 Thread Andrew Cooper
ing this shows one path now needing braces, and one path in evtchn_bind_pirq() where the expanded form simplies back to no delta, as it follows an unconditional clear of info->evtchn. No functional change; The compiled hypervisors are the same. Signed-off-by: Andrew Cooper --- CC: Anthony PERA

Re: [RFC PATCH 3/3] misra: address rule 5.5 bitops

2025-07-29 Thread Andrew Cooper
On 29/07/2025 10:24 pm, Dmytro Prokopchuk1 wrote: > Signed-off-by: Dmytro Prokopchuk > --- > xen/arch/arm/dm.c | 2 +- > xen/arch/arm/domctl.c | 2 +- > xen/arch/arm/gic-vgic.c| 26 +++--- > xen/arch/arm/gic.c

Re: [RFC PATCH 2/3] misra: address rule 5.5 gnttab

2025-07-29 Thread Andrew Cooper
On 29/07/2025 10:24 pm, Dmytro Prokopchuk1 wrote: > Signed-off-by: Dmytro Prokopchuk > --- > xen/common/grant_table.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c > index cf131c43a1..9b8f0d87d3 100644 > ---

Re: [RFC PATCH 1/3] misra: address 5.5 pirq_cleanup_check

2025-07-29 Thread Andrew Cooper
On 29/07/2025 10:24 pm, Dmytro Prokopchuk1 wrote: > diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c > index c8c1bfa615..2efb5f5c78 100644 > --- a/xen/common/event_channel.c > +++ b/xen/common/event_channel.c > @@ -672,7 +672,7 @@ static int evtchn_bind_pirq(evtchn_bind_pirq_t *

Re: [PATCH] xen: fix memory leak on error in vcpu_create

2025-07-29 Thread Andrew Cooper
On 29/07/2025 10:08 pm, Stewart Hildebrand wrote: > On 7/29/25 04:32, Jan Beulich wrote: >> On 28.07.2025 22:09, Andrew Cooper wrote: >>> On 28/07/2025 8:52 pm, Stewart Hildebrand wrote: >>>> In vcpu_create after scheduler data is allocated, if >>>> vmtra

Re: [PATCH] xen/efi: Reduce variable scope to void compiler warning

2025-07-29 Thread Andrew Cooper
On 21/07/2025 9:37 am, Frediano Ziglio wrote: > This change removes some pieve of code working around with > some compiler warnings. > No functional change. > > Signed-off-by: Frediano Ziglio "Piece", although peeve would almost work in context.  Can be fixed on commit. ~Andrew

Re: [PATCH v2 1/9] xenstored: use fread() instead of mmap() for reading live update state

2025-07-29 Thread Andrew Cooper
On 29/07/2025 8:21 pm, Andrew Cooper wrote: > On 29/07/2025 12:01 pm, Juergen Gross wrote: >> diff --git a/tools/xenstored/lu.c b/tools/xenstored/lu.c >> index 77e0d377c5..f2c8b92d07 100644 >> --- a/tools/xenstored/lu.c >> +++ b/tools/xenstored/lu.c >> @@ -

Re: [PATCH v2 1/9] xenstored: use fread() instead of mmap() for reading live update state

2025-07-29 Thread Andrew Cooper
On 29/07/2025 12:01 pm, Juergen Gross wrote: > diff --git a/tools/xenstored/lu.c b/tools/xenstored/lu.c > index 77e0d377c5..f2c8b92d07 100644 > --- a/tools/xenstored/lu.c > +++ b/tools/xenstored/lu.c > @@ -27,9 +27,11 @@ struct live_update *lu_status; > > struct lu_dump_state { > void *buf

Re: [PATCH v3 4/8] pdx: allow per-arch optimization of PDX conversion helpers

2025-07-29 Thread Andrew Cooper
On 24/07/2025 12:04 pm, Roger Pau Monne wrote: > diff --git a/xen/arch/arm/include/asm/Makefile > b/xen/arch/arm/include/asm/Makefile > index 4565baca6a4d..cec13c889dab 100644 > --- a/xen/arch/arm/include/asm/Makefile > +++ b/xen/arch/arm/include/asm/Makefile > @@ -5,6 +5,7 @@ generic-y += hardirq

Re: [PATCH] lib: drop size parameter from sort()'s swap callback

2025-07-29 Thread Andrew Cooper
On 29/07/2025 3:26 pm, Jan Beulich wrote: > This was needed only for generic_swap(), which disappeared in > 8cb0341a61fa ("xen/sort: Switch to an extern inline implementation"). > > Signed-off-by: Jan Beulich Oh, nice. Acked-by: Andrew Cooper I'd expect there to be

Re: [PATCH v1 2/2] drivers/ns16550: remove use of run_in_exception_handler()

2025-07-29 Thread Andrew Cooper
ndler(). > > The ground work for run_in_exception_handler() removal was done under XSA-453: > https://xenbits.xen.org/xsa/advisory-453.html > > Suggested-by: Andrew Cooper > Signed-off-by: Denis Mukhin I wanted to do a before/after comparison, but interestingly I can't even

Re: [PATCH] tools/xl: don't crash on NULL command line

2025-07-28 Thread Andrew Cooper
On 29/07/2025 1:29 am, Jason Andryuk wrote: > On 2025-07-28 06:45, Andrew Cooper wrote: >> On 28/07/2025 11:24 am, Marek Marczykowski-Górecki wrote: >>> When running xl in a domU, it doesn't have access to the Xen command >>> line. Before the non-truncating xc_xen

Re: [PATCH] xen: fix memory leak on error in vcpu_create

2025-07-28 Thread Andrew Cooper
On 28/07/2025 9:09 pm, Andrew Cooper wrote: > On 28/07/2025 8:52 pm, Stewart Hildebrand wrote: >> In vcpu_create after scheduler data is allocated, if >> vmtrace_alloc_buffer fails, it will jump to the wrong cleanup label >> resulting in a memory leak. Correct the label. >

Re: [PATCH] xen: fix memory leak on error in vcpu_create

2025-07-28 Thread Andrew Cooper
On 28/07/2025 8:52 pm, Stewart Hildebrand wrote: > In vcpu_create after scheduler data is allocated, if > vmtrace_alloc_buffer fails, it will jump to the wrong cleanup label > resulting in a memory leak. Correct the label. > > Fixes: 217dd79ee292 ("xen/domain: Add vmtrace_size domain creation param

[PATCH 1/3] tools/flask: Strip trailing whitespace

2025-07-28 Thread Andrew Cooper
No functional change. Signed-off-by: Andrew Cooper --- CC: Daniel P. Smith --- tools/flask/policy/modules/modules.conf | 2 +- tools/flask/policy/modules/vm_role.cons | 4 ++-- tools/flask/policy/policy/mls | 2 +- tools/flask/policy/policy/support

[PATCH 3/3] tools/flask: Reformat allow declarations

2025-07-28 Thread Andrew Cooper
Having multiple values wrapped onto as few lines as practical is good for space efficiency, but causes complex collisions for hypercall backports and local policy changes. Reformat to use one value per line. No functional change, only whitespace changes. Signed-off-by: Andrew Cooper --- CC

[PATCH 2/3] tools/flask: Use tabs uniformly

2025-07-28 Thread Andrew Cooper
Most indentation is with tabs, but a few spaces have slipped in. Switch them back to tabs. No functional change. Signed-off-by: Andrew Cooper --- CC: Daniel P. Smith --- tools/flask/policy/modules/xen.if | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions

[PATCH 0/3] tools/flask: Whitespace changes

2025-07-28 Thread Andrew Cooper
Patch 3 intends to make it easier to maintain local changes to the flask policy in a patchqueue. The prior patches are trivial cleanup. No functional change. Only whitespace changes. Andrew Cooper (3): tools/flask: Strip trailing whitespace tools/flask: Use tabs uniformly tools/flask

[PATCH] x86/ucode: Update vendor/family/model logic

2025-07-28 Thread Andrew Cooper
Switch to the new fields. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/cpu/microcode/amd.c | 10 +- xen/arch/x86/cpu/microcode/core.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86

Re: [PATCH v2] misra: add deviations of MISRA C Rule 5.5

2025-07-28 Thread Andrew Cooper
On 28/07/2025 11:38 am, Nicola Vetrini wrote: > On 2025-07-28 11:36, Jan Beulich wrote: >> On 25.07.2025 18:24, Dmytro Prokopchuk1 wrote: >>> --- a/docs/misra/deviations.rst >>> +++ b/docs/misra/deviations.rst >>> @@ -142,6 +142,31 @@ Deviations related to MISRA C:2012 Rules: >>>     memmove. >

Re: [PATCH] misra: deviate explicit cast for Rule 11.1

2025-07-28 Thread Andrew Cooper
On 28/07/2025 10:56 am, Jan Beulich wrote: > On 27.07.2025 22:27, Dmytro Prokopchuk1 wrote: >> Explicitly cast 'halt_this_cpu' when passing it >> to 'smp_call_function' to match the required >> function pointer type '(void (*)(void *info))'. >> >> Document and justify a MISRA C R11.1 deviation >> (

Re: [PATCH] tools/xl: don't crash on NULL command line

2025-07-28 Thread Andrew Cooper
On 28/07/2025 11:24 am, Marek Marczykowski-Górecki wrote: > When running xl in a domU, it doesn't have access to the Xen command > line. Before the non-truncating xc_xenver_cmdline(), it was always set > with strdup, possibly of an empty string. Now it's NULL. Treat it the > same as empty cmdline,

Re: [RFC PATCH v1 04/10] vpmu.c: factor out register conversion

2025-07-28 Thread Andrew Cooper
On 25/07/2025 4:06 pm, Edwin Török wrote: > diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c > index 7be79c2d00..713311a1ac 100644 > --- a/xen/arch/x86/cpu/vpmu.c > +++ b/xen/arch/x86/cpu/vpmu.c > @@ -160,6 +160,31 @@ static inline struct vcpu *choose_hwdom_vcpu(void) > return ha

Re: [RFC PATCH v1 01/10] pmu.h: add a BUILD_BUG_ON to ensure it fits within one page

2025-07-28 Thread Andrew Cooper
On 25/07/2025 4:06 pm, Edwin Török wrote: > Linux already has a similar BUILD_BUG_ON. > Currently this struct is ~224 bytes on x86-64. > > No functional change. > > Signed-off-by: Edwin Török > --- > xen/arch/x86/cpu/vpmu.c | 1 + > xen/include/public/pmu.h | 3 +++ > 2 files changed, 4 insertio

[PATCH 3/4] xen/cache-col: Fix initialisation of domain colouring information

2025-07-24 Thread Andrew Cooper
, but that's easy enough to keep working as before. Fixes: 6cdea3444eaf ("xen/arm: add Dom0 cache coloring support") Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Carlo Nonat

[PATCH 1/4] xen/cache-col: Remove bogus cast in domain_llc_coloring_free()

2025-07-24 Thread Andrew Cooper
the bogus const on it, and remove the cast when freeing it. No functional change. Fixes: 6985aa5e0c3c ("xen: extend domctl interface for cache coloring") Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Ste

[PATCH 4/4] tools/libxl: Remove unconditional XEN_DOMCTL_set_llc_colors hypercall

2025-07-24 Thread Andrew Cooper
the logic to avoid the hypercall in the general case, leaving a comment explaining why it is performed so early. Fixes: 748bd725fbec ("tools: add support for cache coloring configuration") Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien

[PATCH 2/4] xen/cache-col: Fix freeing of colouring information

2025-07-24 Thread Andrew Cooper
: 6985aa5e0c3c ("xen: extend domctl interface for cache coloring") Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Carlo Nonato CC: Marco Solieri Cache colouring is experimental

[PATCH 0/4] xen/cache-col: Multiple fixes

2025-07-24 Thread Andrew Cooper
Found because XEN_DOMCTL_set_llc_colors failed in XenServer's HostUEFI Secure Boot environment (which has additional checks on hypercalls). Everything else came from trying to fix that. https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/1946483850 Andrew Cooper (4): xen/cach

Re: [PATCH] x86/domain: Dump domain paging pool sizes with the rest of the pageframe info

2025-07-24 Thread Andrew Cooper
s each of these are unsigned quantities.  This can be fixed on commit. Otherwise, Reviewed-by: Andrew Cooper > + > nrspin_unlock(&d->page_alloc_lock); > } > > -- > 2.47.1

Re: [XEN PATCH] CI: Add and use ccache in build-each-commit job

2025-07-24 Thread Andrew Cooper
ject/people/anthonyper/xen/-/jobs/10785719529 > > I haven't updated the container yet. Very nice. Reviewed-by: Andrew Cooper That's rather more simple to integrate than I was expecting. ~Andrew

Re: [PATCH] xen/x86: fix xen.efi boot crash from some bootloaders

2025-07-23 Thread Andrew Cooper
On 23/07/2025 3:21 pm, Jan Beulich wrote: > On 23.07.2025 16:13, Andrew Cooper wrote: >> On 23/07/2025 2:56 pm, Yann Sionneau wrote: >>> xen.efi PE does not boot when loaded from shim or some patched >>> downstream grub2. >>> >>> What happens is th

Re: [PATCH] xen/x86: fix xen.efi boot crash from some bootloaders

2025-07-23 Thread Andrew Cooper
On 23/07/2025 2:56 pm, Yann Sionneau wrote: > xen.efi PE does not boot when loaded from shim or some patched > downstream grub2. > > What happens is the bootloader would honour the MEM_DISCARDABLE > flag of the .reloc section meaning it would not load its content > into memory. > > But Xen is parsi

Re: PCI passthrough of XHCI on Framework AMD crashes the host

2025-07-23 Thread Andrew Cooper
On 23/07/2025 1:35 pm, Marek Marczykowski-Górecki wrote: > Hi, > > There is yet another issue affecting Framework AMD... When I start a > domU with XHCI controller attached (PCI passthrough), the whole host > resets if there was an USB device plugged into it. I don't get any panic > message (neithe

Re: [PATCH] x86/pmstat: drop struct px_stat's usable field

2025-07-23 Thread Andrew Cooper
eld. In turn the struct pointer there can then be > constified. > > Signed-off-by: Jan Beulich Acked-by: Andrew Cooper

Re: [PATCH v2] x86/hvm: Replace do_sched_op calls with their underlying logic

2025-07-23 Thread Andrew Cooper
On 23/07/2025 12:57 pm, Teddy Astie wrote: > Le 23/07/2025 à 13:16, Andrew Cooper a écrit : >> On 23/07/2025 10:05 am, Teddy Astie wrote: >>> do_sched_op(SCHEDOP_yield) just calls vcpu_yield(). Remove the indirection >>> through the hypercall handler and use the functio

Re: [PATCH] x86/svm: Always flush TLB using TLB_CTRL_FLUSH_ALL

2025-07-23 Thread Andrew Cooper
an Beulich > --- > This patch has been sent first at the security mailing list > (secur...@xenproject.org) > which asked me to publish it publicly due to it being actually safe in > practice. Having talked to AMD, we believe the algorithm Xen uses (and has done since it's introduction) happens to be safe for microarchitectural reasons. Reviewed-by: Andrew Cooper ~Andrew

Re: [PATCH v3 1/2] xen: Add capabilities to get_domain_state

2025-07-23 Thread Andrew Cooper
On 23/07/2025 8:29 am, Jürgen Groß wrote: > On 23.07.25 09:04, Jan Beulich wrote: >> On 23.07.2025 08:55, Jürgen Groß wrote: >>> On 23.07.25 08:43, Jan Beulich wrote: On 23.07.2025 08:34, Jürgen Groß wrote: > On 23.07.25 08:28, Jan Beulich wrote: >> On 22.07.2025 02:19, Jason Andryuk w

Re: [PATCH v2] x86/hvm: Replace do_sched_op calls with their underlying logic

2025-07-23 Thread Andrew Cooper
Teddy Astie > --- > v2: > - For SCHEDOP_block case: export and use vcpu_block_enable_events instead You need to adjust the commit message for this change, now that you're exporting vcpu_block_enable_events(). With that adjusted, Reviewed-by: Andrew Cooper If there are no othe

Re: [XEN][PATCH 2/8] xen/arm: move vcpu_switch_to_aarch64_mode() in arch_vcpu_create()

2025-07-23 Thread Andrew Cooper
On 23/07/2025 11:19 am, Grygorii Strashko wrote: > > > On 23.07.25 12:16, Julien Grall wrote: >> Hi, >> >> On 23/07/2025 08:58, Grygorii Strashko wrote: >>> From: Grygorii Strashko >>> >>> Move vcpu_switch_to_aarch64_mode() in arch_vcpu_create() callback >>> instead >>> of calling it manually from

Re: [XEN][PATCH 6/8] xen/arm64: constify is_32/64bit_domain() macro for CONFIG_ARM64_AARCH32=n

2025-07-23 Thread Andrew Cooper
On 23/07/2025 8:58 am, Grygorii Strashko wrote: > diff --git a/xen/arch/arm/include/asm/arm64/domain.h > b/xen/arch/arm/include/asm/arm64/domain.h > index 18402ae3ca0d..a014ab9967ac 100644 > --- a/xen/arch/arm/include/asm/arm64/domain.h > +++ b/xen/arch/arm/include/asm/arm64/domain.h > @@ -12,14 +

Re: [XEN][PATCH 4/8] xen/arm: split is_32bit/64bit_domain() between arm64/arm32

2025-07-23 Thread Andrew Cooper
On 23/07/2025 8:58 am, Grygorii Strashko wrote: > diff --git a/xen/arch/arm/include/asm/arm32/domain.h > b/xen/arch/arm/include/asm/arm32/domain.h > index 4d1251e9c128..c0a7fc35f38b 100644 > --- a/xen/arch/arm/include/asm/arm32/domain.h > +++ b/xen/arch/arm/include/asm/arm32/domain.h > @@ -3,6 +3,

Re: [PATCH] x86/hvm: Replace do_sched_op calls with their underlying logic

2025-07-23 Thread Andrew Cooper
On 22/07/2025 1:05 pm, Jason Andryuk wrote: > On 2025-07-22 14:07, Teddy Astie wrote: >> do_sched_op(SCHEDOP_yield) just calls vcpu_yield(). Remove the >> indirection >> through the hypercall handler and use the function directly. >> >> Perform the same for SCHEDOP_block. >> >> Not a functional cha

[PATCH] x86/pv: Rework TRY_LOAD_SEG() to use asm goto()

2025-07-18 Thread Andrew Cooper
This moves the exception path to being out-of-line within the function, rather than in the .fixup section, which improves backtraces. Because the macro is used multiple times, the fault label needs declaring as local. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC

[PATCH 1/4] x86/mwait-idle: Update vendor/family/model logic

2025-07-18 Thread Andrew Cooper
igned-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/cpu/mwait-idle.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c index e837cbf50eb3..f47fdfb

[PATCH 4/4] x86/intel-family: Resync with Linux

2025-07-18 Thread Andrew Cooper
This snapshot is Linux commit db4001f9cc32 ("x86/cpu/vfm: Delete all the *_FAM6_ CPU #defines"), now that Xen has switched off the old constant names. Leave a comment identifying the exact revision Xen is using. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich

[PATCH 3/4] x86/spec-ctrl: Update vendor/family/model logic

2025-07-18 Thread Andrew Cooper
Switch to the new fields and constants. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné I've intentionally not converted the tables with raw numbers yet. That's not a mechanical change, and requires more care. --- xen/arch/x86/spec_ct

[PATCH 2/4] x86/cpu-policy: Update vendor/family/model logic

2025-07-18 Thread Andrew Cooper
Switch to the new fields and constants. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné This updates one related part in intel.c for ease of ordering subseuqent work. --- xen/arch/x86/cpu-policy.c | 19 --- xen/arch/x86/cpu/intel.c

[PATCH 0/4] x86: Convert remaining INTEL_FAM6_* users

2025-07-18 Thread Andrew Cooper
This is a mechanical change to use the VFM constants rather than the family-specific ones. https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/1934721940 Andrew Cooper (4): x86/mwait-idle: Update vendor/family/model logic x86/cpu-policy: Update vendor/family/model logic x86

Re: [PATCH] x86: Don't allow HVM alongside PV_SHIM_EXCLUSIVE

2025-07-18 Thread Andrew Cooper
On 18/07/2025 4:12 pm, Alejandro Vallejo wrote: > Otherwise compile-time errors ensue. It's a nonsensical configuration, > but it's supriously triggered in randconfig jobs. > > Fixes: 8b5b49ceb3d9("x86: don't include domctl and alike in shim-excl...") > Signed-off-by: Alejandro Vallejo > --- > xe

[PATCH v2 0/3] x86: Convert x86_cpu_id to VFM

2025-07-18 Thread Andrew Cooper
This is the next part of the VFM converstion, focusing on struct x86_cpu_id. Some parts are already committed. See patches for details vs v1. https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/1934588566 Andrew Cooper (3): x86/match-cpu: Improvements to x86_match_cpu() x86

[PATCH v2 1/3] x86/match-cpu: Improvements to x86_match_cpu()

2025-07-18 Thread Andrew Cooper
ical change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné v2: * New There is a marginal code generation improvement, because of not needing to hold as many registers live over the loop termination check. --- xen/arch/x86/cpu/common.c | 35 +--

[PATCH v2 3/3] x86/apic: Convert the TSC deadline errata table to X86_MATCH_*()

2025-07-18 Thread Andrew Cooper
change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné v2: * Move deadline_match[] into check_deadline_errata() which produces a far more legible diff. * Check for TSC_DEADLINE early and skip the search on non-capable CPUs. The bloat-o-meter summary shows that the use

[PATCH v2 2/3] x86/match-cpu: Support matching on steppings

2025-07-18 Thread Andrew Cooper
. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné v2: * Rebase over adjustments to x86_match_cpu(). * Switch name to X86_STEPPING_ANY, and use 0x to remove a conditional from x86_match_cpu(). Combined with the previous patch, the code gener

Re: [PATCH v1.1 6/6] x86/apic: Convert the TSC deadline errata table to X86_MATCH_*()

2025-07-18 Thread Andrew Cooper
On 18/07/2025 3:06 pm, Jan Beulich wrote: > On 18.07.2025 12:55, Andrew Cooper wrote: >> On 18/07/2025 11:23 am, Andrew Cooper wrote: >>> On 18/07/2025 11:19 am, Jan Beulich wrote: >>>> On 18.07.2025 12:07, Andrew Cooper wrote: >>>>> With the a

Re: [PATCH 5/6] x86/match-cpu: Support matching on steppings

2025-07-18 Thread Andrew Cooper
On 18/07/2025 2:28 pm, Jan Beulich wrote: >> uint16_t model; > Whereas the model is strictly limited to 8 bits. There is space in here, if we need it, but you can't shrink it without breaking the check for the NULL entry (going back to the first obfuscation). >>> Breaki

Re: [PATCH v2] xen/efi: Remove PrintMessage function

2025-07-18 Thread Andrew Cooper
o make the code more coherent. > > Signed-off-by: Frediano Ziglio > --- > Changes since v1: > - reuse PrintStr instead of reusing PrintMessage. > --- FWIW, Reviewed-by: Andrew Cooper

Re: [PATCH] xen/efi: Reuse PrintMessage function

2025-07-18 Thread Andrew Cooper
On 18/07/2025 1:00 pm, Frediano Ziglio wrote: > On Fri, Jul 18, 2025 at 12:12 PM Andrew Cooper > wrote: >> On 18/07/2025 10:41 am, Frediano Ziglio wrote: >>> PrintMessage function print a message string followed by a >>> new line. >>> Move the functio

Re: [PATCH] xen/efi: Reuse PrintMessage function

2025-07-18 Thread Andrew Cooper
On 18/07/2025 10:41 am, Frediano Ziglio wrote: > PrintMessage function print a message string followed by a > new line. > Move the function from ARM specific code to common code. > Reuse it in EFI code. > No functional changes. > > Signed-off-by: Frediano Ziglio Please no. Hiding \n (or \r\n) in

Re: [PATCH v1.1 6/6] x86/apic: Convert the TSC deadline errata table to X86_MATCH_*()

2025-07-18 Thread Andrew Cooper
On 18/07/2025 11:23 am, Andrew Cooper wrote: > On 18/07/2025 11:19 am, Jan Beulich wrote: >> On 18.07.2025 12:07, Andrew Cooper wrote: >>> With the ability to match on steppings, introduce a new X86_MATCH_VFMS() >>> helper to match a specific stepping, and use

Re: [PATCH 5/6] x86/match-cpu: Support matching on steppings

2025-07-18 Thread Andrew Cooper
On 18/07/2025 6:53 am, Jan Beulich wrote: > On 17.07.2025 21:39, Andrew Cooper wrote: >> On 17/07/2025 9:11 am, Jan Beulich wrote: >>> On 16.07.2025 19:31, Andrew Cooper wrote: >>>> --- a/xen/arch/x86/cpu/common.c >>>> +++ b/xen/arch/x86/cpu/common.c

Re: [PATCH v1.1 6/6] x86/apic: Convert the TSC deadline errata table to X86_MATCH_*()

2025-07-18 Thread Andrew Cooper
On 18/07/2025 11:19 am, Jan Beulich wrote: > On 18.07.2025 12:07, Andrew Cooper wrote: >> With the ability to match on steppings, introduce a new X86_MATCH_VFMS() >> helper to match a specific stepping, and use it to rework deadline_match[]. >> >> Notably this

[PATCH v1.1 6/6] x86/apic: Convert the TSC deadline errata table to X86_MATCH_*()

2025-07-18 Thread Andrew Cooper
missing ENDBR instructions owing to the lack of the cf_check attribute. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné v2: * Move deadline_match[] into check_deadline_errata() which produces a far more legible diff. The bloat-o-meter summary shows

Re: [PATCH 6/6] x86/apic: Convert the TSC deadline errata table to X86_MATCH_*()

2025-07-17 Thread Andrew Cooper
On 17/07/2025 9:31 am, Jan Beulich wrote: > On 16.07.2025 19:31, Andrew Cooper wrote: >> --- a/xen/arch/x86/apic.c >> +++ b/xen/arch/x86/apic.c >> @@ -1051,64 +1051,32 @@ static void setup_APIC_timer(void) >> local_irq_restore(flags); >> } >>

Re: [PATCH 6/6] x86/apic: Convert the TSC deadline errata table to X86_MATCH_*()

2025-07-17 Thread Andrew Cooper
On 17/07/2025 10:33 am, Jan Beulich wrote: > On 17.07.2025 11:02, Andrew Cooper wrote: >> On 17/07/2025 9:26 am, Jan Beulich wrote: >>> On 16.07.2025 19:31, Andrew Cooper wrote: >>>> With the ability to match on steppings, introduce a new X86_MATCH_VFMS() >>&g

Re: [PATCH 5/6] x86/match-cpu: Support matching on steppings

2025-07-17 Thread Andrew Cooper
On 17/07/2025 9:11 am, Jan Beulich wrote: > On 16.07.2025 19:31, Andrew Cooper wrote: >> --- a/xen/arch/x86/cpu/common.c >> +++ b/xen/arch/x86/cpu/common.c >> @@ -1003,13 +1003,15 @@ const struct x86_cpu_id *x86_match_cpu(const struct >> x86_cpu_id table[]) >>

Re: [PATCH 4/6] x86: Convert users of INTEL_FAM6_MODEL() to X86_MATCH_VFM()

2025-07-17 Thread Andrew Cooper
On 17/07/2025 8:44 am, Jan Beulich wrote: > On 16.07.2025 19:31, Andrew Cooper wrote: >> --- a/xen/arch/x86/acpi/cpu_idle.c >> +++ b/xen/arch/x86/acpi/cpu_idle.c >> @@ -583,7 +583,6 @@ bool errata_c6_workaround(void) >> >> if ( unlikely(fix_need

Re: [PATCH 3/6] x86/match-cpu: Introduce X86_MATCH_VFM() and convert intel_idle_ids[]

2025-07-17 Thread Andrew Cooper
On 17/07/2025 8:35 am, Jan Beulich wrote: > On 16.07.2025 19:31, Andrew Cooper wrote: >> mwait-idle's ICPU() is the most convenient place to get started. Introduce >> X86_MATCH_CPU() and X86_MATCH_VFM() following their Linux counterparts. >> >> This involves ma

Re: [PATCH 2/6] x86: Break struct x86_cpu_id out of processor.h

2025-07-17 Thread Andrew Cooper
On 17/07/2025 8:23 am, Jan Beulich wrote: > On 16.07.2025 19:31, Andrew Cooper wrote: >> Only 5 files use struct x86_cpu_id, so it should not be in processor.h. This >> is in preparation to extend it with VFM support. >> >> No functional change. >> >> Sign

[PATCH] x86/idle: Fix the C6 eoi_errata[] list to include NEHALEM_EX

2025-07-17 Thread Andrew Cooper
NEHALEM_EX is affected by the erratum too. Change the comment to be the full text, rather than interpretation of it. Fixes: 95807bcae47e ("C6 state with EOI issue fix for some Intel processors") Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné Pulled out of t

Re: [PATCH 6/6] x86/apic: Convert the TSC deadline errata table to X86_MATCH_*()

2025-07-17 Thread Andrew Cooper
On 17/07/2025 9:26 am, Jan Beulich wrote: > On 16.07.2025 19:31, Andrew Cooper wrote: >> With the ability to match on steppings, introduce a new X86_MATCH_VFMS() >> helper to match a specific stepping, and use it to rework deadline_match[]. > I'm fine with the patch in prin

[PATCH 6/6] x86/apic: Convert the TSC deadline errata table to X86_MATCH_*()

2025-07-16 Thread Andrew Cooper
missing ENDBR instructions owing to the lack of the cf_check attribute. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné The bloat-o-meter summary shows that the use of functions really wasn't the wisest idea: add/remove: 0/3 grow/shrink: 1/2 up

[PATCH 3/6] x86/match-cpu: Introduce X86_MATCH_VFM() and convert intel_idle_ids[]

2025-07-16 Thread Andrew Cooper
mwait-idle's ICPU() is the most convenient place to get started. Introduce X86_MATCH_CPU() and X86_MATCH_VFM() following their Linux counterparts. This involves match-cpu.h including more headers, which in turn allows us to drop a few. No functional change. Signed-off-by: Andrew Cooper -

[PATCH 2/6] x86: Break struct x86_cpu_id out of processor.h

2025-07-16 Thread Andrew Cooper
Only 5 files use struct x86_cpu_id, so it should not be in processor.h. This is in preparation to extend it with VFM support. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/acpi/cpu_idle.c | 2 +- xen/arch/x86/apic.c

[PATCH 0/6] x86: Convert x86_cpu_id to VFM

2025-07-16 Thread Andrew Cooper
This is the next part of the VFM converstion, focusing on struct x86_cpu_id. https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/1930706122 Andrew Cooper (6): x86: Sort headers x86: Break struct x86_cpu_id out of processor.h x86/match-cpu: Introduce X86_MATCH_VFM() and convert

[PATCH 1/6] x86: Sort headers

2025-07-16 Thread Andrew Cooper
In intel.c, drop asm/mwait.h and asm/uaccess.h, neither of which are used. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/acpi/cpu_idle.c | 3 ++- xen/arch/x86/apic.c | 25 - xen/arch/x86/cpu

[PATCH 5/6] x86/match-cpu: Support matching on steppings

2025-07-16 Thread Andrew Cooper
Architecturally, stepping is a 4-bit field, so a uint16_t suffices for a bitmap of steppings. In order to keep the size of struct x86_cpu_id the same, shrink the vendor and family fields, neither of which need to be uint16_t in Xen. No functional change. Signed-off-by: Andrew Cooper --- CC

[PATCH 4/6] x86: Convert users of INTEL_FAM6_MODEL() to X86_MATCH_VFM()

2025-07-16 Thread Andrew Cooper
This replaces raw model numbers (and comments in some cases) with names. For probe_mwait_errata(), merge the comments with the table to make it easier to see which erratum is which, and drop a stray "Problem" in LNL030. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan B

Re: [PATCH 2/3] x86/intel-family: Resync with Linux

2025-07-16 Thread Andrew Cooper
On 16/07/2025 2:56 pm, Jan Beulich wrote: > On 16.07.2025 15:28, Andrew Cooper wrote: >> This snapshot is prior to Linux commit db4001f9cc32 ("x86/cpu/vfm: Delete all >> the *_FAM6_ CPU #defines") at the end of their conversion phase. >> >> In addition to non-

Re: [PATCH 1/3] x86: Rearrange struct cpuinfo_x86 to introduce a vfm field

2025-07-16 Thread Andrew Cooper
On 16/07/2025 2:47 pm, Jan Beulich wrote: > On 16.07.2025 15:28, Andrew Cooper wrote: >> Intel have run out of model space in Family 6 and will start using Family 19 >> starting with Diamond Rapids. Xen, like Linux, has model checking logic >> which >> will malfuncti

Re: [PATCH 1/2] x86/CPU: re-work populating of cpu_data[]

2025-07-16 Thread Andrew Cooper
;m not sure of the value of keeping the "So far unknown" comment. Also, can we please switch to Xen style as we're doing elsewhere in these not-really-Linux-any-more files. With that, Acked-by: Andrew Cooper

Re: [PATCH 2/2] x86/MCE: adjust x86_mc_get_cpu_info()

2025-07-16 Thread Andrew Cooper
On 12/02/2024 12:53 pm, Jan Beulich wrote: > Move logic independent of c->apicid's initialization status out of > the if/else, leveraging that cpu_data[] now doesn't start out zero- > initialized. Constify c and have it have an initializer. > > Signed-off-by: Jan Beulich Acked-by: Andrew Cooper

Re: [PATCH 3/3] x86/vtd: Switch model check to VFM

2025-07-16 Thread Andrew Cooper
On 16/07/2025 2:28 pm, Andrew Cooper wrote: > diff --git a/xen/arch/x86/include/asm/cpufeature.h > b/xen/arch/x86/include/asm/cpufeature.h > index ba2c1c1c7416..f8b85c0f9520 100644 > --- a/xen/arch/x86/include/asm/cpufeature.h > +++ b/xen/arch/x86/include/asm/cpufeature.h &

[PATCH 3/3] x86/vtd: Switch model check to VFM

2025-07-16 Thread Andrew Cooper
This form is shorer and more legible. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné As this is the first transformation, an anlysis of the code generation change: before: : 8b 05 4a 7e 09 00mov0x97e4a(%rip),%eax

[PATCH 2/3] x86/intel-family: Resync with Linux

2025-07-16 Thread Andrew Cooper
ly deleted in the past. In cpufeature.h, provide VFM_* macros to transform constants to/from the cpuinfo_x86 representation. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné I meant to object to deleting PHI at the time, but was too late. Just becau

[PATCH 0/3] x86: Overhaul of vendor/family/model logic to support DMR

2025-07-16 Thread Andrew Cooper
ingle constant, so it is harder to mismatch family and model checks. https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/1930124712 Andrew Cooper (3): x86: Rearrange struct cpuinfo_x86 to introduce a vfm field x86/intel-family: Resync with Linux x86/vtd: Switch model check to VFM xen

[PATCH 1/3] x86: Rearrange struct cpuinfo_x86 to introduce a vfm field

2025-07-16 Thread Andrew Cooper
together as a single vfm field. As we're cleaning up the logic, take the opportunity to introduce better names, dropping the x86 prefix. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/include/asm/cpufeature.h

[PATCH] x86: Drop rep_nop() and use the PAUSE mnemonic directly

2025-07-15 Thread Andrew Cooper
In udelay(), use cpu_relax() directly which, for better or worse, is the common way to refer to the PAUSE instruction. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/delay.c | 2 +- xen/arch/x86/include/asm

Re: [PATCH v2] x86emul: adjust BSF/BSR/LZCNT/TZCNT behavior as to EFLAGS

2025-07-14 Thread Andrew Cooper
it was perhaps nice, but yielded guest-observable > inconsistencies.) > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper This is one of the more messy parts of x86, and that's saying something. > --- > v2: Use emulate_2op_SrcV_srcmem() also for {L,T}ZCNT. > > --- a/xen/arch/

Re: [PATCH for-4.{20,19,18,17}] x86/idle: undo use of MONITOR/MWAIT mnemonics

2025-07-09 Thread Andrew Cooper
Ack. Sorry for forgetting this On Wed, 9 Jul 2025, 10:44 Jan Beulich, wrote: > While the change is fine on staging, where the toolchain baseline was > moved, we need to remain compatible with older gas on stable branches > for now. > > Fixes: fa254938f00a ("x86/idle: Move monitor()/mwait() wrap

Re: [PATCH 0/9] x86/mwait-idle: (mainly) imports from Linux

2025-07-08 Thread Andrew Cooper
ort > 4: Add Meteorlake support > 5: add Grand Ridge SoC support > 6: add Sierra Forest SoC support > 7: add Granite Rapids Xeon support > 8: add Granite Rapids Xeon D support > 9: add Clearwater Forest SoC support Acked-by: Andrew Cooper

  1   2   3   4   5   6   7   8   9   10   >