Re: [PATCH v3] docs/misra: document the expected sizes of integer types

2024-04-05 Thread Bertrand Marquis
Hi Stefano, > On 5 Apr 2024, at 01:57, Stefano Stabellini wrote: > > On Thu, 4 Apr 2024, Bertrand Marquis wrote: >> Hi Stefano, >> >>> On 4 Apr 2024, at 03:12, Stefano Stabellini wrote: >>> >>> Xen makes assumptions about the size of integer types on the various >>> architectures. Document th

[xen-unstable test] 185241: tolerable FAIL - PUSHED

2024-04-05 Thread osstest service owner
flight 185241 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/185241/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 16 saverestore-support-checkfail like 185236 test-amd64-amd64-xl-qemut-win7-amd64

Re: [PATCH v7 04/19] xen: introduce generic non-atomic test_*bit()

2024-04-05 Thread Oleksii
On Fri, 2024-04-05 at 08:11 +0200, Jan Beulich wrote: > On 04.04.2024 18:24, Oleksii wrote: > > On Thu, 2024-04-04 at 18:12 +0200, Jan Beulich wrote: > > > On 04.04.2024 17:45, Oleksii wrote: > > > > On Thu, 2024-04-04 at 15:22 +0200, Jan Beulich wrote: > > > > > On 03.04.2024 12:19, Oleksii Kuroch

Re: [PATCH v7 04/19] xen: introduce generic non-atomic test_*bit()

2024-04-05 Thread Jan Beulich
On 05.04.2024 09:56, Oleksii wrote: > On Fri, 2024-04-05 at 08:11 +0200, Jan Beulich wrote: >> On 04.04.2024 18:24, Oleksii wrote: >>> On Thu, 2024-04-04 at 18:12 +0200, Jan Beulich wrote: On 04.04.2024 17:45, Oleksii wrote: > On Thu, 2024-04-04 at 15:22 +0200, Jan Beulich wrote: >> On

[PATCH] locking/x86/xen: Use try_cmpxchg() in xen_alloc_p2m_entry()

2024-04-05 Thread Uros Bizjak
Use try_cmpxchg() instead of cmpxchg(*ptr, old, new) == old. The x86 CMPXCHG instruction returns success in the ZF flag, so this change saves a compare after CMPXCHG. Also, try_cmpxchg() implicitly assigns old *ptr value to "old" when CMPXCHG fails. There is no need to explicitly assign old *ptr

[XEN PATCH v2 3/9] x86/irq: tidy switch statement and address MISRA violation

2024-04-05 Thread Nicola Vetrini
Remove unneded blank lines between switch clauses. Refactor the clauses so that a MISRA C Rule 16.2 violation is resolved (A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement). Note that the switch clause ending with the pseudo key

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

2024-04-05 Thread Nicola Vetrini
Remove unneded blank lines between switch clauses. Refactor the last clauses so that a violation of MISRA C Rule 16.2 is resolved (A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement). The switch clause ending with the pseudo keywo

[XEN PATCH v2 5/9] xen/domctl: address violations of MISRA C Rule 16.2

2024-04-05 Thread Nicola Vetrini
Refactor the first clauses so that a violation of MISRA C Rule 16.2 is resolved (a switch label should be immediately enclosed in the compound statement of the switch). Note that the switch clause ending with the pseudo keyword "fallthrough" is an allowed exception to Rule 16.3. Convert fallthroug

[XEN PATCH v2 8/9] xen/domain: deviate MISRA C Rule 16.2 violation

2024-04-05 Thread Nicola Vetrini
MISRA C Rule 16.2 states: "A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement". The PROGRESS_VCPU local helper specifies a case that is directly inside the compound statement of a for loop, hence violating the rule. To avoid this,

[XEN PATCH v2 9/9] eclair_analysis: deviate x86 emulator for Rule 16.2

2024-04-05 Thread Nicola Vetrini
MISRA C Rule 16.2 states: "A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement". Since complying with this rule of the x86 emulator would lead to a lot of code duplication, it is deemed better to exempt those files for this guideli

[XEN PATCH v2 7/9] xen/xsm: address violation of MISRA C Rule 16.2

2024-04-05 Thread Nicola Vetrini
Refactor the switch so that a violation of MISRA C Rule 16.2 is resolved (A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement). Note that the switch clause ending with the pseudo keyword "fallthrough" is an allowed exception to Rule

[XEN PATCH v2 2/9] x86/cpuid: address violation of MISRA C Rule 16.2

2024-04-05 Thread Nicola Vetrini
Refactor the switch so that a violation of MISRA C Rule 16.2 is resolved (A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement). Note that the switch clause ending with the pseudo keyword "fallthrough" is an allowed exception to Rule

[XEN PATCH v2 4/9] x86/efi: tidy switch statement and address MISRA violation

2024-04-05 Thread Nicola Vetrini
Refactor the first clauses so that a violation of MISRA C Rule 16.2 is resolved (a switch label, "default" in this case, should be immediately enclosed in the compound statement of the switch). Note that the switch clause ending with the pseudo keyword "fallthrough" is an allowed exception to Rule

[XEN PATCH v2 0/9] address violations of MISRA C Rule 16.2

2024-04-05 Thread Nicola Vetrini
Continuing the work done in [1], these patches make this rule clean (i.e., no residual violation of the rule). Some switches are refactored to avoid interleaving a case label inside an if statement. In some cases this leads to some duplication, but the files where this would have had the greatest i

[XEN PATCH v2 6/9] x86/hvm: address violations of MISRA C Rule 16.2

2024-04-05 Thread Nicola Vetrini
Refactor the switch so that a violation of MISRA C Rule 16.2 is resolved (a switch label should be immediately enclosed in the compound statement of the switch). The switch clause ending with the pseudo keyword "fallthrough" is an allowed exception to Rule 16.3. Signed-off-by: Nicola Vetrini ---

[XEN PATCH V1] x86/ucode: optional amd/intel ucode build & load

2024-04-05 Thread Sergiy Kibrik
Introduce configuration variables to make it possible to selectively turn on/off CPU microcode management code in the build for AMD and Intel CPUs. This is to allow build configuration for a specific CPU, not compile and load what will not be used anyway. Signed-off-by: Sergiy Kibrik --- xen/ar

Re: [PATCH v7 03/19] xen/riscv: introduce extenstion support check by compiler

2024-04-05 Thread Oleksii
On Fri, 2024-04-05 at 08:08 +0200, Jan Beulich wrote: > On 04.04.2024 18:17, Oleksii wrote: > > On Thu, 2024-04-04 at 17:43 +0200, Jan Beulich wrote: > > > On 04.04.2024 17:18, Oleksii wrote: > > > > On Thu, 2024-04-04 at 12:07 +0200, Jan Beulich wrote: > > > > > On 03.04.2024 12:19, Oleksii Kuroch

Re: [XEN PATCH V1] x86/ucode: optional amd/intel ucode build & load

2024-04-05 Thread Andrew Cooper
On 05/04/2024 11:30 am, Sergiy Kibrik wrote: > Introduce configuration variables to make it possible to selectively turn > on/off CPU microcode management code in the build for AMD and Intel CPUs. > > This is to allow build configuration for a specific CPU, not compile and > load what will not be u

Re: [PATCH v7 04/19] xen: introduce generic non-atomic test_*bit()

2024-04-05 Thread Oleksii
On Fri, 2024-04-05 at 10:05 +0200, Jan Beulich wrote: > On 05.04.2024 09:56, Oleksii wrote: > > On Fri, 2024-04-05 at 08:11 +0200, Jan Beulich wrote: > > > On 04.04.2024 18:24, Oleksii wrote: > > > > On Thu, 2024-04-04 at 18:12 +0200, Jan Beulich wrote: > > > > > On 04.04.2024 17:45, Oleksii wrote:

Re: [PATCH v7 04/19] xen: introduce generic non-atomic test_*bit()

2024-04-05 Thread Oleksii
On Fri, 2024-04-05 at 13:53 +0200, Oleksii wrote: > On Fri, 2024-04-05 at 10:05 +0200, Jan Beulich wrote: > > On 05.04.2024 09:56, Oleksii wrote: > > > On Fri, 2024-04-05 at 08:11 +0200, Jan Beulich wrote: > > > > On 04.04.2024 18:24, Oleksii wrote: > > > > > On Thu, 2024-04-04 at 18:12 +0200, Jan

[PATCH 0/5] x86/xen-ucode: Introduce --force option

2024-04-05 Thread Fouad Hilly
Refactor and introduce --force option to xen-ucode, which skips microcode version check when updating x86 CPU micocode. A new hypercall introduced with flags field to facilitate the new option and allow for future flags as needed. Fouad Hilly (5): x86: Remove x86 low level version check of micro

[PATCH 2/5] x86: Refactor microcode_update() hypercall with flags field

2024-04-05 Thread Fouad Hilly
Refactor microcode_update() hypercall by adding flags field. Introduce XENPF_microcode_update2 hypercall to handle flags field. Signed-off-by: Fouad Hilly --- xen/arch/x86/cpu/microcode/core.c| 12 +--- xen/arch/x86/include/asm/microcode.h | 2 +- xen/arch/x86/platform_hypercall.c

[PATCH 4/5] x86: Use getopt to handle command line args

2024-04-05 Thread Fouad Hilly
Use getopt_long() to handle command line arguments. Introduce ext_err for common exit with errors. Signed-off-by: Fouad Hilly --- tools/misc/xen-ucode.c | 49 +- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/tools/misc/xen-ucode.c b/tools

[PATCH 3/5] x86: Add usage() to print out usage message

2024-04-05 Thread Fouad Hilly
Refactor xen-ucode tool by adding usage() to handle usage\help messages Signed-off-by: Fouad Hilly --- tools/misc/xen-ucode.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/misc/xen-ucode.c b/tools/misc/xen-ucode.c index c6ae6498d659..1edcebfb9f9c 100644 -

[PATCH 5/5] x86: Add --force option to xen-ucode to override microcode version check

2024-04-05 Thread Fouad Hilly
Introduce --force option to xen-ucode to force skipping microcode version check, which allows the user to update x86 microcode even if both versions are the same. Signed-off-by: Fouad Hilly --- Suggested-by: Andrew Cooper --- tools/include/xenctrl.h | 2 +- tools/libs/ctrl/xc_misc.c | 12 ++

[PATCH 1/5] x86: Remove x86 low level version check of microcode

2024-04-05 Thread Fouad Hilly
Remove microcode version check at Intel and AMD Level. Microcode version check will be at higher and common level. Signed-off-by: Fouad Hilly --- xen/arch/x86/cpu/microcode/amd.c | 8 ++-- xen/arch/x86/cpu/microcode/intel.c | 11 +++ 2 files changed, 5 insertions(+), 14 deletions(

[PATCH 2/2] x86/xen: return a sane initial apic id when running as PV guest

2024-04-05 Thread Juergen Gross
With recent sanity checks for topology information added, there are now warnings issued for APs when running as a Xen PV guest: [Firmware Bug]: CPU 1: APIC ID mismatch. CPUID: 0x APIC: 0x0001 This is due to the initial APIC ID obtained via CPUID for PV guests is always 0. Avoid the warni

[PATCH 0/2] x86: Two fixes related to Xen PV guest mode

2024-04-05 Thread Juergen Gross
These are 2 fixes for issues introduced by topology related changes added in the 6.9 merge window. Juergen Gross (2): x86/cpu: fix BSP detection when running as Xen PV guest x86/xen: return a sane initial apic id when running as PV guest arch/x86/kernel/cpu/topology.c | 2 +- arch/x86/xen/e

April 2024 - community call recording

2024-04-05 Thread Kelly Choi
Hi all, The April community call recording has been uploaded: https://www.youtube.com/watch?v=fpcxKWdaJyw&ab_channel=TheXenProject This has also been saved in the Cryptpad file. Many thanks, Kelly Choi Community Manager Xen Project

Re: [PATCH v7 04/19] xen: introduce generic non-atomic test_*bit()

2024-04-05 Thread Jan Beulich
On 05.04.2024 13:56, Oleksii wrote: > On Fri, 2024-04-05 at 13:53 +0200, Oleksii wrote: >> On Fri, 2024-04-05 at 10:05 +0200, Jan Beulich wrote: >>> On 05.04.2024 09:56, Oleksii wrote: On Fri, 2024-04-05 at 08:11 +0200, Jan Beulich wrote: > On 04.04.2024 18:24, Oleksii wrote: >> On Thu

Re: [PATCH 2/2] x86/xen: return a sane initial apic id when running as PV guest

2024-04-05 Thread Andrew Cooper
On 05/04/2024 1:34 pm, Juergen Gross wrote: > With recent sanity checks for topology information added, there are now > warnings issued for APs when running as a Xen PV guest: > > [Firmware Bug]: CPU 1: APIC ID mismatch. CPUID: 0x APIC: 0x0001 > > This is due to the initial APIC ID obtained

Re: [PATCH 2/2] x86/xen: return a sane initial apic id when running as PV guest

2024-04-05 Thread Jürgen Groß
On 05.04.24 14:50, Andrew Cooper wrote: On 05/04/2024 1:34 pm, Juergen Gross wrote: With recent sanity checks for topology information added, there are now warnings issued for APs when running as a Xen PV guest: [Firmware Bug]: CPU 1: APIC ID mismatch. CPUID: 0x APIC: 0x0001 This is d

[XEN PATCH] xen/compiler: address violation of MISRA C Rule 20.9

2024-04-05 Thread Nicola Vetrini
The rule states: "All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be #define'd before evaluation". In this case, using defined(identifier) is a MISRA-compliant way to achieve the same effect. Signed-off-by: Nicola Vetrini --- This is the only outs

Re: [PATCH] x86/tsx: Cope with RTM_ALWAYS_ABORT vs RTM mismatch

2024-04-05 Thread Andrew Cooper
On 04/04/2024 2:32 pm, Jan Beulich wrote: > On 04.04.2024 15:22, Andrew Cooper wrote: >> On 04/04/2024 1:45 pm, Jan Beulich wrote: >>> For the write-discard property, how was that determined? Does it affect all >>> writable bits? >> Marek kindly ran a debugging patch for me last night to try and fi

[PATCH v2] x86/tsx: Cope with RTM_ALWAYS_ABORT vs RTM mismatch

2024-04-05 Thread Andrew Cooper
It turns out there is something wonky on some but not all CPUs with MSR_TSX_FORCE_ABORT. The presence of RTM_ALWAYS_ABORT causes Xen to think it's safe to offer HLE/RTM to guests, but in this case, XBEGIN instructions genuinely #UD. Spot this case and try to back out as cleanly as we can. Signed

Re: [PATCH] x86/tsx: Cope with RTM_ALWAYS_ABORT vs RTM mismatch

2024-04-05 Thread Jan Beulich
On 05.04.2024 15:01, Andrew Cooper wrote: > On 04/04/2024 2:32 pm, Jan Beulich wrote: >> On 04.04.2024 15:22, Andrew Cooper wrote: >>> On 04/04/2024 1:45 pm, Jan Beulich wrote: > + * Spot this case, and treat it as if no TSX is available at > all. > + * This wil

Re: [XEN PATCH] xen/compiler: address violation of MISRA C Rule 20.9

2024-04-05 Thread Jan Beulich
On 05.04.2024 14:59, Nicola Vetrini wrote: > The rule states: > "All identifiers used in the controlling expression of #if or #elif > preprocessing directives shall be #define'd before evaluation". > In this case, using defined(identifier) is a MISRA-compliant > way to achieve the same effect. > >

Re: [PATCH v2] x86/tsx: Cope with RTM_ALWAYS_ABORT vs RTM mismatch

2024-04-05 Thread Jan Beulich
On 05.04.2024 15:07, Andrew Cooper wrote: > It turns out there is something wonky on some but not all CPUs with > MSR_TSX_FORCE_ABORT. The presence of RTM_ALWAYS_ABORT causes Xen to think > it's safe to offer HLE/RTM to guests, but in this case, XBEGIN instructions > genuinely #UD. > > Spot this

[linux-linus test] 185243: regressions - FAIL

2024-04-05 Thread osstest service owner
flight 185243 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/185243/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64-xsm 6 xen-buildfail REGR. vs. 185228 Tests which did not

Re: [OSSTEST PATCH 00/36] Switch to Debian Bookworm

2024-04-05 Thread Anthony PERARD
On Thu, Mar 28, 2024 at 05:54:04PM +, Anthony PERARD wrote: > On Mon, Mar 18, 2024 at 04:55:09PM +, Anthony PERARD wrote: I've now pushed "production-config: Set Bookworm's debian-installer version" and these two: > > Switch to Debian Bookworm as default suite > > make-hosts-flight:

[libvirt test] 185244: tolerable all pass - PUSHED

2024-04-05 Thread osstest service owner
flight 185244 libvirt real [real] http://logs.test-lab.xenproject.org/osstest/logs/185244/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 16 saverestore-support-checkfail like 185235 test-amd64-amd64-libvirt-xsm 15 migrate-s

Re: [XEN PATCH v3 2/2] MISRA C Rule 20.7 states: "The features of `' shall not be used"

2024-04-05 Thread Stefano Stabellini
On Fri, 5 Apr 2024, Jan Beulich wrote: > On 05.04.2024 02:27, Stefano Stabellini wrote: > > On Thu, 28 Mar 2024, Simone Ballarin wrote: > >> The Xen community wants to avoid using variadic functions except for > >> specific circumstances where it feels appropriate by strict code review. > >> > >> F

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

2024-04-05 Thread Shawn Anastasio
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 revealed some missing #includes across the ARM tree, so fix thos

Re: [PATCH v3] docs/misra: document the expected sizes of integer types

2024-04-05 Thread Stefano Stabellini
On Fri, 5 Apr 2024, Jan Beulich wrote: > On 05.04.2024 01:56, Stefano Stabellini wrote: > > On Thu, 4 Apr 2024, Jan Beulich wrote: > >> On 04.04.2024 03:12, Stefano Stabellini wrote: > >>> --- a/docs/misra/C-language-toolchain.rst > >>> +++ b/docs/misra/C-language-toolchain.rst > >>> @@ -480,4 +480

[PATCH v4] docs/misra: document the expected sizes of integer types

2024-04-05 Thread Stefano Stabellini
Xen makes assumptions about the size of integer types on the various architectures. Document these assumptions. Signed-off-by: Stefano Stabellini --- Changes in v4: - list the architectures explicitly - add ARMv7-A --- docs/misra/C-language-toolchain.rst | 73 + 1 fil

Re: [XEN PATCH 3/7] xen/sched: address a violation of MISRA C:2012 Rule 16.3

2024-04-05 Thread Stefano Stabellini
On Fri, 5 Apr 2024, Jan Beulich wrote: > On 05.04.2024 02:18, Stefano Stabellini wrote: > > On Wed, 3 Apr 2024, Nicola Vetrini wrote: > >> On 2024-04-03 08:33, Jan Beulich wrote: > >>> On 02.04.2024 09:22, Federico Serafini wrote: > Use pseudo-keyword fallthrough to meet the requirements to de

[xen-unstable-smoke test] 185249: tolerable all pass - PUSHED

2024-04-05 Thread osstest service owner
flight 185249 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/185249/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 15 migrate-support-checkfail never pass test-armhf-armhf-xl 1

[xen-unstable-smoke test] 185251: tolerable all pass - PUSHED

2024-04-05 Thread osstest service owner
flight 185251 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/185251/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 15 migrate-support-checkfail never pass test-armhf-armhf-xl 1

[xen-unstable test] 185246: tolerable FAIL - PUSHED

2024-04-05 Thread osstest service owner
flight 185246 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/185246/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 16 saverestore-support-checkfail like 185241 test-amd64-amd64-xl-qemut-win7-amd64

[linux-linus test] 185247: tolerable FAIL - PUSHED

2024-04-05 Thread osstest service owner
flight 185247 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/185247/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 16 saverestore-support-checkfail like 185228 test-amd64-amd64-xl-qemut-win7-amd64