[libvirt test] 159437: regressions - FAIL

2021-02-17 Thread osstest service owner
flight 159437 libvirt real [real] http://logs.test-lab.xenproject.org/osstest/logs/159437/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf-libvirt 6 libvirt-buildfail REGR. vs. 151777 build-amd64-libvirt

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

2021-02-17 Thread osstest service owner
flight 159424 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/159424/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-xl-rtds 18 guest-start/debian.repeatfail like 159335

Re: [RFC PATCH 29/34] power/swap: use bio_new in hib_submit_io

2021-02-17 Thread Chaitanya Kulkarni
On 2/17/21 14:03, Pavel Machek wrote: > Hi! >> diff --git a/kernel/power/swap.c b/kernel/power/swap.c >> index c73f2e295167..e92e36c053a6 100644 >> --- a/kernel/power/swap.c >> +++ b/kernel/power/swap.c >> @@ -271,13 +271,12 @@ static int hib_submit_io(int op, int op_flags, pgoff_t >> page_off,

Re: [RFC] xen/arm: introduce XENFEAT_ARM_dom0_iommu

2021-02-17 Thread Stefano Stabellini
On Wed, 17 Feb 2021, Julien Grall wrote: > On 17/02/2021 02:00, Stefano Stabellini wrote: > > Hi all, > > > > Today Linux uses the swiotlb-xen driver (drivers/xen/swiotlb-xen.c) to > > translate addresses for DMA operations in Dom0. Specifically, > > swiotlb-xen is used to translate the address

Re: [PATCH] xen/arm : smmuv3: Fix to handle multiple StreamIds per device.

2021-02-17 Thread Stefano Stabellini
+IanJ On Wed, 17 Feb 2021, Bertrand Marquis wrote: > Hi Rahul, > > > > On 17 Feb 2021, at 10:05, Rahul Singh wrote: > > > > SMMUv3 driver does not handle multiple StreamId if the master device > > supports more than one StreamID. > > > > This bug was introduced when the driver was ported

Re: [RFC PATCH 29/34] power/swap: use bio_new in hib_submit_io

2021-02-17 Thread Pavel Machek
Hi! > > diff --git a/kernel/power/swap.c b/kernel/power/swap.c > index c73f2e295167..e92e36c053a6 100644 > --- a/kernel/power/swap.c > +++ b/kernel/power/swap.c > @@ -271,13 +271,12 @@ static int hib_submit_io(int op, int op_flags, pgoff_t > page_off, void *addr, > struct

[xen-4.14-testing test] 159420: tolerable FAIL - PUSHED

2021-02-17 Thread osstest service owner
flight 159420 xen-4.14-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/159420/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 16 saverestore-support-checkfail like 158558

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

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

Re: [BUG] Linux pvh vm not getting destroyed on shutdown

2021-02-17 Thread Maximilian Engelhardt
On Samstag, 13. Februar 2021 16:36:24 CET Maximilian Engelhardt wrote: > Here are some things I noticed while trying to debug this issue: > > * It happens on a Debian buster dom0 as well as on a bullseye dom0 > > * It seems to only affect pvh vms. > > * shutdown from the pvgrub menu ("c" ->

Re: [PATCH 3/3] tools/libxl: Rework invariants in libxl__domain_get_device_model_uid()

2021-02-17 Thread Andrew Cooper
On 17/02/2021 17:50, Ian Jackson wrote: > Andrew Cooper writes ("[PATCH 3/3] tools/libxl: Rework invariants in > libxl__domain_get_device_model_uid()"): >> Various version of gcc, when compiling with -Og, complain: >> >> libxl_dm.c: In function 'libxl__domain_get_device_model_uid': >>

[xen-4.13-testing test] 159419: tolerable FAIL - PUSHED

2021-02-17 Thread osstest service owner
flight 159419 xen-4.13-testing real [real] flight 159446 xen-4.13-testing real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/159419/ http://logs.test-lab.xenproject.org/osstest/logs/159446/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking):

Re: [PATCH 3/3] tools/libxl: Rework invariants in libxl__domain_get_device_model_uid()

2021-02-17 Thread Ian Jackson
Andrew Cooper writes ("[PATCH 3/3] tools/libxl: Rework invariants in libxl__domain_get_device_model_uid()"): > Various version of gcc, when compiling with -Og, complain: > > libxl_dm.c: In function 'libxl__domain_get_device_model_uid': > libxl_dm.c:256:12: error: 'kill_by_uid' may be used

Re: [RFC] xen/arm: introduce XENFEAT_ARM_dom0_iommu

2021-02-17 Thread Jan Beulich
On 17.02.2021 16:34, Bertrand Marquis wrote: >> On 17 Feb 2021, at 02:00, Stefano Stabellini wrote: >> Today Linux uses the swiotlb-xen driver (drivers/xen/swiotlb-xen.c) to >> translate addresses for DMA operations in Dom0. Specifically, >> swiotlb-xen is used to translate the address of a

Re: [RFC] xen/arm: introduce XENFEAT_ARM_dom0_iommu

2021-02-17 Thread Julien Grall
On 17/02/2021 16:47, Bertrand Marquis wrote: Hi Julien, On 17 Feb 2021, at 16:41, Julien Grall wrote: On 17/02/2021 15:37, Bertrand Marquis wrote: Hi Julien, Hi Bertrand, On 17 Feb 2021, at 08:50, Julien Grall wrote: On 17/02/2021 02:00, Stefano Stabellini wrote: Hi all, Today

Re: [for-4.15][PATCH v3 1/3] xen/iommu: x86: Clear the root page-table before freeing the page-tables

2021-02-17 Thread Julien Grall
On 17/02/2021 15:17, Jan Beulich wrote: On 17.02.2021 16:00, Julien Grall wrote: Hi Jan, On 17/02/2021 14:54, Jan Beulich wrote: On 17.02.2021 15:24, Julien Grall wrote: --- a/xen/drivers/passthrough/x86/iommu.c +++ b/xen/drivers/passthrough/x86/iommu.c @@ -267,6 +267,15 @@ int

Re: [RFC] xen/arm: introduce XENFEAT_ARM_dom0_iommu

2021-02-17 Thread Bertrand Marquis
Hi Julien, > On 17 Feb 2021, at 16:41, Julien Grall wrote: > > > > On 17/02/2021 15:37, Bertrand Marquis wrote: >> Hi Julien, > > Hi Bertrand, > >>> On 17 Feb 2021, at 08:50, Julien Grall wrote: >>> >>> >>> >>> On 17/02/2021 02:00, Stefano Stabellini wrote: Hi all, Today Linux

[PATCH 2/3] tools/libxl: Simplfy the out path in libxl__domain_get_device_model_uid()

2021-02-17 Thread Andrew Cooper
All paths heading towards `out` have rc = 0. Assert this property. The intended_uid check is an error path. Use the err label rather than falling into subsequent success logic. With the above two changes, the two `if (!rc)` checks can be dropped. Now, both remaining tests start with `if (user

[PATCH for-4.15 0/3] tools/libxl: -Og fixes for libxl__domain_get_device_model_uid()

2021-02-17 Thread Andrew Cooper
Split out of previous series, and split up for clarity. Andrew Cooper (3): tools/libxl: Split out and err paths in libxl__domain_get_device_model_uid() tools/libxl: Simplfy the out path in libxl__domain_get_device_model_uid() tools/libxl: Rework invariants in

[PATCH 1/3] tools/libxl: Split out and err paths in libxl__domain_get_device_model_uid()

2021-02-17 Thread Andrew Cooper
All paths with nonzero rc head to err. All paths with a zero rc stay heading towards out. The comment discussing invariants is now arguably stale - it will be fixed in one coherent manner when further fixes are in place. No functional change. Signed-off-by: Andrew Cooper --- CC: Ian Jackson

[PATCH 3/3] tools/libxl: Rework invariants in libxl__domain_get_device_model_uid()

2021-02-17 Thread Andrew Cooper
Various version of gcc, when compiling with -Og, complain: libxl_dm.c: In function 'libxl__domain_get_device_model_uid': libxl_dm.c:256:12: error: 'kill_by_uid' may be used uninitialized in this function [-Werror=maybe-uninitialized] 256 | if (kill_by_uid) |^

Re: [RFC] xen/arm: introduce XENFEAT_ARM_dom0_iommu

2021-02-17 Thread Julien Grall
On 17/02/2021 15:37, Bertrand Marquis wrote: Hi Julien, Hi Bertrand, On 17 Feb 2021, at 08:50, Julien Grall wrote: On 17/02/2021 02:00, Stefano Stabellini wrote: Hi all, Today Linux uses the swiotlb-xen driver (drivers/xen/swiotlb-xen.c) to translate addresses for DMA operations in

Re: [for-4.15][PATCH v3 3/3] xen/iommu: x86: Harden the IOMMU page-table allocator

2021-02-17 Thread Julien Grall
Hi Jan, On 17/02/2021 15:13, Jan Beulich wrote: On 17.02.2021 15:24, Julien Grall wrote:> --- a/xen/drivers/passthrough/x86/iommu.c> +++ b/xen/drivers/passthrough/x86/iommu.c> @@ -149,6 +149,13 @@ int arch_iommu_domain_init(struct domain *d)> > void arch_iommu_domain_destroy(struct domain

Re: [for-4.15][PATCH v3 2/3] xen/x86: iommu: Ignore IOMMU mapping requests when a domain is dying

2021-02-17 Thread Julien Grall
Hi Jan, On 17/02/2021 15:01, Jan Beulich wrote: On 17.02.2021 15:24, Julien Grall wrote: From: Julien Grall The new x86 IOMMU page-tables allocator will release the pages when relinquishing the domain resources. However, this is not sufficient when the domain is dying because nothing

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

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

Re: [RFC] xen/arm: introduce XENFEAT_ARM_dom0_iommu

2021-02-17 Thread Bertrand Marquis
Hi Julien, > On 17 Feb 2021, at 08:50, Julien Grall wrote: > > > > On 17/02/2021 02:00, Stefano Stabellini wrote: >> Hi all, >> Today Linux uses the swiotlb-xen driver (drivers/xen/swiotlb-xen.c) to >> translate addresses for DMA operations in Dom0. Specifically, >> swiotlb-xen is used to

Re: Linux PV/PVH domU crash on (guest) resume from suspend

2021-02-17 Thread Jürgen Groß
On 17.02.21 14:48, Marek Marczykowski-Górecki wrote: On Wed, Feb 17, 2021 at 07:51:42AM +0100, Jürgen Groß wrote: On 17.02.21 06:12, Marek Marczykowski-Górecki wrote: Hi, I'm observing Linux PV/PVH guest crash when I resume it from sleep. I do this with: virsh -c xen dompmsuspend mem

Re: [RFC] xen/arm: introduce XENFEAT_ARM_dom0_iommu

2021-02-17 Thread Bertrand Marquis
Hi Stefano, > On 17 Feb 2021, at 02:00, Stefano Stabellini wrote: > > Hi all, > > Today Linux uses the swiotlb-xen driver (drivers/xen/swiotlb-xen.c) to > translate addresses for DMA operations in Dom0. Specifically, > swiotlb-xen is used to translate the address of a foreign page (a page >

Re: [for-4.15][PATCH v3 1/3] xen/iommu: x86: Clear the root page-table before freeing the page-tables

2021-02-17 Thread Jan Beulich
On 17.02.2021 16:00, Julien Grall wrote: > Hi Jan, > > On 17/02/2021 14:54, Jan Beulich wrote: >> On 17.02.2021 15:24, Julien Grall wrote: >>> --- a/xen/drivers/passthrough/x86/iommu.c >>> +++ b/xen/drivers/passthrough/x86/iommu.c >>> @@ -267,6 +267,15 @@ int iommu_free_pgtables(struct domain *d)

Re: [for-4.15][PATCH v3 3/3] xen/iommu: x86: Harden the IOMMU page-table allocator

2021-02-17 Thread Jan Beulich
On 17.02.2021 15:24, Julien Grall wrote:> --- a/xen/drivers/passthrough/x86/iommu.c> +++ b/xen/drivers/passthrough/x86/iommu.c> @@ -149,6 +149,13 @@ int arch_iommu_domain_init(struct domain *d)> > void arch_iommu_domain_destroy(struct domain *d)> {> +/*> + * There should be not

Re: [for-4.15][PATCH v3 2/3] xen/x86: iommu: Ignore IOMMU mapping requests when a domain is dying

2021-02-17 Thread Jan Beulich
On 17.02.2021 15:24, Julien Grall wrote: > From: Julien Grall > > The new x86 IOMMU page-tables allocator will release the pages when > relinquishing the domain resources. However, this is not sufficient > when the domain is dying because nothing prevents page-table to be > allocated. > >

Re: [for-4.15][PATCH v3 1/3] xen/iommu: x86: Clear the root page-table before freeing the page-tables

2021-02-17 Thread Julien Grall
Hi Jan, On 17/02/2021 14:54, Jan Beulich wrote: On 17.02.2021 15:24, Julien Grall wrote: --- a/xen/drivers/passthrough/x86/iommu.c +++ b/xen/drivers/passthrough/x86/iommu.c @@ -267,6 +267,15 @@ int iommu_free_pgtables(struct domain *d) struct page_info *pg; unsigned int done = 0;

Re: [for-4.15][PATCH v3 1/3] xen/iommu: x86: Clear the root page-table before freeing the page-tables

2021-02-17 Thread Jan Beulich
On 17.02.2021 15:24, Julien Grall wrote: > --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c > +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c > @@ -381,9 +381,18 @@ static int amd_iommu_assign_device(struct domain *d, u8 > devfn, > return reassign_device(pdev->domain, d, devfn, pdev); >

Re: [PATCH v2 7/7] tests/avocado: add boot_xen tests

2021-02-17 Thread Philippe Mathieu-Daudé
On 2/11/21 6:19 PM, Alex Bennée wrote: > These tests make sure we can boot the Xen hypervisor with a Dom0 > kernel using the guest-loader. We currently have to use a kernel I > built myself because there are issues using the Debian kernel images. > > Signed-off-by: Alex Bennée > --- >

Re: [PATCH 2/3] gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant

2021-02-17 Thread Julien Grall
Hi Jan, On 17/02/2021 13:16, Jan Beulich wrote: On 17.02.2021 12:41, Julien Grall wrote: Hi Jan, On 17/02/2021 11:38, Jan Beulich wrote: On 17.02.2021 12:03, Julien Grall wrote: On 17/02/2021 10:46, Jan Beulich wrote: Mappings for a domain's own pages should already be present in the

[for-4.15][PATCH v3 1/3] xen/iommu: x86: Clear the root page-table before freeing the page-tables

2021-02-17 Thread Julien Grall
From: Julien Grall The new per-domain IOMMU page-table allocator will now free the page-tables when domain's resources are relinquished. However, the per-domain IOMMU structure will still contain a dangling pointer to the root page-table. Xen may access the IOMMU page-tables afterwards at least

[for-4.15][PATCH v3 3/3] xen/iommu: x86: Harden the IOMMU page-table allocator

2021-02-17 Thread Julien Grall
From: Julien Grall At the moment, we are assuming that only iommu_map() can allocate IOMMU page-table. Given the complexity of the IOMMU framework, it would be sensible to have a check closer to the IOMMU allocator. This would avoid to leak IOMMU page-tables again in the future.

[for-4.15][PATCH v3 0/3] xen/iommu: Collection of bug fixes for IOMMU teadorwn

2021-02-17 Thread Julien Grall
From: Julien Grall Hi all, This series is a collection of bug fixes for the IOMMU teardown code. All of them are candidate for 4.15 as they can either leak memory or lead to host crash/host corruption. This is sent directly on xen-devel because all the issues were either introduced in 4.15 or

[for-4.15][PATCH v3 2/3] xen/x86: iommu: Ignore IOMMU mapping requests when a domain is dying

2021-02-17 Thread Julien Grall
From: Julien Grall The new x86 IOMMU page-tables allocator will release the pages when relinquishing the domain resources. However, this is not sufficient when the domain is dying because nothing prevents page-table to be allocated. Currently page-table allocations can only happen from

Re: [for-4.15][PATCH v2 5/5] xen/iommu: x86: Clear the root page-table before freeing the page-tables

2021-02-17 Thread Julien Grall
Hi Kevin, On 10/02/2021 02:21, Tian, Kevin wrote: From: Julien Grall Sent: Tuesday, February 9, 2021 11:28 PM From: Julien Grall The new per-domain IOMMU page-table allocator will now free the page-tables when domain's resources are relinquished. However, the root page-table (i.e.

Re: Linux PV/PVH domU crash on (guest) resume from suspend

2021-02-17 Thread Marek Marczykowski-Górecki
On Wed, Feb 17, 2021 at 07:51:42AM +0100, Jürgen Groß wrote: > On 17.02.21 06:12, Marek Marczykowski-Górecki wrote: > > Hi, > > > > I'm observing Linux PV/PVH guest crash when I resume it from sleep. I do > > this with: > > > > virsh -c xen dompmsuspend mem > > virsh -c xen

Re: [PATCH v2 8/8] xen/evtchn: use READ/WRITE_ONCE() for accessing ring indices

2021-02-17 Thread Ross Lagerwall
On 2021-02-11 10:16, Juergen Gross wrote: > For avoiding read- and write-tearing by the compiler use READ_ONCE() > and WRITE_ONCE() for accessing the ring indices in evtchn.c. > > Signed-off-by: Juergen Gross > --- > V2: > - modify all accesses (Julien Grall) > --- > drivers/xen/evtchn.c | 25

Re: [PATCH 2/3] gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant

2021-02-17 Thread Jan Beulich
On 17.02.2021 12:41, Julien Grall wrote: > Hi Jan, > > On 17/02/2021 11:38, Jan Beulich wrote: >> On 17.02.2021 12:03, Julien Grall wrote: >>> On 17/02/2021 10:46, Jan Beulich wrote: Mappings for a domain's own pages should already be present in the IOMMU. While installing the same

Re: [for-4.15][PATCH v2 4/5] xen/iommu: x86: Don't leak the IOMMU page-tables

2021-02-17 Thread Jan Beulich
On 17.02.2021 12:49, Julien Grall wrote: > On 10/02/2021 16:12, Jan Beulich wrote: >> On 10.02.2021 16:04, Julien Grall wrote: >>> Are you know saying that the following snipped would be fine: >>> >>> if ( d->is_dying ) >>> return 0; >> >> In {amd,intel}_iommu_map_page(), after the lock was

[xen-4.12-testing test] 159418: tolerable FAIL - PUSHED

2021-02-17 Thread osstest service owner
flight 159418 xen-4.12-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/159418/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-i386-xl-qemuu-win7-amd64 19 guest-stop fail like 159241 test-armhf-armhf-libvirt-raw 15

Re: [for-4.15][PATCH v2 4/5] xen/iommu: x86: Don't leak the IOMMU page-tables

2021-02-17 Thread Julien Grall
Hi Jan, On 10/02/2021 16:12, Jan Beulich wrote: On 10.02.2021 16:04, Julien Grall wrote: On 10/02/2021 14:32, Jan Beulich wrote: On 09.02.2021 16:28, Julien Grall wrote: From: Julien Grall The new IOMMU page-tables allocator will release the pages when relinquish the domain resources.

Re: [PATCH 2/3] gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant

2021-02-17 Thread Julien Grall
Hi Jan, On 17/02/2021 11:38, Jan Beulich wrote: On 17.02.2021 12:03, Julien Grall wrote: On 17/02/2021 10:46, Jan Beulich wrote: Mappings for a domain's own pages should already be present in the IOMMU. While installing the same mapping again is merely redundant (and inefficient), removing

Re: [PATCH 2/3] gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant

2021-02-17 Thread Jan Beulich
On 17.02.2021 12:03, Julien Grall wrote: > On 17/02/2021 10:46, Jan Beulich wrote: >> Mappings for a domain's own pages should already be present in the >> IOMMU. While installing the same mapping again is merely redundant (and >> inefficient), removing the mapping when the grant mapping gets

Re: [PATCH] xen/arm : smmuv3: Fix to handle multiple StreamIds per device.

2021-02-17 Thread Bertrand Marquis
Hi Rahul, > On 17 Feb 2021, at 10:05, Rahul Singh wrote: > > SMMUv3 driver does not handle multiple StreamId if the master device > supports more than one StreamID. > > This bug was introduced when the driver was ported from Linux to XEN. > dt_device_set_protected(..) should be called from

Re: [for-4.15][PATCH v2 0/5] xen/iommu: Collection of bug fixes for IOMMU teadorwn

2021-02-17 Thread Julien Grall
Hi Ian, On 09/02/2021 16:47, Ian Jackson wrote: Julien Grall writes ("[for-4.15][PATCH v2 0/5] xen/iommu: Collection of bug fixes for IOMMU teadorwn"): From: Julien Grall ... This series is a collection of bug fixes for the IOMMU teardown code. All of them are candidate for 4.15 as they

Re: [for-4.15][PATCH v2 2/5] xen/iommu: Check if the IOMMU was initialized before tearing down

2021-02-17 Thread Julien Grall
Hi Paul, On 09/02/2021 20:22, Paul Durrant wrote: -Original Message- From: Julien Grall Sent: 09 February 2021 15:28 To: xen-devel@lists.xenproject.org Cc: hongy...@amazon.co.uk; i...@xenproject.org; Julien Grall ; Jan Beulich ; Paul Durrant Subject: [for-4.15][PATCH v2 2/5]

Re: [for-4.15][PATCH v2 1/5] xen/x86: p2m: Don't map the special pages in the IOMMU page-tables

2021-02-17 Thread Julien Grall
On 15/02/2021 13:14, Jan Beulich wrote: On 15.02.2021 13:54, Julien Grall wrote: On 15/02/2021 12:36, Jan Beulich wrote: On 15.02.2021 12:38, Julien Grall wrote: Given this series needs to go in 4.15 (we would introduce a 0-day otherwise), could you clarify whether your patch [1] is

Re: [PATCH 2/3] gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant

2021-02-17 Thread Julien Grall
Hi Jan, On 17/02/2021 10:46, Jan Beulich wrote: Mappings for a domain's own pages should already be present in the IOMMU. While installing the same mapping again is merely redundant (and inefficient), removing the mapping when the grant mapping gets removed is outright wrong in this case: The

Re: [PATCH v2 2/2] IOREQ: refine when to send mapcache invalidation request

2021-02-17 Thread Julien Grall
On 17/02/2021 10:02, Jan Beulich wrote: On 02.02.2021 16:14, Jan Beulich wrote: XENMEM_decrease_reservation isn't the only means by which pages can get removed from a guest, yet all removals ought to be signaled to qemu. Put setting of the flag into the central p2m_remove_page() underlying

[PATCH 3/3] gnttab: GTF_sub_page is a v2-only flag

2021-02-17 Thread Jan Beulich
Prior to its introduction, v1 entries weren't checked for this flag, and the flag also has been meaningless for v1 entries. Therefore it also shouldn't be checked. (The only consistent alternative would be to also check for all currently undefined flags to be clear.) Fixes: b545941b6638

[PATCH 2/3] gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant

2021-02-17 Thread Jan Beulich
Mappings for a domain's own pages should already be present in the IOMMU. While installing the same mapping again is merely redundant (and inefficient), removing the mapping when the grant mapping gets removed is outright wrong in this case: The mapping was there before the map, so should remain

[PATCH 1/3] gnttab: never permit mapping transitive grants

2021-02-17 Thread Jan Beulich
Transitive grants allow an intermediate domain I to grant a target domain T access to a page which origin domain O did grant I access to. As an implementation restriction, T is not allowed to map such a grant. This restriction is currently tried to be enforced by marking active entries resulting

[PATCH 0/3] gnttab: misc fixes

2021-02-17 Thread Jan Beulich
Patches 1 and 2 clearly are intended for 4.15; patch 3 is possibly controversial (along the lines of similar relaxation proposed for other (sub-)hypercalls), and hence unlikely to be a candidate as well. 1: never permit mapping transitive grants 2: bypass IOMMU (un)mapping when a domain is

[PATCH] xen/arm : smmuv3: Fix to handle multiple StreamIds per device.

2021-02-17 Thread Rahul Singh
SMMUv3 driver does not handle multiple StreamId if the master device supports more than one StreamID. This bug was introduced when the driver was ported from Linux to XEN. dt_device_set_protected(..) should be called from add_device(..) not from the dt_xlate(..). Move dt_device_set_protected(..)

Re: [PATCH v2 2/2] IOREQ: refine when to send mapcache invalidation request

2021-02-17 Thread Jan Beulich
On 02.02.2021 16:14, Jan Beulich wrote: > XENMEM_decrease_reservation isn't the only means by which pages can get > removed from a guest, yet all removals ought to be signaled to qemu. Put > setting of the flag into the central p2m_remove_page() underlying all > respective hypercalls as well as a

[xen-unstable-coverity test] 159441: all pass - PUSHED

2021-02-17 Thread osstest service owner
flight 159441 xen-unstable-coverity real [real] http://logs.test-lab.xenproject.org/osstest/logs/159441/ Perfect :-) All tests in this flight passed as required version targeted for testing: xen 3b1cc15f1931ba56d0ee256fe9bfe65509733b27 baseline version: xen

Re: [PATCH] firmware: don't build hvmloader if it is not needed

2021-02-17 Thread Jan Beulich
On 16.02.2021 19:31, Stefano Stabellini wrote: > On Mon, 15 Feb 2021, Jan Beulich wrote: >> On 13.02.2021 14:50, Marek Marczykowski-Górecki wrote: >>> On Fri, Feb 12, 2021 at 06:05:40PM -0800, Stefano Stabellini wrote: If rombios, seabios and ovmf are all disabled, don't attempt to build

Re: Ping: [PATCH v2 2/2] IOREQ: refine when to send mapcache invalidation request

2021-02-17 Thread Paul Durrant
On 17/02/2021 08:30, Jan Beulich wrote: Paul (or others), thoughts? On 04.02.2021 12:24, Jan Beulich wrote: On 04.02.2021 10:26, Paul Durrant wrote: From: Jan Beulich Sent: 02 February 2021 15:15 XENMEM_decrease_reservation isn't the only means by which pages can get removed from a guest,

Re: [RFC] xen/arm: introduce XENFEAT_ARM_dom0_iommu

2021-02-17 Thread Julien Grall
On 17/02/2021 02:00, Stefano Stabellini wrote: Hi all, Today Linux uses the swiotlb-xen driver (drivers/xen/swiotlb-xen.c) to translate addresses for DMA operations in Dom0. Specifically, swiotlb-xen is used to translate the address of a foreign page (a page belonging to a domU) mapped into

Ping: [PATCH] x86emul: de-duplicate scatters to the same linear address

2021-02-17 Thread Jan Beulich
On 05.02.2021 12:28, Jan Beulich wrote: > On 05.02.2021 11:41, Andrew Cooper wrote: >> On 10/11/2020 13:26, Jan Beulich wrote: >>> The SDM specifically allows for earlier writes to fully overlapping >>> ranges to be dropped. If a guest did so, hvmemul_phys_mmio_access() >>> would crash it if

Ping: [PATCH v2 2/2] IOREQ: refine when to send mapcache invalidation request

2021-02-17 Thread Jan Beulich
Paul (or others), thoughts? On 04.02.2021 12:24, Jan Beulich wrote: > On 04.02.2021 10:26, Paul Durrant wrote: >>> From: Jan Beulich >>> Sent: 02 February 2021 15:15 >>> >>> XENMEM_decrease_reservation isn't the only means by which pages can get >>> removed from a guest, yet all removals ought

Re: Linux DomU freezes and dies under heavy memory shuffling

2021-02-17 Thread Jürgen Groß
On 17.02.21 09:12, Roman Shaposhnik wrote: Hi Jürgen, thanks for taking a look at this. A few comments below: On Tue, Feb 16, 2021 at 10:47 PM Jürgen Groß wrote: On 16.02.21 21:34, Stefano Stabellini wrote: + x86 maintainers It looks like the tlbflush is getting stuck? I have seen this

Ping: [PATCH v3 0/4] x86/time: calibration rendezvous adjustments

2021-02-17 Thread Jan Beulich
Ian? On 09.02.2021 14:02, Jan Beulich wrote: > On 09.02.2021 13:53, Jan Beulich wrote: >> The middle two patches are meant to address a regression reported on >> the list under "Problems with APIC on versions 4.9 and later (4.8 >> works)". In the course of analyzing output from a debugging patch

[PATCH v2 8/8] x86/PV: use get_unsafe() instead of copy_from_unsafe()

2021-02-17 Thread Jan Beulich
The former expands to a single (memory accessing) insn, which the latter does not guarantee. Yet we'd prefer to read consistent PTEs rather than risking a split read racing with an update done elsewhere. Signed-off-by: Jan Beulich --- a/xen/arch/x86/pv/mm.c +++ b/xen/arch/x86/pv/mm.c @@ -41,9

[PATCH v2 7/8] x86: move stac()/clac() from {get,put}_unsafe_asm() ...

2021-02-17 Thread Jan Beulich
... to {get,put}_unsafe_size(). There's no need to have the macros expanded once per case label in the latter. This also makes the former well-formed single statements again. No change in generated code. Signed-off-by: Jan Beulich --- a/xen/include/asm-x86/uaccess.h +++

[PATCH v2 6/8] x86: rename copy_{from,to}_user() to copy_{from,to}_guest_pv()

2021-02-17 Thread Jan Beulich
Bring them (back) in line with __copy_{from,to}_guest_pv(). Since it falls in the same group, also convert clear_user(). Instead of adjusting __raw_clear_guest(), drop it - it's unused and would require a non- checking __clear_guest_pv() which we don't have. Add previously missing __user at some

[PATCH v2 5/8] x86/gdbsx: convert "user" to "guest" accesses

2021-02-17 Thread Jan Beulich
Using copy_{from,to}_user(), this code was assuming to be called only by PV guests. Use copy_{from,to}_guest() instead, transforming the incoming structure field into a guest handle (the field should really have been one in the first place). Also do not transform the debuggee address into a

[PATCH v2 4/8] x86: rename {get,put}_user() to {get,put}_guest()

2021-02-17 Thread Jan Beulich
Bring them (back) in line with __{get,put}_guest(). Signed-off-by: Jan Beulich --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1649,19 +1649,19 @@ static void load_segments(struct vcpu *n if ( !ring_1(regs) ) { -ret = put_user(regs->ss,

[PATCH v2 3/8] x86/PV: harden guest memory accesses against speculative abuse

2021-02-17 Thread Jan Beulich
Inspired by https://lore.kernel.org/lkml/f12e7d3cecf41b2c29734ea45a393be21d4a8058.1597848273.git.jpoim...@redhat.com/ and prior work in that area of x86 Linux, suppress speculation with guest specified pointer values by suitably masking the addresses to non-canonical space in case they fall into

[PATCH v2 2/8] x86: split __copy_{from,to}_user() into "guest" and "unsafe" variants

2021-02-17 Thread Jan Beulich
The "guest" variants are intended to work with (potentially) fully guest controlled addresses, while the "unsafe" variants are intended to be used in order to access addresses not (directly) under guest control, within Xen's part of virtual address space. Subsequently we will want them to have

[PATCH v2 1/8] x86: split __{get,put}_user() into "guest" and "unsafe" variants

2021-02-17 Thread Jan Beulich
The "guest" variants are intended to work with (potentially) fully guest controlled addresses, while the "unsafe" variants are intended to be used in order to access addresses not (directly) under guest control, within Xen's part of virtual address space. (For linear page table and descriptor

[PATCH v2 0/8] x86/PV: avoid speculation abuse through guest accessors

2021-02-17 Thread Jan Beulich
Re-sending primarily for the purpose of getting a release ack, an explicit release nak, or an indication of there not being a need, all for at least the first three patches here (which are otherwise ready to go in). I've dropped the shadow part of the series from this re-submission, because it has

Re: Linux DomU freezes and dies under heavy memory shuffling

2021-02-17 Thread Roman Shaposhnik
Hi Jürgen, thanks for taking a look at this. A few comments below: On Tue, Feb 16, 2021 at 10:47 PM Jürgen Groß wrote: > > On 16.02.21 21:34, Stefano Stabellini wrote: > > + x86 maintainers > > > > It looks like the tlbflush is getting stuck? > > I have seen this case multiple times on customer