Re: [PATCH 2/2] x86/emul: Emulate %cr8 accesses

2025-03-26 Thread Jan Beulich
On 25.03.2025 18:41, Andrew Cooper wrote: > Petr reports: > > (XEN) MMIO emulation failed (1): d12v1 64bit @ 0010:f8057ba7dfbf -> 45 > 0f 20 c2 ... > > during introspection. > > This is MOV %cr8, which is wired up for hvm_mov_{to,from}_cr(); the VMExit > fastpaths, but not for the full em

Re: [PATCH v3 3/3] PCI/MSI: Convert pci_msi_ignore_mask to per MSI domain flag

2025-03-26 Thread Borislav Petkov
On Wed, Mar 26, 2025 at 12:14:09PM +0100, Roger Pau Monné wrote: > Sorry, not on KVM, I've tested on Xen and native. It also seems to be > somewhat tied to the Kconfig, as I couldn't reproduce it with my > Kconfig, maybe didn't have the required VirtIO options enabled. Right. > It's fixed by: >

Re: [PATCH v3 03/15] xen/cpufreq: refactor cmdline "cpufreq=xxx"

2025-03-26 Thread Jan Beulich
On 26.03.2025 08:20, Penny, Zheng wrote: >> -Original Message- >> From: Jan Beulich >> Sent: Monday, March 24, 2025 11:01 PM >> >> On 06.03.2025 09:39, Penny Zheng wrote: >>> --- a/docs/misc/xen-command-line.pandoc >>> +++ b/docs/misc/xen-command-line.pandoc >>> @@ -535,7 +535,8 @@ choice

Re: [PATCH] x86/elf: Remove ASM_CALL_CONSTRAINT from elf_core_save_regs()

2025-03-26 Thread Andrew Cooper
On 26/03/2025 9:00 am, Jan Beulich wrote: > On 25.03.2025 19:00, Andrew Cooper wrote: >> I was mistaken about when ASM_CALL_CONSTRAINT is applicable. It is not >> applicable for plain pushes/pops, so remove it from the flags logic. >> >> Clarify the description of ASM_CALL_CONSTRAINT to be explici

Re: [PATCH] x86/PVH: expose OEMx ACPI tables to Dom0

2025-03-26 Thread Roger Pau Monné
On Wed, Mar 26, 2025 at 10:45:18AM +0100, Jan Beulich wrote: > On 26.03.2025 10:21, Roger Pau Monné wrote: > > On Wed, Mar 26, 2025 at 09:45:09AM +0100, Jan Beulich wrote: > >> What they contain we don't know, but we can't sensibly hide them. On my > >> Skylake system OEM1 (with a description of "I

Re: [PATCH v3 07/15] xen/cpufreq: fix core frequency calculation for AMD Family 1Ah CPUs

2025-03-26 Thread Jan Beulich
On 26.03.2025 11:14, Nicola Vetrini wrote: > On 2025-03-26 10:54, Penny, Zheng wrote: >>> -Original Message- >>> From: Jan Beulich >>> Sent: Monday, March 24, 2025 11:48 PM >>> >>> On 06.03.2025 09:39, Penny Zheng wrote: This commit fixes core frequency calculation for AMD Family 1Ah

Re: [PATCH] RISCV/bitops: Use Zbb to provide arch-optimised bitops

2025-03-26 Thread Jan Beulich
On 25.03.2025 18:04, Oleksii Kurochko wrote: > > On 3/25/25 5:46 PM, Jan Beulich wrote: >> On 25.03.2025 17:35, Oleksii Kurochko wrote: >>> On 3/7/25 1:12 PM, Andrew Cooper wrote: On 07/03/2025 12:01 pm, Jan Beulich wrote: > On 07.03.2025 12:50, Oleksii Kurochko wrote: >> On 3/6/25 9:

Re: [PATCH v3 6/7] xen: introduce Kconfig ARCH_PAGING_MEMPOOL

2025-03-26 Thread Jan Beulich
On 26.03.2025 10:59, Orzel, Michal wrote: > On 26/03/2025 10:54, Jan Beulich wrote: >> On 26.03.2025 10:39, Orzel, Michal wrote: >>> On 20/03/2025 08:32, Jan Beulich wrote: On 19.03.2025 17:31, Oleksii Kurochko wrote: > On 3/19/25 12:35 PM, Jan Beulich wrote: >> On 18.03.2025 14:05, Ol

Re: [PATCH v1 5/8] xen/console: rename switch_serial_input() to console_switch_focus()

2025-03-26 Thread Jan Beulich
On 19.03.2025 00:36, dm...@proton.me wrote: > Update the name to emphasize the physical console input switch to a > new owner domain following the naming notation in the console driver. > > No functional change. > > Signed-off-by: Denis Mukhin While I don't strictly mind the change, I'd like to

Re: [PATCH v1 6/8] xen/console: rename console_rx to console_focus

2025-03-26 Thread Jan Beulich
On 19.03.2025 00:36, dm...@proton.me wrote: > Update the symbol name in preparation for the semantic change > to the physical console input owner domain identifier. As you say, no semantic change here just yet, but then ... > --- a/xen/drivers/char/console.c > +++ b/xen/drivers/char/console.c > @

Re: [PATCH v1 4/8] xen/domain: introduce domid_alloc()

2025-03-26 Thread Jan Beulich
On 19.03.2025 00:36, dm...@proton.me wrote: > --- a/xen/arch/arm/domain_build.c > +++ b/xen/arch/arm/domain_build.c > @@ -2367,8 +2367,15 @@ void __init create_dom0(void) > .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version), > }; > unsigned int flags = CDF_privileged;

Re: [PATCH v1 3/8] xen/domain: introduce domid_top

2025-03-26 Thread Jan Beulich
On 19.03.2025 00:36, dm...@proton.me wrote: > Rename max_init_domid to domid_top to align with its usage in the code > (Arm), where it represents the upper boundary of the non-system domain > ID range. I think I said before that I don't share this view of yours. The variable is quite appropriately

RE: [PATCH v1 03/19] xen/sysctl: wrap around XEN_SYSCTL_readconsole

2025-03-26 Thread Penny, Zheng
[Public] Hi, > -Original Message- > From: Jan Beulich > Sent: Thursday, March 20, 2025 4:47 PM > To: Penny, Zheng > Cc: Huang, Ray ; Andrew Cooper > ; Anthony PERARD ; > Orzel, Michal ; Julien Grall ; Roger Pau > Monné ; Stefano Stabellini ; > Daniel > P. Smith ; Alejandro Vallejo > ;

[PATCH] x86/emul: Adjust handling of CR8_LEGACY

2025-03-26 Thread Andrew Cooper
The CR8_LEGACY feature was introduced in the K8 Revision F. It doesn't exist in prior revisions of the K8. Furthermore, from APM Vol2 3.1.5 CR8 (Task Priority Register, TPR): The AMD64 architecture introduces a new control register, CR8, defined as the task priority register (TPR). Give CR8

Re: [PATCH] tools: Remove support for qemu-trad's battery reporting

2025-03-26 Thread Alejandro Vallejo
On Wed Mar 26, 2025 at 1:59 PM GMT, Marek Marczykowski-Górecki wrote: > On Tue, Mar 25, 2025 at 05:41:10PM +, Alejandro Vallejo wrote: > > The way this undocumented feature works is via qemu-trad (who nobody > > uses anymore), by intercepting 3 magic PIOs. 0x88 is one of them, and > > it's prob

Re: [PATCH] Arm/domctl: correct XEN_DOMCTL_vuart_op error return value

2025-03-26 Thread Orzel, Michal
On 26/03/2025 12:41, Andrew Cooper wrote: > > > On 26/03/2025 11:39 am, Jan Beulich wrote: >> copy_to_guest() returns the number of bytes not copied; that's not what >> the function should return to its caller though. Convert to returning >> -EFAULT instead. >> >> Fixes: 86039f2e8c20 ("xen/arm

Re: [PATCH 0/6] remove qemu-traditional

2025-03-26 Thread Andrew Cooper
On 26/03/2025 4:04 pm, Juergen Gross wrote: > Remove the qemu-traditional support. This includes the Mini-OS > based ioemu-stubdom. > > I _think_ rombios support could be removed, too, but this can be > done in a second step. XenServer is still using RomBIOS, because qemu-trad and qemu-xen were no

[PATCH 6/6] build: don't require full tools build for building stubdoms

2025-03-26 Thread Juergen Gross
With the drop of qemu-traditional "make stubdom" no longer requires "make tools" to have finished. It is enough to add "install-tools-public-headers" as a prereq of "install-stubdom". Signed-off-by: Juergen Gross --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M

Re: [PATCH] x86/emul: Adjust handling of CR8_LEGACY

2025-03-26 Thread Jan Beulich
On 26.03.2025 16:25, Andrew Cooper wrote: > The CR8_LEGACY feature was introduced in the K8 Revision F. It doesn't exist > in prior revisions of the K8. > > Furthermore, from APM Vol2 3.1.5 CR8 (Task Priority Register, TPR): > > The AMD64 architecture introduces a new control register, CR8, de

[MINI-OS PATCH v2 0/2] 9pfs: add some file operation hooks

2025-03-26 Thread Juergen Gross
For being able to store the Xenstore state in preparation of a live update operation, 9pfront is needing support for fstat and lseek. Changes in V2: - addressed comment for patch 1 Juergen Gross (2): 9pfs: add fstat file operation hook 9pfs: add lseek file operation hook 9pfront.c | 30

Re: [PATCH] tools: Remove support for qemu-trad's battery reporting

2025-03-26 Thread Jürgen Groß
On 26.03.25 15:05, Andrew Cooper wrote: On 25/03/2025 5:41 pm, Alejandro Vallejo wrote: The way this undocumented feature works is via qemu-trad (who nobody uses anymore), by intercepting 3 magic PIOs. 0x88 is one of them, and it's probed by hvmloader as a means of detecting support for this (so

[XEN PATCH] automation: Avoid changing source files for randconfig tests

2025-03-26 Thread Anthony PERARD
We should avoid changing files from the source tree if we don't intend to commit the result. We don't really need to check if $EXTRA_FIXED_RANDCONFIG is empty so add it to the temporary file in all cases. Signed-off-by: Anthony PERARD --- automation/scripts/build | 10 +- 1 file changed

Re: [PATCH v3 14/15] xen/xenpm: Adapt cpu frequency monitor in xenpm

2025-03-26 Thread Anthony PERARD
On Tue, Mar 25, 2025 at 12:26:09PM +0100, Jan Beulich wrote: > On 06.03.2025 09:39, Penny Zheng wrote: > > Make `xenpm get-cpureq-para/set-cpufreq-para` available in CPPC mode. > > --- a/tools/libs/ctrl/xc_pm.c > > +++ b/tools/libs/ctrl/xc_pm.c > > @@ -214,13 +214,12 @@ int xc_get_cpufreq_para(xc_i

[PATCH] ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()

2025-03-26 Thread Andrew Cooper
The switch() statement is over bits 24:25 (unshifted) of the guest provided value. This makes case 0x3: dead, and not an implementation of the 4th possible state. A guest which writes (3<<24)|(ff<<16) to this register will skip the early exit, then enter bitmap_for_each() with targets not bound b

Re: [PATCH 2/6] docs: remove qemu-traditional support from documentation

2025-03-26 Thread Andrew Cooper
On 26/03/2025 4:04 pm, Juergen Gross wrote: > diff --git a/docs/misc/xenstore-paths.pandoc b/docs/misc/xenstore-paths.pandoc > index a604f6b1c6..583e977b65 100644 > --- a/docs/misc/xenstore-paths.pandoc > +++ b/docs/misc/xenstore-paths.pandoc > @@ -634,7 +634,7 @@ Path in xenstore to the backend, n

Re: [PATCH 2/6] docs: remove qemu-traditional support from documentation

2025-03-26 Thread Jürgen Groß
On 26.03.25 17:21, Andrew Cooper wrote: On 26/03/2025 4:04 pm, Juergen Gross wrote: diff --git a/docs/misc/xenstore-paths.pandoc b/docs/misc/xenstore-paths.pandoc index a604f6b1c6..583e977b65 100644 --- a/docs/misc/xenstore-paths.pandoc +++ b/docs/misc/xenstore-paths.pandoc @@ -634,7 +634,7 @@ P

Re: [PATCH v2 4/4] xen/riscv: introduce intc_preinit()

2025-03-26 Thread Jan Beulich
On 25.03.2025 18:37, Oleksii Kurochko wrote: > Currently, only the device tree method is available to locate and perform > pre-initialization steps for the interrupt controller (at the moment, only > one interrupt controller is going to be supported). When `acpi_disabled` > is true, the system will

[PATCH v1] xen/config.h: Move BITS_PER_* definitions from asm/config.h to xen/config.h

2025-03-26 Thread Oleksii Kurochko
BITS_PER_* values can be defined in a common way using compiler-provided macros. Thus, these definitions are moved to xen/config.h to reduce duplication across architectures. Additionally, *_BYTEORDER macros are removed, as BITS_PER_* values now come directly from the compiler environment. The ar

Re: [PATCH v3 6/7] xen: introduce Kconfig ARCH_PAGING_MEMPOOL

2025-03-26 Thread Jan Beulich
On 26.03.2025 10:39, Orzel, Michal wrote: > > > On 20/03/2025 08:32, Jan Beulich wrote: >> >> >> On 19.03.2025 17:31, Oleksii Kurochko wrote: >>> >>> On 3/19/25 12:35 PM, Jan Beulich wrote: On 18.03.2025 14:05, Oleksii Kurochko wrote: > On 3/17/25 9:07 PM, Luca Fancellu wrote: >> Fro

Re: [PATCH] x86/elf: Remove ASM_CALL_CONSTRAINT from elf_core_save_regs()

2025-03-26 Thread Jan Beulich
On 25.03.2025 19:00, Andrew Cooper wrote: > I was mistaken about when ASM_CALL_CONSTRAINT is applicable. It is not > applicable for plain pushes/pops, so remove it from the flags logic. > > Clarify the description of ASM_CALL_CONSTRAINT to be explicit about unwinding > using framepointers. > > F

RE: [PATCH v3 03/15] xen/cpufreq: refactor cmdline "cpufreq=xxx"

2025-03-26 Thread Penny, Zheng
[Public] Hi, > -Original Message- > From: Jan Beulich > Sent: Monday, March 24, 2025 11:01 PM > To: Penny, Zheng > Cc: Huang, Ray ; Andrew Cooper > ; Anthony PERARD ; > Orzel, Michal ; Julien Grall ; Roger Pau > Monné ; Stefano Stabellini ; > xen- > de...@lists.xenproject.org > Subject

Re: [PATCH v3 05/15] xen/x86: introduce "cpufreq=amd-cppc" xen cmdline

2025-03-26 Thread Jan Beulich
On 26.03.2025 09:35, Penny, Zheng wrote: >> -Original Message- >> From: Jan Beulich >> Sent: Monday, March 24, 2025 11:26 PM >> >> On 06.03.2025 09:39, Penny Zheng wrote: >>> @@ -514,5 +515,14 @@ acpi_cpufreq_driver = { >>> >>> int __init acpi_cpufreq_register(void) { >>> -return cpu

Re: [PATCH v3 3/3] PCI/MSI: Convert pci_msi_ignore_mask to per MSI domain flag

2025-03-26 Thread Borislav Petkov
+ Linus so that he can whack it before it spreads any further. On Wed, Feb 19, 2025 at 10:20:57AM +0100, Roger Pau Monne wrote: > Setting pci_msi_ignore_mask inhibits the toggling of the mask bit for both > MSI and MSI-X entries globally, regardless of the IRQ chip they are using. > Only Xen sets

Re: [PATCH] tools: Remove support for qemu-trad's battery reporting

2025-03-26 Thread Roger Pau Monné
On Wed, Mar 26, 2025 at 03:44:05PM +, Alejandro Vallejo wrote: > On Wed Mar 26, 2025 at 1:59 PM GMT, Marek Marczykowski-Górecki wrote: > > On Tue, Mar 25, 2025 at 05:41:10PM +, Alejandro Vallejo wrote: > > > The way this undocumented feature works is via qemu-trad (who nobody > > > uses any

Re: [PATCH v2 13/19] xen/sysctl: wrap around XEN_SYSCTL_scheduler_op

2025-03-26 Thread Stewart Hildebrand
On 3/26/25 01:50, Penny Zheng wrote: > Function sched_adjust_global is designed for XEN_SYSCTL_scheduler_op, so > itself and its calling flow, like .adjust_global, shall all be wrapped. > > Signed-off-by: Penny Zheng > Reviewed-by: Stefano Stabellini For arinc653 only: Acked-by: Stewart Hildebr

[PATCH 3/6] tools: remove support for running a guest with qemu-traditional

2025-03-26 Thread Juergen Gross
Remove the code in tools for running a guest with qemu-traditional. This covers xl, libxl, libacpi, hvmloader and the related python and go bindings. Signed-off-by: Juergen Gross --- tools/firmware/hvmloader/pci.c| 19 +- tools/firmware/hvmloader/util.c | 9 +- tools/golang/xenl

Re: [PATCH v2] tools/arm: Fix nr_spis handling v2

2025-03-26 Thread Anthony PERARD
On Tue, Mar 25, 2025 at 12:00:29PM +0100, Michal Orzel wrote: > diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c > index 2d895408cac3..0adcaa373b54 100644 > --- a/tools/libs/light/libxl_arm.c > +++ b/tools/libs/light/libxl_arm.c > @@ -181,13 +181,18 @@ int libxl__arch_domain

[PATCH 2/6] docs: remove qemu-traditional support from documentation

2025-03-26 Thread Juergen Gross
In preparation to no longer support qemu-traditional (including qemu-stubdom), remove it from documentation. Signed-off-by: Juergen Gross --- docs/man/xl-pci-configuration.5.pod | 4 +- docs/man/xl.cfg.5.pod.in | 46 +++- docs/misc/stubdom.txt

[PATCH 4/6] tools: remove qemu-traditional

2025-03-26 Thread Juergen Gross
Remove qemu traditional from the tree. Signed-off-by: Juergen Gross --- .gitignore | 3 -- CHANGELOG.md | 1 + Config.mk| 24 --- INSTALL | 12 -- MAINTAINERS | 4 -- README | 2 +- SUPPORT.

[PATCH 1/6] SUPPORT.md: make Linux based stubdom fully supported

2025-03-26 Thread Juergen Gross
All patches needed for running with a Linux stubdom device model are in the tree and QubesOS is using and testing Linux stubdoms nowadays. Switch support from "Tech Preview" to "Supported". Signed-off-by: Juergen Gross --- CHANGELOG.md | 1 + SUPPORT.md | 2 +- 2 files changed, 2 insertions(+

[PATCH 0/6] remove qemu-traditional

2025-03-26 Thread Juergen Gross
Remove the qemu-traditional support. This includes the Mini-OS based ioemu-stubdom. I _think_ rombios support could be removed, too, but this can be done in a second step. After adding the series a run of autoconf should be done. Juergen Gross (6): SUPPORT.md: make Linux based stubdom fully su

[PATCH 5/6] stubdom: remove ancient stubdom-dm script

2025-03-26 Thread Juergen Gross
The stubdom-dm script is still using "xm" instead of "xl", so it is probably unused since more than 10 years now. Signed-off-by: Juergen Gross --- stubdom/stubdom-dm | 182 - 1 file changed, 182 deletions(-) delete mode 100644 stubdom/stubdom-dm diff

Re: [PATCH v2 3/4] xen/riscv: implement basic aplic_preinit()

2025-03-26 Thread Jan Beulich
On 25.03.2025 18:36, Oleksii Kurochko wrote: > Introduce preinitialization stuff for the RISC-V Advanced Platform-Level > Interrupt Controller (APLIC) in Xen: > - Implementing the APLIC pre-initialization function (`aplic_preinit()`), >ensuring that only one APLIC instance is supported in S mo

Re: [PATCH v2 1/4] xen/riscv: introduce preinit_xen_time()

2025-03-26 Thread Jan Beulich
On 25.03.2025 18:36, Oleksii Kurochko wrote: > preinit_xen_time() does two things: > 1. Parse timebase-frequency properpy of /cpus node to initialize >cpu_khz variable. > 2. Initialize xen_start_clock_cycles with the current time counter >value. > > Signed-off-by: Oleksii Kurochko > --- >

Re: [PATCH v2 3/4] xen/riscv: implement basic aplic_preinit()

2025-03-26 Thread Oleksii Kurochko
On 3/26/25 4:19 PM, Jan Beulich wrote: On 25.03.2025 18:36, Oleksii Kurochko wrote: Introduce preinitialization stuff for the RISC-V Advanced Platform-Level Interrupt Controller (APLIC) in Xen: - Implementing the APLIC pre-initialization function (`aplic_preinit()`), ensuring that only on

Re: [PATCH v2] tools/arm: Fix nr_spis handling v2

2025-03-26 Thread Orzel, Michal
On 26/03/2025 15:47, Anthony PERARD wrote: > > > On Tue, Mar 25, 2025 at 12:00:29PM +0100, Michal Orzel wrote: >> diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c >> index 2d895408cac3..0adcaa373b54 100644 >> --- a/tools/libs/light/libxl_arm.c >> +++ b/tools/libs/light/

Re: [PATCH V2] xen/arm: Initialize acpi_disabled to true during declaration

2025-03-26 Thread Julien Grall
Hi Oleksandr, On 26/03/2025 11:45, Oleksandr Tyshchenko wrote: Also it is not entirely clear what we should do with acpi_disabled=true during declaration (what current patch does), even if we decided to go with splitting should we retain that change? It should not be necessary. But I will leav

Re: [PATCH v4 1/5] xen/arm: Create tee command line parameter

2025-03-26 Thread Julien Grall
Hi Bertrand, On 24/03/2025 13:52, Bertrand Marquis wrote: Add a new command line parameter "tee=" to be used to explicitly select what tee mediator is to be used by Xen and fail if it does not exist or the probe function for it failed. Without specifying which tee is to be used, Xen will use th

Re: [PATCH v4 2/5] xen/arm: ffa: Introduce VM to VM support

2025-03-26 Thread Julien Grall
Hi Bertrand, I didn't dig in the spec and neither some of the callers. So I will mainly focus on the implementation from Xen PoV. On 24/03/2025 13:53, Bertrand Marquis wrote: Create a CONFIG_FFA_VM_TO_VM parameter to activate FFA communication between VMs. When activated list VMs in the syste

[PATCH v1 2/3] xen: x86: irq: initialize irq desc in create_irq()

2025-03-26 Thread Volodymyr Babchuk
While building xen with GCC 14.2.1 with "-fcondition-coverage" option, the compiler produces a false positive warning: arch/x86/irq.c: In function ‘create_irq’: arch/x86/irq.c:281:11: error: ‘desc’ may be used uninitialized [-Werror=maybe-uninitialized] 281 | ret = init_one_irq_desc(d

Re: [PATCH v3 3/3] drivers: Make ioapic_sbdf and hpet_sbdf contain pci_sbdf_t

2025-03-26 Thread Jan Beulich
On 18.03.2025 16:30, Andrii Sultanov wrote: > --- a/xen/drivers/passthrough/amd/iommu_acpi.c > +++ b/xen/drivers/passthrough/amd/iommu_acpi.c > @@ -707,8 +707,8 @@ static int __init cf_check parse_ivrs_ioapic(const char > *str) > } > } > > -ioapic_sbdf[idx].bdf = PCI_BDF(bus, d

Re: [PATCH v2] x86/irq: introduce APIC_VECTOR_VALID()

2025-03-26 Thread Jan Beulich
On 21.03.2025 00:05, dm...@proton.me wrote: > Add new macro APIC_VECTOR_VALID() to validate the interrupt vector > range as per [1]. This macro replaces hardcoded checks against the > open-coded value 16 in LAPIC and virtual LAPIC code and simplifies > the code a bit. > > [1] Intel SDM volume 3A >

Re: [PATCH] ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()

2025-03-26 Thread Stefano Stabellini
On Thu, 27 Mar 2025, Volodymyr Babchuk wrote: > Hi Andrew, > > Andrew Cooper writes: > > > The switch() statement is over bits 24:25 (unshifted) of the guest provided > > value. This makes case 0x3: dead, and not an implementation of the 4th > > possible state. > > > > A guest which writes (3<<

Re: [PATCH] ARM/vgic: Fix out-of-bounds accesses in vgic_mmio_write_sgir()

2025-03-26 Thread Volodymyr Babchuk
Hi Andrew, Andrew Cooper writes: > The switch() statement is over bits 24:25 (unshifted) of the guest provided > value. This makes case 0x3: dead, and not an implementation of the 4th > possible state. > > A guest which writes (3<<24)|(ff<<16) to this register will skip the early > exit, then

[PATCH v1 1/3] xen: gcov: add support for gcc 14.1

2025-03-26 Thread Volodymyr Babchuk
GCC 14.1 has 9 gcov counters and also can call new merge function __gcov_merge_ior(), so we need a new stub for it. Signed-off-by: Volodymyr Babchuk --- xen/common/coverage/gcc_4_7.c | 4 +++- xen/common/coverage/gcov_base.c | 5 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --gi

[PATCH v1 3/3] xen: debug: gcov: add condition coverage support

2025-03-26 Thread Volodymyr Babchuk
Condition coverage, also known as MC/DC (modified condition/decision coverage) is a coverage metric that tracks separate outcomes in boolean expressions. This patch adds CONFIG_CONDITION_COVERAGE option to enable MC/DC for GCC. Clang is not supported right now. Signed-off-by: Volodymyr Babchuk -

[PATCH v1 0/3] Enable MC/DC support for GCOV

2025-03-26 Thread Volodymyr Babchuk
This series enables MC/DC for Xen when building with GCC. Condition coverage, also known as MC/DC (modified condition/decision coverage) is a coverage metric that tracks separate outcomes in boolean expressions. This metric is used in critical software components, so it natural to collect it for X

Re: [PATCH v1] xen/config.h: Move BITS_PER_* definitions from asm/config.h to xen/config.h

2025-03-26 Thread Andrew Cooper
On 26/03/2025 5:47 pm, Oleksii Kurochko wrote: > diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h > index d888b2314d..dbbf2fce62 100644 > --- a/xen/include/xen/config.h > +++ b/xen/include/xen/config.h > @@ -98,4 +98,13 @@ > #define ZERO_BLOCK_PTR ((void *)-1L) > #endif > > +#de

NULL pointer dereference in cpufreq_update_limits(?) under Xen PV dom0 - regression in 6.13

2025-03-26 Thread Marek Marczykowski-Górecki
Hi, I've got a report[1] that 6.13.6 crashes as listed below. It worked fine in 6.12.11. We've tried few simple things to narrow the problem down, but without much success. This is running in Xen 4.17.5, PV dom0, which probably is relevant here. This is running on AMD Ryzen 9 7950X3D, with ASRock

Re: [PATCH v4 5/5] xen/arm: ffa: Enable VM to VM without firmware

2025-03-26 Thread Julien Grall
On 26/03/2025 23:41, Julien Grall wrote: Hi Bertrand, On 24/03/2025 13:53, Bertrand Marquis wrote: When VM to VM support is activated and there is no suitable FF-A support in the firmware, enable FF-A support for VMs to allow using it for VM to VM communications. tee/ and the callbacks ass

Re: [PATCH] tools: Remove support for qemu-trad's battery reporting

2025-03-26 Thread Andrew Cooper
On 25/03/2025 5:41 pm, Alejandro Vallejo wrote: > The way this undocumented feature works is via qemu-trad (who nobody > uses anymore), by intercepting 3 magic PIOs. 0x88 is one of them, and > it's probed by hvmloader as a means of detecting support for this (so, > on qemu-upstream this check alway

Re: [PATCH v2 1/4] xen/riscv: introduce preinit_xen_time()

2025-03-26 Thread Oleksii Kurochko
On 3/26/25 4:13 PM, Jan Beulich wrote: On 25.03.2025 18:36, Oleksii Kurochko wrote: preinit_xen_time() does two things: 1. Parse timebase-frequency properpy of /cpus node to initialize cpu_khz variable. 2. Initialize xen_start_clock_cycles with the current time counter value. Signed-of

Re: [PATCH V2] xen/arm: Initialize acpi_disabled to true during declaration

2025-03-26 Thread Orzel, Michal
On 25/03/2025 17:54, Oleksandr Tyshchenko wrote: > > > On 25.03.25 18:09, Julien Grall wrote: > > >> Hi Oleksandr, > > Hello Julien > >> >> On 25/03/2025 16:05, Oleksandr Tyshchenko wrote: >> Furthermore, what happen if we decide to use ACPI afterwards? Wouldn't >> this mean that t

Re: [PATCH] x86/bitops: Account for POPCNT errata on earlier Intel CPUs

2025-03-26 Thread Andrew Cooper
On 26/03/2025 9:20 am, Jan Beulich wrote: > On 25.03.2025 19:52, Andrew Cooper wrote: >> It turns out that LZCNT/TZCNT have the same input dependent bug, prior to >> Skylake. > These two do, but BSF/BSR don't? Pretty odd. BSF/BSR have true input dependencies.  They both have cases where the destin

Re: [PATCH v3 6/7] xen: introduce Kconfig ARCH_PAGING_MEMPOOL

2025-03-26 Thread Orzel, Michal
On 20/03/2025 08:32, Jan Beulich wrote: > > > On 19.03.2025 17:31, Oleksii Kurochko wrote: >> >> On 3/19/25 12:35 PM, Jan Beulich wrote: >>> On 18.03.2025 14:05, Oleksii Kurochko wrote: On 3/17/25 9:07 PM, Luca Fancellu wrote: > From: Penny Zheng > > ARM MPU system doesn't nee

Re: [PATCH] x86/PVH: expose OEMx ACPI tables to Dom0

2025-03-26 Thread Jan Beulich
On 26.03.2025 10:21, Roger Pau Monné wrote: > On Wed, Mar 26, 2025 at 09:45:09AM +0100, Jan Beulich wrote: >> What they contain we don't know, but we can't sensibly hide them. On my >> Skylake system OEM1 (with a description of "INTEL CPU EIST") is what >> contains all the _PCT, _PPC, and _PSS met

Re: [PATCH v3 6/7] xen: introduce Kconfig ARCH_PAGING_MEMPOOL

2025-03-26 Thread Oleksii Kurochko
On 3/26/25 10:39 AM, Orzel, Michal wrote: On 20/03/2025 08:32, Jan Beulich wrote: On 19.03.2025 17:31, Oleksii Kurochko wrote: On 3/19/25 12:35 PM, Jan Beulich wrote: On 18.03.2025 14:05, Oleksii Kurochko wrote: On 3/17/25 9:07 PM, Luca Fancellu wrote: From: Penny Zheng ARM MPU system do

Re: [PATCH] x86/bitops: Account for POPCNT errata on earlier Intel CPUs

2025-03-26 Thread Jan Beulich
On 26.03.2025 10:34, Andrew Cooper wrote: > On 26/03/2025 9:20 am, Jan Beulich wrote: >> On 25.03.2025 19:52, Andrew Cooper wrote: >>> --- a/xen/arch/x86/include/asm/bitops.h >>> +++ b/xen/arch/x86/include/asm/bitops.h >>> @@ -488,10 +488,16 @@ static always_inline unsigned int >>> arch_hweightl(u

RE: [PATCH v3 07/15] xen/cpufreq: fix core frequency calculation for AMD Family 1Ah CPUs

2025-03-26 Thread Penny, Zheng
[Public] Hi, > -Original Message- > From: Jan Beulich > Sent: Monday, March 24, 2025 11:48 PM > To: Penny, Zheng > Cc: Huang, Ray ; Andrew Cooper > ; Roger Pau Monné ; xen- > de...@lists.xenproject.org; Nicola Vetrini > Subject: Re: [PATCH v3 07/15] xen/cpufreq: fix core frequency calc

[MINI-OS PATCH 11/12] kexec: add kexec callback functionality

2025-03-26 Thread Juergen Gross
Add a kexec_call() macro which will provide the capability to register a function for being called when doing a kexec() call. The called functions will be called with a boolean parameter "undo" indicating whether a previous call needs to be undone due to a failure during kexec(). The related loop

Re: [PATCH] PCI/MSI: Handle the NOMASK flag correctly for all PCI/MSI backends

2025-03-26 Thread Thomas Gleixner
On Wed, Mar 26 2025 at 13:09, Jürgen Groß wrote: > On 26.03.25 13:05, Thomas Gleixner wrote: >> The conversion of the XEN specific global variable pci_msi_ignore_mask to a >> MSI domain flag, missed the facts that: >> >> 1) Legacy architectures do not provide a interrupt domain >> 2) Par

Re: [PATCH v2] ARM/vgic: Use for_each_set_bit() in vgic_mmio_write_sgir()

2025-03-26 Thread Orzel, Michal
On 14/03/2025 22:21, Andrew Cooper wrote: > > > The bitmap_for_each() expression only inspects the bottom 8 bits of targets. > Change it's type to uint8_t and use for_each_set_bit() which is more efficient > over scalars. > > GICD_SGI_TARGET_LIST_MASK is 2 bits wide. Two cases discard the pr

Re: [PATCH v3] xen/riscv: add H extenstion to -march

2025-03-26 Thread Jan Beulich
On 26.03.2025 13:42, Oleksii Kurochko wrote: > H provides additional instructions and CSRs that control the new stage of > address translation and support hosting a guest OS in virtual S-mode > (VS-mode). > > According to the Unprivileged Architecture (version 20240411) specification: > ``` > Tabl

Re: [PATCH v4 29/30] x86/mm, mm/vmalloc: Defer flush_tlb_kernel_range() targeting NOHZ_FULL CPUs

2025-03-26 Thread Valentin Schneider
On 25/03/25 19:41, Jann Horn wrote: > On Tue, Mar 25, 2025 at 6:52 PM Valentin Schneider > wrote: >> On 20/02/25 09:38, Dave Hansen wrote: >> > But, honestly, I'm still not sure this is worth all the trouble. If >> > folks want to avoid IPIs for TLB flushes, there are hardware features >> > that

Re: [PATCH] x86/bitops: Account for POPCNT errata on earlier Intel CPUs

2025-03-26 Thread Jan Beulich
On 25.03.2025 19:52, Andrew Cooper wrote: > Manually break the false dependency for the benefit of cases such as > bitmap_weight() which is a reasonable hotpath. > > Signed-off-by: Andrew Cooper > --- > CC: Jan Beulich > CC: Roger Pau Monné > > Not sure if this warrants a fixes or not, but: >

Re: [PATCH] x86/PVH: expose OEMx ACPI tables to Dom0

2025-03-26 Thread Roger Pau Monné
On Wed, Mar 26, 2025 at 09:45:09AM +0100, Jan Beulich wrote: > What they contain we don't know, but we can't sensibly hide them. On my > Skylake system OEM1 (with a description of "INTEL CPU EIST") is what > contains all the _PCT, _PPC, and _PSS methods, i.e. about everything > needed for cpufreq.

Re: [PATCH] x86/elf: Remove ASM_CALL_CONSTRAINT from elf_core_save_regs()

2025-03-26 Thread Jan Beulich
On 26.03.2025 10:17, Andrew Cooper wrote: > On 26/03/2025 9:00 am, Jan Beulich wrote: >> On 25.03.2025 19:00, Andrew Cooper wrote: >>> I was mistaken about when ASM_CALL_CONSTRAINT is applicable. It is not >>> applicable for plain pushes/pops, so remove it from the flags logic. >>> >>> Clarify the

Re: [PATCH 2/2] x86/emul: Emulate %cr8 accesses

2025-03-26 Thread Andrew Cooper
On 26/03/2025 11:19 am, Jan Beulich wrote: > On 25.03.2025 18:41, Andrew Cooper wrote: >> Petr reports: >> >> (XEN) MMIO emulation failed (1): d12v1 64bit @ 0010:f8057ba7dfbf -> 45 >> 0f 20 c2 ... >> >> during introspection. >> >> This is MOV %cr8, which is wired up for hvm_mov_{to,from}_cr(

Re: [PATCH v3 3/3] PCI/MSI: Convert pci_msi_ignore_mask to per MSI domain flag

2025-03-26 Thread Roger Pau Monné
On Wed, Mar 26, 2025 at 12:04:55PM +0100, Borislav Petkov wrote: > + Linus so that he can whack it before it spreads any further. > > On Wed, Feb 19, 2025 at 10:20:57AM +0100, Roger Pau Monne wrote: > > Setting pci_msi_ignore_mask inhibits the toggling of the mask bit for both > > MSI and MSI-X en

Re: [PATCH v3 3/3] PCI/MSI: Convert pci_msi_ignore_mask to per MSI domain flag

2025-03-26 Thread Marek Szyprowski
On 25.03.2025 10:20, Thomas Gleixner wrote: > On Tue, Mar 25 2025 at 09:11, Thomas Gleixner wrote: >> On Mon, Mar 24 2025 at 20:18, Roger Pau Monné wrote: >>> On Mon, Mar 24, 2025 at 07:58:14PM +0100, Daniel Gomez wrote: The issue is that info appears to be uninitialized. So, this worked for m

[PATCH] x86/pmstat: correct get_cpufreq_para()'s error return value

2025-03-26 Thread Jan Beulich
copy_to_guest() returns the number of bytes not copied; that's not what the function should return to its caller though. Convert to returning -EFAULT instead. Fixes: 7542c4ff00f2 ("Add user PM control interface") Reported-by: Andrew Cooper Signed-off-by: Jan Beulich --- a/xen/drivers/acpi/pmsta

[PATCH] Arm/domctl: correct XEN_DOMCTL_vuart_op error return value

2025-03-26 Thread Jan Beulich
copy_to_guest() returns the number of bytes not copied; that's not what the function should return to its caller though. Convert to returning -EFAULT instead. Fixes: 86039f2e8c20 ("xen/arm: vpl011: Add a new domctl API to initialize vpl011") Signed-off-by: Jan Beulich --- a/xen/arch/arm/domctl.

Re: [PATCH 1/2] x86/hvm: Rearrange the logic in hvmemul_{read,write}_cr()

2025-03-26 Thread Jan Beulich
On 25.03.2025 18:41, Andrew Cooper wrote: > In hvmemul_read_cr(), make the TRACE()/X86EMUL_OKAY path common in preparation > for adding a %cr8 case. Use a local 'val' variable instead of always > operating on a deferenced pointer. > > In both, calculate curr once. > > No functional change. > >

Re: [PATCH] x86/pmstat: correct get_cpufreq_para()'s error return value

2025-03-26 Thread Andrew Cooper
On 26/03/2025 11:38 am, Jan Beulich wrote: > copy_to_guest() returns the number of bytes not copied; that's not what > the function should return to its caller though. Convert to returning > -EFAULT instead. > > Fixes: 7542c4ff00f2 ("Add user PM control interface") > Reported-by: Andrew Cooper > S

Re: [PATCH] RISCV/bitops: Use Zbb to provide arch-optimised bitops

2025-03-26 Thread Andrew Cooper
On 26/03/2025 10:15 am, Jan Beulich wrote: > On 25.03.2025 18:04, Oleksii Kurochko wrote: >> On 3/25/25 5:46 PM, Jan Beulich wrote: >>> On 25.03.2025 17:35, Oleksii Kurochko wrote: On 3/7/25 1:12 PM, Andrew Cooper wrote: > On 07/03/2025 12:01 pm, Jan Beulich wrote: >> On 07.03.2025 12:

Re: [PATCH] PCI/MSI: Handle the NOMASK flag correctly for all PCI/MSI backends

2025-03-26 Thread Jürgen Groß
On 26.03.25 13:05, Thomas Gleixner wrote: The conversion of the XEN specific global variable pci_msi_ignore_mask to a MSI domain flag, missed the facts that: 1) Legacy architectures do not provide a interrupt domain 2) Parent MSI domains do not necessarily have a domain info attached

Re: [PATCH v1 2/8] xen/console: introduce console input permission

2025-03-26 Thread Jan Beulich
On 19.03.2025 00:36, dm...@proton.me wrote: > @@ -564,10 +586,25 @@ static void __serial_rx(char c) > /* Deliver input to the PV shim console. */ > rc = consoled_guest_tx(c); > > -if ( rc ) > +switch ( rc ) > +{ > +case 0: > +break; > + > +case -EBUSY

Re: [PATCH v3 07/15] xen/cpufreq: fix core frequency calculation for AMD Family 1Ah CPUs

2025-03-26 Thread Nicola Vetrini
On 2025-03-26 10:54, Penny, Zheng wrote: [Public] Hi, -Original Message- From: Jan Beulich Sent: Monday, March 24, 2025 11:48 PM To: Penny, Zheng Cc: Huang, Ray ; Andrew Cooper ; Roger Pau Monné ; xen- de...@lists.xenproject.org; Nicola Vetrini Subject: Re: [PATCH v3 07/15] xen/cp

Re: [PATCH v3 6/7] xen: introduce Kconfig ARCH_PAGING_MEMPOOL

2025-03-26 Thread Orzel, Michal
On 26/03/2025 10:54, Jan Beulich wrote: > > > On 26.03.2025 10:39, Orzel, Michal wrote: >> >> >> On 20/03/2025 08:32, Jan Beulich wrote: >>> >>> >>> On 19.03.2025 17:31, Oleksii Kurochko wrote: On 3/19/25 12:35 PM, Jan Beulich wrote: > On 18.03.2025 14:05, Oleksii Kurochko wrote:

Re: [PATCH] x86/PVH: expose OEMx ACPI tables to Dom0

2025-03-26 Thread Jan Beulich
On 26.03.2025 11:18, Roger Pau Monné wrote: > On Wed, Mar 26, 2025 at 10:45:18AM +0100, Jan Beulich wrote: >> On 26.03.2025 10:21, Roger Pau Monné wrote: >>> On Wed, Mar 26, 2025 at 09:45:09AM +0100, Jan Beulich wrote: Further tables on said system which weren't blacklisted prior to that

Re: [PATCH] Arm/domctl: correct XEN_DOMCTL_vuart_op error return value

2025-03-26 Thread Andrew Cooper
On 26/03/2025 11:39 am, Jan Beulich wrote: > copy_to_guest() returns the number of bytes not copied; that's not what > the function should return to its caller though. Convert to returning > -EFAULT instead. > > Fixes: 86039f2e8c20 ("xen/arm: vpl011: Add a new domctl API to initialize > vpl011") >

Re: [PATCH V2] xen/arm: Initialize acpi_disabled to true during declaration

2025-03-26 Thread Oleksandr Tyshchenko
On 26.03.25 10:57, Orzel, Michal wrote: Hello Michal, Julien > > > On 25/03/2025 17:54, Oleksandr Tyshchenko wrote: >> >> >> On 25.03.25 18:09, Julien Grall wrote: >> >> >>> Hi Oleksandr, >> >> Hello Julien >> >>> >>> On 25/03/2025 16:05, Oleksandr Tyshchenko wrote: >>> Furthermore, what

Re: [PATCH] PCI/MSI: Handle the NOMASK flag correctly for all PCI/MSI backends

2025-03-26 Thread Juergen Gross
On 26.03.25 13:05, Thomas Gleixner wrote: The conversion of the XEN specific global variable pci_msi_ignore_mask to a MSI domain flag, missed the facts that: 1) Legacy architectures do not provide a interrupt domain 2) Parent MSI domains do not necessarily have a domain info attached

[PATCH v3] xen/riscv: add H extenstion to -march

2025-03-26 Thread Oleksii Kurochko
H provides additional instructions and CSRs that control the new stage of address translation and support hosting a guest OS in virtual S-mode (VS-mode). According to the Unprivileged Architecture (version 20240411) specification: ``` Table 74 summarizes the standardized extension names. The table

Re: [PATCH] tools: Remove support for qemu-trad's battery reporting

2025-03-26 Thread Marek Marczykowski-Górecki
On Tue, Mar 25, 2025 at 05:41:10PM +, Alejandro Vallejo wrote: > The way this undocumented feature works is via qemu-trad (who nobody > uses anymore), by intercepting 3 magic PIOs. 0x88 is one of them, and > it's probed by hvmloader as a means of detecting support for this (so, > on qemu-upstre

[XEN PATCH] kconfig/randconfig: Remove non-existing config

2025-03-26 Thread Anthony PERARD
CONFIG_GCOV_FORMAT_AUTODETECT has been removed in 767e6c5fd55b. Fixes: 767e6c5fd55b ("kconfig/gcov: remove gcc version choice from kconfig") Signed-off-by: Anthony PERARD --- xen/tools/kconfig/allrandom.config | 1 - 1 file changed, 1 deletion(-) diff --git a/xen/tools/kconfig/allrandom.config

Re: [PATCH v1 7/8] xen/console: introduce console_set_focus()

2025-03-26 Thread Jan Beulich
On 19.03.2025 20:53, Denis Mukhin wrote: > On Tuesday, March 18th, 2025 at 4:37 PM, dm...@proton.me > wrote: >> +/* >> + * Switch console focus. >> + * Rotates input focus among Xen, dom0 and boot-time created domUs while >> + * skipping switching serial input to non existing domains. >> + */ >>

Re: [XEN PATCH] kconfig/randconfig: Remove non-existing config

2025-03-26 Thread Andrew Cooper
On 26/03/2025 2:29 pm, Anthony PERARD wrote: > CONFIG_GCOV_FORMAT_AUTODETECT has been removed in 767e6c5fd55b. > > Fixes: 767e6c5fd55b ("kconfig/gcov: remove gcc version choice from kconfig") > Signed-off-by: Anthony PERARD Reviewed-by: Andrew Cooper

Re: [PATCH v1 7/8] xen/console: introduce console_set_focus()

2025-03-26 Thread Jan Beulich
On 19.03.2025 00:37, dm...@proton.me wrote: > +/* > + * Switch console focus. > + * Rotates input focus among Xen, dom0 and boot-time created domUs while > + * skipping switching serial input to non existing domains. > + */ > +static void console_switch_focus(void) > +{ > +const domid_t n = dom

Re: [PATCH 2/2] xen/dm: arm: Introduce inject_msi2 DM op

2025-03-26 Thread Oleksandr Tyshchenko
On 19.03.25 14:37, Jan Beulich wrote: Hello Jan, all. On 19.03.2025 13:05, Mykyta Poturai wrote: On 18.03.25 16:26, Jan Beulich wrote: On 18.03.2025 14:31, Mykyta Poturai wrote: On 18.03.25 12:11, Jan Beulich wrote: On 18.03.2025 10:10, Mykyta Poturai wrote: On 15.01.24 11:35, Jan Beul

  1   2   >