Re: [PATCH v4 04/10] vpci: Refactor REGISTER_VPCI_INIT

2025-05-18 Thread Chen, Jiqian
On 2025/5/18 22:34, Jan Beulich wrote: > On 09.05.2025 11:05, Jiqian Chen wrote: >> --- a/xen/drivers/vpci/msi.c >> +++ b/xen/drivers/vpci/msi.c >> @@ -270,7 +270,7 @@ static int cf_check init_msi(struct pci_dev *pdev) >> >> return 0; >> } >> -REGISTER_VPCI_INIT(init_msi, VPCI_PRIORITY_LOW)

Re: [PATCH v4 03/10] vpci/header: Emulate extended capability list for dom0

2025-05-18 Thread Jan Beulich
On 19.05.2025 08:43, Chen, Jiqian wrote: > On 2025/5/18 22:20, Jan Beulich wrote: >> On 09.05.2025 11:05, Jiqian Chen wrote: >>> @@ -827,6 +827,34 @@ static int vpci_init_capability_list(struct pci_dev >>> *pdev) >>> PCI_STATUS_RSVDZ_MASK); >>> }

Re: [PATCH v4 08/10] vpci/rebar: Remove registers when init_rebar() fails

2025-05-18 Thread Jan Beulich
On 09.05.2025 11:05, Jiqian Chen wrote: > --- a/xen/drivers/vpci/rebar.c > +++ b/xen/drivers/vpci/rebar.c > @@ -49,6 +49,26 @@ static void cf_check rebar_ctrl_write(const struct pci_dev > *pdev, > bar->guest_addr = bar->addr; > } > > +static void cleanup_rebar(struct pci_dev *pdev) Just t

Re: [PATCH v4 04/15] xen/cpufreq: refactor cmdline "cpufreq=xxx"

2025-05-18 Thread Jan Beulich
On 19.05.2025 08:27, Penny, Zheng wrote: >> -Original Message- >> From: Jan Beulich >> Sent: Monday, May 12, 2025 11:58 PM >> On 07.05.2025 05:18, Penny, Zheng wrote: -Original Message- From: Jan Beulich Sent: Tuesday, April 29, 2025 7:47 PM On 29.04.2025 12:36

RE: [PATCH v4 04/15] xen/cpufreq: refactor cmdline "cpufreq=xxx"

2025-05-18 Thread Penny, Zheng
[Public] Hi, > -Original Message- > From: Jan Beulich > Sent: Monday, May 12, 2025 11:58 PM > To: Penny, Zheng > Cc: Huang, Ray ; xen-devel@lists.xenproject.org > Subject: Re: [PATCH v4 04/15] xen/cpufreq: refactor cmdline "cpufreq=xxx" > > On 07.05.2025 05:18, Penny, Zheng wrote: > > [

Re: [PATCH v2 01/22] x86/include/asm/intel-txt.h: constants and accessors for TXT registers and heap

2025-05-18 Thread Rich Persaud
On May 18, 2025, at 2:36 PM, Sergii Dmytruk wrote: > > On Wed, May 14, 2025 at 03:55:51PM +0100, Andrew Cooper wrote: >> Please have at least a one-liner introduction to what TXT is. Is there >> a stable URL for the TXT spec? (I can't spot an obvious one, googling >> around) > > In addition t

Re: [PATCH v2 01/22] x86/include/asm/intel-txt.h: constants and accessors for TXT registers and heap

2025-05-18 Thread Sergii Dmytruk
On Wed, May 14, 2025 at 03:55:51PM +0100, Andrew Cooper wrote: > Please have at least a one-liner introduction to what TXT is.  Is there > a stable URL for the TXT spec?  (I can't spot an obvious one, googling > around) In addition to a short definition I'll add: * https://www.intel.com/content/

Re: BUG kernel 6.12.19 defautl_swiotlb_limit() returns wrong value for CONFIG_SWIOTLB_DYNAMIC=y effects atm only under XEN dom0

2025-05-18 Thread Andreas Greve
Hello to all, here is my BUG-Fix tested against kernel 6.12.19 and 6.12.28. Signed-off-by: Andreas greveandreas.gr...@a-greve.de diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index abcf3fa63a56..742e6cbbe852 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -1654,7 +165

Re: [PATCH v4 06/10] vpci: Hide extended capability when it fails to initialize

2025-05-18 Thread Jan Beulich
On 09.05.2025 11:05, Jiqian Chen wrote: > --- a/xen/include/xen/pci_regs.h > +++ b/xen/include/xen/pci_regs.h > @@ -448,7 +448,10 @@ > /* Extended Capabilities (PCI-X 2.0 and Express) */ > #define PCI_EXT_CAP_ID(header) ((header) & 0x) > #define PCI_EXT_CAP_VER(header)

Re: [PATCH v4 05/10] vpci: Hide legacy capability when it fails to initialize

2025-05-18 Thread Jan Beulich
On 09.05.2025 11:05, Jiqian Chen wrote: > @@ -83,6 +99,100 @@ static int assign_virtual_sbdf(struct pci_dev *pdev) > > #endif /* CONFIG_HAS_VPCI_GUEST_SUPPORT */ > > +static struct vpci_register *vpci_get_register(struct vpci *vpci, > + unsigned in

Re: [PATCH v4 04/10] vpci: Refactor REGISTER_VPCI_INIT

2025-05-18 Thread Jan Beulich
On 09.05.2025 11:05, Jiqian Chen wrote: > --- a/xen/drivers/vpci/msi.c > +++ b/xen/drivers/vpci/msi.c > @@ -270,7 +270,7 @@ static int cf_check init_msi(struct pci_dev *pdev) > > return 0; > } > -REGISTER_VPCI_INIT(init_msi, VPCI_PRIORITY_LOW); > +REGISTER_VPCI_LEGACY_CAP(PCI_CAP_ID_MSI, in

Re: [PATCH v4 03/10] vpci/header: Emulate extended capability list for dom0

2025-05-18 Thread Jan Beulich
On 09.05.2025 11:05, Jiqian Chen wrote: > @@ -827,6 +827,34 @@ static int vpci_init_capability_list(struct pci_dev > *pdev) > PCI_STATUS_RSVDZ_MASK); > } > > +static int vpci_init_ext_capability_list(struct pci_dev *pdev) > +{ > +unsigned in

Re: [PATCH v2 5/5] livepatch: Verify livepatch signatures

2025-05-18 Thread Jan Beulich
On 15.05.2025 11:38, Ross Lagerwall wrote: > @@ -79,6 +80,9 @@ static DEFINE_PER_CPU(struct tasklet, livepatch_tasklet); > static struct rsa_public_key builtin_payload_key; > #endif > > +static int check_signature(const struct livepatch_elf *elf, void *raw, > + size_t

Re: [PATCH v2 4/5] livepatch: Load built-in key during boot

2025-05-18 Thread Jan Beulich
On 15.05.2025 11:38, Ross Lagerwall wrote: > @@ -73,6 +75,10 @@ static struct livepatch_work livepatch_work; > static DEFINE_PER_CPU(bool, work_to_do); > static DEFINE_PER_CPU(struct tasklet, livepatch_tasklet); > > +#ifdef CONFIG_PAYLOAD_VERIFY > +static struct rsa_public_key builtin_payload_k

Re: [PATCH v2 3/5] crypto: Add RSA support

2025-05-18 Thread Jan Beulich
On 15.05.2025 11:38, Ross Lagerwall wrote: > --- a/xen/common/Makefile > +++ b/xen/common/Makefile > @@ -28,6 +28,7 @@ obj-$(CONFIG_LIVEPATCH) += livepatch.o livepatch_elf.o > obj-$(CONFIG_LLC_COLORING) += llc-coloring.o > obj-$(CONFIG_VM_EVENT) += mem_access.o > obj-y += memory.o > +obj-$(CONFI

Re: [PATCH v2 2/5] livepatch: Embed public key in Xen

2025-05-18 Thread Jan Beulich
On 15.05.2025 11:38, Ross Lagerwall wrote: > --- a/xen/crypto/Makefile > +++ b/xen/crypto/Makefile > @@ -1,2 +1,15 @@ > obj-y += rijndael.o > obj-y += vmac.o > + > +obj-$(CONFIG_PAYLOAD_VERIFY) += builtin_payload_key.o For new files please prefer dashes over underscores in their names. > +ifeq

Re: [PATCH v2 6/6] x86/hvm: reduce the need to flush caches in memory_type_changed()

2025-05-18 Thread Jan Beulich
On 16.05.2025 11:45, Roger Pau Monne wrote: > The current cache flushing done in memory_type_changed() is too wide, and > this doesn't scale on boxes with high number of CPUs. Attempt to limit > cache flushes as a result of p2m type changes, and only do them if: > > * The CPU doesn't support (or

Re: [PATCH v2 09/22] xen/lib: add implementation of SHA-1

2025-05-18 Thread Sergii Dmytruk
On Sun, May 18, 2025 at 10:34:07AM +0200, Jan Beulich wrote: > On 17.05.2025 20:17, Sergii Dmytruk wrote: > > On Wed, May 14, 2025 at 05:58:59PM +0100, Andrew Cooper wrote: > >> Please crib from sha2.h as much as you can.  Use xen/types.h, drop the > >> double underscore in the guard, and provide a

Re: Request for patch to fix boot loop issue in Xen 4.17.6

2025-05-18 Thread Andrew Cooper
On 18/05/2025 12:24 pm, Maximilian Engelhardt wrote: > On Montag, 12. Mai 2025 10:54:50 CEST Jan Beulich wrote: >> On 03.05.2025 16:02, Ngamia Djabiri Julie wrote: >>> Dear Xen developers, >>> >>> I would like to ask if the following fix can also be included in Xen >>> 4.17.6 (and eventually in the

Re: [PATCH v2 1/6] x86/pv: fix emulation of wb{,no}invd to flush all pCPU caches

2025-05-18 Thread Jan Beulich
On 16.05.2025 11:45, Roger Pau Monne wrote: > The current emulation of wb{,no}invd is bogus for PV guests: it will only > flush the current pCPU cache, without taking into account pCPUs where the > vCPU had run previously. Resort to flushing the cache on all host pCPUs to > make it correct. > > F

Re: [PATCH v2 5/6] x86/hvm: limit memory type cache flush to running domains

2025-05-18 Thread Jan Beulich
On 16.05.2025 11:45, Roger Pau Monne wrote: > Avoid the cache flush if the domain is not yet running. There shouldn't be > any cached data resulting from domain accesses that need flushing, as the > domain hasn't run yet. This again plays into what we started discussing already: There may still b

Re: Request for patch to fix boot loop issue in Xen 4.17.6

2025-05-18 Thread Maximilian Engelhardt
On Montag, 12. Mai 2025 10:54:50 CEST Jan Beulich wrote: > On 03.05.2025 16:02, Ngamia Djabiri Julie wrote: > > Dear Xen developers, > > > > I would like to ask if the following fix can also be included in Xen > > 4.17.6 (and eventually in the Xen versions after 4.17.6 that don't have > > the fix)

Re: [PATCH v2 3/6] xen/x86: rename cache_flush_permitted() to has_arch_io_resources()

2025-05-18 Thread Jan Beulich
On 16.05.2025 11:45, Roger Pau Monne wrote: > To better describe the underlying implementation. Define > cache_flush_permitted() as an alias of has_arch_io_resources(), so that > current users of cache_flush_permitted() are not effectively modified. > > With the introduction of the new handler, c

Re: [PATCH v6 2/2] xen/domain: adjust domain ID allocation for Arm

2025-05-18 Thread Jan Beulich
On 16.05.2025 04:04, dm...@proton.me wrote: > --- a/xen/common/domain.c > +++ b/xen/common/domain.c > @@ -85,7 +85,7 @@ void __init domid_init(void) > * > * If hint is outside of valid [0..DOMID_FIRST_RESERVED - 1] range of IDs, > * perform an exhaustive search starting from the end of the us

Re: [PATCH v6 1/2] xen/domain: unify domain ID allocation

2025-05-18 Thread Jan Beulich
On 16.05.2025 04:04, dm...@proton.me wrote: > From: Denis Mukhin > > Currently, hypervisor code has two different non-system domain ID allocation > implementations: > > (a) Sequential IDs allocation in dom0less Arm code based on max_init_domid; > > (b) Sequential IDs allocation in XEN_DOMCT

Re: [RFC PATCH] xen: Introduce extra IRQ count domain creation parameter

2025-05-18 Thread Jan Beulich
On 16.05.2025 15:50, Teddy Astie wrote: > When doing PCI Passthrough with high-IRQ devices (e.g NVMe drives), > the default limit may be unefficient as not all domains requires > more IRQs. > > Introduce a new parameter to allow the toolstack to tune the IRQ > count if more is required. > > Signe

Re: [PATCH v2 09/22] xen/lib: add implementation of SHA-1

2025-05-18 Thread Jan Beulich
On 17.05.2025 20:17, Sergii Dmytruk wrote: > On Wed, May 14, 2025 at 05:58:59PM +0100, Andrew Cooper wrote: >> Please crib from sha2.h as much as you can.  Use xen/types.h, drop the >> double underscore in the guard, and provide a link to the spec. > > Until yesterday CODING_STYLE instructed to ha

Re: [PATCH v2 08/16] xen/riscv: dt_processor_cpuid() implementation

2025-05-18 Thread Jan Beulich
On 16.05.2025 18:02, Oleksii Kurochko wrote: > > On 5/15/25 9:56 AM, Jan Beulich wrote: >> (adding Bertrand as the one further DT maintainer, for a respective question >> below) >> >> On 06.05.2025 18:51, Oleksii Kurochko wrote: >>> Implements dt_processor_hartid() >> There's no such function (any

Re: [PATCH v2 07/16] xen/riscv: introduce platform_get_irq()

2025-05-18 Thread Jan Beulich
On 16.05.2025 16:04, Oleksii Kurochko wrote: > > On 5/15/25 9:33 AM, Jan Beulich wrote: >>> +int platform_get_irq(const struct dt_device_node *device, int index) >>> +{ >>> +struct dt_irq dt_irq; >>> +int ret; >>> + >>> +if ( (ret = dt_device_get_irq(device, index, &dt_irq)) != 0 ) >>>

Re: [PATCH] x86/stubs: Consolidate the stubs infrastructure in asm/stubs.h

2025-05-18 Thread Jan Beulich
On 16.05.2025 15:49, Andrew Cooper wrote: > On 16/05/2025 2:41 pm, Jan Beulich wrote: >> On 16.05.2025 15:33, Andrew Cooper wrote: >>> --- /dev/null >>> +++ b/xen/arch/x86/include/asm/stubs.h >>> @@ -0,0 +1,37 @@ >>> +/* SPDX-License-Identifier: GPL-2.0-only */ >>> +#ifndef X86_ASM_STUBS_H >>> +#de