Re: [Xen-devel] [PATCH v8 08/11] arm: add ALL_PLAT, QEMU, Rcar3 and MPSoC configs

2018-08-01 Thread Andrii Anisov
Hello Stefano, On 30.07.18 20:48, Stefano Stabellini wrote: Add a "Platform Support" choice with four kconfig options: QEMU, RCAR3, MPSOC and ALL_PLAT. They enable the required options for their hardware platform. ALL_PLAT enables all available platforms and it's the default. It doesn't automat

Re: [Xen-devel] [PATCH 2/4] iommu: generalize iommu_inclusive_mapping

2018-08-01 Thread Jan Beulich
>>> On 31.07.18 at 17:33, wrote: > On Tue, Jul 31, 2018 at 08:39:22AM -0600, Jan Beulich wrote: >> >>> On 27.07.18 at 17:31, wrote: >> > Introduce a new iommu=inclusive generic option that supersedes >> > iommu_inclusive_mapping. This should be a non-functional change on >> > Intel hardware, whil

Re: [Xen-devel] [PATCH] x86/altp2m: Allow setting the #VE info page for an arbitrary VCPU

2018-08-01 Thread Jan Beulich
>>> On 31.07.18 at 19:19, wrote: > On Tue, Jul 31, 2018 at 5:53 AM Jan Beulich wrote: >> >>> On 25.07.18 at 13:49, wrote: >> > -vcpu_altp2m(curr).veinfo_gfn = _gfn(a.u.enable_notify.gfn); >> > -altp2m_vcpu_update_vmfunc_ve(curr); >> > +vcpu_altp2m(v).veinfo_gfn = _gfn(a.u

Re: [Xen-devel] [PATCH] x86/altp2m: Allow setting the #VE info page for an arbitrary VCPU

2018-08-01 Thread Razvan Cojocaru
On 08/01/2018 11:23 AM, Jan Beulich wrote: On 31.07.18 at 19:19, wrote: >> On Tue, Jul 31, 2018 at 5:53 AM Jan Beulich wrote: >> On 25.07.18 at 13:49, wrote: -vcpu_altp2m(curr).veinfo_gfn = _gfn(a.u.enable_notify.gfn); -altp2m_vcpu_update_vmfunc_ve(curr);

Re: [Xen-devel] [PATCH 2/4] iommu: generalize iommu_inclusive_mapping

2018-08-01 Thread Andrew Cooper
On 01/08/2018 09:20, Jan Beulich wrote: On 31.07.18 at 17:33, wrote: >> On Tue, Jul 31, 2018 at 08:39:22AM -0600, Jan Beulich wrote: >> On 27.07.18 at 17:31, wrote: Introduce a new iommu=inclusive generic option that supersedes iommu_inclusive_mapping. This should be a non-func

Re: [Xen-devel] [PATCH 2/4] iommu: generalize iommu_inclusive_mapping

2018-08-01 Thread Paul Durrant
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xenproject.org] On Behalf > Of Jan Beulich > Sent: 01 August 2018 09:21 > To: Roger Pau Monne > Cc: Kevin Tian ; Stefano Stabellini > ; Wei Liu ; George Dunlap > ; Andrew Cooper > ; Ian Jackson ; Tim > (Xen.org) ; Julie

Re: [Xen-devel] [PATCH] x86/altp2m: Allow setting the #VE info page for an arbitrary VCPU

2018-08-01 Thread Andrew Cooper
On 01/08/2018 09:23, Jan Beulich wrote: On 31.07.18 at 19:19, wrote: >> On Tue, Jul 31, 2018 at 5:53 AM Jan Beulich wrote: >> On 25.07.18 at 13:49, wrote: -vcpu_altp2m(curr).veinfo_gfn = _gfn(a.u.enable_notify.gfn); -altp2m_vcpu_update_vmfunc_ve(curr); +

Re: [Xen-devel] [PATCH v6 1/7] xen: xsm: flask: introduce XENMAPSPACE_gmfn_share for memory sharing

2018-08-01 Thread Jan Beulich
First of all I think your Cc list is too short here - all of REST should be included imo. >>> On 31.07.18 at 20:23, wrote: > --- a/xen/include/xsm/dummy.h > +++ b/xen/include/xsm/dummy.h > @@ -535,6 +535,21 @@ static XSM_INLINE int > xsm_map_gmfn_foreign(XSM_DEFAULT_ARG struct domain *d, str >

Re: [Xen-devel] [PATCH 2/4] iommu: generalize iommu_inclusive_mapping

2018-08-01 Thread Roger Pau Monné
On Wed, Aug 01, 2018 at 02:20:36AM -0600, Jan Beulich wrote: > >>> On 31.07.18 at 17:33, wrote: > > On Tue, Jul 31, 2018 at 08:39:22AM -0600, Jan Beulich wrote: > >> >>> On 27.07.18 at 17:31, wrote: > >> > Introduce a new iommu=inclusive generic option that supersedes > >> > iommu_inclusive_mappi

Re: [Xen-devel] [PATCH v3 13/25] xen/arm: introduce create_domUs

2018-08-01 Thread Jan Beulich
>>> On 01.08.18 at 01:27, wrote: > --- > xen/arch/arm/domain_build.c | 42 +++--- > xen/arch/arm/setup.c| 7 ++- > xen/include/asm-arm/setup.h | 3 +++ > xen/include/asm-x86/setup.h | 2 ++ The (trivial) x86 addition Acked-by: Jan Beulich albeit

Re: [Xen-devel] [PATCH V5] x86/altp2m: Fix crash with INVALID_ALTP2M EPTP index

2018-08-01 Thread Razvan Cojocaru
On 07/23/2018 01:29 PM, George Dunlap wrote: > On 07/20/2018 07:02 PM, Razvan Cojocaru wrote: >> On 07/20/2018 08:18 PM, George Dunlap wrote: >>> Furthermore, imagine the following scenario: >>> >>> * dom0 enables altp2m on domain A >>> * dom0 switches altp2m to view 1 on domain A >>> * dom0 enable

[Xen-devel] [PATCH] xen: clean up altp2m op comment

2018-08-01 Thread Wei Liu
Delete trailing spaces and refer to XSM instead of an internal function in the public header. Signed-off-by: Wei Liu --- xen/arch/x86/hvm/hvm.c | 8 xen/include/public/hvm/params.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/x

Re: [Xen-devel] [PATCH v3 23/25] xen: support console_switching between Dom0 and DomUs on ARM

2018-08-01 Thread Jan Beulich
>>> On 01.08.18 at 01:28, wrote: > Today Ctrl-AAA is used to switch between Xen and Dom0. Extend the > mechanism to allow for switching between Xen, Dom0, and any of the > initial DomU created from Xen alongside Dom0 out of information provided > via device tree. > > Rename xen_rx to console_rx t

Re: [Xen-devel] [PATCH 2/4] iommu: generalize iommu_inclusive_mapping

2018-08-01 Thread Jan Beulich
>>> On 01.08.18 at 10:32, wrote: > On 01/08/2018 09:20, Jan Beulich wrote: > On 31.07.18 at 17:33, wrote: >>> On Tue, Jul 31, 2018 at 08:39:22AM -0600, Jan Beulich wrote: >>> On 27.07.18 at 17:31, wrote: > Introduce a new iommu=inclusive generic option that supersedes > iommu_inc

Re: [Xen-devel] [PATCH 2/4] iommu: generalize iommu_inclusive_mapping

2018-08-01 Thread Jan Beulich
>>> On 01.08.18 at 10:33, wrote: >> From: Xen-devel [mailto:xen-devel-boun...@lists.xenproject.org] On Behalf >> Of Jan Beulich >> Sent: 01 August 2018 09:21 >> >>> On 31.07.18 at 17:33, wrote: >> > On Tue, Jul 31, 2018 at 08:39:22AM -0600, Jan Beulich wrote: >> >> >>> On 27.07.18 at 17:31, wrot

Re: [Xen-devel] [PATCH] x86/altp2m: Allow setting the #VE info page for an arbitrary VCPU

2018-08-01 Thread Jan Beulich
>>> On 01.08.18 at 10:38, wrote: > On 01/08/2018 09:23, Jan Beulich wrote: > On 31.07.18 at 19:19, wrote: >>> On Tue, Jul 31, 2018 at 5:53 AM Jan Beulich wrote: >>> On 25.07.18 at 13:49, wrote: > -vcpu_altp2m(curr).veinfo_gfn = _gfn(a.u.enable_notify.gfn); > -alt

Re: [Xen-devel] [PATCH] xen: clean up altp2m op comment

2018-08-01 Thread George Dunlap
On 08/01/2018 10:03 AM, Wei Liu wrote: > Delete trailing spaces and refer to XSM instead of an internal > function in the public header. > > Signed-off-by: Wei Liu Reviewed-by: George Dunlap ___ Xen-devel mailing list Xen-devel@lists.xenproject.org

Re: [Xen-devel] [PATCH] xen: clean up altp2m op comment

2018-08-01 Thread Jan Beulich
>>> On 01.08.18 at 11:03, wrote: > Delete trailing spaces and refer to XSM instead of an internal > function in the public header. > > Signed-off-by: Wei Liu Acked-by: Jan Beulich ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://l

Re: [Xen-devel] [PATCH] tools/gdbsx: use inttypes.h instead of custom macros

2018-08-01 Thread Wei Liu
On Tue, Jul 31, 2018 at 10:19:05PM +0200, Marek Marczykowski-Górecki wrote: > Signed-off-by: Marek Marczykowski-Górecki > --- > This is on top of "tools/gdbsx: fix 'g' packet response for 64bit > guests" patch. > --- > tools/debugger/gdbsx/gx/gx_local.c | 17 +- > tools/debugger/gdbsx/gx

Re: [Xen-devel] [PATCH 2/4] iommu: generalize iommu_inclusive_mapping

2018-08-01 Thread Andrew Cooper
On 01/08/2018 10:10, Jan Beulich wrote: >> Furthermore, on by default is the only reasonable option. Dom0 is >> specifically given cpu mappings of the reserved regions, therefore it >> should have matching IOMMU mappings. > I don't think I can uniformly agree with this: There are reserved > region

Re: [Xen-devel] [PATCH v6 7/7] xen/arm: export shared memory regions as reserved-memory on device tree

2018-08-01 Thread Julien Grall
Hi, On 31/07/18 19:23, Stefano Stabellini wrote: Shared memory regions need to be advertised to the guest. Fortunately, a device tree binding for special memory regions already exist: reserved-memory. Add a reserved-memory node for each shared memory region, for both masters and slaves. Signed

Re: [Xen-devel] [PATCH] x86/altp2m: Allow setting the #VE info page for an arbitrary VCPU

2018-08-01 Thread Andrew Cooper
On 01/08/2018 10:14, Jan Beulich wrote: On 01.08.18 at 10:38, wrote: >> On 01/08/2018 09:23, Jan Beulich wrote: >> On 31.07.18 at 19:19, wrote: On Tue, Jul 31, 2018 at 5:53 AM Jan Beulich wrote: On 25.07.18 at 13:49, wrote: >> -vcpu_altp2m(curr).veinfo_gfn = _

Re: [Xen-devel] [PATCH v3 02/25] xen/arm: move a few DT related defines to public/device_tree_defs.h

2018-08-01 Thread Julien Grall
On 01/08/18 00:27, Stefano Stabellini wrote: Move a few constants defined by libxl_arm.c to xen/include/public/device_tree_defs.h, so that they can be used from Xen and libxl. Prepend GUEST_ to avoid conflicts. Move the DT_IRQ_TYPE* definitions from libxl_arm.c to public/device_tree_defs.h. Us

Re: [Xen-devel] [PATCH] tools/gdbsx: use inttypes.h instead of custom macros

2018-08-01 Thread Wei Liu
On Wed, Aug 01, 2018 at 10:19:17AM +0100, Wei Liu wrote: > On Tue, Jul 31, 2018 at 10:19:05PM +0200, Marek Marczykowski-Górecki wrote: > > Signed-off-by: Marek Marczykowski-Górecki > > --- > > This is on top of "tools/gdbsx: fix 'g' packet response for 64bit > > guests" patch. > > --- > > tools/d

Re: [Xen-devel] [PATCH v3 04/25] xen/arm: document dom0less

2018-08-01 Thread Julien Grall
Hi Stefano, On 01/08/18 00:27, Stefano Stabellini wrote: Add a new document to provide information on how to use dom0less related features and their current limitations. Signed-off-by: Stefano Stabellini --- Changes in v3: - add patch --- docs/misc/arm/dom0less | 47

Re: [Xen-devel] [PATCH v3 05/25] xen/arm: do not pass dt_host to make_memory_node and make_hypervisor_node

2018-08-01 Thread Julien Grall
Hi Stefano, On 01/08/18 00:27, Stefano Stabellini wrote: In order to make make_memory_node and make_hypervisor_node more reusable, do not pass them dt_host. As they only use it to calculate addrcells and sizecells, pass addrcells and sizecells directly. Signed-off-by: Stefano Stabellini Acke

Re: [Xen-devel] [PATCH v3 06/25] xen/arm: move evtchn_allocate call out of make_hypervisor_node

2018-08-01 Thread Julien Grall
Hi Stefano, On 01/08/18 00:27, Stefano Stabellini wrote: In the case of domUs, evtchn_irq is allocated by arch_domain_create and set to GUEST_EVTCHN_PPI. To make make_hypervisor_node more reusable, move the call to evtchn_allocate out of make_hypervisor_node, to the dom0 specific caller (handle

[Xen-devel] [xen-unstable-coverity test] 125723: all pass - PUSHED

2018-08-01 Thread osstest service owner
flight 125723 xen-unstable-coverity real [real] http://logs.test-lab.xenproject.org/osstest/logs/125723/ Perfect :-) All tests in this flight passed as required version targeted for testing: xen 6aaa9fb308171ec58ddf4cf058ad5341f81a65cf baseline version: xen acd0

Re: [Xen-devel] [PATCH v3 07/25] xen/arm: rename acpi_make_chosen_node to make_chosen_node

2018-08-01 Thread Julien Grall
On 01/08/18 00:27, Stefano Stabellini wrote: acpi_make_chosen_node is actually generic and can be reused. Rename it to make_chosen_node and make it available to non-ACPI builds. Signed-off-by: Stefano Stabellini Acked-by: Julien Grall --- Removed Julien's ack due to small change below C

Re: [Xen-devel] [PATCH 2/4] iommu: generalize iommu_inclusive_mapping

2018-08-01 Thread Jan Beulich
>>> On 01.08.18 at 11:20, wrote: > On 01/08/2018 10:10, Jan Beulich wrote: >>> Furthermore, on by default is the only reasonable option. Dom0 is >>> specifically given cpu mappings of the reserved regions, therefore it >>> should have matching IOMMU mappings. >> I don't think I can uniformly agre

Re: [Xen-devel] [PATCH 00/16] x86: indirect call overhead reduction

2018-08-01 Thread Jan Beulich
>>> On 11.07.18 at 15:15, wrote: > While indirect calls have always been more expensive than direct ones, > their cost has further increased with the Spectre v2 mitigations. In a > number of cases we simply pointlessly use them in the first place. In > many other cases the indirection solely exist

Re: [Xen-devel] [PATCH 2/4] iommu: generalize iommu_inclusive_mapping

2018-08-01 Thread Andrew Cooper
On 01/08/18 10:59, Jan Beulich wrote: On 01.08.18 at 11:20, wrote: >> On 01/08/2018 10:10, Jan Beulich wrote: Furthermore, on by default is the only reasonable option. Dom0 is specifically given cpu mappings of the reserved regions, therefore it should have matching IOMMU mapp

Re: [Xen-devel] [PATCH] tools/gdbsx: use inttypes.h instead of custom macros

2018-08-01 Thread Marek Marczykowski-Górecki
On Wed, Aug 01, 2018 at 10:33:23AM +0100, Wei Liu wrote: > On Wed, Aug 01, 2018 at 10:19:17AM +0100, Wei Liu wrote: > > On Tue, Jul 31, 2018 at 10:19:05PM +0200, Marek Marczykowski-Górecki wrote: > > > Signed-off-by: Marek Marczykowski-Górecki > > > > > > --- > > > This is on top of "tools/gdbsx:

Re: [Xen-devel] [PATCH v3 09/25] xen/arm: introduce bootcmdlines

2018-08-01 Thread Julien Grall
Hi Stefano, On 01/08/18 00:27, Stefano Stabellini wrote: Introduce a new array to store the cmdline of each boot module. It is separate from struct bootmodules. Remove the cmdline field from struct boot_module. This way, kernels and initrds with the same address in memory can share struct bootmo

[Xen-devel] [PATCH v2 2/5] iommu: introduce dom0-iommu option

2018-08-01 Thread Roger Pau Monne
To select the iommu configuration used by Dom0. This option supersedes iommu=dom0-strict|dom0-passthrough. No functional change. Signed-off-by: Roger Pau Monné --- Changes since v1: - New in this version. --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Gra

[Xen-devel] [PATCH v2 1/5] iommu/vtd: cleanup vtd_set_hwdom_mapping after ia64 removal

2018-08-01 Thread Roger Pau Monne
Remove the handling for different page sizes now that ia64 is gone. No functional change. Reported by: Jan Beulich Signed-off-by: Roger Pau Monné --- Changes since v1: - New in this version. --- Cc: Kevin Tian --- xen/drivers/passthrough/vtd/x86/vtd.c | 17 - 1 file changed,

[Xen-devel] [PATCH v2 5/5] x86/iommu: add PVH support to the inclusive options

2018-08-01 Thread Roger Pau Monne
Several people have reported hardware issues (malfunctioning USB controllers) due to iommu page faults on Intel hardware. Those faults are caused by missing RMRR (VTd) entries in the ACPI tables. Those can be worked around on VTd hardware by manually adding RMRR entries on the command line, this is

[Xen-devel] [PATCH v2 0/5] x86/iommu: PVH Dom0 workarounds for missing RMRR entries

2018-08-01 Thread Roger Pau Monne
Hello, The following series implement a workaround for missing RMRR entries for a PVH Dom0. It's based on the iommu_inclusive_mapping VTd option. The PVH workaround identity maps all regions marked as reserved in the memory map. Note that this workaround is enabled by default on Intel hardware.

[Xen-devel] [PATCH v2 4/5] dom0/pvh: change the order of the MMCFG initialization

2018-08-01 Thread Roger Pau Monne
So it's done before the iommu is initialized. This is required in order to be able to fetch the MMCFG regions from the domain struct. No functional change. Signed-off-by: Roger Pau Monné --- Changes since v1: - New in this version. --- Cc: Jan Beulich Cc: Andrew Cooper --- xen/arch/x86/hvm/d

[Xen-devel] [PATCH v2 3/5] iommu: make iommu_inclusive_mapping a suboption of dom0-iommu

2018-08-01 Thread Roger Pau Monne
Introduce a new dom0-iommu=inclusive generic option that supersedes iommu_inclusive_mapping. The prevcious behaviour is preserved and the option should only be enabled by default on Intel hardware. No functional change intended. Signed-off-by: Roger Pau Monné --- Changes since v1: - Use dom0-io

Re: [Xen-devel] [PATCH v3 10/25] xen/arm: don't add duplicate boot modules

2018-08-01 Thread Julien Grall
Hi Stefano, On 01/08/18 00:27, Stefano Stabellini wrote: Don't add duplicate boot modules (same kind and same start address). Please explain why you don't want to duplicate it. Mark kernels and ramdisks of "xen,domain" nodes as BOOTMOD_KERNEL_DOMAIN and BOOTMOD_RAMDISK_DOMAIN respectively,

Re: [Xen-devel] [PATCH v2 2/5] iommu: introduce dom0-iommu option

2018-08-01 Thread Andrew Cooper
On 01/08/18 12:03, Roger Pau Monne wrote: > @@ -1198,6 +1204,32 @@ detection of systems known to misbehave upon accesses > to that port. > > >> Enable IOMMU debugging code (implies `verbose`). > > +### dom0-iommu > +> `= List of [ none | strict | relaxed ]` > + > +> Sub-options are of boolean

Re: [Xen-devel] [PATCH v2 2/5] iommu: introduce dom0-iommu option

2018-08-01 Thread Paul Durrant
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xenproject.org] On Behalf > Of Roger Pau Monne > Sent: 01 August 2018 12:04 > To: xen-devel@lists.xenproject.org > Cc: Kevin Tian ; Stefano Stabellini > ; Wei Liu ; Suravee > Suthikulpanit ; George Dunlap > ; Andrew Coop

Re: [Xen-devel] [PATCH v2 1/5] iommu/vtd: cleanup vtd_set_hwdom_mapping after ia64 removal

2018-08-01 Thread Paul Durrant
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xenproject.org] On Behalf > Of Roger Pau Monne > Sent: 01 August 2018 12:04 > To: xen-devel@lists.xenproject.org > Cc: Kevin Tian ; Roger Pau Monne > > Subject: [Xen-devel] [PATCH v2 1/5] iommu/vtd: cleanup > vtd_set_hw

Re: [Xen-devel] [PATCH v2 3/5] iommu: make iommu_inclusive_mapping a suboption of dom0-iommu

2018-08-01 Thread Paul Durrant
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xenproject.org] On Behalf > Of Roger Pau Monne > Sent: 01 August 2018 12:04 > To: xen-devel@lists.xenproject.org > Cc: Kevin Tian ; Stefano Stabellini > ; Wei Liu ; George Dunlap > ; Andrew Cooper > ; Ian Jackson ; Tim >

Re: [Xen-devel] [PATCH v2 5/5] x86/iommu: add PVH support to the inclusive options

2018-08-01 Thread Paul Durrant
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xenproject.org] On Behalf > Of Roger Pau Monne > Sent: 01 August 2018 12:04 > To: xen-devel@lists.xenproject.org > Cc: Stefano Stabellini ; Wei Liu > ; George Dunlap ; > Andrew Cooper ; Ian Jackson > ; Tim (Xen.org) ; Ju

Re: [Xen-devel] [PATCH v3 17/25] xen/arm: introduce allocate_memory

2018-08-01 Thread Julien Grall
Hi, On 01/08/18 00:28, Stefano Stabellini wrote: Introduce an allocate_memory function able to allocate memory for DomUs and map it at the right guest addresses, according to the guest memory map: GUEST_RAM0_BASE and GUEST_RAM1_BASE. Signed-off-by: Stefano Stabellini --- Changes in v3: - new p

[Xen-devel] [qemu-mainline test] 125695: trouble: broken/fail/pass

2018-08-01 Thread osstest service owner
flight 125695 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/125695/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-xl broken test-armhf-armhf-xl

[Xen-devel] [PATCH] x86/vmx: Avoid hitting BUG_ON() after EPTP-related domain_crash()

2018-08-01 Thread Andrew Cooper
If the EPTP pointer can't be located in the altp2m list, the domain is (legitimately) crashed. Under those circumstances, execution will continue and guarentee to hit the BUG_ON(idx >= MAX_ALTP2M) (unfortunately, just out of context). Return from vmx_vmexit_handler() after the domain_crash(), whi

Re: [Xen-devel] [PATCH] x86/vmx: Avoid hitting BUG_ON() after EPTP-related domain_crash()

2018-08-01 Thread Razvan Cojocaru
On 08/01/2018 03:07 PM, Andrew Cooper wrote: > If the EPTP pointer can't be located in the altp2m list, the domain > is (legitimately) crashed. > > Under those circumstances, execution will continue and guarentee to hit the > BUG_ON(idx >= MAX_ALTP2M) (unfortunately, just out of context). > > Ret

[Xen-devel] [PATCH] x86/vmx: Avoid using domain_crash_syncrhonous() in vmx_vmentry_failure()

2018-08-01 Thread Andrew Cooper
There is no need for the syncrhonous varient, as the vmentry failure path can just return to processing softirqs. This is in aid of trying to remove domain_crash_syncrhonous() from the codebase. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Jun Nakajima CC: Kevin Tian --- xen/arch/x86

Re: [Xen-devel] [PATCH] x86/vmx: Avoid using domain_crash_syncrhonous() in vmx_vmentry_failure()

2018-08-01 Thread Jan Beulich
>>> On 01.08.18 at 14:55, wrote: > There is no need for the syncrhonous varient, as the vmentry failure path can > just return to processing softirqs. > > This is in aid of trying to remove domain_crash_syncrhonous() from the > codebase. > > Signed-off-by: Andrew Cooper With the name of the fu

[Xen-devel] [xen-unstable-smoke test] 125729: tolerable all pass - PUSHED

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

[Xen-devel] [PATCH] xen: Remove domain_crash_synchronous() completely

2018-08-01 Thread Andrew Cooper
domain_crash_synchronous() is unsafe to use in general as it may leave spinlocks held, temporary memory allocated, etc. With domain_crash_synchronous() removed from the ARM code in 4.11, take the opportunity to remove the infrastructure completely by opencoding the softirq loop in the remaining ca

[Xen-devel] [PATCH v4 09/15] vtd: add lookup_page method to iommu_ops

2018-08-01 Thread Paul Durrant
This patch adds a new method to the VT-d IOMMU implementation to find the MFN currently mapped by the specified BFN along with a wrapper function in generic IOMMU code to call the implementation if it exists. This functionality will be used by a subsequent patch. Signed-off-by: Paul Durrant Revi

[Xen-devel] [PATCH v4 08/15] x86: add iommu_op to query reserved ranges

2018-08-01 Thread Paul Durrant
This patch adds an iommu_op to allow the domain IOMMU reserved ranges to be queried by the guest. NOTE: The number of reserved ranges is determined by system firmware, in conjunction with Xen command line options, and is expected to be small. Thus, to avoid over-complicating the code,

[Xen-devel] [PATCH v4 01/15] re-work commit 3e06b989 "IOMMU: make page table population preemptible"...

2018-08-01 Thread Paul Durrant
...to simplify the implementation and turn need_iommu back into a boolean. As noted in [1] the tri-state nature of need_iommu after commit 3e06b989 is confusing, as is the implementation of pre-emption using relmem_list. This patch instead uses a simple count of pages already populated stored in

[Xen-devel] [PATCH v4 00/15] paravirtual IOMMU interface

2018-08-01 Thread Paul Durrant
The idea of a paravirtual IOMMU interface was last discussed on xen-devel several years ago and narrowed down on a draft specification [1]. There was also an RFC patch series posted with an implementation, however this was never followed through. In this patch series I have tried to simplify the i

[Xen-devel] [PATCH v4 02/15] iommu: introduce the concept of BFN...

2018-08-01 Thread Paul Durrant
...meaning 'bus frame number' i.e. a frame number mapped in the IOMMU rather than the MMU. This patch is a largely cosmetic change that substitutes the terms 'gfn' and 'gaddr' for 'bfn' and 'baddr' in all the places where the frame number or address relate to the IOMMU rather than the MMU. The pa

[Xen-devel] [PATCH v4 05/15] iommu: don't domain_crash() inside iommu_map/unmap_page()

2018-08-01 Thread Paul Durrant
Turn iommu_map/unmap_page() into straightforward wrappers that check the existence of the relevant iommu_op and call through to it. This makes them usable by PV IOMMU code to be delivered in future patches. Leave the decision on whether to invoke domain_crash() up to the caller. This has the added

[Xen-devel] [PATCH v4 04/15] iommu: push use of type-safe BFN and MFN into iommu_ops

2018-08-01 Thread Paul Durrant
This patch modifies the methods in struct iommu_ops to use type-safe BFN and MFN. This follows on from the prior patch that modified the functions exported in xen/iommu.h. Signed-off-by: Paul Durrant Reviewed-by: Wei Liu --- Cc: Suravee Suthikulpanit Cc: Jan Beulich Cc: Kevin Tian Cc: Andrew

[Xen-devel] [PATCH v4 07/15] iommu: track reserved ranges using a rangeset

2018-08-01 Thread Paul Durrant
Ranges that should be considered reserved in the IOMMU are not necessarily limited to RMRRs. If iommu_inclusive_mapping is set then any frame number falling within an E820 reserved region should also be considered as reserved in the IOMMU. This patch adds a rangeset to the domain_iommu structure th

[Xen-devel] [PATCH v4 03/15] iommu: make use of type-safe BFN and MFN in exported functions

2018-08-01 Thread Paul Durrant
This patch modifies the declaration of the entry points to the IOMMU sub-system to use bfn_t and mfn_t in place of unsigned long. A subsequent patch will similarly modify the methods in the iommu_ops structure. Signed-off-by: Paul Durrant Reviewed-by: Wei Liu --- Cc: Jan Beulich Cc: Andrew Coop

Re: [Xen-devel] [PATCH] xen: Remove domain_crash_synchronous() completely

2018-08-01 Thread Jan Beulich
>>> On 01.08.18 at 15:29, wrote: > domain_crash_synchronous() is unsafe to use in general as it may leave > spinlocks held, temporary memory allocated, etc. > > With domain_crash_synchronous() removed from the ARM code in 4.11, take the > opportunity to remove the infrastructure completely by ope

[Xen-devel] [PATCH v4 06/15] public / x86: introduce __HYPERCALL_iommu_op

2018-08-01 Thread Paul Durrant
This patch introduces the boilerplate for a new hypercall to allow a domain to control IOMMU mappings for its own pages. Whilst there is duplication of code between the native and compat entry points which appears ripe for some form of combination, I think it is better to maintain the separation as

Re: [Xen-devel] [PATCH] xen: Remove domain_crash_synchronous() completely

2018-08-01 Thread Roger Pau Monné
On Wed, Aug 01, 2018 at 02:29:35PM +0100, Andrew Cooper wrote: > domain_crash_synchronous() is unsafe to use in general as it may leave > spinlocks held, temporary memory allocated, etc. > > With domain_crash_synchronous() removed from the ARM code in 4.11, take the > opportunity to remove the inf

[Xen-devel] [PATCH v4 12/15] x86: add iommu_op to enable modification of IOMMU mappings

2018-08-01 Thread Paul Durrant
This patch adds an iommu_op which checks whether it is possible or safe for a domain to modify its own IOMMU mappings and, if so, creates a rangeset to track modifications. NOTE: The actual map and unmap operations are introduced by subsequent patches. Signed-off-by: Paul Durrant --- Cc: J

[Xen-devel] [PATCH v4 14/15] x86: add iommu_ops to modify and flush IOMMU mappings

2018-08-01 Thread Paul Durrant
This patch adds iommu_ops to add (map) or remove (unmap) frames in the domain's IOMMU mappings, and an iommu_op to synchronize (flush) those manipulations with the hardware. Mappings added by the map operation are tracked and only those mappings may be removed by a subsequent unmap operation. Fram

[Xen-devel] [PATCH v4 15/15] x86: extend the map and unmap iommu_ops to support grant references

2018-08-01 Thread Paul Durrant
This patch allows a domain to add or remove foreign frames from its IOMMU mappings by grant reference as well as GFN. This is necessary, for example, to support a PV network backend that needs to construct a packet buffer that can be directly accessed by a NIC. Signed-off-by: Paul Durrant --- Cc:

[Xen-devel] [PATCH v4 10/15] mm / iommu: include need_iommu() test in iommu_use_hap_pt()

2018-08-01 Thread Paul Durrant
The name 'iommu_use_hap_pt' suggests that that P2M table is in use as the domain's IOMMU pagetable which, prior to this patch, is not strictly true since the macro did not test whether the domain actually has IOMMU mappings. Signed-off-by: Paul Durrant --- Cc: Jun Nakajima Cc: Kevin Tian Cc: Ge

[Xen-devel] [PATCH v4 13/15] memory: add get_paged_gfn() as a wrapper...

2018-08-01 Thread Paul Durrant
...for some uses of get_page_from_gfn(). There are many occurences of the following pattern in the code: q = ? P2M_ALLOC : P2M_UNSHARE; page = get_page_from_gfn(d, gfn, &p2mt, q); if ( p2m_is_paging(p2mt) ) { if ( page ) put_page(page); p2m_mem_pagin

[Xen-devel] [PATCH v4 11/15] mm / iommu: split need_iommu() into has_iommu_pt() and sync_iommu_pt()

2018-08-01 Thread Paul Durrant
The name 'need_iommu' is a little confusing as it suggests a domain needs to use the IOMMU but something might not be set up yet, when in fact it doesn't become true until IOMMU mappings for the domain have been created. Two different meanings are also inferred from it in various places in the cod

Re: [Xen-devel] [PATCH] xen: Remove domain_crash_synchronous() completely

2018-08-01 Thread Andrew Cooper
On 01/08/18 14:50, Roger Pau Monné wrote: > On Wed, Aug 01, 2018 at 02:29:35PM +0100, Andrew Cooper wrote: >> domain_crash_synchronous() is unsafe to use in general as it may leave >> spinlocks held, temporary memory allocated, etc. >> >> With domain_crash_synchronous() removed from the ARM code in

Re: [Xen-devel] [PATCH] xen: Remove domain_crash_synchronous() completely

2018-08-01 Thread Paul Durrant
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xenproject.org] On Behalf > Of Roger Pau Monné > Sent: 01 August 2018 14:50 > To: Andrew Cooper > Cc: Julien Grall ; Stefano Stabellini > ; Wei Liu ; Jan Beulich > ; Xen-devel > Subject: Re: [Xen-devel] [PATCH] xen: Re

[Xen-devel] [PATCH 0/5] x86: more power-efficient CPU parking

2018-08-01 Thread Jan Beulich
When putting CPUs to sleep permanently, we should try to put them into the most power conserving state possible. For now it is unclear whether, especially in a deep C-state, the P-state also matters, so this series only arranges for the C-state side of things (plus some cleanup). 1: x86/cpuidle: r

Re: [Xen-devel] [RFC PATCH 01/17] libxl: fix qemu-trad cmdline for no sdl/vnc case

2018-08-01 Thread Jason Andryuk
On Mon, Jul 30, 2018 at 11:56 PM, Marek Marczykowski-Górecki wrote: > When qemu is running in stubdomain, any attempt to initialize vnc/sdl > there will crash it (on failed attempt to load a keymap from a file). If > vfb is present, all those cases are skipped. But since > b053f0c4c9e533f3d97837cf

Re: [Xen-devel] [RFC PATCH 02/17] libxl: Add "stubdomain_version" to domain_build_info.

2018-08-01 Thread Jason Andryuk
On Mon, Jul 30, 2018 at 11:56 PM, Marek Marczykowski-Górecki wrote: > From: Eric Shelton > > This enum gives the ability to select between a MiniOS-based QEMU > traditional stub domain and a Linux-based QEMU upstream stub domain. To > use the Linux-based stubdomain, the following two lines shoul

Re: [Xen-devel] [RFC PATCH 03/17] libxl: Handle Linux stubdomain specific QEMU options.

2018-08-01 Thread Jason Andryuk
On Mon, Jul 30, 2018 at 11:56 PM, Marek Marczykowski-Górecki wrote: > From: Eric Shelton > > This patch creates an appropriate command line for the QEMU instance > running in a Linux-based stubdomain. > > NOTE: a number of items are not currently implemented for Linux-based > stubdomains, such as

Re: [Xen-devel] [RFC PATCH 04/17] libxl: Build the domain with a Linux based stubdomain

2018-08-01 Thread Jason Andryuk
On Mon, Jul 30, 2018 at 11:56 PM, Marek Marczykowski-Górecki wrote: > From: Eric Shelton > > This will build a Linux-based stubdomain with QEMU upstream. > > Signed-off-by: Eric Shelton > > Simon: > * use initramfs instead of disk with rootfs > * don't initialize qmp (unused in Qubes) > * Mak

[Xen-devel] [xen-4.10-testing test] 125698: tolerable FAIL - PUSHED

2018-08-01 Thread osstest service owner
flight 125698 xen-4.10-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/125698/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd64-i386-xl-shadow 20 guest-start/debian.repeat fail in 125677 pass in 125698 test-armhf-armhf-xl

Re: [Xen-devel] [RFC PATCH 05/17] libxl: use xenstore for pci hotplug qemu-in-linux-stubdom commands

2018-08-01 Thread Jason Andryuk
On Mon, Jul 30, 2018 at 11:56 PM, Marek Marczykowski-Górecki wrote: > From: Simon Gaiser > > There is no QMP socket access, re-use the same mechanism as for MiniOS > based stubdom. Later you add some QMP support. Is this preferred because your QMP support is unreliable? > @@ -1010,7 +1011,15

Re: [Xen-devel] [RFC PATCH 06/17] libxl: create vkb device only for guests with graphics output

2018-08-01 Thread Jason Andryuk
On Mon, Jul 30, 2018 at 11:56 PM, Marek Marczykowski-Górecki wrote: > The forced vkb device is meant for better performance of qemu access > (at least according to ebbd2561b4cefb299f0f68a88b2788504223de18 "libxl: > Add a vkbd frontend/backend pair for HVM guests"), which isn't used if > there is n

[Xen-devel] [xen-unstable baseline-only test] 75032: regressions - FAIL

2018-08-01 Thread Platform Team regression test user
This run is configured for baseline tests only. flight 75032 xen-unstable real [real] http://osstest.xensource.com/osstest/logs/75032/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-xtf-amd64-amd64-4 63 xtf/test-hvm64-xsa-204

[Xen-devel] [PATCH 2/5] x86/idle: re-arrange dead-idle handling

2018-08-01 Thread Jan Beulich
In order to be able to wake parked CPUs from default_dead_idle(), the function must not itself loop. Move the loop into play_dead(), and use play_dead() as well on the AP boot error path. Furthermore, not the least considering the comment in play_dead(), make sure NMI raised (for now this would be

[Xen-devel] [PATCH 1/5] x86/cpuidle: replace a pointless NULL check

2018-08-01 Thread Jan Beulich
The address of an array slot can't be NULL. Instead add a bounds check to make sure the array indexing is valid (the check is against 2 since slot zero of the array - corresponding to C0 - is of no interest here). Signed-off-by: Jan Beulich --- a/xen/arch/x86/acpi/cpu_idle.c +++ b/xen/arch/x86/a

[Xen-devel] [PATCH 3/5] x86/cpuidle: push parked CPUs into deeper sleep states when possible

2018-08-01 Thread Jan Beulich
When the mwait-idle driver isn't used, C-state information becomes available only in the course of Dom0 starting up. Use the provided data to allow parked CPUs to sleep in a more energy efficient way, by waking them briefly (via NMI) once the data has been recorded. This involves re-arranging how/

[Xen-devel] [PATCH 4/5] x86/cpuidle: clean up Cx dumping

2018-08-01 Thread Jan Beulich
Don't log the same global information once per CPU. Don't log the same information (here: the currently active state) twice. Don't prefix decimal numbers with zeros (giving the impression they're octal). Use format specifiers matching the type of the corresponding expressions. Don't split printk()-

[Xen-devel] [PATCH 5/5] x86: place non-parked CPUs into wait-for-SIPI state after offlining

2018-08-01 Thread Jan Beulich
This is presumably more power efficient than keeping them in a HLT loop, and I supposed also the state in which they're being handed off by firmware. Split off from wakeup_secondary_cpu() the code to assert/deassert INIT (and in turn also recurring wait-for-send-completion code), and re-use it fro

Re: [Xen-devel] [RFC PATCH 07/17] libxl: add save/restore support for qemu-xen in stubdomain

2018-08-01 Thread Jason Andryuk
On Mon, Jul 30, 2018 at 11:56 PM, Marek Marczykowski-Górecki wrote: > Rely on a wrapper script in stubdomain to attach FD 3/4 of qemu to > relevant consoles. Should FD 3 & 4 be defined in some header? That's not useful from a wrapper shell script, but it should be documented somewhere. Reviewed

Re: [Xen-devel] [RFC PATCH 09/17] libxl: use \x1b to separate qemu arguments for linux stubdomain

2018-08-01 Thread Jason Andryuk
On Mon, Jul 30, 2018 at 11:56 PM, Marek Marczykowski-Górecki wrote: > This allows using arguments with spaces, like -append. > Stubdomain side of this require "xenstore-client: Add option for raw > in-/output" commit. I had to look up \x1b - it is ascii escape. Since I was on the www.asciitable.

Re: [Xen-devel] [RFC PATCH 08/17] xl: add stubdomain related options to xl config parser

2018-08-01 Thread Jason Andryuk
On Mon, Jul 30, 2018 at 11:56 PM, Marek Marczykowski-Górecki wrote: No Signed-off-by > --- > docs/man/xl.cfg.pod.5.in | 23 +++ > tools/xl/xl_parse.c | 7 +++ > 2 files changed, 26 insertions(+), 4 deletions(-) > > diff --git a/docs/man/xl.cfg.pod.5.in b/docs/man/x

Re: [Xen-devel] [RFC PATCH 04/17] libxl: Build the domain with a Linux based stubdomain

2018-08-01 Thread Marek Marczykowski-Górecki
On Wed, Aug 01, 2018 at 10:26:06AM -0400, Jason Andryuk wrote: > On Mon, Jul 30, 2018 at 11:56 PM, Marek Marczykowski-Górecki > wrote: > > From: Eric Shelton > > > > This will build a Linux-based stubdomain with QEMU upstream. > > > > Signed-off-by: Eric Shelton > > > > Simon: > > * use initram

Re: [Xen-devel] [PATCH 1/5] x86/cpuidle: replace a pointless NULL check

2018-08-01 Thread Andrew Cooper
On 01/08/18 15:31, Jan Beulich wrote: > The address of an array slot can't be NULL. Instead add a bounds check > to make sure the array indexing is valid (the check is against 2 since > slot zero of the array - corresponding to C0 - is of no interest here). > > Signed-off-by: Jan Beulich Wouldn't

Re: [Xen-devel] [PATCH 4/5] x86/cpuidle: clean up Cx dumping

2018-08-01 Thread Andrew Cooper
On 01/08/18 15:33, Jan Beulich wrote: > Don't log the same global information once per CPU. Don't log the same > information (here: the currently active state) twice. Don't prefix > decimal numbers with zeros (giving the impression they're octal). Use > format specifiers matching the type of the co

Re: [Xen-devel] [PATCH v14 09/11] x86/domctl: Don't pause the whole domain if only getting vcpu state

2018-08-01 Thread Isaila Alexandru
On Ma, 2018-07-31 at 07:08 -0600, Jan Beulich wrote: > > > > > > > > > > > > > On 25.07.18 at 14:14, wrote: > > This patch is focused on moving the for loop to the caller so > > now we can save info for a single vcpu instance with the save_one > > handlers. > > > > Signed-off-by: Alexandru Isa

Re: [Xen-devel] [RFC PATCH 04/17] libxl: Build the domain with a Linux based stubdomain

2018-08-01 Thread Jason Andryuk
On Wed, Aug 1, 2018 at 10:37 AM, Marek Marczykowski-Górecki wrote: > On Wed, Aug 01, 2018 at 10:26:06AM -0400, Jason Andryuk wrote: >> On Mon, Jul 30, 2018 at 11:56 PM, Marek Marczykowski-Górecki >> wrote: >> > From: Eric Shelton >> > >> > This will build a Linux-based stubdomain with QEMU upstr

Re: [Xen-devel] [PATCH v14 06/11] x86/hvm: Introduce hvm_save_mtrr_msr_one func

2018-08-01 Thread Isaila Alexandru
On Ma, 2018-07-31 at 06:16 -0600, Jan Beulich wrote: > > > > > > > > > > > > > On 25.07.18 at 14:14, wrote: > > This is used to save data from a single instance. > > > > Signed-off-by: Alexandru Isaila > > > > --- > > Changes since v11: > > - hvm_save_mtrr_msr() now returns err from > >

Re: [Xen-devel] [PATCH v14 06/11] x86/hvm: Introduce hvm_save_mtrr_msr_one func

2018-08-01 Thread Jan Beulich
>>> On 01.08.18 at 16:57, wrote: > On Ma, 2018-07-31 at 06:16 -0600, Jan Beulich wrote: >> > > > On 25.07.18 at 14:14, wrote: >> > --- a/xen/arch/x86/hvm/mtrr.c >> > +++ b/xen/arch/x86/hvm/mtrr.c >> > @@ -718,52 +718,59 @@ int hvm_set_mem_pinned_cacheattr(struct >> > domain *d, >> > uint64_t gfn

Re: [Xen-devel] [PATCH v14 09/11] x86/domctl: Don't pause the whole domain if only getting vcpu state

2018-08-01 Thread Jan Beulich
>>> On 01.08.18 at 16:50, wrote: > On Ma, 2018-07-31 at 07:08 -0600, Jan Beulich wrote: >> > >> > > >> > > > >> > > > On 25.07.18 at 14:14, wrote: >> > This patch is focused on moving the for loop to the caller so >> > now we can save info for a single vcpu instance with the save_one >> > hand

Re: [Xen-devel] [PATCH 1/5] x86/cpuidle: replace a pointless NULL check

2018-08-01 Thread Jan Beulich
>>> On 01.08.18 at 16:33, wrote: > On 01/08/18 15:31, Jan Beulich wrote: >> The address of an array slot can't be NULL. Instead add a bounds check >> to make sure the array indexing is valid (the check is against 2 since >> slot zero of the array - corresponding to C0 - is of no interest here). >>

  1   2   >