Re: [Xen-devel] [PATCH 0/9] qspinlock stuff -v15

2015-03-26 Thread Raghavendra K T
On 03/16/2015 06:46 PM, Peter Zijlstra wrote: Hi Waiman, As promised; here is the paravirt stuff I did during the trip to BOS last week. All the !paravirt patches are more or less the same as before (the only real change is the copyright lines in the first patch). The paravirt stuff is 'simple

[Xen-devel] question about suspending the guest

2015-03-26 Thread Wen Congyang
When I test COLO, I find that suspending the primay guest will fail. static void domain_suspend_common_wait_guest(libxl__egc *egc, libxl__domain_suspend_state2 *dss2) { STATE_AO_GC(dss2->ao); int rc; LOG(DEBUG, "wait for the guest to suspen

Re: [Xen-devel] [RFC v1 08/15] Update IRTE according to guest interrupt config changes

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Andrew Cooper [mailto:andrew.coop...@citrix.com] > Sent: Friday, March 27, 2015 3:59 AM > To: Wu, Feng; xen-devel@lists.xen.org > Cc: Zhang, Yang Z; Tian, Kevin; k...@xen.org; jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 08/15] Update IRTE according to

Re: [Xen-devel] [RFC v1 08/15] Update IRTE according to guest interrupt config changes

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Konrad Rzeszutek Wilk [mailto:konrad.w...@oracle.com] > Sent: Friday, March 27, 2015 3:47 AM > To: Wu, Feng > Cc: xen-devel@lists.xen.org; Zhang, Yang Z; Tian, Kevin; k...@xen.org; > jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 08/15] Update IRTE accor

[Xen-devel] [PATCH v2] xen-blkback: enlarge the array size of blkback name

2015-03-26 Thread Tao Chen
The blkback name is like blkback.domid.xvd[a-z], if domid has four digits (means larger than 1000), then the backmost xvd wouldn't be fully shown. Define a BLKBACK_NAME_LEN macro to be 20, enlarge the array size of blkback name, so it will be fully shown in any case. Signed-off-by: Tao Chen ---

Re: [Xen-devel] [RFC v1 12/15] vmx: Properly handle notification event when vCPU is running

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Zhang, Yang Z > Sent: Friday, March 27, 2015 12:44 PM > To: Wu, Feng; xen-devel@lists.xen.org > Cc: jbeul...@suse.com; k...@xen.org; Tian, Kevin > Subject: RE: [RFC v1 12/15] vmx: Properly handle notification event when vCPU > is running > > Wu, Feng wrote on

Re: [Xen-devel] [RFC v1 07/15] vt-d: Add API to update IRTE when VT-d PI is used

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Andrew Cooper [mailto:andrew.coop...@citrix.com] > Sent: Friday, March 27, 2015 3:17 AM > To: Wu, Feng; xen-devel@lists.xen.org > Cc: Zhang, Yang Z; Tian, Kevin; k...@xen.org; jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 07/15] vt-d: Add API to update

Re: [Xen-devel] [RFC v1 01/15] iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Andrew Cooper [mailto:andrew.coop...@citrix.com] > Sent: Friday, March 27, 2015 1:40 AM > To: Wu, Feng; xen-devel@lists.xen.org > Cc: Zhang, Yang Z; Tian, Kevin; k...@xen.org; jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 01/15] iommu: Add iommu_intpost

Re: [Xen-devel] [RFC v1 12/15] vmx: Properly handle notification event when vCPU is running

2015-03-26 Thread Zhang, Yang Z
Wu, Feng wrote on 2015-03-27: > > > Zhang, Yang Z wrote on 2015-03-25: >> when vCPU is running >> >> Wu, Feng wrote on 2015-03-25: >>> When a vCPU is running in Root mode and a notification event has >>> been injected to it. we need to set VCPU_KICK_SOFTIRQ for the >>> current cpu, so the pendin

Re: [Xen-devel] [RFC v1 12/15] vmx: Properly handle notification event when vCPU is running

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Zhang, Yang Z > Sent: Wednesday, March 25, 2015 10:15 PM > To: Wu, Feng; xen-devel@lists.xen.org > Cc: jbeul...@suse.com; k...@xen.org; Tian, Kevin > Subject: RE: [RFC v1 12/15] vmx: Properly handle notification event when vCPU > is running > > Wu, Feng wrote

Re: [Xen-devel] [PATCH] xen-blkback: enlarge the array size of blkback name

2015-03-26 Thread Chentao (Boby)
You are right, roger. Thanks. domid is a u16, it will occupy 5 characters at most. So the biggest length of blkback name is 8+5+5=18. At this situation, define BLKBACK_NAME_LEN macro to be 20 is safe. On 2015/3/26 19:23, Roger Pau Monné wrote: El 13/03/15 a les 16.52, Tao Chen ha escrit: Th

Re: [Xen-devel] [RFC v1 12/15] vmx: Properly handle notification event when vCPU is running

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Konrad Rzeszutek Wilk [mailto:konrad.w...@oracle.com] > Sent: Friday, March 27, 2015 3:57 AM > To: Wu, Feng > Cc: xen-devel@lists.xen.org; Zhang, Yang Z; Tian, Kevin; k...@xen.org; > jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 12/15] vmx: Properly han

Re: [Xen-devel] [RFC v1 14/15] Suppress posting interrupts when 'SN' is set

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Andrew Cooper [mailto:andrew.coop...@citrix.com] > Sent: Friday, March 27, 2015 4:35 AM > To: Wu, Feng; xen-devel@lists.xen.org > Cc: Zhang, Yang Z; Tian, Kevin; k...@xen.org; jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 14/15] Suppress posting interru

Re: [Xen-devel] [RFC v1 13/15] Update Posted-Interrupts Descriptor during vCPU scheduling

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Andrew Cooper [mailto:andrew.coop...@citrix.com] > Sent: Friday, March 27, 2015 4:16 AM > To: Wu, Feng; xen-devel@lists.xen.org > Cc: Zhang, Yang Z; Tian, Kevin; k...@xen.org; jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 13/15] Update Posted-Interrupts

[Xen-devel] [PATCH 09/10] log-dirty: Refine common code to support PML

2015-03-26 Thread Kai Huang
This patch adds several new callbacks in paging/hap/p2m layer to support PML. At paging layer, a new callback is added to log_dirty_domain to flush hardware cached dirty pages to log-dirty radix tree, as in case of PML, it's possible there are dirty GPAs logged in vcpus' PML buffers when userspace

[Xen-devel] [PATCH 10/10] p2m/ept: Enable PML in p2m-ept for log-dirty.

2015-03-26 Thread Kai Huang
This patch adds PML support in p2m-ept for log-dirty. In case of PML is used, we just need to clear EPT entry's D-bit in order to log that GFN instead of setting EPT entry to read-only. And for partial log-dirty, we also set D-bit for guest memory in normal mode to avoid unnecessary GPA logging, a

[Xen-devel] [PATCH 05/10] VMX: add help functions to support PML

2015-03-26 Thread Kai Huang
This patch adds help functions to enable/disable PML, and flush PML buffer for single vcpu and particular domain for further use. Signed-off-by: Kai Huang --- xen/arch/x86/hvm/vmx/vmcs.c| 190 + xen/include/asm-x86/hvm/vmx/vmcs.h | 9 ++ 2 files chan

[Xen-devel] [PATCH 06/10] VMX: handle PML buffer full VMEXIT

2015-03-26 Thread Kai Huang
We need to flush PML buffer when it's full. Signed-off-by: Kai Huang --- xen/arch/x86/hvm/vmx/vmx.c | 4 1 file changed, 4 insertions(+) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index e1c55ce..453bcc5 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hv

[Xen-devel] [PATCH 03/10] VMX: Add PML definition and feature detection.

2015-03-26 Thread Kai Huang
The patch adds PML definition and feature detection. Note PML won't be detected if PML is disabled from boot parameter. PML is also disabled in construct_vmcs, as it will only be enabled when domain is switched to log dirty mode. Signed-off-by: Kai Huang --- xen/arch/x86/hvm/vmx/vmcs.c|

[Xen-devel] [PATCH 07/10] VMX: handle PML enabling in vmx_vcpu_initialise

2015-03-26 Thread Kai Huang
It's possible domain has already been in log-dirty mode when creating vcpu, in which case we should enable PML for this vcpu if PML has been enabled for the domain. Signed-off-by: Kai Huang --- xen/arch/x86/hvm/vmx/vmx.c | 24 1 file changed, 24 insertions(+) diff --git

[Xen-devel] [PATCH 04/10] VMX: New data structure member to support PML

2015-03-26 Thread Kai Huang
A new 4K page pointer is added to arch_vmx_struct as PML buffer for vcpu. And a new 'status' field is added to vmx_domain to indicate whether PML is enabled for the domain or not. The 'status' field also can be used for further similiar purpose. Note both new members don't have to be initialized t

[Xen-devel] [PATCH 02/10] VMX: New parameter to control PML enabling

2015-03-26 Thread Kai Huang
A top level EPT parameter "ept=" and a sub boolean "pml_enable" are added to control PML. Other booleans can be further added for any other EPT related features. Signed-off-by: Kai Huang --- xen/arch/x86/hvm/vmx/vmcs.c | 32 1 file changed, 32 insertions(+) diff

[Xen-devel] [PATCH 01/10] VMX: Enable EPT A/D bit support

2015-03-26 Thread Kai Huang
PML requires A/D bit support so enable it for further use. Signed-off-by: Kai Huang --- xen/arch/x86/hvm/vmx/vmcs.c| 1 + xen/arch/x86/mm/p2m-ept.c | 8 +++- xen/include/asm-x86/hvm/vmx/vmcs.h | 4 +++- xen/include/asm-x86/hvm/vmx/vmx.h | 5 - 4 files changed, 15 insert

[Xen-devel] [PATCH 08/10] VMX: disable PML in vmx_vcpu_destroy

2015-03-26 Thread Kai Huang
It's possible domain still remains in log-dirty mode when it is about to be destroyed, in which case we should manually disable PML for it. Signed-off-by: Kai Huang --- xen/arch/x86/hvm/vmx/vmx.c | 9 + 1 file changed, 9 insertions(+) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x

[Xen-devel] [PATCH 00/10] PML (Paging Modification Logging) support

2015-03-26 Thread Kai Huang
Hi all, This patch series adds PML support to Xen. Please kindly help to review it. The patches were organized in below way: patch 0: enables EPT A/D bit support, which is a dependence of PML patch 1 to 8: changes in VMX to enable PML patch 9: change log-dirty common code to suppo

Re: [Xen-devel] [RFC v1 07/15] vt-d: Add API to update IRTE when VT-d PI is used

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Andrew Cooper [mailto:andrew.coop...@citrix.com] > Sent: Friday, March 27, 2015 3:17 AM > To: Wu, Feng; xen-devel@lists.xen.org > Cc: Zhang, Yang Z; Tian, Kevin; k...@xen.org; jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 07/15] vt-d: Add API to update

Re: [Xen-devel] [RFC v1 07/15] vt-d: Add API to update IRTE when VT-d PI is used

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Konrad Rzeszutek Wilk [mailto:konrad.w...@oracle.com] > Sent: Friday, March 27, 2015 3:36 AM > To: Wu, Feng > Cc: xen-devel@lists.xen.org; Zhang, Yang Z; Tian, Kevin; k...@xen.org; > jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 07/15] vt-d: Add API to

Re: [Xen-devel] [RFC v1 06/15] vt-d: Extend struct iremap_entry to support VT-d Posted-Interrupts

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Andrew Cooper [mailto:andrew.coop...@citrix.com] > Sent: Friday, March 27, 2015 3:01 AM > To: Wu, Feng; xen-devel@lists.xen.org > Cc: Zhang, Yang Z; Tian, Kevin; k...@xen.org; jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 06/15] vt-d: Extend struct irem

Re: [Xen-devel] [RFC v1 05/15] vmx: Initialize VT-d Posted-Interrupts Descriptor

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Andrew Cooper [mailto:andrew.coop...@citrix.com] > Sent: Friday, March 27, 2015 2:54 AM > To: Wu, Feng; xen-devel@lists.xen.org > Cc: Zhang, Yang Z; Tian, Kevin; k...@xen.org; jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 05/15] vmx: Initialize VT-d Pos

Re: [Xen-devel] [RFC v1 05/15] vmx: Initialize VT-d Posted-Interrupts Descriptor

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Konrad Rzeszutek Wilk [mailto:konrad.w...@oracle.com] > Sent: Friday, March 27, 2015 3:29 AM > To: Wu, Feng > Cc: xen-devel@lists.xen.org; Zhang, Yang Z; Tian, Kevin; k...@xen.org; > jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 05/15] vmx: Initialize V

Re: [Xen-devel] [RFC v1 03/15] vmx: Extend struct pi_desc to support VT-d Posted-Interrupts

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Andrew Cooper [mailto:andrew.coop...@citrix.com] > Sent: Friday, March 27, 2015 2:37 AM > To: Wu, Feng; xen-devel@lists.xen.org > Cc: Zhang, Yang Z; Tian, Kevin; k...@xen.org; jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 03/15] vmx: Extend struct pi_de

Re: [Xen-devel] [v3][PATCH 2/2] libxl: introduce gfx_passthru_kind

2015-03-26 Thread Chen, Tiejun
On 2015/3/26 18:06, Ian Campbell wrote: On Thu, 2015-03-26 at 08:53 +0800, Chen, Tiejun wrote: Hrm, OK. I suppose we can live with autodetect and igd both meaning igd and whoever adds a new type will have to remember to add a check for qemu-trad then. When we really have to introduce a new ty

Re: [Xen-devel] [RFC v1 02/15] vt-d: VT-d Posted-Interrupts feature detection

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Andrew Cooper [mailto:andrew.coop...@citrix.com] > Sent: Friday, March 27, 2015 2:13 AM > To: Wu, Feng; xen-devel@lists.xen.org > Cc: Zhang, Yang Z; Tian, Kevin; k...@xen.org; jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 02/15] vt-d: VT-d Posted-Interr

Re: [Xen-devel] [RFC v1 00/15] Add VT-d Posted-Interrupts support

2015-03-26 Thread Wu, Feng
> -Original Message- > From: Konrad Rzeszutek Wilk [mailto:konrad.w...@oracle.com] > Sent: Friday, March 27, 2015 2:51 AM > To: Wu, Feng > Cc: xen-devel@lists.xen.org; Zhang, Yang Z; Tian, Kevin; k...@xen.org; > jbeul...@suse.com > Subject: Re: [Xen-devel] [RFC v1 00/15] Add VT-d Posted-I

Re: [Xen-devel] [PATCH] VT-d: improve fault info logging

2015-03-26 Thread Zhang, Yang Z
Jan Beulich wrote on 2015-03-26: > I got repeatedly annoyed by there not getting anything logged by > default on VT-d faults (and hence having to tell people to add extra > command line options), and hence I think it is time to redo this code: > Log basic fault information at guest-warning level

[Xen-devel] [qemu-mainline test] 36760: regressions - FAIL

2015-03-26 Thread xen . org
flight 36760 qemu-mainline real [real] http://www.chiark.greenend.org.uk/~xensrcts/logs/36760/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-ovmf-amd64 15 guest-start.2 fail REGR. vs. 36709 Regressions which a

Re: [Xen-devel] [PATCH v1 02/47] x86: mtrr: generalize run time disabling of MTRR

2015-03-26 Thread Luis R. Rodriguez
On Wed, Mar 25, 2015 at 03:59:41PM -0400, Konrad Rzeszutek Wilk wrote: > On Fri, Mar 20, 2015 at 04:17:52PM -0700, Luis R. Rodriguez wrote: > > From: "Luis R. Rodriguez" > > > > It is possible to enable CONFIG_MTRR and up with it > > disabled at run time and yet CONFIG_X86_PAT continues > > to ki

[Xen-devel] [RFT] x86/pvh: disable all MTRR CPU features on cpuid for dom0

2015-03-26 Thread Luis R. Rodriguez
From: "Luis R. Rodriguez" Commit 586ab6a by Roger disabled the main MTRR CPU feature on the cpuid when on pvh in order to avoid having MTRR code run on the OS on dom0. This missed the fact that not all CPUs use this cpuid to identify MTRR support, this complets that. This could in theory fix som

Re: [Xen-devel] [PATCH V14 5/7] xen/arm: Instruction prefetch abort (X) mem_access event handling

2015-03-26 Thread Julien Grall
Hi Tamas, On 26/03/2015 22:05, Tamas K Lengyel wrote: Add missing structure definition for iabt and update the trap handling mechanism to only inject the exception if the mem_access checker decides to do so. Signed-off-by: Tamas K Lengyel Acked-by: Ian Campbell Reviewed-by: Julien Grall I

Re: [Xen-devel] [PATCH 3/3] libxl: drop virDomainObj lock when destroying a domain

2015-03-26 Thread Jim Fehlig
Ian Campbell wrote: > On Wed, 2015-03-25 at 14:08 -0600, Jim Fehlig wrote: > >> A destroy operation can take considerable time on large memory >> domains due to scrubbing the domain' memory. The operation is >> running in the context of a job, so unlocking the domain and >> allowing query opera

[Xen-devel] [PATCH V14 4/7] xen/arm: Data abort exception (R/W) mem_access events

2015-03-26 Thread Tamas K Lengyel
This patch enables to store, set, check and deliver LPAE R/W mem_events. As the LPAE PTE's lack enough available software programmable bits, we store the permissions in a Radix tree. The tree is only looked at if mem_access_enabled is turned on. Signed-off-by: Tamas K Lengyel --- v14: - Make radi

[Xen-devel] [PATCH V14 1/7] xen/arm: groundwork for mem_access support on ARM

2015-03-26 Thread Tamas K Lengyel
Add necessary changes for page table construction routines to pass the default access information and hypercall continuation mask. Also, define necessary functions and data fields to be used later by mem_access. The p2m_access_t info will be stored in a Radix tree as the PTE lacks enough software

[Xen-devel] [PATCH V14 0/7] Mem_access for ARM

2015-03-26 Thread Tamas K Lengyel
The ARM virtualization extension provides 2-stage paging, a similar mechanisms to Intel's EPT, which can be used to trace the memory accesses performed by the guest systems. This series sets up the necessary infrastructure in the ARM code to deliver the event on R/W/X traps. Finally, we turn on the

[Xen-devel] [PATCH V14 6/7] xen/arm: Enable mem_access on ARM

2015-03-26 Thread Tamas K Lengyel
Signed-off-by: Tamas K Lengyel Acked-by: Ian Campbell Reviewed-by: Julien Grall --- config/arm32.mk | 1 + config/arm64.mk | 1 + 2 files changed, 2 insertions(+) diff --git a/config/arm32.mk b/config/arm32.mk index 268ca9c..cd97e42 100644 --- a/config/arm32.mk +++ b/config/arm32.mk @@ -14,6 +

[Xen-devel] [PATCH V14 7/7] tools/libxc: Allocate magic page for mem access on ARM

2015-03-26 Thread Tamas K Lengyel
Signed-off-by: Tamas K Lengyel Reviewed-by: Julien Grall Acked-by: Stefano Stabellini Acked-by: Ian Campbell --- tools/libxc/xc_dom_arm.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c index c7feca7..aaf835c 100644 -

[Xen-devel] [PATCH V14 2/7] xen/arm: Implement domain_get_maximum_gpfn

2015-03-26 Thread Tamas K Lengyel
From: Julien Grall The function domain_get_maximum_gpfn is returning the maximum gpfn ever mapped in the guest. We can use d->arch.p2m.max_mapped_gfn for this purpose. We use this in xenaccess as to avoid the user attempting to set page permissions on pages which don't exist for the domain, as a

[Xen-devel] [PATCH V14 3/7] xen/arm: Allow hypervisor access to mem_access protected pages

2015-03-26 Thread Tamas K Lengyel
The hypervisor may use the MMU to verify that the given guest has read/write access to a given page during hypercalls. As we may have custom mem_access permissions set on these pages, we do a software-based type checking in case the MMU based approach failed, but only if mem_access_enabled is set.

[Xen-devel] [PATCH V14 5/7] xen/arm: Instruction prefetch abort (X) mem_access event handling

2015-03-26 Thread Tamas K Lengyel
Add missing structure definition for iabt and update the trap handling mechanism to only inject the exception if the mem_access checker decides to do so. Signed-off-by: Tamas K Lengyel Acked-by: Ian Campbell Reviewed-by: Julien Grall --- v14: - Query HPFAR_EL2 when valid in iabt handler -

Re: [Xen-devel] [PATCH 2/3] libxl: acquire a job when destroying a domain

2015-03-26 Thread Jim Fehlig
Konrad Rzeszutek Wilk wrote: > On Wed, Mar 25, 2015 at 02:08:35PM -0600, Jim Fehlig wrote: > >> A job should be acquired at the beginning of a domain destroy operation, >> not at the end when cleaning up the domain. Fix two occurances of this >> late job acquisition in the libxl driver. Doing

[Xen-devel] [PATCH V8 12/12] xen/vm_event: Add RESUME option to vm_event_op domctl

2015-03-26 Thread Tamas K Lengyel
Thus far mem_access and mem_sharing memops had been able to signal to Xen to start pulling responses off the corresponding rings. In this patch we retire these memops and add them to the option to the vm_event_op domctl. The vm_event_op domctl suboptions are the same for each ring thus we consolid

[Xen-devel] [PATCH V8 02/12] xen/mem_event: Cleanup mem_event names in rings, functions and domctls

2015-03-26 Thread Tamas K Lengyel
The name of one of the mem_event rings still implies it is used only for memory accesses, which is no longer the case. It is also used to deliver various HVM events, thus the name "monitor" is more appropriate in this setting. Couple functions incorrectly labeled as part of mem_event is also renam

[Xen-devel] [PATCH V8 05/12] tools/tests: Clean-up tools/tests/xen-access

2015-03-26 Thread Tamas K Lengyel
The spin-lock implementation in the xen-access test program is implemented in a fashion that is actually incomplete. The x86 assembly that guarantees that the lock is held by only one thread lacks the "lock;" instruction. However, the spin-lock is not actually necessary in xen-access as it is not

[Xen-devel] [PATCH V8 09/12] xen/vm_event: Decouple vm_event and mem_access.

2015-03-26 Thread Tamas K Lengyel
The vm_event subsystem has been artifically tied to the presence of mem_access. While mem_access does depend on vm_event, vm_event is an entirely independent subsystem that can be used for arbitrary function-offloading to helper apps in domains. This patch removes the dependency that mem_access nee

[Xen-devel] [PATCH V8 06/12] x86/hvm: factor out and rename vm_event related functions

2015-03-26 Thread Tamas K Lengyel
To avoid growing hvm.c these functions can be stored separately. Minor style changes are applied to the logic in the file. Signed-off-by: Tamas K Lengyel Acked-by: Kevin Tian Acked-by: Tim Deegan Acked-by: Jan Beulich --- v6: Style fixes v5: Style fixes Fix hvm_event_msr input types to mat

[Xen-devel] [PATCH V8 04/12] xen: Rename mem_event to vm_event

2015-03-26 Thread Tamas K Lengyel
In this patch we mechanically rename mem_event to vm_event. This patch introduces no logic changes to the code. Using the name vm_event better describes the intended use of this subsystem, which is not limited to memory events. It can be used for off-loading the decision making logic into helper ap

[Xen-devel] [PATCH V8 01/12] xen/mem_event: Cleanup of mem_event structures

2015-03-26 Thread Tamas K Lengyel
The public mem_event structures used to communicate with helper applications via shared rings have been used in different settings. However, the variable names within this structure have not reflected this fact, resulting in the reuse of variables to mean different things under different scenarios.

[Xen-devel] [PATCH V8 08/12] xen/vm_event: Deprecate VM_EVENT_FLAG_DUMMY flag

2015-03-26 Thread Tamas K Lengyel
There are no use-cases for this flag. Signed-off-by: Tamas K Lengyel Acked-by: Tim Deegan --- xen/arch/x86/mm/mem_sharing.c | 3 --- xen/arch/x86/mm/p2m.c | 3 --- xen/common/mem_access.c | 3 --- xen/include/public/vm_event.h | 1 - 4 files changed, 10 deletions(-) diff --git a/

[Xen-devel] [PATCH V8 11/12] xen/xsm: Split vm_event_op into three separate labels

2015-03-26 Thread Tamas K Lengyel
The XSM label vm_event_op has been used to control the three memops controlling mem_access, mem_paging and mem_sharing. While these systems rely on vm_event, these are not vm_event operations themselves. Thus, in this patch we introduce three separate labels for each of these memops. Signed-off-by

[Xen-devel] [PATCH V8 10/12] xen/vm_event: Relocate memop checks

2015-03-26 Thread Tamas K Lengyel
The memop handler function for paging/sharing responsible for calling XSM doesn't really have anything to do with vm_event, thus in this patch we relocate it into mem_paging_memop and mem_sharing_memop. This has already been the approach in mem_access_memop, so in this patch we just make it consist

[Xen-devel] [PATCH V8 07/12] xen: Introduce monitor_op domctl

2015-03-26 Thread Tamas K Lengyel
In preparation for allowing for introspecting ARM and PV domains the old control interface via the hvm_op hypercall is retired. A new control mechanism is introduced via the domctl hypercall: monitor_op. This patch aims to establish a base API on which future applications can build on. Suggested-

[Xen-devel] [PATCH V8 03/12] xen/mem_paging: Convert mem_event_op to mem_paging_op and cleanup

2015-03-26 Thread Tamas K Lengyel
The only use-case of the mem_event_op structure had been in mem_paging, thus renaming the structure mem_paging_op and relocating its associated functions clarifies its actual usage. As part of this fix-up we also convert the gfn's in the toolstack to be explicitely 64-bit wide and clean the code a

[Xen-devel] [PATCH V8 00/12] xen: Clean-up of mem_event subsystem

2015-03-26 Thread Tamas K Lengyel
This patch series aims to clean up the mem_event subsystem within Xen. The original use-case for this system was to allow external helper applications running in privileged domains to control various memory operations performed by Xen. Amongs these were paging, sharing and access control. The subsy

[Xen-devel] REGRESSION [PATCH v2 08/13] libxc: Check xc_domain_maximum_gpfn for negative return values

2015-03-26 Thread Andrew Cooper
On 20/03/15 17:03, Ian Campbell wrote: On Fri, 2015-03-20 at 11:45 -0400, Konrad Rzeszutek Wilk wrote: From 45bd7cd377b0b8364757cc2bc0bd8d6a13523a97 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Fri, 13 Mar 2015 14:57:44 -0400 Subject: [PATCH] libxc: Check xc_domain_maximum_gpfn f

Re: [Xen-devel] [PATCH] libxl: Fix memory leak if pthread_create fails.

2015-03-26 Thread Jim Fehlig
Konrad Rzeszutek Wilk wrote: > If we fail to create the thread we leak the shutdown_info > structure. > Nice catch, thanks! ACK and pushed. Regards, Jim > Signed-off-by: Konrad Rzeszutek Wilk > --- > src/libxl/libxl_domain.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > dif

Re: [Xen-devel] [PATCH v3 1/8] x86: clean up psr boot parameter parsing

2015-03-26 Thread Andrew Cooper
On 26/03/15 12:38, Chao Peng wrote: Change type of opt_psr from bool to int so more psr features can fit. Introduce a new routine to parse bool parameter so that both cmt and future psr features like cat can use it. Signed-off-by: Chao Peng --- Changes in v3: * Set "off" value explicity if req

Re: [Xen-devel] [RFC v1 14/15] Suppress posting interrupts when 'SN' is set

2015-03-26 Thread Andrew Cooper
On 25/03/15 12:31, Feng Wu wrote: Currently, we don't support urgent interrupt, all interrupts are recognized as non-urgent interrupt, so we cannot send posted-interrupt when 'SN' is set. Signed-off-by: Feng Wu --- xen/arch/x86/hvm/vmx/vmx.c | 13 - 1 file changed, 12 insertions(

Re: [Xen-devel] [PATCH 0/9] qspinlock stuff -v15

2015-03-26 Thread Peter Zijlstra
On Wed, Mar 25, 2015 at 03:47:39PM -0400, Konrad Rzeszutek Wilk wrote: > Ah nice. That could be spun out as a seperate patch to optimize the existing > ticket locks I presume. Yes I suppose we can do something similar for the ticket and patch in the right increment. We'd need to restructure the co

Re: [Xen-devel] [RFC v1 13/15] Update Posted-Interrupts Descriptor during vCPU scheduling

2015-03-26 Thread Andrew Cooper
On 25/03/15 12:31, Feng Wu wrote: The basic idea here is: 1. When vCPU's state is RUNSTATE_running, - set 'NV' to 'Notification Vector'. - Clear 'SN' to accpet PI. - set 'NDST' to the right pCPU. 2. When vCPU's state is RUNSTATE_blocked, - set 'NV' to 'Wake-up

Re: [Xen-devel] [PATCH RESEND 1/2] xen/blkback: safely unmap purge persistent grants

2015-03-26 Thread Jens Axboe
On 03/26/2015 01:01 PM, Konrad Rzeszutek Wilk wrote: > On Thu, Mar 26, 2015 at 04:23:27PM +0100, Roger Pau Monné wrote: >> El 26/03/15 a les 13.16, Bob Liu ha escrit: >>> Commit c43cf3ea8385 ("xen-blkback: safely unmap grants in case they are >>> still >>> in use") use gnttab_unmap_refs_async() to

Re: [Xen-devel] [RFC v1 11/15] vmx: Add a global wake-up vector for VT-d Posted-Interrupts

2015-03-26 Thread Andrew Cooper
On 25/03/15 12:31, Feng Wu wrote: This patch adds a global vector which is used to wake up the blocked vCPU when an interrupt is being posted to it. Signed-off-by: Feng Wu Suggested-by: Yang Zhang --- xen/arch/x86/hvm/vmx/vmx.c| 33 + xen/include/asm-

Re: [Xen-devel] [RFC v1 10/15] vmx: Define two per-cpu variants

2015-03-26 Thread Andrew Cooper
On 25/03/15 12:31, Feng Wu wrote: This patch defines two per-cpu variants: You do not mean variants. You mean variables. ~Andrew blocked_vcpu_on_cpu: A list storing the vCPUs which were blocked on this pCPU. blocked_vcpu_on_cpu_lock: The spinlock to protect blocked_vcpu_on_cpu. Signed-of

Re: [Xen-devel] [RFC v1 08/15] Update IRTE according to guest interrupt config changes

2015-03-26 Thread Andrew Cooper
On 25/03/15 12:31, Feng Wu wrote: When guest changes its interrupt configuration (such as, vector, etc.) for direct-assigned devices, we need to update the associated IRTE with the new guest vector, so external interrupts from the assigned devices can be injected to guests without VM-Exit. For l

Re: [Xen-devel] [RFC v1 12/15] vmx: Properly handle notification event when vCPU is running

2015-03-26 Thread Konrad Rzeszutek Wilk
On Wed, Mar 25, 2015 at 08:31:54PM +0800, Feng Wu wrote: > When a vCPU is running in Root mode and a notification event > has been injected to it. we need to set VCPU_KICK_SOFTIRQ for > the current cpu, so the pending interrupt in PIRR will be > synced to vIRR before VM-Exit in time. > > Signed-of

Re: [Xen-devel] Dom0 kernel 3.18.10 with CONFIG_HYPERV_STORAGE and Xen 4.5.0 nested inside Hyper-V

2015-03-26 Thread Andrew Cooper
On 26/03/15 19:37, Mark wrote: Hi, We're trying to nest virtualisation using 64bit Xen inside a Hyper-V virtual machine. When we enable CONFIG_HYPERV_STORAGE and boot with the Xen hypervisor we can't see /dev/sda. If we boot the Linux kernel without Xen it works fine. The full dmesg for bo

Re: [Xen-devel] [RFC v1 08/15] Update IRTE according to guest interrupt config changes

2015-03-26 Thread Konrad Rzeszutek Wilk
On Wed, Mar 25, 2015 at 08:31:50PM +0800, Feng Wu wrote: > When guest changes its interrupt configuration (such as, vector, etc.) s/such as,/such as/ > for direct-assigned devices, we need to update the associated IRTE > with the new guest vector, so external interrupts from the assigned > devices

[Xen-devel] Dom0 kernel 3.18.10 with CONFIG_HYPERV_STORAGE and Xen 4.5.0 nested inside Hyper-V

2015-03-26 Thread Mark
Hi, We're trying to nest virtualisation using 64bit Xen inside a Hyper-V virtual machine. When we enable CONFIG_HYPERV_STORAGE and boot with the Xen hypervisor we can't see /dev/sda. If we boot the Linux kernel without Xen it works fine. The full dmesg for booting with and without Xen is attache

Re: [Xen-devel] [RFC v1 07/15] vt-d: Add API to update IRTE when VT-d PI is used

2015-03-26 Thread Konrad Rzeszutek Wilk
On Wed, Mar 25, 2015 at 08:31:49PM +0800, Feng Wu wrote: > This patch adds an API which is used to update the IRTE > for posted-interrupt when guest changes MSI/MSI-X information. > > Signed-off-by: Feng Wu > --- > xen/drivers/passthrough/vtd/intremap.c | 83 > ++

Re: [Xen-devel] [RFC v1 05/15] vmx: Initialize VT-d Posted-Interrupts Descriptor

2015-03-26 Thread Konrad Rzeszutek Wilk
On Wed, Mar 25, 2015 at 08:31:47PM +0800, Feng Wu wrote: > This patch initializes the VT-d Posted-interrupt Descriptor. > > Signed-off-by: Feng Wu > --- > xen/arch/x86/hvm/vmx/vmcs.c | 3 +++ > xen/include/asm-x86/hvm/vmx/vmx.h | 21 - > 2 files changed, 23 insertions(

Re: [Xen-devel] [RFC v1 07/15] vt-d: Add API to update IRTE when VT-d PI is used

2015-03-26 Thread Andrew Cooper
On 25/03/15 12:31, Feng Wu wrote: This patch adds an API which is used to update the IRTE for posted-interrupt when guest changes MSI/MSI-X information. Signed-off-by: Feng Wu --- xen/drivers/passthrough/vtd/intremap.c | 83 ++ xen/drivers/passthrough/vtd/iomm

Re: [Xen-devel] [PATCH 2/2] xen/grant: introduce func gnttab_unmap_refs_async_wait_completion()

2015-03-26 Thread Konrad Rzeszutek Wilk
On Thu, Mar 26, 2015 at 08:16:01PM +0800, Bob Liu wrote: > There are several place using gnttab async unmap and wait for > completion, so move the common code to a function > gnttab_unmap_refs_async_wait_completion(). > > Signed-off-by: Bob Liu Jens, and would you be OK if this patch went throug

Re: [Xen-devel] [PATCH RESEND 1/2] xen/blkback: safely unmap purge persistent grants

2015-03-26 Thread Konrad Rzeszutek Wilk
On Thu, Mar 26, 2015 at 04:23:27PM +0100, Roger Pau Monné wrote: > El 26/03/15 a les 13.16, Bob Liu ha escrit: > > Commit c43cf3ea8385 ("xen-blkback: safely unmap grants in case they are > > still > > in use") use gnttab_unmap_refs_async() to wait until the mapped pages are no > > longer in use be

Re: [Xen-devel] [RFC v1 06/15] vt-d: Extend struct iremap_entry to support VT-d Posted-Interrupts

2015-03-26 Thread Andrew Cooper
On 25/03/15 12:31, Feng Wu wrote: Extend struct iremap_entry according to VT-d Posted-Interrupts Spec. Signed-off-by: Feng Wu --- xen/drivers/passthrough/vtd/iommu.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/xen/drivers/passthrough/vtd/iommu.h b/xen/drivers/pa

Re: [Xen-devel] [RFC v1 05/15] vmx: Initialize VT-d Posted-Interrupts Descriptor

2015-03-26 Thread Andrew Cooper
On 25/03/15 12:31, Feng Wu wrote: This patch initializes the VT-d Posted-interrupt Descriptor. Signed-off-by: Feng Wu --- xen/arch/x86/hvm/vmx/vmcs.c | 3 +++ xen/include/asm-x86/hvm/vmx/vmx.h | 21 - 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/

Re: [Xen-devel] [RFC v1 00/15] Add VT-d Posted-Interrupts support

2015-03-26 Thread Konrad Rzeszutek Wilk
On Wed, Mar 25, 2015 at 08:31:42PM +0800, Feng Wu wrote: > VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt. > With VT-d Posted-Interrupts enabled, external interrupts from > direct-assigned devices can be delivered to guests without VMM > intervention when guest is running in

Re: [Xen-devel] ARM: KVM/XEN: how should we support virt-what?

2015-03-26 Thread Ard Biesheuvel
On 26 March 2015 at 19:49, Ard Biesheuvel wrote: > On 26 March 2015 at 19:45, Stefano Stabellini > wrote: >> On Thu, 26 Mar 2015, Andrew Jones wrote: >>> On Wed, Mar 25, 2015 at 10:44:42AM +0100, Andrew Jones wrote: >>> > Hello ARM virt maintainers, >>> > >>> > I'd like to start a discussion abou

Re: [Xen-devel] ARM: KVM/XEN: how should we support virt-what?

2015-03-26 Thread Ard Biesheuvel
On 26 March 2015 at 19:45, Stefano Stabellini wrote: > On Thu, 26 Mar 2015, Andrew Jones wrote: >> On Wed, Mar 25, 2015 at 10:44:42AM +0100, Andrew Jones wrote: >> > Hello ARM virt maintainers, >> > >> > I'd like to start a discussion about supporting virt-what[1]. virt-what >> > allows userspace

Re: [Xen-devel] ARM: KVM/XEN: how should we support virt-what?

2015-03-26 Thread Stefano Stabellini
On Thu, 26 Mar 2015, Andrew Jones wrote: > On Wed, Mar 25, 2015 at 10:44:42AM +0100, Andrew Jones wrote: > > Hello ARM virt maintainers, > > > > I'd like to start a discussion about supporting virt-what[1]. virt-what > > allows userspace to determine if the system it's running on is running > > in

Re: [Xen-devel] [RFC v1 04/15] vmx: Add some helper functions for Posted-Interrupts

2015-03-26 Thread Andrew Cooper
On 25/03/15 12:31, Feng Wu wrote: This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. Signed-off-by: Feng Wu --- xen/include/asm-x86/hvm/vmx/vmx.h | 21 + 1 file changed, 21 insertions(+) diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b

Re: [Xen-devel] [RFC v1 03/15] vmx: Extend struct pi_desc to support VT-d Posted-Interrupts

2015-03-26 Thread Andrew Cooper
On 25/03/15 12:31, Feng Wu wrote: Extend struct pi_desc according to VT-d Posted-Interrupts Spec. Signed-off-by: Feng Wu --- xen/include/asm-x86/hvm/vmx/vmcs.h | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/incl

Re: [Xen-devel] linux-next: manual merge of the xen-tip tree with the arm64-acpi tree

2015-03-26 Thread Stefano Stabellini
On Thu, 26 Mar 2015, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the xen-tip tree got a conflict in > drivers/xen/Kconfig between commit 94ccae47e02d ("XEN / ACPI: Make XEN > ACPI depend on X86") from the arm64-acpi tree and commit 628c28eefd6f > ("xen: unify foreign GFN map/

Re: [Xen-devel] [PATCH 2/2] x86: Replace this_cpu_sp0 with current_top_of_stack and fix it on x86_32

2015-03-26 Thread Andy Lutomirski
On Mar 26, 2015 6:32 AM, "Boris Ostrovsky" wrote: > > On 03/06/2015 08:50 PM, Andy Lutomirski wrote: >> >> I broke 32-bit kernels. The implementation of sp0 was correct as >> far as I can tell, but sp0 was much weirder on x86_32 than I >> realized. It has the following issues: >> >> - Init's s

[Xen-devel] [PATCH] libxc: Make conversion from page count to bytes 32-bit safe

2015-03-26 Thread Boris Ostrovsky
Commit ba59e2ce935d ("libxc: allocate memory with vNUMA information for PV guest") creates default vNUMA layout with a single range containing all memory. The end of the range is calculated by shifting dom->total_pages by 12 to the left. On 32-bit dom0 this may result in losing upper bits since to

Re: [Xen-devel] [RFC v1 02/15] vt-d: VT-d Posted-Interrupts feature detection

2015-03-26 Thread Andrew Cooper
On 25/03/15 12:31, Feng Wu wrote: VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt. With VT-d Posted-Interrupts enabled, external interrupts from direct-assigned devices can be delivered to guests without VMM intervention when guest is running in non-root mode. This patch ad

Re: [Xen-devel] [PATCH RFC 0/4] tools: Upstream blktap "2.5" as an external repo

2015-03-26 Thread Felipe Franciosi
> -Original Message- > From: George Dunlap [mailto:george.dun...@eu.citrix.com] > Sent: 26 March 2015 17:23 > To: Andrew Cooper; Felipe Franciosi; George Dunlap; Jonathan Ludlam > Cc: Dave Scott; Wei Liu; Ian Campbell; Wen Congyang; xen-devel@lists.xen.org; > Ian Jackson; Yang Hongyang >

Re: [Xen-devel] [PATCH 05/11] x86/altp2m: basic data structures and support routines.

2015-03-26 Thread Ed White
On 03/26/2015 03:48 AM, Tim Deegan wrote: > At 13:59 -0700 on 25 Mar (1427291983), Ed White wrote: > diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c > index abf3d7a..8fe0650 100644 > --- a/xen/arch/x86/mm/hap/hap.c > +++ b/xen/arch/x86/mm/hap/hap.c > @@ -439,7

Re: [Xen-devel] [RFC v1 01/15] iommu: Add iommu_intpost to control VT-d Posted-Interrupts feature

2015-03-26 Thread Andrew Cooper
On 25/03/15 12:31, Feng Wu wrote: VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt. With VT-d Posted-Interrupts enabled, external interrupts from direct-assigned devices can be delivered to guests without VMM intervention when guest is running in non-root mode. This patch ad

Re: [Xen-devel] [PATCH RFC 0/4] tools: Upstream blktap "2.5" as an external repo

2015-03-26 Thread George Dunlap
On 03/26/2015 05:12 PM, Andrew Cooper wrote: > On 26/03/15 17:05, George Dunlap wrote: >> On 03/26/2015 04:25 PM, Felipe Franciosi wrote: Another thing I'd like to explore (since this took all of about an afternoon to get working) is what it would take to switch to using blktap3

Re: [Xen-devel] preparing for 4.5.1

2015-03-26 Thread Andrew Cooper
On 26/03/15 17:07, Jan Beulich wrote: All, having been released mid January, it is time to get ready for 4.5.1-rc1. Please reply with backport requests which you consider necessary but still missing. Please also be patient with them being pulled in - I'll be gone the coming two weeks, and I'd ho

Re: [Xen-devel] NULL pointers and PV guests.

2015-03-26 Thread Ian Campbell
On Thu, 2015-03-26 at 16:44 +, Andrew Cooper wrote: > As a result I don't think this is a feasible option, although it might > be a very good idea to have an opt-in restriction for guests which > actively wish to play nice. opt-in isn't very useful, my malicious guest simply wouldn't opt-in.

Re: [Xen-devel] [PATCH RFC 0/4] tools: Upstream blktap "2.5" as an external repo

2015-03-26 Thread Andrew Cooper
On 26/03/15 17:05, George Dunlap wrote: On 03/26/2015 04:25 PM, Felipe Franciosi wrote: Another thing I'd like to explore (since this took all of about an afternoon to get working) is what it would take to switch to using blktap3 instead. As I understand from my conversations with the XenServe

  1   2   3   >