[Xen-devel] [PATCH 1/1] xen/time: do not decrease steal time after live migration on xen

2017-10-19 Thread Dongli Zhang
After guest live migration on xen, steal time in /proc/stat (cpustat[CPUTIME_STEAL]) might decrease because steal returned by xen_steal_lock() might be less than this_rq()->prev_steal_time which is derived from previous return value of xen_steal_clock(). For instance, steal time of each vcpu is 33

Re: [Xen-devel] [PATCH V3 5/29] tools/libacpi: Add new fields in acpi_config for DMAR table

2017-10-19 Thread Lan Tianyu
On 2017年10月18日 23:12, Roger Pau Monné wrote: > On Thu, Sep 21, 2017 at 11:01:46PM -0400, Lan Tianyu wrote: >> From: Chao Gao >> >> The BIOS reports the remapping hardware units in a platform to system >> software >> through the DMA Remapping Reporting (DMAR) ACPI table. >> New fields are introduc

Re: [Xen-devel] [PATCH RFC 13/14] xen: tools: Introduce the set-subpage into xenctrl

2017-10-19 Thread Razvan Cojocaru
On 19.10.2017 11:15, Zhang Yi wrote: > From: Zhang Yi Z > > Introduce the Xen Hypercall HVMOP_set_subpage into Xenctl. > The API is defined as flowing. > > int xc_mem_set_subpage(xc_interface *handle, domid_t domid, >xen_pfn_t gfn, uint32_t access); > > Signed-off-by: Zh

[Xen-devel] [distros-debian-wheezy test] 72331: regressions - trouble: broken/fail/pass

2017-10-19 Thread Platform Team regression test user
flight 72331 distros-debian-wheezy real [real] http://osstest.xs.citrite.net/~osstest/testlogs/logs/72331/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf-pvops 6 kernel-build fail REGR. vs. 72230 Tests w

Re: [Xen-devel] [PATCH V3 5/29] tools/libacpi: Add new fields in acpi_config for DMAR table

2017-10-19 Thread Roger Pau Monné
On Thu, Oct 19, 2017 at 04:09:02PM +0800, Lan Tianyu wrote: > On 2017年10月18日 23:12, Roger Pau Monné wrote: > >> diff --git a/tools/libacpi/libacpi.h b/tools/libacpi/libacpi.h > >> index a2efd23..fdd6a78 100644 > >> --- a/tools/libacpi/libacpi.h > >> +++ b/tools/libacpi/libacpi.h > >> @@ -20,6 +20,8

Re: [Xen-devel] [PATCH RFC 14/14] xen: tools: Added xen-subpage tool.

2017-10-19 Thread Razvan Cojocaru
> +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#define DPRINTF(a, b...) fprintf(stderr, a, ## b) > +#define ERROR(a, b...) fprintf(stderr, a "\n", ## b) > +#define PERROR(a, b...)

Re: [Xen-devel] [PATCH V3 2/29] VIOMMU: Add vIOMMU helper functions to create, destroy vIOMMU instance

2017-10-19 Thread Roger Pau Monné
On Thu, Oct 19, 2017 at 02:31:22PM +0800, Lan Tianyu wrote: > On 2017年10月18日 22:05, Roger Pau Monné wrote: > > On Thu, Sep 21, 2017 at 11:01:43PM -0400, Lan Tianyu wrote: > >> +static int viommu_create(struct domain *d, uint64_t type, > >> + uint64_t base_address, uint64_t c

Re: [Xen-devel] [PATCH V3 1/29] Xen/doc: Add Xen virtual IOMMU doc

2017-10-19 Thread Roger Pau Monné
On Thu, Oct 19, 2017 at 10:26:36AM +0800, Lan Tianyu wrote: > Hi Roger: > Thanks for review. > > On 2017年10月18日 21:26, Roger Pau Monné wrote: > > On Thu, Sep 21, 2017 at 11:01:42PM -0400, Lan Tianyu wrote: > >> +Xen hypervisor vIOMMU command > >> += > >> +Introduce

Re: [Xen-devel] [PATCH 3/3 v4] xenfb: Add [feature|request]-raw-pointer

2017-10-19 Thread Owen Smith
> -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 12 October 2017 18:27 > To: Paul Durrant > Cc: 'Gerd Hoffmann' ; 'Stefano Stabellini' > ; Anthony Perard ; > qemu-de...@nongnu.org; xen-de...@lists.xenproject.org; Owen Smith > > Subject: RE: [Xen-deve

Re: [Xen-devel] [PATCH RFC 00/14] Intel EPT-Based Sub-page Write Protection Support.

2017-10-19 Thread Razvan Cojocaru
On 19.10.2017 11:04, Zhang Yi wrote: > From: Zhang Yi Z > > Hi All, > > Here is a patch-series which adding EPT-Based Sub-page Write Protection > Support. You can get It's software developer manuals from: > > https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction

[Xen-devel] [PATCH RFC 13/14] xen: tools: Introduce the set-subpage into xenctrl

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z Introduce the Xen Hypercall HVMOP_set_subpage into Xenctl. The API is defined as flowing. int xc_mem_set_subpage(xc_interface *handle, domid_t domid, xen_pfn_t gfn, uint32_t access); Signed-off-by: Zhang, Yi Z --- tools/libxc/include/xenctrl.h | 2 ++

[Xen-devel] [PATCH RFC 09/14] xen: vmx: Introduce a Hyper call to set subpage

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z The Hypercall is defined as HVMOP_set_subpage And the Interface's parameters is defined as struct xen_hvm_subpage { domid_t domid; uint32_t access_map; uint64_t gfn; } The user application: xl, or some other security control daemon. will set the protection bitmap

[Xen-devel] [PATCH RFC 04/14] xen: vmx: Introduce SPP-Induced vm exit and it's handle.

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z Accesses using guest-physical addresses may cause SPP-induced VM exits due to an SPPT misconfiguration or an SPPT miss. The basic VM exit reason code reported for SPP-induced VM exits is 66. An SPPT misconfiguration VM exit occurs when, in the course of translating a guest-physi

[Xen-devel] [PATCH RFC 08/14] xen: vmx: Added setup spp page structure.

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z The hardware uses the guest-physical address and bits 11:7 of the address accessed to lookup the SPPT to fetch a write permission bit for the 128 byte wide sub-page region being accessed within the 4K guest-physical page. If the sub-page region write permission bit is set, the wr

[Xen-devel] [PATCH RFC 07/14] xen: vmx: Update the EPT leaf entry indicated with the SPP enable bit.

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z If the sub-page write permission VM-execution control is set, treatment of write accesses to guest-physical accesses depends on the state of the accumulated write-access bit (position 1) and sub-page permission bit (position 61) in the EPT leaf paging-structure. Software will up

[Xen-devel] [PATCH RFC 06/14] xen: vmx: Added SPP flags in EPT leaf entry.

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z This change also modified the p2m_type width to 5, bits 52:56; the p2m_access_t bits 60:57, as the bit 61 is hardware using for EPT leaf entry SPP flags. Signed-off-by: Zhang Yi Z --- xen/include/asm-x86/hvm/vmx/vmx.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

[Xen-devel] [PATCH RFC 14/14] xen: tools: Added xen-subpage tool.

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z It is a tool could set a 4K page corresponding a 32 bit bitmap: xen-subpage -m [domid] set [gfn] [bitmap] Signed-off-by: Zhang Yi Z --- tools/tests/xen-subpage/Makefile | 30 tools/tests/xen-subpage/xen-subpage.c | 125 ++ 2 files

[Xen-devel] [PATCH RFC 01/14] xen: vmx: Added EPT based Subpage Write Protection Doc.

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z Signed-off-by: Zhang Yi Z --- docs/txt/misc/spp_xen.txt | 259 ++ 1 file changed, 259 insertions(+) create mode 100644 docs/txt/misc/spp_xen.txt diff --git a/docs/txt/misc/spp_xen.txt b/docs/txt/misc/spp_xen.txt new file mode 100644

[Xen-devel] [PATCH RFC 05/14] xen: vmx: Disable the 2M/1G superpage when SPP enabled

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z Current we only support Sub-page Protection on the 4k page table. Signed-off-by: Zhang Yi Z --- xen/arch/x86/hvm/vmx/vmx.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 04ae0d6..a4c24bb 100644 --- a/xen/

[Xen-devel] [PATCH RFC 11/14] xen: vmx: Added handle of SPP write protection fault

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z While hardware walking the SPP page table, If the sub-page region write permission bit is set, the write is allowed, else the write is disallowed and results in an EPT violation. we need peek this case in EPT violation handler. Signed-off-by: Zhang Yi Z --- xen/arch/x86/hvm/h

[Xen-devel] [PATCH RFC 03/14] xen: vmx: Introduce the SPPTP and SPP page table.

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z SPPT has 4-level paging structure that is similar to EPT except L1E. The sub-page permission table is referenced via a 64-bit control field called Sub-Page Permission Table Pointer (SPPTP) which contains a 4K-aligned physical address, the index and encoding for this VMCS field is

[Xen-devel] [PATCH RFC 00/14] Intel EPT-Based Sub-page Write Protection Support.

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z Hi All, Here is a patch-series which adding EPT-Based Sub-page Write Protection Support. You can get It's software developer manuals from: https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf In Chapter

[Xen-devel] [PATCH RFC 02/14] xen: vmx: Added VMX SPP feature flags and VM-Execution Controls.

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z Add new secondary processor-based VM-execution control bit which defined as "sub-page write permission", VMX Procbased MSR - MSR_IA32_VMX_EXIT_CTLS bit 23 is the capability bit of SPP. And VMX_SECONDARY_EXEC_CONTROL bit 23 is the enable bit of SPP. Also we introduced a spp_enabl

[Xen-devel] [PATCH RFC 12/14] xen: vmx: Support for clear EPT SPP write Protect bit

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z This is a implement of clear the Write protect bit. EPT SPP Write Protect bit will remove when we set all the 32 sub-pages is writeable. We should also update the EPT page frame w bit as the whole page is writeable. Signed-off-by: Zhang Yi Z --- xen/arch/x86/mm/mem_access.c |

[Xen-devel] [PATCH RFC 10/14] xen: vmx: Implement the Hypercall p2m_set_subpage

2017-10-19 Thread Zhang Yi
From: Zhang Yi Z To utilize SPP feature, system admin should Set a Sub-page access write via SPP Hypercall `HVMOP_set_subpage`, which will prepared the flowing things. (1.Got the corresponding EPT leaf entry via the guest physical address. (2.If it is a 4K page frame, flag the bit 61 to en

Re: [Xen-devel] [PATCH V3 6/29] tools/libxl: Add a user configurable parameter to control vIOMMU attributes

2017-10-19 Thread Roger Pau Monné
On Thu, Sep 21, 2017 at 11:01:47PM -0400, Lan Tianyu wrote: > From: Chao Gao > > A field, viommu_info, is added to struct libxl_domain_build_info. Several > attributes can be specified by guest config file for virtual IOMMU. These > attributes are used for DMAR construction and vIOMMU creation.

Re: [Xen-devel] [PATCH V3 7/29] tools/libxl: build DMAR table for a guest with one virtual VTD

2017-10-19 Thread Roger Pau Monné
On Thu, Sep 21, 2017 at 11:01:48PM -0400, Lan Tianyu wrote: > From: Chao Gao > > A new logic is added to build ACPI DMAR table in tool stack for a guest > with one virtual VTD and pass through it to guest via existing mechanism. If > there already are ACPI tables needed to pass through, we joint

Re: [Xen-devel] [PATCH V3 8/29] tools/libxl: create vIOMMU during domain construction

2017-10-19 Thread Roger Pau Monné
On Thu, Sep 21, 2017 at 11:01:49PM -0400, Lan Tianyu wrote: > From: Chao Gao > > If guest is configured to have a vIOMMU, create it during domain construction. > > Signed-off-by: Chao Gao > Signed-off-by: Lan Tianyu > > --- > v3: > - Remove the process of querying capabilities. > --- > tool

[Xen-devel] [OSSTEST PATCH] mg-repro-setup: --autoalloc-nofree option

2017-10-19 Thread Ian Jackson
This lets you run the automatic allocator within your own task, so you get to keep whatever it found. Signed-off-by: Ian Jackson CC: Wei Liu --- mg-repro-setup | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mg-repro-setup b/mg-repro-setup index 25cbc78..0bafb53 100755

Re: [Xen-devel] [PATCH V3 9/29] tools/libxc: Add viommu operations in libxc

2017-10-19 Thread Roger Pau Monné
On Thu, Sep 21, 2017 at 11:01:50PM -0400, Lan Tianyu wrote: > From: Chao Gao > > This patch adds XEN_DOMCTL_viommu_op hypercall. This hypercall > comprises two sub-commands: Patch description doesn't match actual code. This patch doesn't add any new hypercalls, it just adds libxc helpers for XEN

Re: [Xen-devel] [PATCH V3 10/29] vtd: add and align register definitions

2017-10-19 Thread Roger Pau Monné
On Thu, Sep 21, 2017 at 11:01:51PM -0400, Lan Tianyu wrote: > From: Chao Gao > > No functional changes. > > Signed-off-by: Chao Gao > Signed-off-by: Lan Tianyu Reviewed-by: Roger Pau Monné Would have been nice to maybe split this into two, one patch that simply fixes the alignment and anoth

[Xen-devel] [OSSTEST PATCH] mg-repro-setup: --autoalloc-nofree option

2017-10-19 Thread Ian Jackson
This lets you run the automatic allocator within your own task, so you get to keep whatever it found. Signed-off-by: Ian Jackson CC: Wei Liu --- v2: Some docs, and a warning message. --- mg-repro-setup | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mg-repro-

[Xen-devel] [xen-4.9-testing test] 114673: trouble: broken/fail/pass

2017-10-19 Thread osstest service owner
flight 114673 xen-4.9-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/114673/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-libvirt-raw broken Tests which are f

[Xen-devel] Block device hang after migration

2017-10-19 Thread Wei Liu
Hi In the process of upgrading osstest to Stretch, I discovered an issue with the block device. This happens after a local migration. [ 127.216232] Freezing user space processes ... (elapsed 0.005 seconds) done. [ 127.222143] Freezing remaining freezable tasks ... [ 147.228913] Freezing of ta

[Xen-devel] [PATCH v2 2/2] x86: convert x86_platform_ops to timespec64

2017-10-19 Thread Arnd Bergmann
The x86 platform operations are fairly isolated, so we can change them from using timespec to timespec64. I checked that All the users and callers are safe, and there is only one critical function that is broken beyond 2106: pvclock_read_wallclock() uses a 32-bit number of seconds since the epoch

Re: [Xen-devel] [PATCH v2] arm: configure interrupts to be in non-secure group1

2017-10-19 Thread Julien Grall
Hi Stefano, On 18/10/17 22:29, Stefano Stabellini wrote: Xen uses non-secure group1 interrupts, however it doesn't configure the GICv3 accordingly. Xen needs to set GICD_IGROUPR for SPIs and GICR_IGROUPR0 for local interrupt to "1" to specify that interrupts belong to group1. This is particularl

Re: [Xen-devel] [PATCH] xen/public: Correct the definition of GNTTAB_CACHE_SOURCE_GREF

2017-10-19 Thread Julien Grall
Hi Andrew, On 17/10/17 15:11, Andrew Cooper wrote: Discovered when running the XSA-232 PoC on a UBSAN-enabled hypervisor. (d79) XSA-232 PoC (XEN) (XEN) UBSAN: Undefined behaviour in grant_table.c:3217:25

Re: [Xen-devel] [PATCH] gcov: support gcc 7.x

2017-10-19 Thread Julien Grall
Hi Jan, On 18/10/17 14:45, Jan Beulich wrote: Taking Linux commit 0538421343 ("gcov: support GCC 7.1") as reference, enable gcc 7 support requiring __gcov_exit() and having 9 counters. Signed-off-by: Jan Beulich --- Considering that gcc 7 has been out for a while, I think we shouldn't ship 4.1

Re: [Xen-devel] [PATCH v2 for-4.10] x86/mm: Make PV linear pagetables optional

2017-10-19 Thread Julien Grall
Hi George, On 18/10/17 11:51, George Dunlap wrote: Allowing pagetables to point to other pagetables of the same level (often called 'linear pagetables') has been included in Xen since its inception; but recently it has been the source of a number of subtle reference-counting bugs. It is not use

Re: [Xen-devel] [PATCH V3 11/29] x86/hvm: Introduce a emulated VTD for HVM

2017-10-19 Thread Roger Pau Monné
On Thu, Sep 21, 2017 at 11:01:52PM -0400, Lan Tianyu wrote: > From: Chao Gao > > This patch adds create/destroy function for the emulated VTD > and adapts it to the common VIOMMU abstraction. > > Signed-off-by: Chao Gao > Signed-off-by: Lan Tianyu > --- > xen/drivers/passthrough/vtd/Makefile

[Xen-devel] [PATCH for-4.10] passthrough/vtd: Don't DMA to the stack in queue_invalidate_wait()

2017-10-19 Thread Andrew Cooper
DMA-ing to the stack is generally considered bad practice. In this case, if a timeout occurs because of a sluggish device which is processing the request, the completion notification will corrupt the stack of a subsequent deeper call tree. Place the poll_slot in a percpu area and DMA to that inst

Re: [Xen-devel] [PATCH V3 1/29] Xen/doc: Add Xen virtual IOMMU doc

2017-10-19 Thread Jan Beulich
>>> On 19.10.17 at 10:49, wrote: > On Thu, Oct 19, 2017 at 10:26:36AM +0800, Lan Tianyu wrote: >> Hi Roger: >> Thanks for review. >> >> On 2017年10月18日 21:26, Roger Pau Monné wrote: >> > On Thu, Sep 21, 2017 at 11:01:42PM -0400, Lan Tianyu wrote: >> >> +Xen hypervisor vIOMMU command >> >> +==

Re: [Xen-devel] [PATCH V3 5/29] tools/libacpi: Add new fields in acpi_config for DMAR table

2017-10-19 Thread Jan Beulich
>>> On 19.10.17 at 10:09, wrote: > On 2017年10月18日 23:12, Roger Pau Monné wrote: >> On Thu, Sep 21, 2017 at 11:01:46PM -0400, Lan Tianyu wrote: >>> --- a/tools/libacpi/libacpi.h >>> +++ b/tools/libacpi/libacpi.h >>> @@ -20,6 +20,8 @@ >>> #ifndef __LIBACPI_H__ >>> #define __LIBACPI_H__ >>> >>> +

Re: [Xen-devel] [PATCH V3 12/29] x86/vvtd: Add MMIO handler for VVTD

2017-10-19 Thread Roger Pau Monné
On Thu, Sep 21, 2017 at 11:01:53PM -0400, Lan Tianyu wrote: > From: Chao Gao > > This patch adds VVTD MMIO handler to deal with MMIO access. > > Signed-off-by: Chao Gao > Signed-off-by: Lan Tianyu > --- > xen/drivers/passthrough/vtd/vvtd.c | 91 > ++ > 1 f

Re: [Xen-devel] [PATCH v9 02/16] Rename PSR sysctl/domctl interfaces and xsm policy to make them be general

2017-10-19 Thread Jan Beulich
>>> On 19.10.17 at 03:22, wrote: > v9: > - bump domctl/sysctl version number as this patch missed 4.10. > And add info in commit message. > (suggested by Jan Beulich) I don't understand this - I've specifically given reason why you _don't_ need to increment them, and now you send

[Xen-devel] [xen-unstable test] 114670: regressions - FAIL

2017-10-19 Thread osstest service owner
flight 114670 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/114670/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-debianhvm-amd64 7 xen-bootfail REGR. vs. 114644 test-armhf-armhf-l

Re: [Xen-devel] [PATCH v2 2/2] x86: convert x86_platform_ops to timespec64

2017-10-19 Thread Paolo Bonzini
On 19/10/2017 12:57, Arnd Bergmann wrote: > The x86 platform operations are fairly isolated, so we can > change them from using timespec to timespec64. I checked that > All the users and callers are safe, and there is only one > critical function that is broken beyond 2106: > > pvclock_read_wallcl

Re: [Xen-devel] [xen-unstable test] 114670: regressions - FAIL

2017-10-19 Thread Wei Liu
On Thu, Oct 19, 2017 at 11:36:46AM +, osstest service owner wrote: > flight 114670 xen-unstable real [real] > http://logs.test-lab.xenproject.org/osstest/logs/114670/ > > Regressions :-( > > Tests which did not succeed and are blocking, > including tests which could not be run: > test-amd64-

Re: [Xen-devel] [PATCH V3 13/29] x86/vvtd: Set Interrupt Remapping Table Pointer through GCMD

2017-10-19 Thread Roger Pau Monné
On Thu, Sep 21, 2017 at 11:01:54PM -0400, Lan Tianyu wrote: > From: Chao Gao > > Software sets this field to set/update the interrupt remapping table pointer > used by hardware. The interrupt remapping table pointer is specified through > the Interrupt Remapping Table Address (IRTA_REG) register.

Re: [Xen-devel] [PATCH v3 2/7] xsm: flask: change the dummy xsm policy and flask hook for map_gmfn_foregin

2017-10-19 Thread Jan Beulich
>>> On 19.10.17 at 04:36, wrote: > --- a/xen/include/xsm/dummy.h > +++ b/xen/include/xsm/dummy.h > @@ -516,7 +516,8 @@ static XSM_INLINE int > xsm_remove_from_physmap(XSM_DEFAULT_ARG struct domain *d1, > static XSM_INLINE int xsm_map_gmfn_foreign(XSM_DEFAULT_ARG struct domain *d, > struct domai

Re: [Xen-devel] [PATCH v9 02/16] Rename PSR sysctl/domctl interfaces and xsm policy to make them be general

2017-10-19 Thread Yi Sun
On 17-10-19 05:36:37, Jan Beulich wrote: > >>> On 19.10.17 at 03:22, wrote: > > v9: > > - bump domctl/sysctl version number as this patch missed 4.10. > > And add info in commit message. > > (suggested by Jan Beulich) > > I don't understand this - I've specifically given reason wh

Re: [Xen-devel] [PATCH for-4.10 1/2] tools/libxc: Fix precopy_policy() to not pass a structure by value

2017-10-19 Thread Andrew Cooper
On 16/10/17 16:07, Ian Jackson wrote: > Wei Liu writes ("Re: [PATCH for-4.10 1/2] tools/libxc: Fix precopy_policy() > to not pass a structure by value"): >> On Mon, Oct 16, 2017 at 02:51:54PM +0100, Andrew Cooper wrote: > ... >>> With Joshua's patch in place, the implementer of this callback is th

Re: [Xen-devel] [PATCH for-4.10] passthrough/vtd: Don't DMA to the stack in queue_invalidate_wait()

2017-10-19 Thread Jan Beulich
>>> On 19.10.17 at 13:26, wrote: > --- a/xen/drivers/passthrough/vtd/qinval.c > +++ b/xen/drivers/passthrough/vtd/qinval.c > @@ -147,7 +147,8 @@ static int __must_check queue_invalidate_wait(struct > iommu *iommu, >u8 iflag, u8 sw, u8 fn, >

Re: [Xen-devel] [PATCH v12 05/11] x86/mm: add HYPERVISOR_memory_op to acquire guest resources

2017-10-19 Thread Julien Grall
Hi, On 17/10/17 14:24, Paul Durrant wrote: Certain memory resources associated with a guest are not necessarily present in the guest P2M. This patch adds the boilerplate for new memory op to allow such a resource to be priv-mapped directly, by either a PV or HVM tools domain. NOTE: Whilst the

Re: [Xen-devel] [PATCH v12 06/11] x86/hvm/ioreq: add a new mappable resource type...

2017-10-19 Thread Julien Grall
Hi, On 17/10/17 14:24, Paul Durrant wrote: diff --git a/xen/common/memory.c b/xen/common/memory.c index cdd2e030cf..b27a71c4f1 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -1011,6 +1011,11 @@ static int acquire_resource( switch ( xmar.type ) { +case XENMEM_re

[Xen-devel] [PATCH 00/12] ARM: VGIC/GIC separation cleanups

2017-10-19 Thread Andre Przywara
By the original VGIC design, Xen differentiates between the actual VGIC emulation on one hand and the GIC hardware accesses on the other. It seems there were some deviations from that scheme (over time?), so at the moment we end up happily accessing VGIC specific data structures like struct pending

[Xen-devel] [PATCH 09/12] ARM: VGIC: rework events_need_delivery()

2017-10-19 Thread Andre Przywara
In event.h we very deeply dive into the VGIC to learn if an event for a guest is pending. Rework that function to abstract the VGIC specific part out. Also reorder the queries there, as we only actually need to check for the event channel if there are no other pending IRQs. Signed-off-by: Andre Pr

[Xen-devel] [PATCH 03/12] ARM: VGIC: remove gic_clear_pending_irqs()

2017-10-19 Thread Andre Przywara
gic_clear_pending_irqs() was not only misnamed, but also misplaced, as a function solely dealing with the GIC emulation should not live in gic.c. Move the functionality of this function into its only caller in vgic.c Signed-off-by: Andre Przywara --- xen/arch/arm/gic.c| 11 --- x

[Xen-devel] [PATCH 06/12] ARM: VGIC: streamline gic_restore_pending_irqs()

2017-10-19 Thread Andre Przywara
In gic_restore_pending_irqs() we push our pending virtual IRQs into the list registers. This function is called once from a GIC context and once from a VGIC context. Refactor the calls so that we have only one callsite from the VGIC context. This will help separating the two worlds later. Signed-o

[Xen-devel] [PATCH 12/12] ARM: VGIC: rework gicv[23]_update_lr to not use pending_irq

2017-10-19 Thread Andre Przywara
The functions to actually populate a list register were accessing the VGIC internal pending_irq struct, although they should be abstracting from that. Break the needed information down to remove the reference to pending_irq from gic-v[23].c. Signed-off-by: Andre Przywara --- xen/arch/arm/gic-v2.

[Xen-devel] [PATCH 11/12] ARM: VGIC: factor out vgic_get_hw_irq_desc()

2017-10-19 Thread Andre Przywara
At the moment we happily access the VGIC internal struct pending_irq (which describes a virtual IRQ) in irq.c. Factor out the actually needed functionality to learn the associated hardware IRQ and move that into gic-vgic.c to improve abstraction. Signed-off-by: Andre Przywara --- xen/arch/arm/gi

[Xen-devel] [PATCH 08/12] ARM: VGIC: split up gic_dump_info() to cover virtual part separately

2017-10-19 Thread Andre Przywara
Currently gic_dump_info() not only dumps the hardware state of the GIC, but also the VGIC internal virtual IRQ lists. Split the latter off and move it into vgic.c to observe the abstraction. Signed-off-by: Andre Przywara --- xen/arch/arm/domain.c | 1 + xen/arch/arm/gic.c | 12

[Xen-devel] [PATCH 05/12] ARM: VGIC: move gic_remove_from_lr_pending()

2017-10-19 Thread Andre Przywara
gic_remove_from_lr_pending() was not only misnamed, it also had the wrong abstraction, as it should not live in gic.c. Move it into vgic.c and vgic.h, where it belongs, and rename it on the way. Signed-off-by: Andre Przywara --- xen/arch/arm/gic.c | 7 --- xen/arch/arm/vgic-v3-its.c

[Xen-devel] [PATCH 10/12] ARM: VGIC: factor out vgic_connect_hw_irq()

2017-10-19 Thread Andre Przywara
At the moment we happily access VGIC internal data structures like the rank and struct pending_irq in gic.c, which should be VGIC agnostic. Factor out a new function vgic_connect_hw_irq(), which allows a virtual IRQ to be connected to a hardware IRQ (using the hw bit in the LR). This removes said

[Xen-devel] [PATCH 04/12] ARM: VGIC: move gic_remove_irq_from_queues()

2017-10-19 Thread Andre Przywara
gic_remove_irq_from_queues() was not only misnamed, it also has the wrong abstraction, as it should not live in gic.c. Move it into vgic.c and vgic.h, where it belongs to, and rename it on the way. Signed-off-by: Andre Przywara --- xen/arch/arm/gic.c | 9 - xen/arch/arm/vgic-v3-

[Xen-devel] [PATCH 01/12] ARM: remove unneeded gic.h inclusions

2017-10-19 Thread Andre Przywara
gic.h is supposed to hold defines and prototypes for the hardware side of the GIC interrupt controller. A lot of parts in Xen should not be bothered with that, as they either only care about the VGIC or use more generic interfaces. Remove unneeded inclusions of gic.h from files where they are actua

[Xen-devel] [PATCH 02/12] ARM: vGIC: fix nr_irq definition

2017-10-19 Thread Andre Przywara
The global variable "nr_irqs" is used for x86 and some common Xen code. To make the latter work easily for ARM, it was #defined to NR_IRQS. This not only violated the common habit of capitalizing macros, but also caused issues if one wanted to use a rather innocent "nr_irqs" as a local variable nam

[Xen-devel] [PATCH 07/12] ARM: VGIC: split gic.c to observe hardware/virtual GIC separation

2017-10-19 Thread Andre Przywara
Currently gic.c holds code to handle hardware IRQs as well as code to bridge VGIC requests to the GIC virtualization hardware. Despite being named gic.c, this file reaches into the VGIC and uses data structures describing virtual IRQs. To improve abstraction, move the VGIC functions into a separate

Re: [Xen-devel] [PATCH for-4.10] passthrough/vtd: Don't DMA to the stack in queue_invalidate_wait()

2017-10-19 Thread Andrew Cooper
On 19/10/17 13:11, Jan Beulich wrote: On 19.10.17 at 13:26, wrote: >> --- a/xen/drivers/passthrough/vtd/qinval.c >> +++ b/xen/drivers/passthrough/vtd/qinval.c >> @@ -147,7 +147,8 @@ static int __must_check queue_invalidate_wait(struct >> iommu *iommu, >>

Re: [Xen-devel] [PATCH v12 05/11] x86/mm: add HYPERVISOR_memory_op to acquire guest resources

2017-10-19 Thread Paul Durrant
> -Original Message- > From: Julien Grall [mailto:julien.gr...@linaro.org] > Sent: 19 October 2017 13:23 > To: Paul Durrant ; xen-de...@lists.xenproject.org > Cc: Stefano Stabellini ; Wei Liu > ; Konrad Rzeszutek Wilk ; > George Dunlap ; Andrew Cooper > ; Ian Jackson ; Tim > (Xen.org) ; Jul

Re: [Xen-devel] [PATCH v12 06/11] x86/hvm/ioreq: add a new mappable resource type...

2017-10-19 Thread Paul Durrant
> -Original Message- > From: Julien Grall [mailto:julien.gr...@linaro.org] > Sent: 19 October 2017 13:31 > To: Paul Durrant ; xen-de...@lists.xenproject.org > Cc: Stefano Stabellini ; Wei Liu > ; Konrad Rzeszutek Wilk ; > George Dunlap ; Andrew Cooper > ; Ian Jackson ; Tim > (Xen.org) ; Jan

[Xen-devel] [OSSTEST PATCH] mg-repro-setup: Correct usage message re host idents

2017-10-19 Thread Ian Jackson
`[host=]' was misleading - it suggests you have to type literally `host=', or nothing. But actually `host' here is any host ident. Signed-off-by: Ian Jackson CC: Wei Liu --- mg-repro-setup | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mg-repro-setup b/mg-repro-setu

Re: [Xen-devel] [PATCH v12 06/11] x86/hvm/ioreq: add a new mappable resource type...

2017-10-19 Thread Julien Grall
Hi Paul, On 10/19/2017 01:58 PM, Paul Durrant wrote: -Original Message- From: Julien Grall [mailto:julien.gr...@linaro.org] Sent: 19 October 2017 13:31 To: Paul Durrant ; xen-de...@lists.xenproject.org Cc: Stefano Stabellini ; Wei Liu ; Konrad Rzeszutek Wilk ; George Dunlap ; Andrew Coop

Re: [Xen-devel] [PATCH v12 06/11] x86/hvm/ioreq: add a new mappable resource type...

2017-10-19 Thread Paul Durrant
> -Original Message- > From: Julien Grall [mailto:julien.gr...@linaro.org] > Sent: 19 October 2017 14:08 > To: Paul Durrant ; xen-de...@lists.xenproject.org > Cc: Stefano Stabellini ; Wei Liu > ; Konrad Rzeszutek Wilk ; > George Dunlap ; Andrew Cooper > ; Ian Jackson ; Tim > (Xen.org) ; Jan

Re: [Xen-devel] [PATCH for-4.10] passthrough/vtd: Don't DMA to the stack in queue_invalidate_wait()

2017-10-19 Thread Jan Beulich
>>> On 19.10.17 at 14:54, wrote: > On 19/10/17 13:11, Jan Beulich wrote: > On 19.10.17 at 13:26, wrote: >>> --- a/xen/drivers/passthrough/vtd/qinval.c >>> +++ b/xen/drivers/passthrough/vtd/qinval.c >>> @@ -147,7 +147,8 @@ static int __must_check queue_invalidate_wait(struct >>> iommu *iommu,

Re: [Xen-devel] [PATCH v12 05/11] x86/mm: add HYPERVISOR_memory_op to acquire guest resources

2017-10-19 Thread Julien Grall
Hi, On 10/19/2017 01:57 PM, Paul Durrant wrote: -Original Message- From: Julien Grall [mailto:julien.gr...@linaro.org] Sent: 19 October 2017 13:23 To: Paul Durrant ; xen-de...@lists.xenproject.org Cc: Stefano Stabellini ; Wei Liu ; Konrad Rzeszutek Wilk ; George Dunlap ; Andrew Cooper ;

[Xen-devel] [linux-4.1 baseline-only test] 72330: regressions - trouble: blocked/broken/fail/pass

2017-10-19 Thread Platform Team regression test user
This run is configured for baseline tests only. flight 72330 linux-4.1 real [real] http://osstest.xs.citrite.net/~osstest/testlogs/logs/72330/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-qemuu-nested-intel 10 debian-hvm-

Re: [Xen-devel] [PATCH for-4.10] passthrough/vtd: Don't DMA to the stack in queue_invalidate_wait()

2017-10-19 Thread Andrew Cooper
On 19/10/17 14:25, Jan Beulich wrote: On 19.10.17 at 14:54, wrote: >> On 19/10/17 13:11, Jan Beulich wrote: >> On 19.10.17 at 13:26, wrote: --- a/xen/drivers/passthrough/vtd/qinval.c +++ b/xen/drivers/passthrough/vtd/qinval.c @@ -147,7 +147,8 @@ static int __must_check que

Re: [Xen-devel] [PATCH v12 05/11] x86/mm: add HYPERVISOR_memory_op to acquire guest resources

2017-10-19 Thread Paul Durrant
> -Original Message- > From: Julien Grall [mailto:julien.gr...@linaro.org] > Sent: 19 October 2017 14:29 > To: Paul Durrant ; xen-de...@lists.xenproject.org > Cc: Stefano Stabellini ; Wei Liu > ; Konrad Rzeszutek Wilk ; > George Dunlap ; Andrew Cooper > ; Ian Jackson ; Tim > (Xen.org) ; Jul

[Xen-devel] [PATCH v7 1/5] ptp_kvm: probe for kvm guest availability

2017-10-19 Thread Joao Martins
In the event of moving pvclock_pvti_cpu0_va() definition to common pvclock code, this function could return a value on non KVM guests. If user tried to load the module (or have it builtin) it would fail with a GPF on ptp_kvm_init when running on a Xen guest. Therefore, ptp_kvm_init() should check w

[Xen-devel] [PATCH v7 5/5] MAINTAINERS: xen, kvm: track pvclock-abi.h changes

2017-10-19 Thread Joao Martins
This file defines an ABI shared between guest and hypervisor(s) (KVM, Xen) and as such there should be an correspondent entry in MAINTAINERS file. Notice that there's already a text notice at the top of the header file, hence this commit simply enforces it more explicitly and have both peers notice

[Xen-devel] [PATCH v7 0/5] x86/xen: pvclock vdso support

2017-10-19 Thread Joao Martins
Hey, [ I found an issue with ptp_kvm modinit with my series, so resending with that fixed. ] This is take 7 for vdso for Xen. PVCLOCK_TSC_STABLE_BIT can be set starting Xen 4.8 which is required for vdso time related calls. In order to have it on, you need to have the hypervisor clocksource be

[Xen-devel] [PATCH v7 3/5] x86/xen/time: set pvclock flags on xen_time_init()

2017-10-19 Thread Joao Martins
Specifically check for PVCLOCK_TSC_STABLE_BIT and if this bit is set, then set it too on pvclock flags. This allows Xen clocksource to use it and thus speeding up xen_clocksource_read() callers (i.e. sched_clock()) Signed-off-by: Joao Martins Reviewed-by: Boris Ostrovsky --- Changes since v5: *

[Xen-devel] [PATCH v7 2/5] x86/pvclock: add setter for pvclock_pvti_cpu0_va

2017-10-19 Thread Joao Martins
Right now there is only a pvclock_pvti_cpu0_va() which is defined on kvmclock since: commit dac16fba6fc5 ("x86/vdso: Get pvclock data from the vvar VMA instead of the fixmap") The only user of this interface so far is kvm. This commit adds a setter function for the pvti page and moves pvclock_pvt

[Xen-devel] [PATCH v7 4/5] x86/xen/time: setup vcpu 0 time info page

2017-10-19 Thread Joao Martins
In order to support pvclock vdso on xen we need to setup the time info page for vcpu 0 and register the page with Xen using the VCPUOP_register_vcpu_time_memory_area hypercall. This hypercall will also forcefully update the pvti which will set some of the necessary flags for vdso. Afterwards we che

Re: [Xen-devel] [PATCH v6 1/4] x86/pvclock: add setter for pvclock_pvti_cpu0_va

2017-10-19 Thread Joao Martins
On 10/17/2017 04:34 PM, Joao Martins wrote: > On 10/03/2017 12:55 PM, Joao Martins wrote: >> Right now there is only a pvclock_pvti_cpu0_va() which is defined >> on kvmclock since: >> >> commit dac16fba6fc5 >> ("x86/vdso: Get pvclock data from the vvar VMA instead of the fixmap") >> >> The only use

Re: [Xen-devel] [PATCH V3 14/29] x86/vvtd: Enable Interrupt Remapping through GCMD

2017-10-19 Thread Roger Pau Monné
On Thu, Sep 21, 2017 at 11:01:55PM -0400, Lan Tianyu wrote: > From: Chao Gao > > Software writes this field to enable/disable interrupt reampping. This patch > emulate IRES field of GCMD. > > Signed-off-by: Chao Gao > Signed-off-by: Lan Tianyu > --- > xen/drivers/passthrough/vtd/iommu.h | 3

Re: [Xen-devel] [RFC 4/4] arm: tee: add basic OP-TEE mediator

2017-10-19 Thread Julien Grall
Hi Volodymyr, On 17/10/17 19:57, Volodymyr Babchuk wrote: On Tue, Oct 17, 2017 at 06:30:13PM +0100, Julien Grall wrote: On 11/10/17 20:01, Volodymyr Babchuk wrote: Add basic OP-TEE mediator as an example how TEE mediator framework works. Currently it support only calls from Dom0. Calls from

Re: [Xen-devel] [PATCH v12 05/11] x86/mm: add HYPERVISOR_memory_op to acquire guest resources

2017-10-19 Thread Julien Grall
Hi, On 19/10/17 14:35, Paul Durrant wrote: -Original Message- From: Julien Grall [mailto:julien.gr...@linaro.org] Sent: 19 October 2017 14:29 To: Paul Durrant ; xen-de...@lists.xenproject.org Cc: Stefano Stabellini ; Wei Liu ; Konrad Rzeszutek Wilk ; George Dunlap ; Andrew Cooper ; Ian J

Re: [Xen-devel] [PATCH V3 15/29] x86/vvtd: Process interrupt remapping request

2017-10-19 Thread Roger Pau Monné
On Thu, Sep 21, 2017 at 11:01:56PM -0400, Lan Tianyu wrote: > From: Chao Gao > > When a remapping interrupt request arrives, remapping hardware computes the > interrupt_index per the algorithm described in VTD spec > "Interrupt Remapping Table", interprets the IRTE and generates a remapped > inte

[Xen-devel] [PATCH] tools/Makefile: unset MAKELEVEL before building QEMU

2017-10-19 Thread Anthony PERARD
Since QEMU commits aef45d51d1204f3335fb99de6658e0c5612c2b67 "build: automatically handle GIT submodule checkout for dtc" the QEMU makefiles rely on the variable MAKELEVEL to make a decision on whether to update some git submodules or not. Since we call QEMU build from within the Xen one, MAKELEVEL

Re: [Xen-devel] Block device hang after migration

2017-10-19 Thread Roger Pau Monné
On Thu, Oct 19, 2017 at 11:53:11AM +0100, Wei Liu wrote: > Hi > > In the process of upgrading osstest to Stretch, I discovered an issue > with the block device. This happens after a local migration. > > [ 127.216232] Freezing user space processes ... (elapsed 0.005 seconds) done. > [ 127.222143

Re: [Xen-devel] 4.9.52: INFO: task X blocked for more than 300 seconds.

2017-10-19 Thread Philipp Hahn
Hello Ankur, Am 05.10.2017 um 19:59 schrieb Ankur Arora: > On 2017-10-05 06:20 AM, Konrad Rzeszutek Wilk wrote: >> On Wed, Oct 04, 2017 at 08:26:27PM +0200, Philipp Hahn wrote: ... >> Adding Ankur to this as I think he saw something similar. >> >> But in the meantime - do you see this with the lat

Re: [Xen-devel] [PATCH V3 16/29] x86/vvtd: decode interrupt attribute from IRTE

2017-10-19 Thread Roger Pau Monné
On Thu, Sep 21, 2017 at 11:01:57PM -0400, Lan Tianyu wrote: > From: Chao Gao > > Without interrupt remapping, interrupt attributes can be extracted from > msi message or IOAPIC RTE. However, with interrupt remapping enabled, > the attributes are enclosed in the associated IRTE. This callback is >

Re: [Xen-devel] [PATCH V3 17/29] x86/vvtd: add a helper function to decide the interrupt format

2017-10-19 Thread Roger Pau Monné
On Thu, Sep 21, 2017 at 11:01:58PM -0400, Lan Tianyu wrote: > From: Chao Gao > > Different platform may use different method to distinguish > remapping format interrupt and normal format interrupt. > > Intel uses one bit in IOAPIC RTE or MSI address register to > indicate the interrupt is remapp

Re: [Xen-devel] [PATCH] aarch64: advertise the GIC system register interface

2017-10-19 Thread Peter Maydell
On 18 October 2017 at 01:10, Stefano Stabellini wrote: > Advertise the presence of the GIC system register interface (1<<24) > according to H9.248 of the ARM ARM. > > This patch allows Xen to boot on QEMU aarch64. > > Signed-off-by: Stefano Stabellini > > diff --git a/target/arm/cpu64.c b/target/

Re: [Xen-devel] [PATCH v12 05/11] x86/mm: add HYPERVISOR_memory_op to acquire guest resources

2017-10-19 Thread Paul Durrant
> -Original Message- [snip] > > > > I'd prefer to make the whole thing x86-only since that's the only platform > on which I can test it, and indeed the code used to be x86-only. Jan objected > to this so all I'm trying to achieve is that it builds for ARM. Please can > you and > Jan reach

Re: [Xen-devel] [RFC v2 2/7] arm64: Add definitions for fwnode_handle

2017-10-19 Thread Goel, Sameer
On 10/12/2017 6:45 AM, Julien Grall wrote: > Hi, > > On 21/09/17 01:37, Sameer Goel wrote: >> This will be used as a device property to match the DMA capable devices >> with the associated SMMU. The header file is a port from linux. The code >> was changed to remove the types that were not neede

[Xen-devel] [linux-4.9 test] 114676: trouble: blocked/broken/fail/pass

2017-10-19 Thread osstest service owner
flight 114676 linux-4.9 real [real] http://logs.test-lab.xenproject.org/osstest/logs/114676/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf-pvopsbroken build-armhf-pvops

Re: [Xen-devel] [PATCH v2 for-4.10 2/2] xentoolcore_restrict_all: Implement for libxenevtchn

2017-10-19 Thread Ian Jackson
Ross Lagerwall writes ("[PATCH v2 for-4.10 2/2] xentoolcore_restrict_all: Implement for libxenevtchn"): > Signed-off-by: Ross Lagerwall > --- > Changed in v2: > * Keep warning about DoS and resource exhaustion being a possibility. Acked-by: Ian Jackson Julien, I think you intended your release

  1   2   3   >