RE: [PATCH v4 09/15] xen/x86: introduce a new amd cppc driver for cpufreq scaling

2025-05-07 Thread Penny, Zheng
[Public] Hi, > -Original Message- > From: Jan Beulich > Sent: Tuesday, April 29, 2025 10:29 PM > To: Penny, Zheng > Cc: Huang, Ray ; Andrew Cooper > ; Roger Pau Monné ; xen- > de...@lists.xenproject.org > Subject: Re: [PATCH v4 09/15] xen/x86: introduce a new amd cppc driver for > cpufr

Re: [PATCH] x86/pmstat: Check size of PMSTAT_get_pxstat buffers

2025-05-07 Thread Ross Lagerwall
On Thu, Apr 17, 2025 at 2:23 PM Jan Beulich wrote: > > On 17.04.2025 12:30, Ross Lagerwall wrote: > > --- a/xen/drivers/acpi/pmstat.c > > +++ b/xen/drivers/acpi/pmstat.c > > @@ -104,6 +104,14 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op) > > cpufreq_residency_update(op->cpuid, p

Re: [PATCH] xenbus: Use kref to track req lifetime

2025-05-07 Thread Jürgen Groß
On 06.05.25 23:09, Jason Andryuk wrote: Marek reported seeing a NULL pointer fault in the xenbus_thread callstack: BUG: kernel NULL pointer dereference, address: RIP: e030:__wake_up_common+0x4c/0x180 Call Trace: __wake_up_common_lock+0x82/0xd0 process_msg+0x18e/0x2f0 xen

Re: [PATCH] xenbus: Use kref to track req lifetime

2025-05-07 Thread Jason Andryuk
On 2025-05-07 05:27, Jürgen Groß wrote: On 06.05.25 23:09, Jason Andryuk wrote: Marek reported seeing a NULL pointer fault in the xenbus_thread callstack: BUG: kernel NULL pointer dereference, address: RIP: e030:__wake_up_common+0x4c/0x180 Call Trace:     __wake_up_common_lock+

Re: Mapping memory into a domain

2025-05-07 Thread Roger Pau Monné
On Tue, May 06, 2025 at 04:56:12PM -0400, Demi Marie Obenour wrote: > On 5/6/25 9:06 AM, Alejandro Vallejo wrote: > > On Tue May 6, 2025 at 3:02 AM CEST, Demi Marie Obenour wrote: > >> On 5/5/25 7:32 AM, Alejandro Vallejo wrote: > >>> I suppose this is still about multiplexing the GPU driver the wa

Re: [PATCH v20 2/2] vpci: translate virtual PCI bus topology for guests

2025-05-07 Thread Roger Pau Monné
On Wed, May 07, 2025 at 09:38:51AM -0400, Stewart Hildebrand wrote: > On 5/7/25 03:44, Roger Pau Monné wrote: > > On Tue, May 06, 2025 at 11:05:13PM -0400, Stewart Hildebrand wrote: > >> On 5/6/25 07:16, Roger Pau Monné wrote: > >>> On Fri, Apr 18, 2025 at 02:58:37PM -0400, Stewart Hildebrand wrote

Re: [PATCH 2/2] xen: swiotlb: Implement map_resource callback

2025-05-07 Thread Christoph Hellwig
On Wed, May 07, 2025 at 04:09:15PM -0700, Stefano Stabellini wrote: > > This mapping is not for a RAM backed address. In the eDMA case for the > > iMX8QXP the `phys` coming in here is the address of a register. > > Ok, this information is important :-) > > I am not certain whether the map_resour

[RFC PATCH v3 1/2] xen: add libafl-qemu fuzzer support

2025-05-07 Thread Volodymyr Babchuk
LibAFL, which is a part of AFL++ project is a instrument that allows us to perform fuzzing on beremetal code (Xen hypervisor in this case) using QEMU as an emulator. It employs QEMU's ability to create snapshots to run many tests relatively quickly: system state is saved right before executing a ne

[XEN PATCH v3] sbat: Add SBAT section to the Xen EFI binary

2025-05-07 Thread Gerald Elder-Vass
SBAT is a revocation scheme for UEFI SecureBoot, and is mandated by Microsoft for signing. The SBAT section provides a way for the binary to declare a generation id for its upstream source and any vendor changes applied. A compatible loader can then revoke vulnerable binaries by generation, using

Re: [MINI-OS PATCH 00/12] kexec: add kexec support to Mini-OS

2025-05-07 Thread Juergen Gross
Ping? On 21.03.25 10:24, Juergen Gross wrote: Add basic kexec support to Mini-OS for running in x86 PVH mode. With this series applied it is possible to activate another kernel from within Mini-OS. Right now no Xen related teardown is done (so no reset of grant table, event channels, PV device

Re: [PATCH 2/4] efi: Add a function to check if Secure Boot mode is enabled

2025-05-07 Thread Frediano Ziglio
On Tue, May 6, 2025 at 5:56 PM Andrew Cooper wrote: > > CC'ing the EFI maintainers. > > On 06/05/2025 5:24 pm, Kevin Lampis wrote: > > diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c > > index e39fbc3529..7c528cd5dd 100644 > > --- a/xen/common/efi/boot.c > > +++ b/xen/common/efi/boot.c

Re: [PATCH v20 2/2] vpci: translate virtual PCI bus topology for guests

2025-05-07 Thread Stewart Hildebrand
On 5/7/25 03:44, Roger Pau Monné wrote: > On Tue, May 06, 2025 at 11:05:13PM -0400, Stewart Hildebrand wrote: >> On 5/6/25 07:16, Roger Pau Monné wrote: >>> On Fri, Apr 18, 2025 at 02:58:37PM -0400, Stewart Hildebrand wrote: From: Oleksandr Andrushchenko static int vpci_register_cmp(con

Re: [PATCH v3 07/11] vpci: Hide extended capability when it fails to initialize

2025-05-07 Thread Roger Pau Monné
On Wed, May 07, 2025 at 08:49:46AM +, Chen, Jiqian wrote: > On 2025/5/7 16:09, Roger Pau Monné wrote: > > On Wed, May 07, 2025 at 07:26:21AM +, Chen, Jiqian wrote: > >> On 2025/5/7 00:21, Roger Pau Monné wrote: > >>> On Mon, Apr 21, 2025 at 02:18:59PM +0800, Jiqian Chen wrote: > When v

Re: [PATCH 2/4] efi: Add a function to check if Secure Boot mode is enabled

2025-05-07 Thread Ross Lagerwall
On Tue, May 6, 2025 at 5:56 PM Andrew Cooper wrote: > > CC'ing the EFI maintainers. > > On 06/05/2025 5:24 pm, Kevin Lampis wrote: > > diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c > > index e39fbc3529..7c528cd5dd 100644 > > --- a/xen/common/efi/boot.c > > +++ b/xen/common/efi/boot.c

[PATCH v2 3/4] kexec: Implement new EFI load types

2025-05-07 Thread Frediano Ziglio
From: Ross Lagerwall Add two new EFI load types for kexec. These load types are suitable for use when Secure Boot is enabled. When these load types are used, the caller should not pass purgatory as one of the kexec segments. Instead, Xen will prepare and supply purgatory itself. Preparing purga

[RFC PATCH v3 0/2] xen: add libalf fuzzing support

2025-05-07 Thread Volodymyr Babchuk
It is possible to use LibAFL with LibAFL-QEMU to fuzz different baremetal programs, including Xen hypervisor. This small series tries to add minimal (but extenable) support for fuzzing. changes in v3: - Added patch with experimental CI integration - Severely reworked the main patch (see notes in

[PATCH v2 2/4] kexec: Include purgatory in Xen

2025-05-07 Thread Frediano Ziglio
From: Ross Lagerwall Purgatory is a binary that runs between two kernels during kexec. When Secure Boot is enabled, it should be signed and verified before being loaded and executed. Currently, purgatory is built as part of kexec-tools and dynamically modified before being loaded. This prevents

[PATCH v2 4/4] kexec: Support non-page-aligned kexec segments

2025-05-07 Thread Frediano Ziglio
From: Ross Lagerwall With Secure Boot, userspace passes in the entire kernel loaded for verification purposes. However, the kernel's startup32 function needs to be aligned (e.g. to 16 MiB) and this results in the start of the segment not being page-aligned (depending on where the startup32 functi

[PATCH v2 1/4] xen/lib: Export additional sha256 functions

2025-05-07 Thread Frediano Ziglio
From: Ross Lagerwall In future, some code needs to generate a digest over several separate buffers so export the necessary functions to do so. Signed-off-by: Ross Lagerwall --- xen/include/xen/sha2.h | 12 xen/lib/sha2-256.c | 17 ++--- 2 files changed, 18 insertio

[PATCH v2 0/4] Allows Secure Boot for Kexec

2025-05-07 Thread Frediano Ziglio
From: Frediano Ziglio Using EFI Secure Boot all kernel level code should be signed and there should be no way to run unchecked code. For this reason the Kexec interface needs to be changed in order to allows signature checking. The purgatory code is included in Xen itself as passing this code fr

[RFC PATCH v3 2/2] ci: enable fuzzing for arm64

2025-05-07 Thread Volodymyr Babchuk
Add new alpine-based build that enables LibAFL-based fuzzer. Use this new build to run two fuzzing sessions: hypercall fuzzing and gicv2 fuzzing. Currently, this is all the fuzzing modes supported by xen fuzzer. Every fuzzing session will run approximately 10 minutes. Fuzzing session will provide

[PATCH v2] lib: Add strcspn function

2025-05-07 Thread Kevin Lampis
From: Ross Lagerwall This will be used by future patches. Signed-off-by: Ross Lagerwall Signed-off-by: Kevin Lampis --- Changes in v2: - Add alias to __builtin_strcspn --- xen/include/xen/string.h | 5 + xen/lib/Makefile | 1 + xen/lib/strcspn.c| 22 +

Re: Assert in x86_emulate_wrapper triggerable by HVM domain

2025-05-07 Thread Manuel Andreas
On 4/16/25 15:52, Jan Beulich wrote: On 15.04.2025 23:52, Manuel Andreas wrote: my fuzzing infrastructure discovered that an assert in x86_emulate_wrapper is able to be triggered by an HVM domain executing a specially crafted repeating movs instruction. Specifically, if the emulation of the re

[PATCH] livepatch: Pass buffer size to list sysctl

2025-05-07 Thread Ross Lagerwall
From: Kevin Lampis The livepatch list sysctl writes metadata into a buffer provided by the caller. The caller is expected to allocate an appropriately sized buffer but this is racy and may result in Xen writing beyond the end of the buffer should the metadata size change. The name buffer is expe

Re: [PATCH 5/6] xen/arm: exclude xen,reg{-cacheable} from domU extended regions

2025-05-07 Thread Stewart Hildebrand
On 5/5/25 19:31, Stefano Stabellini wrote: > On Sun, 4 May 2025, Stewart Hildebrand wrote: >> When a device is passed through to a dom0less domU, the >> xen,reg{-cacheable} ranges may overlap with the extended regions. Remove >> xen,reg{-cacheable} from extended regions. > > There is no reg-cachea

Re: Mapping memory into a domain

2025-05-07 Thread Demi Marie Obenour
On 5/7/25 1:39 PM, Roger Pau Monné wrote: > On Tue, May 06, 2025 at 04:56:12PM -0400, Demi Marie Obenour wrote: >> On 5/6/25 9:06 AM, Alejandro Vallejo wrote: >>> On Tue May 6, 2025 at 3:02 AM CEST, Demi Marie Obenour wrote: On 5/5/25 7:32 AM, Alejandro Vallejo wrote: > I suppose this is s

[bug report] x86/xen/msr: Remove calling native_{read,write}_msr{,_safe}() in pmu_msr_{read,write}()

2025-05-07 Thread Dan Carpenter
Hello Xin Li (Intel), Commit 0cb6f4128a7d ("x86/xen/msr: Remove calling native_{read,write}_msr{,_safe}() in pmu_msr_{read,write}()") from Apr 27, 2025 (linux-next), leads to the following Smatch static checker warning: arch/x86/xen/enlighten_pv.c:1168 xen_read_msr_safe() error: u

Re: [PATCH v20 2/2] vpci: translate virtual PCI bus topology for guests

2025-05-07 Thread Stewart Hildebrand
On 5/7/25 13:44, Roger Pau Monné wrote: > On Wed, May 07, 2025 at 09:38:51AM -0400, Stewart Hildebrand wrote: >> On 5/7/25 03:44, Roger Pau Monné wrote: >>> On Tue, May 06, 2025 at 11:05:13PM -0400, Stewart Hildebrand wrote: On 5/6/25 07:16, Roger Pau Monné wrote: > On Fri, Apr 18, 2025 at

Re: [PATCH] xen/x86: allow Dom0 PVH to call XENMEM_exchange

2025-05-07 Thread Stefano Stabellini
On Tue, 6 May 2025, Roger Pau Monné wrote: > On Mon, May 05, 2025 at 11:11:10AM -0700, Stefano Stabellini wrote: > > On Mon, 5 May 2025, Roger Pau Monné wrote: > > > On Mon, May 05, 2025 at 12:40:18PM +0200, Marek Marczykowski-Górecki > > > wrote: > > > > On Mon, Apr 28, 2025 at 01:00:01PM -0700,

Re: [PATCH 2/2] xen: swiotlb: Implement map_resource callback

2025-05-07 Thread Stefano Stabellini
On Tue, 6 May 2025, John Ernberg wrote: > Hi Stefano, > > On 5/2/25 7:20 PM, Stefano Stabellini wrote: > > +Christoph > > > > On Fri, 2 May 2025, John Ernberg wrote: > >> Needed by the eDMA v3 DMA engine found in iommu-less SoCs such as iMX8QXP > >> to be able to perform DMA operations as a Xen H

Re: [PATCH v3 5/7] arm/mpu: Introduce MPU memory mapping flags

2025-05-07 Thread Julien Grall
On 16/04/2025 17:52, Luca Fancellu wrote: Hi Julien, Hi Luca, Sorry for the late answer. On 14 Apr 2025, at 12:48, Julien Grall wrote: Hi Luca, On 11/04/2025 23:56, Luca Fancellu wrote: Introduce the MPU memory mapping flags in asm/page.h. Signed-off-by: Luca Fancellu --- xen/arc

[PATCH v1 1/2] x86: x86_emulate: address violation of MISRA C Rule 13.2

2025-05-07 Thread victorm.lira
From: Nicola Vetrini Rule 13.2 states: "The value of an expression and its persistent side effects shall be the same under all permitted evaluation orders". The full expansion of macro "commit_far_branch" contains an assignment to variable "rc", which is also assigned to the result of the GNU st

[PATCH v1 2/2] automation/eclair: tag Rule 13.2 as clean

2025-05-07 Thread victorm.lira
From: Federico Serafini Update ECLAIR configuration to consider Rule 13.2 as clean so as to avoid regressions. Signed-off-by: Federico Serafini Signed-off-by: Victor Lira --- Cc: Andrew Cooper Cc: Anthony PERARD Cc: Michal Orzel Cc: Jan Beulich Cc: Julien Grall Cc: Roger Pau Monné Cc: St

Re: [PATCH v20 2/2] vpci: translate virtual PCI bus topology for guests

2025-05-07 Thread Roger Pau Monné
On Tue, May 06, 2025 at 11:05:13PM -0400, Stewart Hildebrand wrote: > On 5/6/25 07:16, Roger Pau Monné wrote: > > Hello, > > > > Sorry I haven't looked at this before, I was confused with the cover > > letter having ARM in the subject and somehow assumed all the code was > > ARM related. > > No w

Re: [PATCH v3 04/11] vpci/header: Emulate extended capability list for dom0

2025-05-07 Thread Roger Pau Monné
On Wed, May 07, 2025 at 03:32:47AM +, Chen, Jiqian wrote: > On 2025/5/6 22:14, Roger Pau Monné wrote: > > On Mon, Apr 21, 2025 at 02:18:56PM +0800, Jiqian Chen wrote: > >> Add a new function to emulate extended capability list for dom0, > >> and call it in init_header(). So that it will be easy

Re: [PATCH v3 05/11] vpci: Refactor REGISTER_VPCI_INIT

2025-05-07 Thread Roger Pau Monné
On Wed, May 07, 2025 at 05:59:52AM +, Chen, Jiqian wrote: > On 2025/5/6 22:37, Roger Pau Monné wrote: > > On Mon, Apr 21, 2025 at 02:18:57PM +0800, Jiqian Chen wrote: > >> Refactor REGISTER_VPCI_INIT to contain more capability specific > >> information, this is benifit for follow-on changes to

Re: [PATCH v3 06/11] vpci: Hide legacy capability when it fails to initialize

2025-05-07 Thread Roger Pau Monné
On Wed, May 07, 2025 at 06:38:45AM +, Chen, Jiqian wrote: > On 2025/5/7 00:00, Roger Pau Monné wrote: > > On Mon, Apr 21, 2025 at 02:18:58PM +0800, Jiqian Chen wrote: > >> +} > >> + > >> +/* PCI_CAP_LIST_NEXT register of target capability */ > >> +list_del(&next_r->node); > >> +

Re: [PATCH v3 07/11] vpci: Hide extended capability when it fails to initialize

2025-05-07 Thread Roger Pau Monné
On Wed, May 07, 2025 at 07:26:21AM +, Chen, Jiqian wrote: > On 2025/5/7 00:21, Roger Pau Monné wrote: > > On Mon, Apr 21, 2025 at 02:18:59PM +0800, Jiqian Chen wrote: > >> When vpci fails to initialize a extended capability of device for dom0, > >> it just return error instead of catching and p

Re: [PATCH v3 03/11] vpci/header: Emulate legacy capability list for dom0

2025-05-07 Thread Chen, Jiqian
On 2025/5/7 15:49, Roger Pau Monné wrote: > On Wed, May 07, 2025 at 02:46:52AM +, Chen, Jiqian wrote: >> On 2025/5/6 21:50, Roger Pau Monné wrote: >>> On Mon, Apr 21, 2025 at 02:18:55PM +0800, Jiqian Chen wrote: Current logic of emulating legacy capability list is only for domU. So, e

Re: [PATCH v3 05/11] vpci: Refactor REGISTER_VPCI_INIT

2025-05-07 Thread Chen, Jiqian
On 2025/5/7 16:04, Roger Pau Monné wrote: > On Wed, May 07, 2025 at 05:59:52AM +, Chen, Jiqian wrote: >> On 2025/5/6 22:37, Roger Pau Monné wrote: >>> On Mon, Apr 21, 2025 at 02:18:57PM +0800, Jiqian Chen wrote: +if ( !is_ext ) +pos = pci_find_cap_offset(pdev-

Re: [PATCH v3 03/11] vpci/header: Emulate legacy capability list for dom0

2025-05-07 Thread Roger Pau Monné
On Wed, May 07, 2025 at 02:46:52AM +, Chen, Jiqian wrote: > On 2025/5/6 21:50, Roger Pau Monné wrote: > > On Mon, Apr 21, 2025 at 02:18:55PM +0800, Jiqian Chen wrote: > >> Current logic of emulating legacy capability list is only for domU. > >> So, expand it to emulate for dom0 too. Then it wil

Re: [PATCH v3 07/11] vpci: Hide extended capability when it fails to initialize

2025-05-07 Thread Chen, Jiqian
On 2025/5/7 00:21, Roger Pau Monné wrote: > On Mon, Apr 21, 2025 at 02:18:59PM +0800, Jiqian Chen wrote: >> When vpci fails to initialize a extended capability of device for dom0, >> it just return error instead of catching and processing exception. That >> makes the entire device unusable. >> >> S

Re: [PATCH v3 07/11] vpci: Hide extended capability when it fails to initialize

2025-05-07 Thread Chen, Jiqian
On 2025/5/7 16:09, Roger Pau Monné wrote: > On Wed, May 07, 2025 at 07:26:21AM +, Chen, Jiqian wrote: >> On 2025/5/7 00:21, Roger Pau Monné wrote: >>> On Mon, Apr 21, 2025 at 02:18:59PM +0800, Jiqian Chen wrote: When vpci fails to initialize a extended capability of device for dom0, i