Re: [PATCH v12 1/8] xen/riscv: disable unnecessary configs

2024-05-30 Thread Andrew Cooper
On 30/05/2024 5:44 pm, Andrew Cooper wrote: > On 29/05/2024 8:55 pm, Oleksii Kurochko wrote: >> To allow CONFIG_ARGO build happy it was included to >> >> as ARGO requires p2m_type_t ( p2m_ram_rw ) and declaration of >> check_get_page_from_gfn() from xen/p2m-common.h.

Re: [PATCH v4 1/2] tools/xg: Streamline cpu policy serialise/deserialise calls

2024-05-30 Thread Andrew Cooper
On 29/05/2024 3:30 pm, Alejandro Vallejo wrote: > diff --git a/tools/include/xenguest.h b/tools/include/xenguest.h > index e01f494b772a..85d56f26537b 100644 > --- a/tools/include/xenguest.h > +++ b/tools/include/xenguest.h > @@ -799,15 +799,23 @@ int xc_cpu_policy_set_domain(xc_interface *xch, >

Re: [PATCH v12 8/8] xen/README: add compiler and binutils versions for RISC-V64

2024-05-30 Thread Andrew Cooper
On 29/05/2024 8:55 pm, Oleksii Kurochko wrote: > diff --git a/README b/README > index c8a108449e..30da5ff9c0 100644 > --- a/README > +++ b/README > @@ -48,6 +48,10 @@ provided by your OS distributor: >- For ARM 64-bit: > - GCC 5.1 or later > - GNU Binutils 2.24 or later >

Re: [PATCH v12 7/8] xen/riscv: enable full Xen build

2024-05-30 Thread Andrew Cooper
On 30/05/2024 7:27 pm, Oleksii K. wrote: > On Thu, 2024-05-30 at 18:45 +0100, Andrew Cooper wrote: >> On 30/05/2024 6:12 pm, Oleksii K. wrote: >>> On Thu, 2024-05-30 at 17:48 +0100, Andrew Cooper wrote: >>>> On 29/05/2024 8:55 pm, Oleksii Kurochko wrote: >>>&

[PATCH 1/2] arch/irq: Make irq_ack_none() mandatory

2024-05-30 Thread Andrew Cooper
, gaining an irq_ prefix for consisntency with everything else in no_irq_type. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Oleksii Kurochko CC: Shawn Anastasio

[PATCH 2/2] arch/irq: Centralise no_irq_type

2024-05-30 Thread Andrew Cooper
. No functional change, but a whole lot less tangled. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Oleksii Kurochko CC: Shawn Anastasio Oleksii: For RISC-V, you should only need to provide

[PATCH for-4.19 0/2] arch/irq: Untangle no_irq_type

2024-05-30 Thread Andrew Cooper
Found when reviewing Oleksii's series to enable the RISC-V build. The way no_irq_type works is horrifying. Make it less-so. Andrew Cooper (2): arch/irq: Make irq_ack_none() mandatory arch/irq: Centralise no_irq_type xen/arch/arm/include/asm/irq.h | 3 +++ xen/arch/arm/irq.c

Re: [PATCH v12 6/8] xen/riscv: add minimal amount of stubs to build full Xen

2024-05-30 Thread Andrew Cooper
On 29/05/2024 8:55 pm, Oleksii Kurochko wrote: > diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c > index fe3a43be20..2c3fb7d72e 100644 > --- a/xen/arch/riscv/mm.c > +++ b/xen/arch/riscv/mm.c > @@ -1,5 +1,6 @@ > /* SPDX-License-Identifier: GPL-2.0-only */ > > +#include > #include >

Re: [PATCH v12 7/8] xen/riscv: enable full Xen build

2024-05-30 Thread Andrew Cooper
On 30/05/2024 6:12 pm, Oleksii K. wrote: > On Thu, 2024-05-30 at 17:48 +0100, Andrew Cooper wrote: >> On 29/05/2024 8:55 pm, Oleksii Kurochko wrote: >>> diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c >>> index 8285bcffef..bda35fc347 100644 >>> --

Re: [PATCH v12 5/8] xen/riscv: add minimal stuff to mm.h to build full Xen

2024-05-30 Thread Andrew Cooper
On 29/05/2024 8:55 pm, Oleksii Kurochko wrote: > Signed-off-by: Oleksii Kurochko > Acked-by: Jan Beulich This patch looks like it can go in independently?  Or does it depend on having bitops.h working in practice? However, one very strong suggestion... > diff --git

Re: [PATCH v12 8/8] xen/README: add compiler and binutils versions for RISC-V64

2024-05-30 Thread Andrew Cooper
On 30/05/2024 6:16 pm, Oleksii K. wrote: > On Thu, 2024-05-30 at 17:47 +0100, Andrew Cooper wrote: >> On 29/05/2024 8:55 pm, Oleksii Kurochko wrote: >>> diff --git a/README b/README >>> index c8a108449e..30da5ff9c0 100644 >>> --- a/README >>> +++ b/READ

Re: [PATCH v12 6/8] xen/riscv: add minimal amount of stubs to build full Xen

2024-05-30 Thread Andrew Cooper
On 29/05/2024 8:55 pm, Oleksii Kurochko wrote: > diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c > new file mode 100644 > index 00..8285bcffef > --- /dev/null > +++ b/xen/arch/riscv/stubs.c > @@ -0,0 +1,439 @@ > > +void udelay(unsigned long usecs) > +{ > +

Re: [PATCH v12 7/8] xen/riscv: enable full Xen build

2024-05-30 Thread Andrew Cooper
On 29/05/2024 8:55 pm, Oleksii Kurochko wrote: > diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c > index 8285bcffef..bda35fc347 100644 > --- a/xen/arch/riscv/stubs.c > +++ b/xen/arch/riscv/stubs.c > @@ -24,12 +24,6 @@ DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_mask); > >

Re: [PATCH v12 8/8] xen/README: add compiler and binutils versions for RISC-V64

2024-05-30 Thread Andrew Cooper
s is what we run in CI" is perfectly good enough. With this dropped, Reviewed-by: Andrew Cooper .  Can fix on commit.

Re: [PATCH v12 1/8] xen/riscv: disable unnecessary configs

2024-05-30 Thread Andrew Cooper
$FOO selected by ARCH. However, that's not work to get stuck into now. It's quite unreasonable how much stuff doesn't work in simple builds... > Signed-off-by: Oleksii Kurochko Acked-by: Andrew Cooper I'm happy to fix up the two minor issues on commit.

Re: [PATCH] tools: (Actually) drop libsystemd as a dependency

2024-05-30 Thread Andrew Cooper
On 30/05/2024 12:02 pm, Roger Pau Monné wrote: > On Thu, May 30, 2024 at 11:14:39AM +0100, Andrew Cooper wrote: >> When reinstating some of systemd.m4 between v1 and v2, I reintroduced a >> little >> too much. While {c,o}xenstored are indeed no longer linked against >&

Re: [PATCH v3 2/6] xen/x86: Add initial x2APIC ID to the per-vLAPIC save area

2024-05-30 Thread Andrew Cooper
On 29/05/2024 3:32 pm, Alejandro Vallejo wrote: > diff --git a/xen/lib/x86/policy.c b/xen/lib/x86/policy.c > index f033d22785be..b70b22d55fcf 100644 > --- a/xen/lib/x86/policy.c > +++ b/xen/lib/x86/policy.c > @@ -2,6 +2,17 @@ > > #include > > +uint32_t x86_x2apic_id_from_vcpu_id(const struct

[PATCH] tools: (Actually) drop libsystemd as a dependency

2024-05-30 Thread Andrew Cooper
When reinstating some of systemd.m4 between v1 and v2, I reintroduced a little too much. While {c,o}xenstored are indeed no longer linked against libsystemd, ./configure still looks for it. Drop this too. Fixes: ae26101f6bfc ("tools: Drop libsystemd as a dependency") Signed-off-

Re: [PATCH v4 0/2] Clean the policy manipulation path in domain creation

2024-05-30 Thread Andrew Cooper
On 29/05/2024 3:30 pm, Alejandro Vallejo wrote: > Alejandro Vallejo (2): > tools/xg: Streamline cpu policy serialise/deserialise calls > tools/xg: Clean up xend-style overrides for CPU policies Oleksii: Please consider for 4.19. This is internal clean-up to CPUID handling which has been

Re: [PATCH] x86/hvm: allow XENMEM_machine_memory_map

2024-05-30 Thread Andrew Cooper
On 30/05/2024 9:14 am, Roger Pau Monné wrote: > On Thu, May 30, 2024 at 09:04:08AM +0100, Andrew Cooper wrote: >> On 30/05/2024 8:53 am, Roger Pau Monne wrote: >>> For HVM based control domains XENMEM_machine_memory_map must be available so >>> that the `e820_host

Re: [PATCH] x86/hvm: allow XENMEM_machine_memory_map

2024-05-30 Thread Andrew Cooper
On 30/05/2024 8:53 am, Roger Pau Monne wrote: > For HVM based control domains XENMEM_machine_memory_map must be available so > that the `e820_host` xl.cfg option can be used. > > Signed-off-by: Roger Pau Monné Seems safe enough to allow. Does this want a reported-by, or some further discussion

Re: [PATCH v2 10/13] xen/bitops: Delete find_first_set_bit()

2024-05-29 Thread Andrew Cooper
On 27/05/2024 1:58 pm, Jan Beulich wrote: > On 24.05.2024 22:03, Andrew Cooper wrote: >> No more users. >> >> Signed-off-by: Andrew Cooper > Acked-by: Jan Beulich > > FYI, with the rearrangements I've done, this safely merges into and supersedes patch 4. ~Andrew

Re: [PATCH v2 04/13] xen/page_alloc: Coerce min(flsl(), foo) expressions to being unsigned

2024-05-29 Thread Andrew Cooper
On 29/05/2024 8:07 pm, Andrew Cooper wrote: > On 27/05/2024 7:26 am, Jan Beulich wrote: >> On 24.05.2024 22:03, Andrew Cooper wrote: >>> This is in order to maintain bisectability through the subsequent changes, >>> where flsl() changes sign-ness non-atomically by archi

Re: [PATCH v2 04/13] xen/page_alloc: Coerce min(flsl(), foo) expressions to being unsigned

2024-05-29 Thread Andrew Cooper
On 27/05/2024 7:26 am, Jan Beulich wrote: > On 24.05.2024 22:03, Andrew Cooper wrote: >> This is in order to maintain bisectability through the subsequent changes, >> where flsl() changes sign-ness non-atomically by architecture. >> >> Signed-off-by: Andrew Cooper

Re: [PATCH 2/3] CI: Use a debug build of Xen for the Xilinx HW tests

2024-05-29 Thread Andrew Cooper
On 29/05/2024 4:30 pm, Michal Orzel wrote: > Hi Andrew, > > On 29/05/2024 16:19, Andrew Cooper wrote: >> >> ... like the other hardware tests. This gets more value out of the testing. >> >> Signed-off-by: Andrew Cooper >> --- >> CC: Roger Pau Monné &

[PATCH for-4.19 0/3] CI: Misc improvements

2024-05-29 Thread Andrew Cooper
All found while making extensive use of Gitlab CI for the bitops boot testing. For 4.19. It's all very low risk, and improves the utility/useability of our testing. Andrew Cooper (3): CI: Remove CI_COMMIT_REF_PROTECTED requirement for HW jobs CI: Use a debug build of Xen for the Xilinx HW

[PATCH 3/3] CI: Improve serial handling in qemu-smoke-ppc64le.sh

2024-05-29 Thread Andrew Cooper
Have PPC put serial to stdout like all other tests, so it shows up in the main job log. Signed-off-by: Andrew Cooper --- CC: Roger Pau Monné CC: Stefano Stabellini CC: Michal Orzel CC: Marek Marczykowski-Górecki CC: Oleksii Kurochko --- automation/scripts/qemu-smoke-ppc64le.sh | 13

[PATCH 1/3] CI: Remove CI_COMMIT_REF_PROTECTED requirement for HW jobs

2024-05-29 Thread Andrew Cooper
the requirement. Fixes: 746774cd1786 ("automation: introduce a dom0less test run on Xilinx hardware") Fixes: 0ab316e7e15f ("automation: add a smoke and suspend test on an Alder Lake system") Signed-off-by: Andrew Cooper --- CC: Roger Pau Monné CC: Stefano Stabellini CC: Mic

[PATCH 2/3] CI: Use a debug build of Xen for the Xilinx HW tests

2024-05-29 Thread Andrew Cooper
... like the other hardware tests. This gets more value out of the testing. Signed-off-by: Andrew Cooper --- CC: Roger Pau Monné CC: Stefano Stabellini CC: Michal Orzel CC: Marek Marczykowski-Górecki CC: Oleksii Kurochko --- automation/gitlab-ci/test.yaml | 4 ++-- 1 file changed, 2

Re: [PATCH] x86/MCE: don't treat S3 resume the same as boot

2024-05-29 Thread Andrew Cooper
On 29/05/2024 11:46 am, Jan Beulich wrote: > Checks for running on CPU0 are bogus; they identify S3 resume the same > as being the BSP while booting. Replace with the same check we use > elsewhere to properly limit things to just the BSP. > > Link:

[PATCH] Partial revert of "x86/MCE: optional build of AMD/Intel MCE code"

2024-05-29 Thread Andrew Cooper
Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Sergiy Kibrik CC: Stefano Stabellini CC: Oleksii Kurochko We're past feature freeze and this was a silent change in a patch, which was also untested. A 30s look at mcheck_init() shows clearly that it's not a 30s job to fix. ---

Re: [PATCH for-4.19 9/9] x86/irq: forward pending interrupts to new destination in fixup_irqs()

2024-05-29 Thread Andrew Cooper
On 29/05/2024 10:01 am, Roger Pau Monne wrote: > diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c > index 6567af685a1b..4d77fba3ed19 100644 > --- a/xen/arch/x86/apic.c > +++ b/xen/arch/x86/apic.c > @@ -1543,3 +1543,8 @@ void check_for_unexpected_msi(unsigned int vector) > { >

Re: [PATCH v4 4/4] x86/ucode: Utilize ucode_force and remove opt_ucode_allow_same

2024-05-28 Thread Andrew Cooper
On 28/05/2024 4:29 pm, Fouad Hilly wrote: > Pass ucode_force to common micorocde checks and utilize it to allow for > microcode downgrade > or reapply the same version of the microcode. > Update low level Intel and AMD to check for valid signature only. Any version > checks is done > at core.c.

Re: [PATCH v4 3/4] x86/ucode: Introduce --force option to xen-ucode to force skipping microcode version check

2024-05-28 Thread Andrew Cooper
are doing" which makes it very clear that people get to keep all pieces if they try this. Otherwise (and subject to the style cleanup in the previous patch), Reviewed-by: Andrew Cooper

Re: [PATCH v4 2/4] x86/ucode: refactor xen-ucode to utilize getopt

2024-05-28 Thread Andrew Cooper
On 28/05/2024 4:29 pm, Fouad Hilly wrote: > Use getopt_long() to handle command line arguments. > Introduce ext_err for common exit with errors. > xc_microcode_update() refactored to accept flags and utilize > xenpf_microcode_update2 Importantly, not.  That's deferred until the next patch. >

Re: [PATCH v4 1/4] x86/ucode: Introduce PF_microcode_update2 with flags parameter

2024-05-28 Thread Andrew Cooper
wants expanding to the full name, i.e. XENPF_microcode_update2.  Can be fixed on commit. Reviewed-by: Andrew Cooper

Re: [PATCH 2/3] xen/x86: Drop useless non-Kconfig CONFIG_* variables

2024-05-28 Thread Andrew Cooper
On 22/05/2024 7:03 am, Jan Beulich wrote: > On 21.05.2024 19:15, Andrew Cooper wrote: >> These are all either completely unused, or do nothing useful. >> >> Signed-off-by: Andrew Cooper > Not an objection, i.e. you're fine to commit as is with Stefano's R-b, yet > still

[PATCH] x86/svm: Rework VMCB_ACCESSORS() to use a plain type name

2024-05-28 Thread Andrew Cooper
This avoids having a function call in a typeof() expression. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné --- xen/arch/x86/include/asm/hvm/svm/vmcb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/include/asm/hvm

[PATCH v2 for-4.19 0.5/13] xen: Introduce CONFIG_SELF_TESTS

2024-05-28 Thread Andrew Cooper
... and move x86's stub_selftest() under this new option. There is value in having these tests included in release builds too. It will shortly be used to gate the bitops unit tests on all architectures. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC

Re: [PATCH v2 05/13] xen/bitops: Implement generic_f?sl() in lib/

2024-05-28 Thread Andrew Cooper
On 27/05/2024 9:44 am, Jan Beulich wrote: > On 24.05.2024 22:03, Andrew Cooper wrote: >> generic_f?s() being static inline is the cause of lots of the complexity >> between the common and arch-specific bitops.h >> >> They appear to be static inline for constant-fol

Re: [PATCH v2 07/13] x86/bitops: Improve arch_ffs() in the general case

2024-05-28 Thread Andrew Cooper
On 27/05/2024 2:37 pm, Jan Beulich wrote: > On 27.05.2024 15:27, Jan Beulich wrote: >> On 24.05.2024 22:03, Andrew Cooper wrote: >>> --- a/xen/arch/x86/include/asm/bitops.h >>> +++ b/xen/arch/x86/include/asm/bitops.h >>> @@ -432,12 +432,28 @@ st

Re: Linux HVM fails to start with PANIC: early exception 0x00 IP 0010:clear_page_orig+0x12/0x40 error 0

2024-05-28 Thread Andrew Cooper
On 12/05/2024 3:48 pm, Andrew Cooper wrote: > On 12/05/2024 3:16 am, Marek Marczykowski-Górecki wrote: >> Hi, >> >> I've got a report[1] that after some update Linux HVM fails to start with the >> error as in the subject. It looks to be caused by some change between >

[PATCH v2 13/13] xen/bitops: Rearrange the top of xen/bitops.h

2024-05-24 Thread Andrew Cooper
The #include can move to the top of the file now now that generic_f?s() have been untangled. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel CC: Oleksii

[PATCH v2 11/13] xen/bitops: Implement fls()/flsl() in common logic

2024-05-24 Thread Andrew Cooper
From: Oleksii Kurochko This is most easily done together because of how arm32 is currently structured, but it does just mirror the existing ffs()/ffsl() work. Introduce compile and boot time testing. Signed-off-by: Oleksii Kurochko Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger

[PATCH v2 06/13] xen/bitops: Implement ffs() in common logic

2024-05-24 Thread Andrew Cooper
__builtin_ctz(), but less dramatically because it using optimised asm(). Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel CC: Oleksii Kurochko CC: Shawn Anastasio CC

[PATCH v2 09/13] xen/bitops: Replace find_first_set_bit() with ffsl() - 1

2024-05-24 Thread Andrew Cooper
of the expression. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel CC: Oleksii Kurochko CC: Shawn Anastasio CC: consult...@bugseng.com CC

[PATCH v2 02/13] xen/bitops: Cleanup ahead of rearrangements

2024-05-24 Thread Andrew Cooper
. This provides a statement of the ABI, and a confirmation that arch-specific implementations behave as expected. Sadly Clang 7 and older isn't happy with the compile time checks. Skip them, and just rely on the runtime checks. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau

[PATCH v2 for-4.19 00/13] xen/bitops: Untangle ffs()/fls() infrastructure

2024-05-24 Thread Andrew Cooper
444 132-312 xmem_pool_free 17761440-336 __do_softirq 604 252-352 init_heap_pages 23281416-912 xmem_pool_alloc 29201596 -1324 Andrew

[PATCH v2 05/13] xen/bitops: Implement generic_f?sl() in lib/

2024-05-24 Thread Andrew Cooper
-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel CC: Oleksii Kurochko CC: Shawn Anastasio CC: consult...@bugseng.com CC: Simone Ballarin CC: Federico Serafini CC

[PATCH v2 12/13] xen/bitops: Clean up ffs64()/fls64() definitions

2024-05-24 Thread Andrew Cooper
Implement ffs64() and fls64() as plain static inlines, dropping the ifdefary and intermediate generic_f?s64() forms. Add tests for all interesting bit positions at 32bit boundaries. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC

[PATCH v2 08/13] xen/bitops: Implement ffsl() in common logic

2024-05-24 Thread Andrew Cooper
Just like ffs() in the previous changes. Express the upper bound of the testing in terms of BITS_PER_LONG as it varies between architectures. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC

[PATCH v2 07/13] x86/bitops: Improve arch_ffs() in the general case

2024-05-24 Thread Andrew Cooper
of this: add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-31 (-31) Function old new delta mask_write 114 107 -7 xmem_pool_alloc 10631039 -24 Signed-off-by: Andrew Cooper --- CC

[PATCH v2 10/13] xen/bitops: Delete find_first_set_bit()

2024-05-24 Thread Andrew Cooper
No more users. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal Orzel CC: Oleksii Kurochko CC: Shawn Anastasio CC: consult...@bugseng.com CC: Simone Ballarin

[PATCH v2 03/13] ARM/bitops: Change find_first_set_bit() to be a define

2024-05-24 Thread Andrew Cooper
This is in order to maintain bisectability through the subsequent changes, as the order of definitions is altered. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Michal

[PATCH v2 04/13] xen/page_alloc: Coerce min(flsl(), foo) expressions to being unsigned

2024-05-24 Thread Andrew Cooper
This is in order to maintain bisectability through the subsequent changes, where flsl() changes sign-ness non-atomically by architecture. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC

[PATCH v2 01/13] ppc/boot: Run constructors on boot

2024-05-24 Thread Andrew Cooper
PPC collects constructors, but doesn't run them yet. Do so. They'll shortly be used to confirm correct behaviour of the bitops primitives. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC

Re: [PATCH v2 3/8] x86/vlapic: Move lapic_load_hidden migration checks to the check hook

2024-05-23 Thread Andrew Cooper
On 08/05/2024 1:39 pm, Alejandro Vallejo wrote: > diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c > index 8a24419c..2f06bff1b2cc 100644 > --- a/xen/arch/x86/hvm/vlapic.c > +++ b/xen/arch/x86/hvm/vlapic.c > @@ -1573,35 +1573,54 @@ static void lapic_load_fixup(struct vlapic

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

2024-05-23 Thread Andrew Cooper
hvm_vmexit_process to handle all four potential > values appropriately. > > If SVM entries are encountered, set opt.svm_mode so that other > SVM-specific functionality is triggered. > > Remove the `--svm-mode` command-line option, since it's now redundant. > > Signed-off-by: George Dunlap Acked-by: Andrew Cooper

[PATCH 7/7] x86/defns: Clean up X86_{XCR0,XSS}_* constants

2024-05-23 Thread Andrew Cooper
With the exception of one case in read_bndcfgu() which can use ilog2(), the *_POS defines are unused. X86_XCR0_X87 is the name used by both the SDM and APM, rather than X86_XCR0_FP. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné v3: * New

[PATCH 3/7] x86/boot: Collect the Raw CPU Policy earlier on boot

2024-05-23 Thread Andrew Cooper
This is a tangle, but it's a small step in the right direction. xstate_init() is shortly going to want data from the Raw policy. calculate_raw_cpu_policy() is sufficiently separate from the other policies to be safe to do. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich

[PATCH 5/7] x86/cpu-policy: Simplify recalculate_xstate()

2024-05-23 Thread Andrew Cooper
. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monné v2: * Tie ALIGN64 to xsavec rather than xsaves. v3: * Tweak commit message. --- xen/arch/x86/cpu-policy.c | 55 +++ xen/arch/x86/include/asm/xstate.h | 1 + 2 files

[PATCH 1/7] x86/xstate: Fix initialisation of XSS cache

2024-05-23 Thread Andrew Cooper
that the invalid value must only be used in the case that the hardware register is available. Fixes: f7f4a523927f ("x86/xstate: reset cached register values on resume") Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné v3: * Split out of later patch --- xen/arch/x86/xst

[PATCH 6/7] x86/cpuid: Fix handling of XSAVE dynamic leaves

2024-05-23 Thread Andrew Cooper
plications are still accurate. Introduce xstate_compressed_size() to mirror the uncompressed one. Cross check it at boot. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu v3: * Adjust commit message about !XSAVE guests * Rebase over boot time cross check * Use

[PATCH 4/7] x86/xstate: Rework xstate_ctxt_size() as xstate_uncompressed_size()

2024-05-23 Thread Andrew Cooper
) to be replaced with CPUID instructions. They run with feature_mask in XCR0, and prior to setup_xstate_features() on the BSP. No practical change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné v2: * Scan all features. LWP/APX_F are out-of-order. v3: * Rebase over boot time

[PATCH 2/7] x86/xstate: Cross-check dynamic XSTATE sizes at boot

2024-05-23 Thread Andrew Cooper
xcr0" for the lifetime of the VM, which we don't want to be tickling in the general case. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné v3: * New On Sapphire Rapids with the whole series inc diagnostics, we get this pattern: (XEN) *** check_new_xstate(, 0x00

[PATCH for-4.19 v3 0/7] x86/xstate: Fixes to size calculations

2024-05-23 Thread Andrew Cooper
my plate. Andrew Cooper (7): x86/xstate: Fix initialisation of XSS cache x86/xstate: Cross-check dynamic XSTATE sizes at boot x86/boot: Collect the Raw CPU Policy earlier on boot x86/xstate: Rework xstate_ctxt_size() as xstate_uncompressed_size() x86/cpu-policy: Simplify

Re: [PATCH v2 4/4] tools: Drop libsystemd as a dependency

2024-05-23 Thread Andrew Cooper
On 23/05/2024 9:27 am, Jürgen Groß wrote: > On 16.05.24 20:58, Andrew Cooper wrote: >> diff --git a/automation/build/archlinux/current.dockerfile >> b/automation/build/archlinux/current.dockerfile >> index 3e37ab5c40c1..d29f1358c2bd 100644 >> --- a/automation/build/a

Re: [PATCH v2 2/4] x86/shadow: Introduce sh_trace_gl1e_va()

2024-05-22 Thread Andrew Cooper
On 22/05/2024 2:47 pm, Jan Beulich wrote: > On 22.05.2024 15:17, Andrew Cooper wrote: >> trace_shadow_fixup() and trace_not_shadow_fault() both write out identical >> trace records. Reimplement them in terms of a common sh_trace_gl1e_va(). >> >> There's no need to

Re: New Defects reported by Coverity Scan for XenProject

2024-05-22 Thread Andrew Cooper
On 22/05/2024 11:05 am, Jan Beulich wrote: > On 22.05.2024 11:56, scan-ad...@coverity.com wrote: >> ** CID 1598431: Memory - corruptions (OVERRUN) >> >> >> >> *** CID 1598431: Memory -

Re: [PATCH v2 1/4] x86/shadow: Rework trace_shadow_gen() into sh_trace_va()

2024-05-22 Thread Andrew Cooper
On 22/05/2024 2:40 pm, Jan Beulich wrote: > On 22.05.2024 15:17, Andrew Cooper wrote: >> --- a/xen/arch/x86/mm/shadow/multi.c >> +++ b/xen/arch/x86/mm/shadow/multi.c >> @@ -1974,13 +1974,17 @@ typedef u32 guest_va_t; >> typedef u32 guest_pa_t; >> #

[PATCH v2 0/4] x86/shadow: Trace fixes and cleanup

2024-05-22 Thread Andrew Cooper
Patches 1-3 new, following reivew of Jan's bugfix (patch 4) Andrew Cooper (3): x86/shadow: Rework trace_shadow_gen() into sh_trace_va() x86/shadow: Introduce sh_trace_gl1e_va() x86/shadow: Rework trace_shadow_emulate_other() as sh_trace_gfn_va() Jan Beulich (1): x86/shadow: Don't leave

[PATCH v2 1/4] x86/shadow: Rework trace_shadow_gen() into sh_trace_va()

2024-05-22 Thread Andrew Cooper
later cleanup. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: George Dunlap v2: * New --- xen/arch/x86/mm/shadow/multi.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/xen/arch/x86/mm/shadow/multi.c

[PATCH v2 3/4] x86/shadow: Rework trace_shadow_emulate_other() as sh_trace_gfn_va()

2024-05-22 Thread Andrew Cooper
sh_trace_gfn_va() is very similar to sh_trace_gl1e_va(), and a rather shorter name than trace_shadow_emulate_other(). Like sh_trace_gl1e_va(), there is no need to pack the trace record. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: George

[PATCH v2 2/4] x86/shadow: Introduce sh_trace_gl1e_va()

2024-05-22 Thread Andrew Cooper
trace_shadow_fixup() and trace_not_shadow_fault() both write out identical trace records. Reimplement them in terms of a common sh_trace_gl1e_va(). There's no need to pack the trace record, even in the case of PAE paging. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich

[PATCH v2 4/4] x86/shadow: Don't leave trace record field uninitialized

2024-05-22 Thread Andrew Cooper
From: Jan Beulich The emulation_count field is set only conditionally right now. Convert all field setting to an initializer, thus guaranteeing that field to be set to 0 (default initialized) when GUEST_PAGING_LEVELS != 3. Rework trace_shadow_emulate() to be consistent with the other trace

Re: [PATCH] x86/shadow: don't leave trace record field uninitialized

2024-05-22 Thread Andrew Cooper
On 22/05/2024 11:17 am, Jan Beulich wrote: > The emulation_count field is set only conditionally right now. Convert > all field setting to an initializer, thus guaranteeing that field to be > set to 0 (default initialized) when GUEST_PAGING_LEVELS != 3. > > While there also drop the "event" local

[PATCH 3/3] xen/x86: Address two misc MISRA 17.7 violations

2024-05-21 Thread Andrew Cooper
Neither text_poke() nor watchdog_setup() have return value consulted. Switch them to being void. Signed-off-by: Andrew Cooper --- CC: George Dunlap CC: Jan Beulich CC: Stefano Stabellini CC: Julien Grall CC: Roberto Bagnara CC: consult...@bugseng.com CC: Oleksii Kurochko --- xen/arch

[PATCH 1/3] xen/lzo: Implement COPY{4,8} using memcpy()

2024-05-21 Thread Andrew Cooper
This is simpler and easier for both humans and compilers to read. It also addresses 6 instances of MISRA R5.3 violation (shadowing of the ptr_ local variable inside both {put,get}_unaligned()). No change, not even in the compiled binary. Signed-off-by: Andrew Cooper --- CC: George Dunlap CC

[PATCH 2/3] xen/x86: Drop useless non-Kconfig CONFIG_* variables

2024-05-21 Thread Andrew Cooper
These are all either completely unused, or do nothing useful. Signed-off-by: Andrew Cooper --- CC: George Dunlap CC: Jan Beulich CC: Stefano Stabellini CC: Julien Grall CC: Roberto Bagnara CC: consult...@bugseng.com CC: Oleksii Kurochko --- xen/arch/x86/include/asm/config.h | 4

[PATCH for-4.19 0/3] xen: Misc MISRA changes

2024-05-21 Thread Andrew Cooper
Misc fixes collected during today's call. Andrew Cooper (3): xen/lzo: Implement COPY{4,8} using memcpy() xen/x86: Drop useless non-Kconfig CONFIG_* variables xen/x86: Address two misc MISRA 17.7 violations xen/arch/x86/alternative.c| 4 ++-- xen/arch/x86/include/asm/config.h | 4

Re: [PATCH v3.5 3/4] tools/xen-cpuid: Use automatically generated feature names

2024-05-20 Thread Andrew Cooper
On 20/05/2024 5:29 pm, Roger Pau Monné wrote: > On Mon, May 20, 2024 at 04:20:37PM +0100, Andrew Cooper wrote: >> On 20/05/2024 4:07 pm, Roger Pau Monné wrote: >>> On Mon, May 20, 2024 at 03:33:59PM +0100, Andrew Cooper wrote: >>>> From: Roger Pau Monné >>

Re: [PATCH v3.5 3/4] tools/xen-cpuid: Use automatically generated feature names

2024-05-20 Thread Andrew Cooper
On 20/05/2024 4:07 pm, Roger Pau Monné wrote: > On Mon, May 20, 2024 at 03:33:59PM +0100, Andrew Cooper wrote: >> From: Roger Pau Monné >> >> Have gen-cpuid.py write out INIT_FEATURE_VAL_TO_NAME, derived from the same >> data source as INIT_FEATURE_NAME_TO_VAL, althoug

[PATCH v3.5 3/4] tools/xen-cpuid: Use automatically generated feature names

2024-05-20 Thread Andrew Cooper
. As dump_leaf() rendered missing names as numbers, always dump leaves even if we don't have the leaf name. This conversion was argumably missed in commit 59afdb8a81d6 ("tools/misc: Tweak reserved bit handling for xen-cpuid"). Signed-off-by: Roger Pau Monné Signed-off-by: Andrew Cooper -

Re: [PATCH 1/4] x86/gen-cpuid: Minor cleanup

2024-05-20 Thread Andrew Cooper
On 14/05/2024 8:14 am, Roger Pau Monné wrote: > On Fri, May 10, 2024 at 11:39:59PM +0100, Andrew Cooper wrote: >> Rename INIT_FEATURE_NAMES to INIT_FEATURE_NAME_TO_VAL as we're about to gain >> a >> inverse mapping of the same thing. >> >> Use dict.it

Re: [PATCH for-4.19] x86/msi: prevent watchdog triggering when dumping MSI state

2024-05-20 Thread Andrew Cooper
On 17/05/2024 2:56 pm, Roger Pau Monne wrote: > Use the same check that's used in dump_irqs(). > > Signed-off-by: Roger Pau Monné Acked-by: Andrew Cooper

Re: [PATCH v2 2/4] tools: Import standalone sd_notify() implementation from systemd

2024-05-16 Thread Andrew Cooper
On 17/05/2024 12:07 am, Marek Marczykowski-Górecki wrote: > On Thu, May 16, 2024 at 07:58:02PM +0100, Andrew Cooper wrote: >> ... in order to avoid linking against the whole of libsystemd. >> >> Only minimal changes to the upstream copy, to function as a drop-in >>

[PATCH v2 3/4] tools/{c,o}xenstored: Don't link against libsystemd

2024-05-16 Thread Andrew Cooper
Use the local freestanding wrapper instead. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Juergen Gross CC: George Dunlap CC: Jan Beulich CC: Stefano Stabellini CC: Julien Grall CC: Christian Lindig CC: Edwin Török v2: * Redo almost from scratch, using the freestanding

[PATCH v2 1/4] LICENSES: Add MIT-0 (MIT No Attribution)

2024-05-16 Thread Andrew Cooper
We are about to import code licensed under MIT-0. It's compatible for us to use, so identify it as a permitted license. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Juergen Gross CC: George Dunlap CC: Jan Beulich CC: Stefano Stabellini CC: Julien Grall CC: Christian Lindig CC

[PATCH v2 4/4] tools: Drop libsystemd as a dependency

2024-05-16 Thread Andrew Cooper
as removed in the build containers. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Juergen Gross CC: George Dunlap CC: Jan Beulich CC: Stefano Stabellini CC: Julien Grall CC: Christian Lindig CC: Edwin Török v2: * Only strip out the library check. --- automation/build/archlinux

[PATCH v2 for-4.19 0/4] Drop libsystemd

2024-05-16 Thread Andrew Cooper
On advise from the systemd leadership. v2: * Import the free-standing example and use that to retain existing functionality. Andrew Cooper (4): LICENSES: Add MIT-0 (MIT No Attribution) tools: Import standalone sd_notify() implementation from systemd tools/{c,o}xenstored: Don't link

[PATCH v2 2/4] tools: Import standalone sd_notify() implementation from systemd

2024-05-16 Thread Andrew Cooper
... in order to avoid linking against the whole of libsystemd. Only minimal changes to the upstream copy, to function as a drop-in replacement for sd_notify() and as a header-only library. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Juergen Gross CC: George Dunlap CC: Jan Beulich

Re: [PATCH for-4.19?] xen/x86: pretty print interrupt CPU affinity masks

2024-05-16 Thread Andrew Cooper
On 15/05/2024 4:29 pm, Roger Pau Monne wrote: > Print the CPU affinity masks as numeric ranges instead of plain hexadecimal > bitfields. > > Signed-off-by: Roger Pau Monné > --- > xen/arch/x86/irq.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git

Re: [PATCH] x86/ucode: Further fixes to identify "ucode already up to date"

2024-05-16 Thread Andrew Cooper
On 16/05/2024 12:44 pm, Jan Beulich wrote: > On 16.05.2024 13:31, Andrew Cooper wrote: >> When the revision in hardware is newer than anything Xen has to hand, >> 'microcode_cache' isn't set up. Then, `xen-ucode` initiates the update >> because it doesn't know whether

Re: [PATCH] x86/ucode: Further fixes to identify "ucode already up to date"

2024-05-16 Thread Andrew Cooper
On 16/05/2024 12:50 pm, Roger Pau Monné wrote: > On Thu, May 16, 2024 at 12:31:03PM +0100, Andrew Cooper wrote: >> When the revision in hardware is newer than anything Xen has to hand, >> 'microcode_cache' isn't set up. Then, `xen-ucode` initiates the update >> because it

[PATCH] x86/ucode: Further fixes to identify "ucode already up to date"

2024-05-16 Thread Andrew Cooper
if Xen doesn't find new microcode to use. Fixes: 648db37a155a ("x86/ucode: Distinguish "ucode already up to date"") Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Fouad Hilly Sorry Fouad, but this collides with your `--force` series once again. Hop

Re: [PATCH for-4.19] x86/mtrr: avoid system wide rendezvous when setting AP MTRRs

2024-05-15 Thread Andrew Cooper
On 14/05/2024 3:43 pm, Roger Pau Monné wrote: > On Tue, May 14, 2024 at 02:50:18PM +0100, Andrew Cooper wrote: >> On 14/05/2024 12:09 pm, Andrew Cooper wrote: >>> On 13/05/2024 9:59 am, Roger Pau Monne wrote: >>>> There's no point in forcing a system w

Re: [RFC PATCH v2 4/5] docs/man: document VIF vlan keyword

2024-05-15 Thread Andrew Cooper
On 15/05/2024 4:30 pm, Leigh Brown wrote: > Hi Jason, > > On 2024-05-15 01:57, Jason Andryuk wrote: >> On Wed, May 8, 2024 at 5:39 PM Leigh Brown wrote: >>> >>> Document the new `vlan' keyword in xl-network-configuration(5). >>> >>> Signed-off-by: Leigh Brown >> >> Reviewed-by: Jason Andryuk >>

Re: [PATCH for-4.19?] xen/x86: pretty print interrupt CPU affinity masks

2024-05-15 Thread Andrew Cooper
On 15/05/2024 4:29 pm, Roger Pau Monne wrote: > Print the CPU affinity masks as numeric ranges instead of plain hexadecimal > bitfields. > > Signed-off-by: Roger Pau Monné Ha - I was going to write exactly the same patch, but you beat me to it. Acked-by: Andrew Cooper

Re: [PATCH] xen/sched: set all sched_resource data inside locked region for new cpu

2024-05-15 Thread Andrew Cooper
ad_balance+0x41/0x877 > (XEN)[] F > common/sched/credit.c#csched_schedule+0x36a/0x69f > (XEN)[] F common/sched/core.c#do_schedule+0xe8/0x433 > (XEN)[] F common/sched/core.c#schedule+0x2e5/0x2f9 > (XEN)[] F common/softirq.c#__do_softirq+0x94/0xbe > (XEN)

Re: Xen crash in scheduler during cpu hotplug

2024-05-15 Thread Andrew Cooper
On 15/05/2024 2:38 pm, Jürgen Groß wrote: > On 15.05.24 15:22, Andrew Cooper wrote: >> On 15/05/2024 1:39 pm, Jan Beulich wrote: >>> On 15.05.2024 13:58, Andrew Cooper wrote: >>>> Just so it doesn't get lost.  In XenRT, we've found: >>>> >>>>

  1   2   3   4   5   6   7   8   9   10   >