[PATCH] sysctl: XSM hook should not cause XEN_SYSCTL_getdomaininfolist to (appear to) fail

2023-05-02 Thread Jan Beulich
Unlike for XEN_DOMCTL_getdomaininfo, where the XSM check is intended to cause the operation to fail, in the loop here it ought to merely determine whether information for the domain at hand may be reported back. Therefore if on the last iteration the hook results in denial, this should not affect t

Re: [PATCH] xen/sysctl: fix XEN_SYSCTL_getdomaininfolist handling with XSM

2023-05-02 Thread Jan Beulich
On 30.04.2023 16:46, Juergen Gross wrote: > In case XSM is active, the handling of XEN_SYSCTL_getdomaininfolist > can fail if the last domain scanned isn't allowed to be accessed by > the calling domain (i.e. xsm_getdomaininfo(XSM_HOOK, d) is failing). > > Fix that by just ignoring scanned domains

Re: HAS_CC_CET_IBT misdetected

2023-05-02 Thread Jan Beulich
On 02.05.2023 07:48, Olaf Hering wrote: > The next push to xen.git#staging will trigger a build failure in the > refreshed Leap docker image. > > For some reason HAS_CC_CET_IBT will evaluate to true. I think the significant > change is the binutils upgrade from 2.37 to 2.39 in November 2022. >

Re: HAS_CC_CET_IBT misdetected

2023-05-02 Thread Jan Beulich
On 02.05.2023 09:31, Jan Beulich wrote: > On 02.05.2023 07:48, Olaf Hering wrote: >> The next push to xen.git#staging will trigger a build failure in the >> refreshed Leap docker image. >> >> For some reason HAS_CC_CET_IBT will evaluate to true. I think the >> significant change is the binutils u

Re: [PATCH v1 3/6] iommu/arm: Introduce iommu_add_dt_pci_device API

2023-05-02 Thread Jan Beulich
On 01.05.2023 22:03, Stewart Hildebrand wrote: > @@ -228,6 +229,9 @@ int iommu_release_dt_devices(struct domain *d); > * (IOMMU is not enabled/present or device is not connected to it). > */ > int iommu_add_dt_device(struct dt_device_node *np); > +#ifdef CONFIG_HAS_PCI > +int iommu_add_dt

Re: [PATCH v1 4/6] pci/arm: Use iommu_add_dt_pci_device() instead of arch hook

2023-05-02 Thread Jan Beulich
On 01.05.2023 22:03, Stewart Hildebrand wrote: > --- a/xen/drivers/passthrough/pci.c > +++ b/xen/drivers/passthrough/pci.c > @@ -1305,7 +1305,7 @@ __initcall(setup_dump_pcidevs); > > static int iommu_add_device(struct pci_dev *pdev) > { > -const struct domain_iommu *hd; > +const struct

Re: [PATCH] xen/grant-table: Properly acquire the vCPU maptrack freelist lock

2023-05-02 Thread Jan Beulich
On 28.04.2023 12:26, Ruben Hakobyan wrote: > Introduced as part of XSA-228, the maptrack_freelist_lock is meant to > protect all accesses to entries in the vCPU freelist as well as the > head and tail pointers. > > However, this principle is violated twice in get_maptrack_handle(), > where the tai

[PATCH 0/2] x86: init improvements

2023-05-02 Thread Roger Pau Monne
Hello, The following series contain two minor improvements for early boot: the first one is an alignment check when building the initial page tables, the second is a consistency fix for the GDT used by the BSP for the trampoline code. Both are a result of some debugging work done on a system with

[PATCH 2/2] x86/trampoline: load the GDT located in the trampoline page

2023-05-02 Thread Roger Pau Monne
When booting the BSP the portion of the code executed from the trampoline page will be using the GDT located in the hypervisor .text.head section rather than the GDT located in the trampoline page. If skip_realmode is not set the GDT located in the trampoline page will be loaded after having execu

[PATCH 1/2] x86/head: check base address alignment

2023-05-02 Thread Roger Pau Monne
Ensure that the base address is 2M aligned, or else the page table entries created would be corrupt as reserved bits on the PDE end up set. We have found a broken firmware where the loader would end up loading Xen at a non 2M aligned region, and that caused a very difficult to debug triple fault.

Re: [PATCH] sysctl: XSM hook should not cause XEN_SYSCTL_getdomaininfolist to (appear to) fail

2023-05-02 Thread Andrew Cooper
On 02/05/2023 8:17 am, Jan Beulich wrote: > The hook being able to deny access to data for certain domains means > that no caller can assume to have a system-wide picture when holding the > results. > > Wouldn't it make sense to permit the function to merely "count" domains? > While racy in general

Re: [PATCH] sysctl: XSM hook should not cause XEN_SYSCTL_getdomaininfolist to (appear to) fail

2023-05-02 Thread Roger Pau Monné
On Tue, May 02, 2023 at 10:27:39AM +0100, Andrew Cooper wrote: > On 02/05/2023 8:17 am, Jan Beulich wrote: > > The hook being able to deny access to data for certain domains means > > that no caller can assume to have a system-wide picture when holding the > > results. > > > > Wouldn't it make sens

[ovmf test] 180502: all pass - PUSHED

2023-05-02 Thread osstest service owner
flight 180502 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/180502/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 23c71536efbebed57942947668f470f934324477 baseline version: ovmf 56e9828380b7425678a08

Re: [PATCH] sysctl: XSM hook should not cause XEN_SYSCTL_getdomaininfolist to (appear to) fail

2023-05-02 Thread Andrew Cooper
On 02/05/2023 10:33 am, Roger Pau Monné wrote: > On Tue, May 02, 2023 at 10:27:39AM +0100, Andrew Cooper wrote: >> On 02/05/2023 8:17 am, Jan Beulich wrote: >>> The hook being able to deny access to data for certain domains means >>> that no caller can assume to have a system-wide picture when hold

Re: [PATCH] sysctl: XSM hook should not cause XEN_SYSCTL_getdomaininfolist to (appear to) fail

2023-05-02 Thread Jan Beulich
On 02.05.2023 11:33, Roger Pau Monné wrote: > On Tue, May 02, 2023 at 10:27:39AM +0100, Andrew Cooper wrote: >> On 02/05/2023 8:17 am, Jan Beulich wrote: >>> The hook being able to deny access to data for certain domains means >>> that no caller can assume to have a system-wide picture when holding

Re: [PATCH 2/2] x86/trampoline: load the GDT located in the trampoline page

2023-05-02 Thread Andrew Cooper
On 02/05/2023 10:22 am, Roger Pau Monne wrote: > When booting the BSP the portion of the code executed from the > trampoline page will be using the GDT located in the hypervisor > .text.head section rather than the GDT located in the trampoline page. It's more subtle than this. gdt_boot_descr ref

Re: [PATCH 1/2] x86/head: check base address alignment

2023-05-02 Thread Andrew Cooper
On 02/05/2023 10:22 am, Roger Pau Monne wrote: > Ensure that the base address is 2M aligned, or else the page table > entries created would be corrupt as reserved bits on the PDE end up > set. > > We have found a broken firmware where the loader would end up loading > Xen at a non 2M aligned region

Re: [PATCH] xen/blkfront: Only check REQ_FUA for writes

2023-05-02 Thread Juergen Gross
On 26.04.23 18:40, Ross Lagerwall wrote: The existing code silently converts read operations with the REQ_FUA bit set into write-barrier operations. This results in data loss as the backend scribbles zeroes over the data instead of returning it. While the REQ_FUA bit doesn't make sense on a read

Re: [PATCH] x86/msi: dynamically map pages for MSI-X tables

2023-05-02 Thread Roger Pau Monné
On Wed, Apr 26, 2023 at 02:55:20PM +, Ruben Hakobyan wrote: > Xen reserves a constant number of pages that can be used for mapping > MSI-X tables. This limit is defined by FIX_MSIX_MAX_PAGES in fixmap.h. > > Reserving a fixed number of pages could result in an -ENOMEM if a > device requests a

[linux-linus test] 180500: regressions - FAIL

2023-05-02 Thread osstest service owner
flight 180500 linux-linus real [real] flight 180503 linux-linus real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/180500/ http://logs.test-lab.xenproject.org/osstest/logs/180503/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run

Re: [PATCH] x86/msi: dynamically map pages for MSI-X tables

2023-05-02 Thread Jan Beulich
On 02.05.2023 12:10, Roger Pau Monné wrote: > On Wed, Apr 26, 2023 at 02:55:20PM +, Ruben Hakobyan wrote: >> Xen reserves a constant number of pages that can be used for mapping >> MSI-X tables. This limit is defined by FIX_MSIX_MAX_PAGES in fixmap.h. >> >> Reserving a fixed number of pages cou

Re: [PATCH] x86/mm: replace bogus assertion in paging_log_dirty_op()

2023-05-02 Thread Roger Pau Monné
On Thu, Apr 27, 2023 at 02:29:06PM +0200, Jan Beulich wrote: > While I was the one to introduce it, I don't think it is correct: A > bogus continuation call issued by a tool stack domain may find another > continuation in progress. IOW we've been asserting caller controlled > state (which is reacha

Re: [PATCH] x86/msi: dynamically map pages for MSI-X tables

2023-05-02 Thread Roger Pau Monné
On Tue, May 02, 2023 at 12:18:06PM +0200, Jan Beulich wrote: > On 02.05.2023 12:10, Roger Pau Monné wrote: > > On Wed, Apr 26, 2023 at 02:55:20PM +, Ruben Hakobyan wrote: > >> Xen reserves a constant number of pages that can be used for mapping > >> MSI-X tables. This limit is defined by FIX_MS

Re: [PATCH 1/2] x86/head: check base address alignment

2023-05-02 Thread Jan Beulich
On 02.05.2023 11:54, Andrew Cooper wrote: > On 02/05/2023 10:22 am, Roger Pau Monne wrote: >> Ensure that the base address is 2M aligned, or else the page table >> entries created would be corrupt as reserved bits on the PDE end up >> set. >> >> We have found a broken firmware where the loader woul

Re: [PATCH 1/2] x86/head: check base address alignment

2023-05-02 Thread Roger Pau Monné
On Tue, May 02, 2023 at 10:54:55AM +0100, Andrew Cooper wrote: > On 02/05/2023 10:22 am, Roger Pau Monne wrote: > > Ensure that the base address is 2M aligned, or else the page table > > entries created would be corrupt as reserved bits on the PDE end up > > set. > > > > We have found a broken firm

Re: [PATCH 2/2] x86/trampoline: load the GDT located in the trampoline page

2023-05-02 Thread Roger Pau Monné
On Tue, May 02, 2023 at 10:43:13AM +0100, Andrew Cooper wrote: > On 02/05/2023 10:22 am, Roger Pau Monne wrote: > > When booting the BSP the portion of the code executed from the > > trampoline page will be using the GDT located in the hypervisor > > .text.head section rather than the GDT located i

Re: [PATCH 1/2] x86/head: check base address alignment

2023-05-02 Thread Jan Beulich
On 02.05.2023 12:28, Roger Pau Monné wrote: > On Tue, May 02, 2023 at 10:54:55AM +0100, Andrew Cooper wrote: >> On 02/05/2023 10:22 am, Roger Pau Monne wrote: >>> Ensure that the base address is 2M aligned, or else the page table >>> entries created would be corrupt as reserved bits on the PDE end

Re: [PATCH 1/2] x86/head: check base address alignment

2023-05-02 Thread Andrew Cooper
On 02/05/2023 11:28 am, Roger Pau Monné wrote: > On Tue, May 02, 2023 at 10:54:55AM +0100, Andrew Cooper wrote: >> On 02/05/2023 10:22 am, Roger Pau Monne wrote: >>> Ensure that the base address is 2M aligned, or else the page table >>> entries created would be corrupt as reserved bits on the PDE e

Re: [PATCH] sysctl: XSM hook should not cause XEN_SYSCTL_getdomaininfolist to (appear to) fail

2023-05-02 Thread Daniel P. Smith
On 5/2/23 03:17, Jan Beulich wrote: Unlike for XEN_DOMCTL_getdomaininfo, where the XSM check is intended to cause the operation to fail, in the loop here it ought to merely determine whether information for the domain at hand may be reported back. Therefore if on the last iteration the hook re

Re: [PATCH 1/2] x86/head: check base address alignment

2023-05-02 Thread Roger Pau Monné
On Tue, May 02, 2023 at 12:28:55PM +0200, Jan Beulich wrote: > On 02.05.2023 11:54, Andrew Cooper wrote: > > On 02/05/2023 10:22 am, Roger Pau Monne wrote: > >> Ensure that the base address is 2M aligned, or else the page table > >> entries created would be corrupt as reserved bits on the PDE end u

Re: [PATCH v2] ns16550: enable memory decoding on MMIO-based PCI console card

2023-05-02 Thread Jan Beulich
On 25.04.2023 16:39, Marek Marczykowski-Górecki wrote: > pci_serial_early_init() enables PCI_COMMAND_IO for IO-based UART > devices, add setting PCI_COMMAND_MEMORY for MMIO-based UART devices too. This sentence is odd, as by its grammar it looks to describe the current situation only. The respecti

Re: [PATCH] sysctl: XSM hook should not cause XEN_SYSCTL_getdomaininfolist to (appear to) fail

2023-05-02 Thread Jan Beulich
On 02.05.2023 12:43, Daniel P. Smith wrote: > On 5/2/23 03:17, Jan Beulich wrote: >> Unlike for XEN_DOMCTL_getdomaininfo, where the XSM check is intended to >> cause the operation to fail, in the loop here it ought to merely >> determine whether information for the domain at hand may be reported >>

[RFC PATCH] xen/arm: arm32: Enable smpboot on Arm32 based systems

2023-05-02 Thread Ayan Kumar Halder
On some of the Arm32 based systems (eg Cortex-R52), smpboot is supported. In these systems PSCI may not always be supported. In case of Cortex-R52, there is no EL3 or secure mode. Thus, PSCI is not supported as it requires EL3. Thus, we use 'spin-table' mechanism to boot the secondary cpus. The pr

Re: [PATCH] sysctl: XSM hook should not cause XEN_SYSCTL_getdomaininfolist to (appear to) fail

2023-05-02 Thread Roger Pau Monné
On Tue, May 02, 2023 at 06:43:33AM -0400, Daniel P. Smith wrote: > > > On 5/2/23 03:17, Jan Beulich wrote: > > Unlike for XEN_DOMCTL_getdomaininfo, where the XSM check is intended to > > cause the operation to fail, in the loop here it ought to merely > > determine whether information for the dom

Re: [PATCH 1/2] x86/head: check base address alignment

2023-05-02 Thread Jan Beulich
On 02.05.2023 12:51, Roger Pau Monné wrote: > On Tue, May 02, 2023 at 12:28:55PM +0200, Jan Beulich wrote: >> On 02.05.2023 11:54, Andrew Cooper wrote: >>> On 02/05/2023 10:22 am, Roger Pau Monne wrote: Ensure that the base address is 2M aligned, or else the page table entries created wou

Re: xen | Failed pipeline for staging | 6a47ba2f

2023-05-02 Thread Alejandro Vallejo
On Tue, May 02, 2023 at 08:53:31AM +0200, Jan Beulich wrote: > I'm also having a hard time seeing what failure case the test ended > up encountering: There are only two errors which can occur - one > from the XSM hook (which is mishandled, and I'll make a separate > patch for that) and the other fr

Re: [PATCH 1/2] x86/head: check base address alignment

2023-05-02 Thread Jan Beulich
On 02.05.2023 13:05, Jan Beulich wrote: > On 02.05.2023 12:51, Roger Pau Monné wrote: >> On Tue, May 02, 2023 at 12:28:55PM +0200, Jan Beulich wrote: >>> On 02.05.2023 11:54, Andrew Cooper wrote: On 02/05/2023 10:22 am, Roger Pau Monne wrote: > @@ -670,6 +674,11 @@ trampoline_setup: >

[PATCH v3 0/3] Rationalize usage of xc_domain_getinfo{,list}()

2023-05-02 Thread Alejandro Vallejo
The first 4 patches of v2 already made it to staging. This is a corrected repost of the 3 remaining ones. Original cover letter: xc_domain_getinfo() returns the list of domains with domid >= first_domid. It does so by repeatedly invoking XEN_DOMCTL_getdomaininfo, which leads to unintuitive behavi

[PATCH v3 1/3] tools: Modify single-domid callers of xc_domain_getinfolist()

2023-05-02 Thread Alejandro Vallejo
xc_domain_getinfolist() internally relies on a sysctl that performs a linear search for the domids. Many callers of xc_domain_getinfolist() who require information about a precise domid are much better off calling xc_domain_getinfo_single() instead, that will use the getdomaininfo domctl instead an

[PATCH v3 3/3] domctl: Modify XEN_DOMCTL_getdomaininfo to fail if domid is not found

2023-05-02 Thread Alejandro Vallejo
It previously mimicked the getdomaininfo sysctl semantics by returning the first domid higher than the requested domid that does exist. This unintuitive behaviour causes quite a few mistakes and makes the call needlessly slow in its error path. This patch removes the fallback search, returning -ES

[PATCH v3 2/3] tools: Use new xc function for some xc_domain_getinfo() calls

2023-05-02 Thread Alejandro Vallejo
Move calls that require a information about a single precisely identified domain to the new xc_domain_getinfo_single(). Signed-off-by: Alejandro Vallejo Reviewed-by: Andrew Cooper --- Cc: Andrew Cooper Cc: Wei Liu Cc: Anthony PERARD Cc: Tim Deegan Cc: George Dunlap Cc: Juergen Gross v3:

Re: [PATCH v3 1/3] tools: Modify single-domid callers of xc_domain_getinfolist()

2023-05-02 Thread Alejandro Vallejo
On Tue, May 02, 2023 at 12:13:36PM +0100, Alejandro Vallejo wrote: > xc_domain_getinfolist() internally relies on a sysctl that performs > a linear search for the domids. Many callers of xc_domain_getinfolist() > who require information about a precise domid are much better off calling > xc_domain_

Re: [PATCH v3 2/3] tools: Use new xc function for some xc_domain_getinfo() calls

2023-05-02 Thread Alejandro Vallejo
On Tue, May 02, 2023 at 12:13:37PM +0100, Alejandro Vallejo wrote: > Move calls that require a information about a single precisely identified > domain to the new xc_domain_getinfo_single(). > > Signed-off-by: Alejandro Vallejo > Reviewed-by: Andrew Cooper > > --- > Cc: Andrew Cooper > Cc: Wei

Re: [PATCH RFC] SUPPORT.md: Make all security support explicit

2023-05-02 Thread Jan Beulich
On 28.04.2023 10:12, George Dunlap wrote: > --- a/SUPPORT.md > +++ b/SUPPORT.md > @@ -17,6 +17,36 @@ for the definitions of the support status levels etc. > Release Notes > : href="https://wiki.xenproject.org/wiki/Xen_Project_X.YY_Release_Notes";>RN > > +# General security support > + > +An XS

Re: [PATCH RFC] SUPPORT.md: Make all security support explicit

2023-05-02 Thread Jan Beulich
On 28.04.2023 10:14, George Dunlap wrote: > On Fri, Apr 28, 2023 at 9:12 AM George Dunlap wrote: > It occurred to me that in many (most? all?) cases it would be more > effective to define the security support parameters in the > documentation itself. I think I agree; the alternative of needing to

Re: HAS_CC_CET_IBT misdetected

2023-05-02 Thread Olaf Hering
Tue, 2 May 2023 09:31:56 +0200 Jan Beulich : > How does 2.37 vs 2.39 matter? CET-IBT support is present in gas as of 2.29. I have no idea. It turned out, the previous Leap image was based on 15.3, while the current one will be 15.4. If I run this manually, it appears the error is produced prope

Re: [PATCH v3 1/2] acpi: Make TPM version configurable.

2023-05-02 Thread Jan Beulich
On 25.04.2023 19:47, Jennifer Herbert wrote: > This patch makes the TPM version, for which the ACPI libary probes, > configurable. > If acpi_config.tpm_verison is set to 1, it indicates that 1.2 (TCPA) should > be probed. > I have also added to hvmloader an option to allow setting this new config

Re: HAS_CC_CET_IBT misdetected

2023-05-02 Thread Andrew Cooper
On 02/05/2023 12:33 pm, Olaf Hering wrote: > Tue, 2 May 2023 09:31:56 +0200 Jan Beulich : > >> How does 2.37 vs 2.39 matter? CET-IBT support is present in gas as of 2.29. > I have no idea. It turned out, the previous Leap image was based on 15.3, > while the current one will be 15.4. > > If I run

Re: HAS_CC_CET_IBT misdetected

2023-05-02 Thread Olaf Hering
Tue, 2 May 2023 13:33:13 +0200 Olaf Hering : > I will investigate why it failed to build for me. This happens if one builds first with the Tumbleweed container, and later with the Leap container, without a 'git clean -dffx' in between. Is there a way to invalidate everything if the toolchain ch

[PATCH v6 00/16] x86/mtrr: fix handling with PAT but without MTRR

2023-05-02 Thread Juergen Gross
This series tries to fix the rather special case of PAT being available without having MTRRs (either due to CONFIG_MTRR being not set, or because the feature has been disabled e.g. by a hypervisor). The main use cases are Xen PV guests and SEV-SNP guests running under Hyper-V. Instead of trying t

[PATCH v6 05/16] x86/xen: set MTRR state when running as Xen PV initial domain

2023-05-02 Thread Juergen Gross
When running as Xen PV initial domain (aka dom0), MTRRs are disabled by the hypervisor, but the system should nevertheless use correct cache memory types. This has always kind of worked, as disabled MTRRs resulted in disabled PAT, too, so that the kernel avoided code paths resulting in inconsistenc

Re: [PATCH v3 1/3] tools: Modify single-domid callers of xc_domain_getinfolist()

2023-05-02 Thread Christian Lindig
> On 2 May 2023, at 12:13, Alejandro Vallejo > wrote: > > xc_domain_getinfolist() internally relies on a sysctl that performs > a linear search for the domids. Many callers of xc_domain_getinfolist() > who require information about a precise domid are much better off calling > xc_domain_getin

Re: [PATCH] sysctl: XSM hook should not cause XEN_SYSCTL_getdomaininfolist to (appear to) fail

2023-05-02 Thread Daniel P. Smith
On 5/2/23 06:59, Jan Beulich wrote: On 02.05.2023 12:43, Daniel P. Smith wrote: On 5/2/23 03:17, Jan Beulich wrote: Unlike for XEN_DOMCTL_getdomaininfo, where the XSM check is intended to cause the operation to fail, in the loop here it ought to merely determine whether information for the doma

Re: [PATCH v3 2/3] tools: Use new xc function for some xc_domain_getinfo() calls

2023-05-02 Thread Andrew Cooper
On 02/05/2023 12:18 pm, Alejandro Vallejo wrote: > On Tue, May 02, 2023 at 12:13:37PM +0100, Alejandro Vallejo wrote: >> Move calls that require a information about a single precisely identified >> domain to the new xc_domain_getinfo_single(). >> >> Signed-off-by: Alejandro Vallejo >> Reviewed-by:

Re: [PATCH] xen/sysctl: fix XEN_SYSCTL_getdomaininfolist handling with XSM

2023-05-02 Thread Daniel P. Smith
On 4/30/23 10:46, Juergen Gross wrote: In case XSM is active, the handling of XEN_SYSCTL_getdomaininfolist can fail if the last domain scanned isn't allowed to be accessed by the calling domain (i.e. xsm_getdomaininfo(XSM_HOOK, d) is failing). Fix that by just ignoring scanned domains where xsm_

Re: [PATCH 1/2] x86/head: check base address alignment

2023-05-02 Thread Roger Pau Monné
On Tue, May 02, 2023 at 01:11:12PM +0200, Jan Beulich wrote: > On 02.05.2023 13:05, Jan Beulich wrote: > > On 02.05.2023 12:51, Roger Pau Monné wrote: > >> On Tue, May 02, 2023 at 12:28:55PM +0200, Jan Beulich wrote: > >>> On 02.05.2023 11:54, Andrew Cooper wrote: > On 02/05/2023 10:22 am, Rog

Re: [PATCH] xen/sysctl: fix XEN_SYSCTL_getdomaininfolist handling with XSM

2023-05-02 Thread Roger Pau Monné
On Tue, May 02, 2023 at 09:03:00AM -0400, Daniel P. Smith wrote: > On 4/30/23 10:46, Juergen Gross wrote: > > In case XSM is active, the handling of XEN_SYSCTL_getdomaininfolist > > can fail if the last domain scanned isn't allowed to be accessed by > > the calling domain (i.e. xsm_getdomaininfo(XS

Re: [PATCH] xen/sysctl: fix XEN_SYSCTL_getdomaininfolist handling with XSM

2023-05-02 Thread Juergen Gross
On 02.05.23 15:03, Daniel P. Smith wrote: On 4/30/23 10:46, Juergen Gross wrote: In case XSM is active, the handling of XEN_SYSCTL_getdomaininfolist can fail if the last domain scanned isn't allowed to be accessed by the calling domain (i.e. xsm_getdomaininfo(XSM_HOOK, d) is failing). Fix that

Re: [PATCH] sysctl: XSM hook should not cause XEN_SYSCTL_getdomaininfolist to (appear to) fail

2023-05-02 Thread Daniel P. Smith
On 5/2/23 07:00, Roger Pau Monné wrote: On Tue, May 02, 2023 at 06:43:33AM -0400, Daniel P. Smith wrote: On 5/2/23 03:17, Jan Beulich wrote: Unlike for XEN_DOMCTL_getdomaininfo, where the XSM check is intended to cause the operation to fail, in the loop here it ought to merely determine wheth

Re: [PATCH] sysctl: XSM hook should not cause XEN_SYSCTL_getdomaininfolist to (appear to) fail

2023-05-02 Thread Jan Beulich
On 02.05.2023 14:54, Daniel P. Smith wrote: > On 5/2/23 06:59, Jan Beulich wrote: >> On 02.05.2023 12:43, Daniel P. Smith wrote: >>> On 5/2/23 03:17, Jan Beulich wrote: Unlike for XEN_DOMCTL_getdomaininfo, where the XSM check is intended to cause the operation to fail, in the loop here it

Re: [PATCH] xen/sysctl: fix XEN_SYSCTL_getdomaininfolist handling with XSM

2023-05-02 Thread Daniel P. Smith
On 5/2/23 09:10, Roger Pau Monné wrote: On Tue, May 02, 2023 at 09:03:00AM -0400, Daniel P. Smith wrote: On 4/30/23 10:46, Juergen Gross wrote: In case XSM is active, the handling of XEN_SYSCTL_getdomaininfolist can fail if the last domain scanned isn't allowed to be accessed by the calling dom

Re: [PATCH v4 04/20] virtio-scsi: stop using aio_disable_external() during unplug

2023-05-02 Thread Kevin Wolf
Am 01.05.2023 um 17:09 hat Stefan Hajnoczi geschrieben: > On Fri, Apr 28, 2023 at 04:22:55PM +0200, Kevin Wolf wrote: > > Am 25.04.2023 um 19:27 hat Stefan Hajnoczi geschrieben: > > > This patch is part of an effort to remove the aio_disable_external() > > > API because it does not fit in a multi-q

Re: [PATCH] sysctl: XSM hook should not cause XEN_SYSCTL_getdomaininfolist to (appear to) fail

2023-05-02 Thread Jan Beulich
On 02.05.2023 15:13, Daniel P. Smith wrote: > On 5/2/23 07:00, Roger Pau Monné wrote: >> On Tue, May 02, 2023 at 06:43:33AM -0400, Daniel P. Smith wrote: >>> On 5/2/23 03:17, Jan Beulich wrote: Unlike for XEN_DOMCTL_getdomaininfo, where the XSM check is intended to cause the operation to

Re: [PATCH] xen/sysctl: fix XEN_SYSCTL_getdomaininfolist handling with XSM

2023-05-02 Thread Daniel P. Smith
On 5/2/23 09:13, Juergen Gross wrote: On 02.05.23 15:03, Daniel P. Smith wrote: On 4/30/23 10:46, Juergen Gross wrote: In case XSM is active, the handling of XEN_SYSCTL_getdomaininfolist can fail if the last domain scanned isn't allowed to be accessed by the calling domain (i.e. xsm_getdomainin

Re: [PATCH 1/2] x86/head: check base address alignment

2023-05-02 Thread Jan Beulich
On 02.05.2023 15:02, Roger Pau Monné wrote: > On Tue, May 02, 2023 at 01:11:12PM +0200, Jan Beulich wrote: >> On 02.05.2023 13:05, Jan Beulich wrote: >>> On 02.05.2023 12:51, Roger Pau Monné wrote: On Tue, May 02, 2023 at 12:28:55PM +0200, Jan Beulich wrote: > On 02.05.2023 11:54, Andrew C

Re: [PATCH] xen/sysctl: fix XEN_SYSCTL_getdomaininfolist handling with XSM

2023-05-02 Thread Daniel P. Smith
On 5/2/23 09:23, Daniel P. Smith wrote: On 5/2/23 09:13, Juergen Gross wrote: On 02.05.23 15:03, Daniel P. Smith wrote: On 4/30/23 10:46, Juergen Gross wrote: In case XSM is active, the handling of XEN_SYSCTL_getdomaininfolist can fail if the last domain scanned isn't allowed to be accessed by

Re: HAS_CC_CET_IBT misdetected

2023-05-02 Thread Jan Beulich
On 02.05.2023 14:04, Olaf Hering wrote: > Tue, 2 May 2023 13:33:13 +0200 Olaf Hering : > >> I will investigate why it failed to build for me. > > This happens if one builds first with the Tumbleweed container, and later > with the Leap container, without a 'git clean -dffx' in between. > > Is t

Re: [PATCH] xen/sysctl: fix XEN_SYSCTL_getdomaininfolist handling with XSM

2023-05-02 Thread Juergen Gross
On 02.05.23 15:23, Daniel P. Smith wrote: On 5/2/23 09:13, Juergen Gross wrote: On 02.05.23 15:03, Daniel P. Smith wrote: On 4/30/23 10:46, Juergen Gross wrote: In case XSM is active, the handling of XEN_SYSCTL_getdomaininfolist can fail if the last domain scanned isn't allowed to be accessed

Re: HAS_CC_CET_IBT misdetected

2023-05-02 Thread Olaf Hering
Tue, 2 May 2023 15:29:19 +0200 Jan Beulich : > Getting this to work automatically is a continued subject of discussion. I think the only real solution is an out-of-tree build. Essentially every single component needs to detect a toolchain change. This is unrealistic. Olaf pgpjSDzLmeFs3.pgp D

Re: [PATCH v3 2/2] acpi: Add TPM2 interface definition.

2023-05-02 Thread Jan Beulich
On 25.04.2023 19:47, Jennifer Herbert wrote: > --- a/tools/libacpi/acpi2_0.h > +++ b/tools/libacpi/acpi2_0.h > @@ -121,6 +121,36 @@ struct acpi_20_tcpa { > }; > #define ACPI_2_0_TCPA_LAML_SIZE (64*1024) > > +/* > + * TPM2 > + */ Nit: While I'm willing to accept the comment style violation here

Re: HAS_CC_CET_IBT misdetected

2023-05-02 Thread Andrew Cooper
On 02/05/2023 1:04 pm, Olaf Hering wrote: > Tue, 2 May 2023 13:33:13 +0200 Olaf Hering : > >> I will investigate why it failed to build for me. > This happens if one builds first with the Tumbleweed container, and later > with the Leap container, without a 'git clean -dffx' in between. > > Is ther

Re: [PATCH] xen/sysctl: fix XEN_SYSCTL_getdomaininfolist handling with XSM

2023-05-02 Thread Daniel P. Smith
On 5/2/23 09:30, Juergen Gross wrote: On 02.05.23 15:23, Daniel P. Smith wrote: On 5/2/23 09:13, Juergen Gross wrote: On 02.05.23 15:03, Daniel P. Smith wrote: On 4/30/23 10:46, Juergen Gross wrote: In case XSM is active, the handling of XEN_SYSCTL_getdomaininfolist can fail if the last domai

Re: HAS_CC_CET_IBT misdetected

2023-05-02 Thread Jan Beulich
On 02.05.2023 15:36, Olaf Hering wrote: > Tue, 2 May 2023 15:29:19 +0200 Jan Beulich : > >> Getting this to work automatically is a continued subject of discussion. > > I think the only real solution is an out-of-tree build. Essentially every > single component needs to detect a toolchain change

[xen-unstable test] 180501: tolerable FAIL

2023-05-02 Thread osstest service owner
flight 180501 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/180501/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail in 180496 pass in 180501 test-amd64-am

Re: HAS_CC_CET_IBT misdetected

2023-05-02 Thread Olaf Hering
Tue, 2 May 2023 15:44:41 +0200 Jan Beulich : > How would an out-of-tree build help (which for the hypervisor we now > have support for)? An incremental build there will hit exactly the same > issue afaict. Each container target will use a separate output directory. The Leap container will only s

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

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

[PATCH] 9pfs/xen: Fix segfault on shutdown

2023-05-02 Thread Jason Andryuk
xen_9pfs_free can't use gnttabdev since it is already closed and NULL-ed out when free is called. Do the teardown in _disconnect(). This matches the setup done in _connect(). trace-events are also added for the XenDevOps functions. Signed-off-by: Jason Andryuk --- hw/9pfs/trace-events |

Re: [PATCH] libxl: arm: Allow grant mappings for backends running on Dom0

2023-05-02 Thread Anthony PERARD
On Thu, Mar 30, 2023 at 02:13:08PM +0530, Viresh Kumar wrote: > diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in > index 10f37990be57..4879f136aab8 100644 > --- a/docs/man/xl.cfg.5.pod.in > +++ b/docs/man/xl.cfg.5.pod.in > @@ -1616,6 +1616,10 @@ properties in the Device Tree, the ty

Re: [PATCH] xen/evtchn: Introduce new IOCTL to bind static evtchn

2023-05-02 Thread Rahul Singh
Hi Ayan, On 28 Apr 2023, at 2:30 pm, Ayan Kumar Halder wrote: Hi Rahul, On 28/04/2023 13:36, Rahul Singh wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. Xen 4.

[PATCH v2 1/2] x86/head: check base address alignment

2023-05-02 Thread Roger Pau Monne
Ensure that the base address is 2M aligned, or else the page table entries created would be corrupt as reserved bits on the PDE end up set. We have encountered a broken firmware where grub2 would end up loading Xen at a non 2M aligned region when using the multiboot2 protocol, and that caused a ve

[PATCH v2 2/2] x86/trampoline: load the GDT located in the trampoline page

2023-05-02 Thread Roger Pau Monne
When booting the BSP the portion of the code executed from the trampoline page will be using the GDT located in the hypervisor .text.head section rather than the GDT located in the relocated trampoline page. If skip_realmode is not set the GDT located in the trampoline page will be loaded after ha

[PATCH v2 0/2] x86: init improvements

2023-05-02 Thread Roger Pau Monne
Hello, The following series contain two minor improvements for early boot: the first one is an alignment check when building the initial page tables, the second is a consistency fix for the GDT used by the BSP for the trampoline code. Both are a result of some debugging work done on a system with

Re: [PATCH v3 2/4] tools/xendevicemodel: Introduce ..._get_ioreq_server_info_ext

2023-05-02 Thread Anthony PERARD
On Thu, Apr 06, 2023 at 08:05:04AM +0200, Juergen Gross wrote: > On 06.04.23 05:57, Marek Marczykowski-Górecki wrote: > > Add xendevicemodel_get_ioreq_server_info_ext() which additionally > > returns output flags that XEN_DMOP_get_ioreq_server_info can now return. > > Do not change signature of exi

Re: HAS_CC_CET_IBT misdetected

2023-05-02 Thread Olaf Hering
Tue, 2 May 2023 14:41:25 +0100 Andrew Cooper : > Does this improve things for you? ./checker: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by ./checker) make[2]: *** [Makefile:24: check-headers] Error 1 I think as soon as tools/ or stubdom/ is built, more issues like that will ap

Re: [PATCH v4 03/20] virtio-scsi: avoid race between unplug and transport event

2023-05-02 Thread Kevin Wolf
Am 25.04.2023 um 19:26 hat Stefan Hajnoczi geschrieben: > Only report a transport reset event to the guest after the SCSIDevice > has been unrealized by qdev_simple_device_unplug_cb(). > > qdev_simple_device_unplug_cb() sets the SCSIDevice's qdev.realized field > to false so that scsi_device_find/

Re: [PATCH v4 06/20] block/export: wait for vhost-user-blk requests when draining

2023-05-02 Thread Kevin Wolf
Am 25.04.2023 um 19:27 hat Stefan Hajnoczi geschrieben: > Each vhost-user-blk request runs in a coroutine. When the BlockBackend > enters a drained section we need to enter a quiescent state. Currently > any in-flight requests race with bdrv_drained_begin() because it is > unaware of vhost-user-blk

Re: [PATCH] xen/blkfront: Only check REQ_FUA for writes

2023-05-02 Thread Roger Pau Monné
On Wed, Apr 26, 2023 at 05:40:05PM +0100, Ross Lagerwall wrote: > The existing code silently converts read operations with the > REQ_FUA bit set into write-barrier operations. This results in data > loss as the backend scribbles zeroes over the data instead of returning > it. > > While the REQ_FUA

Re: [PATCH v4 07/20] block/export: stop using is_external in vhost-user-blk server

2023-05-02 Thread Kevin Wolf
Am 25.04.2023 um 19:27 hat Stefan Hajnoczi geschrieben: > vhost-user activity must be suspended during bdrv_drained_begin/end(). > This prevents new requests from interfering with whatever is happening > in the drained section. > > Previously this was done using aio_set_fd_handler()'s is_external

Re: [PATCH v6 09/12] tools: add physinfo arch_capabilities handling for Arm

2023-05-02 Thread Anthony PERARD
On Mon, Apr 24, 2023 at 07:02:45AM +0100, Luca Fancellu wrote: > diff --git a/tools/include/xen-tools/arm-arch-capabilities.h > b/tools/include/xen-tools/arm-arch-capabilities.h > new file mode 100644 > index ..ac44c8b14344 > --- /dev/null > +++ b/tools/include/xen-tools/arm-arch-capab

Re: [PATCH v4 10/20] block: drain from main loop thread in bdrv_co_yield_to_drain()

2023-05-02 Thread Kevin Wolf
Am 25.04.2023 um 19:27 hat Stefan Hajnoczi geschrieben: > For simplicity, always run BlockDevOps .drained_begin/end/poll() > callbacks in the main loop thread. This makes it easier to implement the > callbacks and avoids extra locks. > > Move the function pointer declarations from the I/O Code sec

Re: [PATCH] xen/blkfront: Only check REQ_FUA for writes

2023-05-02 Thread Ross Lagerwall
> From: Roger Pau Monne > Sent: Tuesday, May 2, 2023 4:57 PM > To: Ross Lagerwall > Cc: xen-devel@lists.xenproject.org ; > jgr...@suse.com ; sstabell...@kernel.org > ; oleksandr_tyshche...@epam.com > ; ax...@kernel.dk > Subject: Re: [PATCH] xen/blkfront: Only check REQ_FUA for writes >   > O

Re: [PATCH v6 10/12] xen/tools: add sve parameter in XL configuration

2023-05-02 Thread Anthony PERARD
On Mon, Apr 24, 2023 at 07:02:46AM +0100, Luca Fancellu wrote: > diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c > index ddc7b2a15975..1e69dac2c4fa 100644 > --- a/tools/libs/light/libxl_arm.c > +++ b/tools/libs/light/libxl_arm.c > @@ -211,6 +213,12 @@ int libxl__arch_domain

Re: [PULL 05/27] hw/xen: Watches on XenStore transactions

2023-05-02 Thread Peter Maydell
On Tue, 7 Mar 2023 at 18:27, David Woodhouse wrote: > > From: David Woodhouse > > Firing watches on the nodes that still exist is relatively easy; just > walk the tree and look at the nodes with refcount of one. > > Firing watches on *deleted* nodes is more fun. We add 'modified_in_tx' > and 'del

[linux-linus test] 180504: regressions - FAIL

2023-05-02 Thread osstest service owner
flight 180504 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/180504/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-xl-credit1 8 xen-boot fail REGR. vs. 180278 Tests which are fai

Re: [PATCH v4 05/13] tools/xenstore: use accounting buffering for node accounting

2023-05-02 Thread Julien Grall
Hi Juergen, On 05/04/2023 08:03, Juergen Gross wrote: Add the node accounting to the accounting information buffering in order to avoid having to undo it in case of failure. Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_core.c | 21 ++--- tools/xenstore/xenstor

Re: [PATCH v4 03/20] virtio-scsi: avoid race between unplug and transport event

2023-05-02 Thread Stefan Hajnoczi
On Tue, May 02, 2023 at 05:19:46PM +0200, Kevin Wolf wrote: > Am 25.04.2023 um 19:26 hat Stefan Hajnoczi geschrieben: > > Only report a transport reset event to the guest after the SCSIDevice > > has been unrealized by qdev_simple_device_unplug_cb(). > > > > qdev_simple_device_unplug_cb() sets the

Re: [PATCH v4 06/13] tools/xenstore: add current connection to domain_memory_add() parameters

2023-05-02 Thread Julien Grall
Hi Juergen, On 05/04/2023 08:03, Juergen Gross wrote: In order to enable switching memory accounting to the generic array based accounting, add the current connection to the parameters of domain_memory_add(). This requires to add the connection to some other functions, too. Signed-off-by: Juer

Re: [PATCH v4 07/13] tools/xenstore: use accounting data array for per-domain values

2023-05-02 Thread Julien Grall
Hi Juergen, On 05/04/2023 08:03, Juergen Gross wrote: diff --git a/tools/xenstore/xenstored_domain.h b/tools/xenstore/xenstored_domain.h index 5cfd730cf6..0d61bf4344 100644 --- a/tools/xenstore/xenstored_domain.h +++ b/tools/xenstore/xenstored_domain.h @@ -28,7 +28,10 @@ enum accitem {

Re: [PATCH v4 10/13] tools/xenstore: switch transaction accounting to generic accounting

2023-05-02 Thread Julien Grall
Hi, On 05/04/2023 08:03, Juergen Gross wrote: As transaction accounting is active for unprivileged domains only, it can easily be added to the generic per-domain accounting. Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_core.c| 3 +-- tools/xenstore/xenstored_core.h

Re: [PATCH v4 06/20] block/export: wait for vhost-user-blk requests when draining

2023-05-02 Thread Stefan Hajnoczi
On Tue, May 02, 2023 at 05:42:51PM +0200, Kevin Wolf wrote: > Am 25.04.2023 um 19:27 hat Stefan Hajnoczi geschrieben: > > Each vhost-user-blk request runs in a coroutine. When the BlockBackend > > enters a drained section we need to enter a quiescent state. Currently > > any in-flight requests race

  1   2   >