Re: [PATCH] xen/x86: Fix Syntax warning in gen-cpuid.py

2024-04-26 Thread Andrew Cooper
string to be considered raw, not just the first line. Acked-by: Andrew Cooper I'll rebase my pending change altering the regex over this.

[PATCH] x86/cpu-policy: Annotate the accumulated features

2024-04-26 Thread Andrew Cooper
hint for hand-crafted cpuid= lines in vm.cfg files. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/include/public/arch-x86/cpufeatureset.h | 15 ++- xen/tools/gen-cpuid.py | 7 +-- 2 files changed, 15 insertions(+), 7 deletions

Re: [PATCH 1/3] x86/hvm/trace: Use a different trace type for AMD processors

2024-04-26 Thread Andrew Cooper
On 26/04/2024 4:29 pm, George Dunlap wrote: > On Fri, Apr 26, 2024 at 4:18 PM Andrew Cooper > wrote: >> On 26/04/2024 3:32 pm, George Dunlap wrote: >>> In xenalyze, first remove the redundant call to init_hvm_data(); >>> there's no way to get to hvm_vmexit_proc

Re: [PATCH 1/3] x86/hvm/trace: Use a different trace type for AMD processors

2024-04-26 Thread Andrew Cooper
On 26/04/2024 3:32 pm, George Dunlap wrote: > A long-standing usability sub-optimality with xenalyze is the > necessity to specify `--svm-mode` when analyzing AMD processors. This > fundamentally comes about because the same trace event ID is used for > both VMX and SVM, but the contents of the

Re: [PATCH 2/3] tools/xenalyze: Ignore HVM_EMUL events harder

2024-04-26 Thread Andrew Cooper
clude TRC_HVM_EMUL records from idle and vcpu data_mode >checks > > - Don't attempt to set the vcpu data_type in hvm_process for >TRC_HVM_EMUL records. > > Signed-off-by: George Dunlap Acked-by: Andrew Cooper Although I'm tempted to say that if records of this type show up o

Re: [PATCH 3/3] tools/xentrace: Remove xentrace_format

2024-04-26 Thread Andrew Cooper
page for xenalyze, so the "see also" on the > xentrace man page is simply removed for now. > > Signed-off-by: George Dunlap Acked-by: Andrew Cooper

[PATCH 0/3] x86/boot: Untangling

2024-04-26 Thread Andrew Cooper
. It interacts with the HyperLaunch Boot Module cleanup, but should make it simpler overall. Andrew Cooper (3): x86/boot: Explain how moving mod[0] works x86/boot: Explain discard_initial_images() and untangle PV initrd handling x86/boot: Refactor pvh_load_kernel() to have an initrd_len local xen

[PATCH 2/3] x86/boot: Explain discard_initial_images() and untangle PV initrd handling

2024-04-26 Thread Andrew Cooper
ewhere. Invalidate the initrd pointer with LIST_POISON1 to make it clearer that it shouldn't be used. No practical change in behaviour, but a substantial reduction in the complexity of how this works. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: Daniel

[PATCH 3/3] x86/boot: Refactor pvh_load_kernel() to have an initrd_len local

2024-04-26 Thread Andrew Cooper
The expression get more complicated when ->mod_end isn't being abused as a size field. Introduce and use a initrd_len local variable. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: Daniel Smith CC: Christopher Cl

[PATCH 1/3] x86/boot: Explain how moving mod[0] works

2024-04-26 Thread Andrew Cooper
modules_headroom is a misleading name as it applies strictly to mod[0] only, and the movement loop is deeply unintuitive and completely undocumented. Provide help to whomever needs to look at this code next. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano

Re: [PATCH v3 7/8] gzip: move bitbuffer into gunzip state

2024-04-26 Thread Andrew Cooper
On 26/04/2024 6:57 am, Jan Beulich wrote: > On 26.04.2024 07:55, Jan Beulich wrote: >> On 25.04.2024 21:23, Andrew Cooper wrote: >>> On 24/04/2024 5:34 pm, Daniel P. Smith wrote: >>>> --- a/xen/common/gzip/inflate.c >>>> +++ b/xen/common/gzip/inflate.c &g

MISRA and -Wextra-semi

2024-04-26 Thread Andrew Cooper
Hi, Based on a call a long while back, I experimented with -Wextra-semi.  This is what lead to 8e36c668ca107 "xen: Drop superfluous semi-colons". However, there are a number of problems with getting this working fully.  First, we need workarounds like this: diff --git a/xen/include/xen/config.h

Re: [PATCH 1/2] tools/{c,o}xenstored: Don't link against libsystemd

2024-04-26 Thread Andrew Cooper
On 26/04/2024 9:51 am, Anthony PERARD wrote: > On Thu, Apr 25, 2024 at 07:16:23PM +0100, Andrew Cooper wrote: >> On 25/04/2024 7:06 pm, Anthony PERARD wrote: >>> On Thu, Apr 25, 2024 at 06:32:15PM +0100, Andrew Cooper wrote: >>>> libsystemd is a giant depe

Re: [PATCH v3 7/8] gzip: move bitbuffer into gunzip state

2024-04-25 Thread Andrew Cooper
On 24/04/2024 5:34 pm, Daniel P. Smith wrote: > Signed-off-by: Daniel P. Smith Acked-by: Andrew Cooper > diff --git a/xen/common/gzip/inflate.c b/xen/common/gzip/inflate.c > index bec8801df487..8da14880cfbe 100644 > --- a/xen/common/gzip/inflate.c > +++ b/xen/common/gzip/inflate

Re: [PATCH v3 8/8] gzip: move crc state into gunzip state

2024-04-25 Thread Andrew Cooper
On 24/04/2024 5:34 pm, Daniel P. Smith wrote: > Move the crc and its state into struct gunzip_state. In the process, expand > the > only use of CRC_VALUE as it is hides what is being compared. "All variables here should be uint32_t rather than unsigned long, which halves the storage space

Re: [PATCH v3 1/8] gzip: clean up comments and fix code alignment

2024-04-25 Thread Andrew Cooper
On 24/04/2024 5:34 pm, Daniel P. Smith wrote: > This commit cleans up the comments and fixes the code alignment using Xen > coding style. This is done to make the code more legible before refactoring. > > Signed-off-by: Daniel P. Smith Acked-by: Andrew Cooper

Re: [PATCH 1/2] tools/{c,o}xenstored: Don't link against libsystemd

2024-04-25 Thread Andrew Cooper
On 25/04/2024 7:06 pm, Anthony PERARD wrote: > On Thu, Apr 25, 2024 at 06:32:15PM +0100, Andrew Cooper wrote: >> libsystemd is a giant dependency for one single function, but in the wake of >> the xz backdoor, it turns out that even systemd leadership recommend against >

[PATCH] CI: Drop glibc-i386 from the build containers

2024-04-25 Thread Andrew Cooper
Xen 4.14 no longer runs in Gitlab CI. Drop the dependency to shrink the build containers a little. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Stefano Stabellini CC: Michal Orzel CC: Doug Goldstein CC: Roger Pau Monné --- automation/build/archlinux/current.dockerfile

[PATCH 2/2] tools: Drop libsystemd as a dependency

2024-04-25 Thread Andrew Cooper
as removed in the build containers. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Juergen Gross CC: Christian Lindig CC: Edwin Török CC: Stefano Stabellini --- automation/build/archlinux/current.dockerfile | 1 + .../build/suse/opensuse-leap.dockerfile | 1 + .../build/suse

[PATCH 0/2] Drop libsystemd

2024-04-25 Thread Andrew Cooper
On advise from the systemd leadership. See patch 1 for details. Andrew Cooper (2): tools/{c,o}xenstored: Don't link against libsystemd tools: Drop libsystemd as a dependency automation/build/archlinux/current.dockerfile | 1 + .../build/suse/opensuse-leap.dockerfile | 1

[PATCH 1/2] tools/{c,o}xenstored: Don't link against libsystemd

2024-04-25 Thread Andrew Cooper
the launch-xenstore script invokes systemd-notify directly, so its not even necessary for the xenstored's to call sd_notify() themselves. Therefore, just drop the calls to sd_notify() and stop linking against libsystemd. No functional change. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD C

Re: [PATCH] svm: Fix MISRA 8.2 violation

2024-04-25 Thread Andrew Cooper
lude the Reported-by's. Otherwise, Acked-by: Andrew Cooper although I have a strong wish to shorten the parameter name.  That can be done at a later point. ~Andrew

Re: [PATCH v3] x86/entry: shrink insn size for some of our EFLAGS manipulation

2024-04-25 Thread Andrew Cooper
while in my CET reference build section size > doesn't change (there and in .text only padding space increases). > > Inspired by other long->byte conversion work. > > Signed-off-by: Jan Beulich Acked-by: Andrew Cooper

Re: [PATCH] VMX: no open-coding in vmx_get_cpl()

2024-04-25 Thread Andrew Cooper
On 25/04/2024 2:27 pm, Jan Beulich wrote: > Neither X86_SEG_AR_DPL nor MASK_EXTR() should really be avoided here, > using literal number instead. > > No difference in generated code (with gcc13 at least). > > Signed-off-by: Jan Beulich Acked-by: Andrew Cooepr

Re: [PATCH v2 2/2] x86/spec: adjust logic to logic that elides lfence

2024-04-25 Thread Andrew Cooper
also selected.  It's not possible to express "protect dom0 but not domU of $TYPE". This early on boot we have no idea whether dom0 is going to be PV or HVM.  We could in principle figure it out by peeking at dom0's ELF notes, but that needs a lot of rearranging of __start_xen() to do safely. Reviewed-by: Andrew Cooper

Re: [PATCH v2 1/2] x86/spec: fix reporting of BHB clearing usage from guest entry points

2024-04-25 Thread Andrew Cooper
es') > Signed-off-by: Roger Pau Monné Reviewed-by: Andrew Cooper Can make the one tweak on commit.

Re: [XEN PATCH 2/2] x86/msr: add suffix 'U' to MSR_AMD_CSTATE_CFG macro.

2024-04-24 Thread Andrew Cooper
On 24/04/2024 1:51 pm, Jan Beulich wrote: > On 24.04.2024 14:11, Alessandro Zucchelli wrote: >> This addresses violations of MISRA C:2012 Rule 7.2 which states as >> following: A “u” or “U” suffix shall be applied to all integer constants >> that are represented in an unsigned type. >> >> No

Re: [PATCH 1/4] x86/P2M: write_p2m_entry() is HVM-only anyway

2024-04-23 Thread Andrew Cooper
On 23/04/2024 3:31 pm, Jan Beulich wrote: > The latest as of e2b2ff677958 ("x86/P2M: split out init/teardown > functions") the function is obviously unreachable for PV guests. This doesn't parse.  Do you mean "Since e2b2ff677958 ..." ? > Hence > the paging_mode_enabled(d) check is pointless. >

Re: [PATCH 1/6] x86: Introduce x86_decode_lite()

2024-04-23 Thread Andrew Cooper
On 23/04/2024 10:17 am, Jan Beulich wrote: > On 22.04.2024 20:14, Andrew Cooper wrote: >> --- /dev/null >> +++ b/xen/arch/x86/x86_emulate/decode-lite.c >> @@ -0,0 +1,245 @@ >> +/* SPDX-License-Identifier: GPL-2.0-only */ >> + >> +#include "private.h&q

Re: [PATCH 3/6] x86/alternative: Intend the relocation logic

2024-04-22 Thread Andrew Cooper
This of course intended to say indent... ~Andrew

[PATCH 2/6] x86/alternative: Walk all replacements in debug builds

2024-04-22 Thread Andrew Cooper
In debug builds, walk all alternative replacements with x86_decode_lite(). This checks that we can decode all instructions, and also lets us check that disp8's don't leave the replacement block. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86

[PATCH 5/6] x86/alternative: Relocate all insn-relative fields

2024-04-22 Thread Andrew Cooper
. the RSB stuffing loop. These stay unmodified. For now, leave the altcall devirtualisation alone. These require more care to transform into the new scheme. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/alternative.c | 46

[PATCH 1/6] x86: Introduce x86_decode_lite()

2024-04-22 Thread Andrew Cooper
. This logic is sufficient to decode all alternative blocks that exist in Xen right now. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/x86_emulate/Makefile | 1 + xen/arch/x86/x86_emulate/decode-lite.c | 245 + xen/arch/x86

[PATCH 6/6] x86/spec-ctrl: Introduce and use DO_COND_BHB_SEQ

2024-04-22 Thread Andrew Cooper
Now that alternatives can fix up call displacements even when they're not the first instruction of the replacement, move the SCF_entry_bhb conditional inside the replacement block. This removes a conditional branch from the fastpaths of BHI-unaffected hardware. Signed-off-by: Andrew Cooper

[PATCH 3/6] x86/alternative: Intend the relocation logic

2024-04-22 Thread Andrew Cooper
... to make subsequent patches legible. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/alternative.c | 126 +++-- 1 file changed, 64 insertions(+), 62 deletions(-) diff --git a/xen/arch/x86

[PATCH 0/6] x86/alternatives: Adjust all insn-relative fields

2024-04-22 Thread Andrew Cooper
the BHB scrubbing logic to use it. Andrew Cooper (6): x86: Introduce x86_decode_lite() x86/alternative: Walk all replacements in debug builds x86/alternative: Intend the relocation logic x86/alternative: Replace a continue with a goto x86/alternative: Relocate all insn-relative fields x86

[PATCH 4/6] x86/alternative: Replace a continue with a goto

2024-04-22 Thread Andrew Cooper
A subsequent patch is going to insert a loop, which interferes with the continue in the devirtualisation logic. Replace it with a goto, and a paragraph explaining why we intentionally avoid setting a->priv = 1. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Ro

Re: [PATCH v2 1/2] xen: introduce header file with section related symbols

2024-04-19 Thread Andrew Cooper
On 19/04/2024 11:12 am, Jan Beulich wrote: > On 19.04.2024 12:08, Andrew Cooper wrote: >> On 19/04/2024 11:02 am, Roger Pau Monne wrote: >>> Start by declaring the beginning and end of the init section. >>> >>> No functional change intended. >>> &g

Re: [PATCH v2 2/2] livepatch: refuse to resolve symbols that belong to init sections

2024-04-19 Thread Andrew Cooper
ymbols that point to __init_begin, as that address is > also unmapped. On the other hand, __init_end is not unmapped, and hence allow > resolutions against it. > > Signed-off-by: Roger Pau Monné Reviewed-by: Andrew Cooper , although ... > --- > Changes since v1: > -

Re: [PATCH v2 1/2] xen: introduce header file with section related symbols

2024-04-19 Thread Andrew Cooper
On 19/04/2024 11:02 am, Roger Pau Monne wrote: > Start by declaring the beginning and end of the init section. > > No functional change intended. > > Requested-by: Andrew Cooper > Signed-off-by: Roger Pau Monné TYVM for doing this.  There's a lot of cleanup which can follow on

Re: [XEN PATCH] docs/misra: mark the gzip folder as adopted code

2024-04-18 Thread Andrew Cooper
On 18/04/2024 8:39 am, Jan Beulich wrote: > On 15.04.2024 17:44, Andrew Cooper wrote: >> On 15/04/2024 10:56 am, Federico Serafini wrote: >>> Mark the whole gzip folder as adopted code and remove the redundant >>> deviation of file inflate. >>> >>&g

Re: [PATCH] xen/efi: Rewrite DOS/PE magic checking without memcmp()

2024-04-18 Thread Andrew Cooper
On 17/04/2024 8:14 am, Roger Pau Monné wrote: > On Tue, Apr 16, 2024 at 04:52:51PM +0100, Andrew Cooper wrote: >> Misra Rule 21.16 doesn't like the use of memcmp() between a string literal >> and >> a UINT8 array. Rewrite using plain compares. > The commit message makes

Re: [PATCH] xen/efi: Rewrite DOS/PE magic checking without memcmp()

2024-04-18 Thread Andrew Cooper
On 18/04/2024 12:09 pm, Jan Beulich wrote: > On 16.04.2024 17:52, Andrew Cooper wrote: >> Misra Rule 21.16 doesn't like the use of memcmp() between a string literal >> and >> a UINT8 array. Rewrite using plain compares. >> >> No functional change. >> >

Re: [PATCH] xen/efi: Rewrite DOS/PE magic checking without memcmp()

2024-04-18 Thread Andrew Cooper
On 18/04/2024 12:06 pm, Jan Beulich wrote: > On 17.04.2024 09:14, Roger Pau Monné wrote: >> On Tue, Apr 16, 2024 at 04:52:51PM +0100, Andrew Cooper wrote: >>> --- a/xen/common/efi/pe.c >>> +++ b/xen/common/efi/pe.c >>> @@ -111,7 +111,8 @@ const void *__in

Re: [XEN PATCH v1 08/15] x86/vpmu: separate amd/intel vPMU code

2024-04-18 Thread Andrew Cooper
On 18/04/2024 2:25 pm, Sergiy Kibrik wrote: > 16.04.24 14:05, Andrew Cooper: >> On 16/04/2024 7:35 am, Sergiy Kibrik wrote: >>> diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile >>> index 35561fe51d..d3d7b8fb2e 100644 >>> --- a/xen/arch/x86/cpu

Re: [PATCH 1/4] xen/xlat: Sort out whitespace

2024-04-18 Thread Andrew Cooper
On 15/04/2024 10:49 pm, Stefano Stabellini wrote: > On Mon, 15 Apr 2024, Andrew Cooper wrote: >> * Fix tabs/spaces mismatch for certain rows >> * Insert lines between header files to improve legibility >> >> Signed-off-by: Andrew Cooper >> --- >> CC: G

Re: [PATCH v2 1/5] x86: Update x86 low level version check of microcode

2024-04-18 Thread Andrew Cooper
On 16/04/2024 10:15 am, Fouad Hilly wrote: > Update microcode version check at Intel and AMD Level by: > Preventing the low level code from sending errors if the microcode > version provided is not a newer version. Other errors will be sent like > before. > When the provided microcode version is

Re: [PATCH v2 4/6] gzip: refactor state tracking

2024-04-17 Thread Andrew Cooper
On 17/04/2024 3:37 pm, Daniel P. Smith wrote: > diff --git a/xen/common/gzip/gunzip.c b/xen/common/gzip/gunzip.c > index 1b448d6e3655..8178a05a0190 100644 > --- a/xen/common/gzip/gunzip.c > +++ b/xen/common/gzip/gunzip.c > @@ -4,18 +4,25 @@ > #include > #include > > -static unsigned char

Re: [PATCH v2 5/6] gzip: move crc state into consilidated gzip state

2024-04-17 Thread Andrew Cooper
On 17/04/2024 3:37 pm, Daniel P. Smith wrote: > Signed-off-by: Daniel P. Smith The change in type is fine, but does need discussing.  Furthermore, ... > diff --git a/xen/common/gzip/gunzip.c b/xen/common/gzip/gunzip.c > index 8178a05a0190..bef324d3d166 100644 > --- a/xen/common/gzip/gunzip.c >

Re: [PATCH v2 3/6] gzip: remove custom memory allocator

2024-04-17 Thread Andrew Cooper
iles changed, 2 insertions(+), 62 deletions(-) Good riddance. Reviewed-by: Andrew Cooper

Re: [PATCH v2 6/6] gzip: drop huffman code table tracking

2024-04-17 Thread Andrew Cooper
On 17/04/2024 3:37 pm, Daniel P. Smith wrote: > The "tracking" bits does not appear to be used, so dropping from the code. > > Signed-off-by: Daniel P. Smith > --- > xen/common/gzip/inflate.c | 6 -- > 1 file changed, 6 deletions(-) > > diff --git a/xen/common/gzip/inflate.c

Re: [PATCH v2 1/6] gzip: drop unused define checks

2024-04-17 Thread Andrew Cooper
On 17/04/2024 3:37 pm, Daniel P. Smith wrote: > Dropping the define checks for PKZIP_BUG_WORKAROUND and NOMEMCPY define as > they > never are set. > > Signed-off-by: Daniel P. Smith It looks like ARCH_HAS_DECOMP_WDOG is another one that can go. There's only a single instance, in inflate(),

[PATCH] xen/efi: Rewrite DOS/PE magic checking without memcmp()

2024-04-16 Thread Andrew Cooper
Misra Rule 21.16 doesn't like the use of memcmp() between a string literal and a UINT8 array. Rewrite using plain compares. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: consult...@bugseng.com CC: Roberto Bagnara CC

Re: [PATCH] x86/hvm: Allow supplying a dynamic start ASID

2024-04-16 Thread Andrew Cooper
On 16/04/2024 9:54 am, Vaishali Thakkar wrote: > Currently, Xen always starts the ASID allocation at 1. But > for SEV technologies the ASID space is divided. This is > because it's a security issue if a guest is started as > ES/SNP and is migrated to SEV-only. So, the types are > tracked

Re: [PATCH] x86/svm: Add flushbyasid in the supported features

2024-04-16 Thread Andrew Cooper
uot;); > P(cpu_has_svm_vloadsave, "Virtual VMLOAD/VMSAVE"); > P(cpu_has_svm_vgif, "Virtual GIF"); This is consistent with pre-existing behaviour, so Acked-by: Andrew Cooper However, an ever increasing list of lines like this is something I'm trying to push back

Re: [XEN PATCH v1 13/15] x86: wire cpu_has_{svm/vmx}_* to false when svm/vmx not enabled

2024-04-16 Thread Andrew Cooper
On 16/04/2024 7:46 am, Sergiy Kibrik wrote: > From: Xenia Ragiadakou > > To be able to use cpu_has_{svm/vmx}_* macros in common code without enclosing > them inside #ifdef guards when the respective virtualization technology is > not enabled, define corresponding helper routines as false when not

Re: [XEN PATCH v1 08/15] x86/vpmu: separate amd/intel vPMU code

2024-04-16 Thread Andrew Cooper
On 16/04/2024 7:35 am, Sergiy Kibrik wrote: > diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile > index 35561fe51d..d3d7b8fb2e 100644 > --- a/xen/arch/x86/cpu/Makefile > +++ b/xen/arch/x86/cpu/Makefile > @@ -10,4 +10,6 @@ obj-y += intel.o > obj-y += intel_cacheinfo.o > obj-y +=

Re: [PATCH] Mini-OS: add some macros for asm statements

2024-04-16 Thread Andrew Cooper
On 16/04/2024 8:11 am, Juergen Gross wrote: > diff --git a/arch/x86/sched.c b/arch/x86/sched.c > index dabe6fd6..460dea2e 100644 > --- a/arch/x86/sched.c > +++ b/arch/x86/sched.c > @@ -119,20 +113,12 @@ struct thread* arch_create_thread(char *name, void > (*function)(void *), > > void

Re: [XEN PATCH v1 06/15] x86/p2m: guard altp2m code with CONFIG_VMX option

2024-04-16 Thread Andrew Cooper
On 16/04/2024 7:31 am, Sergiy Kibrik wrote: > Instead of using generic CONFIG_HVM option switch to a bit more specific > CONFIG_VMX option for altp2m support, as it depends on VMX. Also guard > altp2m routines, so that it can be disabled completely in the build. > > Signed-off-by: Sergiy Kibrik

Re: [XEN PATCH v1 15/15] x86/hvm: make AMD-V and Intel VT-x support configurable

2024-04-16 Thread Andrew Cooper
On 16/04/2024 7:50 am, Sergiy Kibrik wrote: > From: Xenia Ragiadakou > > Provide the user with configuration control over the cpu virtualization > support > in Xen by making SVM and VMX options user selectable. > > To preserve the current default behavior, both options depend on HVM and >

Re: [XEN PATCH] docs/misra: mark the gzip folder as adopted code

2024-04-15 Thread Andrew Cooper
On 15/04/2024 10:56 am, Federico Serafini wrote: > Mark the whole gzip folder as adopted code and remove the redundant > deviation of file inflate. > > Signed-off-by: Federico Serafini Acked-by: Andrew Cooper I hadn't realised that we had a special case like this.  Definitely bette

[PATCH 2/4] xen/xlat: Sort structs per file

2024-04-15 Thread Andrew Cooper
Signed-off-by: Andrew Cooper --- CC: George Dunlap CC: Jan Beulich CC: Stefano Stabellini CC: Julien Grall --- xen/include/xlat.lst | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst index

[PATCH 0/4] xen/xlat: Improvements to compat hypercall checking

2024-04-15 Thread Andrew Cooper
This started off as patch 3, and grew somewhat. Patches 1-3 are simple and hopefully non-controversial. Patch 4 is an attempt to make the headers less fragile, but came with an unexpected complication. Details in the patch. Andrew Cooper (4): xen/xlat: Sort out whitespace xen/xlat: Sort

[PATCH 3/4] xen/gnttab: Perform compat/native gnttab_query_size check

2024-04-15 Thread Andrew Cooper
This subop appears to have been missed from the compat checks. Signed-off-by: Andrew Cooper --- CC: George Dunlap CC: Jan Beulich CC: Stefano Stabellini CC: Julien Grall --- xen/common/compat/grant_table.c | 4 xen/include/xlat.lst| 1 + 2 files changed, 5 insertions

[PATCH 4/4] xen/public: Use -Wpadding for public headers

2024-04-15 Thread Andrew Cooper
RFC. In theory this is a great way to avoid some of the spiketraps involved with C being the official representation. However, this doesn't build. gnttab_transfer has a layout that requires a CONFIG_COMPAT if we want to satisfy -Wpadding for both forms of the structure. Thoughts on whether

[PATCH 1/4] xen/xlat: Sort out whitespace

2024-04-15 Thread Andrew Cooper
* Fix tabs/spaces mismatch for certain rows * Insert lines between header files to improve legibility Signed-off-by: Andrew Cooper --- CC: George Dunlap CC: Jan Beulich CC: Stefano Stabellini CC: Julien Grall --- xen/include/xlat.lst | 31 +++ 1 file changed

Re: Rewritten XSA status page, xsa.json

2024-04-15 Thread Andrew Cooper
On 15/04/2024 3:14 pm, George Dunlap wrote: > Hey all, > > Some of you may have noticed that xenbis.xenproject.org/xsa/ doesn't > currently list XSA-456. This has prompted me to rewrite the perl code > which generates that area of the webpage into golang, which is much > easier for the current

Re: [PATCH v4 1/3] xen/arm: Add imx8q{m,x} platform glue

2024-04-15 Thread Andrew Cooper
On 15/04/2024 11:25 am, Julien Grall wrote: > Hi John, > > I saw this patch was committed. I have one question this may require > some adjustment. > > On 08/04/2024 17:11, John Ernberg wrote: >> --- >>   xen/arch/arm/platforms/Makefile |   1 + >>   xen/arch/arm/platforms/imx8qm.c | 139

Re: [XEN PATCH v3 0/3] x86/iommu: Drop IOMMU support when cx16 isn't supported

2024-04-12 Thread Andrew Cooper
On 12/04/2024 4:51 pm, Teddy Astie wrote: > Le 12/04/2024 à 16:49, Andrew Cooper a écrit : >> 3) In patch 1, you shouldn't modify x2apic_bsp_setup() like that. >> x2APIC && no-IOMMU is a legal combination. >> >> Instead, you should put a cx16 check in both

Re: [PATCH v1 1/2] Implemented AMD SEV discovery and enabling.

2024-04-12 Thread Andrew Cooper
On 12/04/2024 3:38 pm, Vaishali Thakkar wrote: > On 4/12/24 4:06 PM, Andrei Semenov wrote: >> On 4/11/24 20:32, Andrew Cooper wrote: >>> On 10/04/2024 4:36 pm, Andrei Semenov wrote: >>>> +    } >>>> + >>>> +    i

Re: [PATCH v1 2/2] Implemented Amd Secure Processor device driver

2024-04-12 Thread Andrew Cooper
On 12/04/2024 3:49 pm, Andrei Semenov wrote: >> Can you discuss this comment: >>> CET shadow stack: adapt #CP handler??? >> some more.  What's going on? > > Yep. Actually CET Shadow Stack raised #21 exception  (near ret) on older > > versions of Xen (when I said older I talk about 4.19

Re: [XEN PATCH v3 0/3] x86/iommu: Drop IOMMU support when cx16 isn't supported

2024-04-12 Thread Andrew Cooper
On 12/04/2024 1:33 pm, Teddy Astie wrote: > All hardware that supports VT-d/AMD-Vi that exists also supports cx16 (aside > specifically crafted virtual machines). > > Some IOMMU code paths in Xen consider cases where VT-d/AMD-Vi is supported > while cx16 isn't, those paths may be bugged and are

Re: [PATCH] osstest: increase boot timeout for Debian PV guests

2024-04-12 Thread Andrew Cooper
the timeout to 60s. > > Signed-off-by: Roger Pau Monné FWIW, Acked-by: Andrew Cooper

Re: [PATCH 3/5] gzip: refactor state tracking

2024-04-12 Thread Andrew Cooper
On 12/04/2024 1:51 pm, Daniel P. Smith wrote: > On 4/12/24 08:18, Andrew Cooper wrote: >> On 12/04/2024 12:41 pm, Daniel P. Smith wrote: >>> On 4/12/24 07:34, Daniel P. Smith wrote: >>>> On 4/11/24 15:24, Andrew Cooper wrote: >>>>> On 11/04/2024 4:25

Re: [PATCH 3/5] gzip: refactor state tracking

2024-04-12 Thread Andrew Cooper
On 12/04/2024 12:41 pm, Daniel P. Smith wrote: > On 4/12/24 07:34, Daniel P. Smith wrote: >> On 4/11/24 15:24, Andrew Cooper wrote: >>> On 11/04/2024 4:25 pm, Daniel P. Smith wrote: >>>> diff --git a/xen/common/gzip/gunzip.c b/xen/common/gzip/gunzip.c >>>&g

Re: [PATCH 2/5] gzip: clean up comments and fix code alignment

2024-04-12 Thread Andrew Cooper
On 12/04/2024 12:28 pm, Daniel P. Smith wrote: > On 4/11/24 15:11, Andrew Cooper wrote: > >> Thoughts? > > I think it is all doable, the only question is would you prefer to see > the PKZIP_BUG_WORKAROUND and NOMEMCPY drop happen before relocating > the files or after

Re: [PATCH] livepatch: refuse to resolve symbols that belong to init sections

2024-04-12 Thread Andrew Cooper
On 12/04/2024 9:07 am, Roger Pau Monne wrote: > Livepatch payloads containing symbols that belong to init sections can only > lead to page faults later on, as by the time the livepatch is loaded init > sections have already been freed. > > Refuse to resolve such symbols and return an error

Re: [XEN PATCH v2 0/3] x86/iommu: Drop IOMMU support when cx16 isn't supported

2024-04-12 Thread Andrew Cooper
On 12/04/2024 9:31 am, Teddy Astie wrote: > Le 11/04/2024 à 22:05, Andrew Cooper a écrit : >> On 08/04/2024 2:02 pm, Teddy Astie wrote: >>> All hardware that supports VT-d/AMD-Vi that exists also supports cx16 (aside >>> specifically crafted virtual machines). >>&

Re: [XEN PATCH v2 0/3] x86/iommu: Drop IOMMU support when cx16 isn't supported

2024-04-11 Thread Andrew Cooper
On 08/04/2024 2:02 pm, Teddy Astie wrote: > All hardware that supports VT-d/AMD-Vi that exists also supports cx16 (aside > specifically crafted virtual machines). > > Some IOMMU code paths in Xen consider cases where VT-d/AMD-Vi is supported > while cx16 isn't, those paths may be bugged and are

Re: [PATCH 5/5] gzip: move huffman code table tracking into gzip state

2024-04-11 Thread Andrew Cooper
On 11/04/2024 4:25 pm, Daniel P. Smith wrote: > Signed-off-by: Daniel P. Smith > --- > xen/common/gzip/gunzip.c | 2 ++ > xen/common/gzip/inflate.c | 26 -- > 2 files changed, 14 insertions(+), 14 deletions(-) > > diff --git a/xen/common/gzip/gunzip.c

Re: [PATCH 4/5] gzip: move crc state into consilidated gzip state

2024-04-11 Thread Andrew Cooper
On 11/04/2024 4:25 pm, Daniel P. Smith wrote: > diff --git a/xen/common/gzip/inflate.c b/xen/common/gzip/inflate.c > index c8dd35962abb..6c8c7452a31f 100644 > --- a/xen/common/gzip/inflate.c > +++ b/xen/common/gzip/inflate.c > @@ -1125,16 +1125,14 @@ static int __init inflate(struct gzip_data *gd)

Re: [PATCH 3/5] gzip: refactor state tracking

2024-04-11 Thread Andrew Cooper
On 11/04/2024 4:25 pm, Daniel P. Smith wrote: > diff --git a/xen/common/gzip/gunzip.c b/xen/common/gzip/gunzip.c > index 1bcb007395ba..9b4891731b8b 100644 > --- a/xen/common/gzip/gunzip.c > +++ b/xen/common/gzip/gunzip.c > @@ -102,12 +109,13 @@ __init int gzip_check(char *image, unsigned long >

Re: [PATCH 2/5] gzip: clean up comments and fix code alignment

2024-04-11 Thread Andrew Cooper
On 11/04/2024 4:25 pm, Daniel P. Smith wrote: > This commit cleans up the comments and fixes the code alignment using Xen > coding style. This is done to make the code more legible before refactoring. > > Signed-off-by: Daniel P. Smith I've found two more minor adjustments: diff --git

Re: [PATCH 1/5] gzip: colocate gunzip code files

2024-04-11 Thread Andrew Cooper
On 11/04/2024 5:00 pm, Luca Fancellu wrote: >> On 11 Apr 2024, at 16:25, Daniel P. Smith >> wrote: >> >> This patch moves the gunzip code files to common/gzip. Makefiles are adjusted >> accordingly. >> >> Signed-off-by: Daniel P. Smith >> --- >> xen/common/Makefile | 2 +- >>

Re: [PATCH v1 2/2] Implemented Amd Secure Processor device driver

2024-04-11 Thread Andrew Cooper
On 10/04/2024 4:36 pm, Andrei Semenov wrote: > Signed-off-by: Andrei Semenov > --- > xen/arch/x86/include/asm/psp-sev.h | 655 +++ > xen/drivers/Kconfig| 2 + > xen/drivers/Makefile | 1 + > xen/drivers/crypto/Kconfig | 10 + >

Re: [PATCH v1 1/2] Implemented AMD SEV discovery and enabling.

2024-04-11 Thread Andrew Cooper
On 10/04/2024 4:36 pm, Andrei Semenov wrote: > diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c > index ab92333673..a5903613f0 100644 > --- a/xen/arch/x86/cpu/amd.c > +++ b/xen/arch/x86/cpu/amd.c > @@ -1030,6 +1031,54 @@ static void amd_check_erratum_1485(void) >

Re: [PATCH v2] altcall: fix __alt_call_maybe_initdata so it's safe for livepatch

2024-04-11 Thread Andrew Cooper
ute instead of > __initdata for __alt_call_maybe_initdata. > > Fixes: f26bb285949b ('xen: Implement xen/alternative-call.h for use in common > code') > Signed-off-by: Roger Pau Monné I really did screw up livepatching with the indirect-branch reduction work, didn't I... Reviewed-by: Andrew Cooper

[PATCH] x86/emul: Simplify segment override prefix decoding

2024-04-11 Thread Andrew Cooper
x86_seg_* uses architectural encodings. Therefore, we can fold the prefix handling cases together and derive the segment from the prefix byte itself. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné This makes a marginal saving of 47 bytes

[PATCH] docs/hypercall-abi: State that the hypercall page is optional

2024-04-11 Thread Andrew Cooper
-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: George Dunlap CC: Stefano Stabellini CC: Julien Grall CC: Anthony PERARD --- docs/guest-guide/x86/hypercall-abi.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/guest-guide/x86/hypercall-abi.rst b

Re: [PATCH] xen/acpi: Allow xen/acpi.h to be included on non-ACPI archs

2024-04-11 Thread Andrew Cooper
On 05/04/2024 7:20 pm, Shawn Anastasio wrote: > Conditionalize xen/acpi.h's inclusion of acpi/acpi.h and asm/acpi.h on > CONFIG_ACPI and import ARM's !CONFIG_ACPI stub for acpi_disabled() so > that the header can be included on architectures without ACPI support, > like ppc. > > This change

Re: [PATCH] xen/include: move definition of ASM_INT() to xen/linkage.h

2024-04-11 Thread Andrew Cooper
On 03/04/2024 3:22 pm, Jan Beulich wrote: > On 03.04.2024 15:59, Andrew Cooper wrote: >> On 03/04/2024 1:51 pm, Jan Beulich wrote: >>> On 03.04.2024 14:03, Juergen Gross wrote: >>>> ASM_INT() is defined in arch/[arm|x86]/include/asm/asm_defns.h in >>>> ex

Re: [PATCH v2 2/6] tools/misc: rework xenwatchdogd signal handling

2024-04-11 Thread Andrew Cooper
On 29/03/2024 11:10 am, le...@solinno.co.uk wrote: > diff --git a/tools/misc/xenwatchdogd.c b/tools/misc/xenwatchdogd.c > index 2f7c822d61..35a0df655a 100644 > --- a/tools/misc/xenwatchdogd.c > +++ b/tools/misc/xenwatchdogd.c > @@ -9,9 +9,11 @@ > #include > #include > #include > +#include >

Re: [PATCH] xen/acpi: Allow xen/acpi.h to be included on non-ACPI archs

2024-04-11 Thread Andrew Cooper
On 09/04/2024 11:16 pm, Shawn Anastasio wrote: > On 4/8/24 1:54 AM, Jan Beulich wrote: >> On 05.04.2024 20:20, Shawn Anastasio wrote: >>> Conditionalize xen/acpi.h's inclusion of acpi/acpi.h and asm/acpi.h on >>> CONFIG_ACPI and import ARM's !CONFIG_ACPI stub for acpi_disabled() so >>> that the

Re: [XEN PATCH v2 1/9] x86/vlapic: tidy switch statement and address MISRA violation

2024-04-11 Thread Andrew Cooper
On 09/04/2024 8:45 pm, Nicola Vetrini wrote: > On 2024-04-08 09:32, Jan Beulich wrote: >> On 05.04.2024 11:14, Nicola Vetrini wrote: >>> Remove unneded blank lines between switch clauses. >> >> "Unneeded" based on what? We're carefully trying to improve >> readability of >> large switch()

Re: [PATCH v2 3/4] xen/virtual-region: Link the list build time

2024-04-11 Thread Andrew Cooper
On 11/04/2024 7:34 am, Michal Orzel wrote: > Hi Andrew, > > On 10/04/2024 20:42, Andrew Cooper wrote: >> diff --git a/xen/common/virtual_region.c b/xen/common/virtual_region.c >> index 7d8bdeb61282..db3e0dc9fe74 100644 >> --- a/xen/common/virtual_region.c >>

Re: [PATCH v2 2/4] xen/virtual-region: Rework how bugframe linkage works

2024-04-11 Thread Andrew Cooper
On 11/04/2024 7:20 am, Michal Orzel wrote: > Hi Andrew, > > On 10/04/2024 20:42, Andrew Cooper wrote: >> >> The start/stop1/etc linkage scheme predates struct virtual_region, and as >> setup_virtual_regions() shows, it's awkward to express in the new scheme. >>

[PATCH] x86/emul: Adjust X86EMUL_OPC_EXT_MASK to placate MISRA

2024-04-10 Thread Andrew Cooper
Resolves 4740 MISRA R7.2 violations. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: consult...@bugseng.com CC: Roberto Bagnara CC: Federico Serafini CC: Nicola Vetrini of 4935, so 96% of them... --- xen/arch/x86/x86_emulate/x86_emulate.h

[PATCH] xen/spinlock: Adjust LOCK_DEBUG_INITVAL to placate MISRA

2024-04-10 Thread Andrew Cooper
Resolves an R7.2 violation. Fixes: c286bb93d20c ("xen/spinlock: support higher number of cpus") Signed-off-by: Andrew Cooper --- CC: George Dunlap CC: Jan Beulich CC: Stefano Stabellini CC: Julien Grall CC: Juergen Gross CC: consult...@bugseng.com CC: Roberto Bagnara CC: Federic

[PATCH] xen/vPCI: Remove shadowed variable

2024-04-10 Thread Andrew Cooper
Resolves a MISRA R5.3 violation. Fixes: 622bdd962822 ("vpci/header: handle p2m range sets per BAR") Signed-off-by: Andrew Cooper --- CC: Roger Pau Monné CC: Stefano Stabellini CC: consult...@bugseng.com CC: Roberto Bagnara CC: Federico Serafini CC: Nicola Vetrini --- xen/dr

[PATCH] xen/nospec: Remove unreachable code

2024-04-10 Thread Andrew Cooper
nlock: introduce support for blocking speculation into critical regions") Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: consult...@bugseng.com CC: Roberto Bagnara CC: Federico Serafini CC: Nicola Vetrini --- xen/include/xen/nospec.h | 3 +

  1   2   3   4   5   6   7   8   9   10   >