[Xen-devel] [PATCH 0/2] VT-d flush issue

2015-12-03 Thread Quan Xu
This patches are based on Kevin Tian's previous discussion 'Revisit VT-d asynchronous flush issue'. Fix current timeout concern and also allow limited ATS support in a light way: 1. Reduce spin timeout to 1ms, which can be boot-time changed with 'iommu_qi_timeout_ms'. For example:

[Xen-devel] [PATCH 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-03 Thread Quan Xu
If IOTLB/Context/IETC flush is timeout, we should think all devices under this IOMMU cannot function correctly. So for each device under this IOMMU we'll mark it as unassignable and kill the domain owning the device. If Device-TLB flush is timeout, we'll mark the target ATS device as unassignable

[Xen-devel] [PATCH 1/2] VT-d: Reduce spin timeout to 1ms, which can be boot-time changed.

2015-12-03 Thread Quan Xu
Signed-off-by: Quan Xu --- xen/drivers/passthrough/vtd/qinval.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c index b81b0bd..990baf2 100644 --- a/xen/drivers/passthrough/vtd/qinval.c +++

Re: [Xen-devel] [PATCH 1/4] x86/HVM: don't inject #DB with error code

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 08:46, wrote: >> From: Jan Beulich >> Sent: Wednesday, November 11, 2015 1:38 AM >> >> Signed-off-by: Jan Beulich > > A simple description why error code is not required is preferred here. Well, anyone knowing what #DB means should also know that an error code is not only n

Re: [Xen-devel] [PATCH] iommu/quirk: disable shared EPT for Sandybridge and earlier processors.

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 03:40, wrote: > Just confirmed internally with HW team. On SNB 4KB cache is always > used regardless of 4KB/2MB/1GB mapping. There'd be another reason > for this 40% drop observation... So when they stated that the 4k TLB gets always used, did they at least provide some thought

Re: [Xen-devel] [PATCHv6] 00/28] Kconfig conversion

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 04:02, wrote: > There's been quite a few comments on this series and I'll admit I'm a > bit lost as to the requested direction for the series so just to clear > things up I'm going to send this out and address all the items before > the next repost. My goal is to save you all ti

Re: [Xen-devel] [PATCH 1/4] x86/HVM: don't inject #DB with error code

2015-12-03 Thread Tian, Kevin
> From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: Thursday, December 03, 2015 4:15 PM > > >>> On 03.12.15 at 08:46, wrote: > >> From: Jan Beulich > >> Sent: Wednesday, November 11, 2015 1:38 AM > >> > >> Signed-off-by: Jan Beulich > > > > A simple description why error code is not required

Re: [Xen-devel] [PATCH] iommu/quirk: disable shared EPT for Sandybridge and earlier processors.

2015-12-03 Thread Tian, Kevin
> From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: Thursday, December 03, 2015 4:18 PM > > >>> On 03.12.15 at 03:40, wrote: > > Just confirmed internally with HW team. On SNB 4KB cache is always > > used regardless of 4KB/2MB/1GB mapping. There'd be another reason > > for this 40% drop observ

Re: [Xen-devel] [V2 PATCH 9/9] x86/hvm: pkeys, add pkeys support for gva2gfn funcitons

2015-12-03 Thread Han, Huaitong
On Wed, 2015-12-02 at 04:35 -0700, Jan Beulich wrote: > >>> On 27.11.15 at 10:52, wrote: > > --- a/xen/arch/x86/hvm/hvm.c > > +++ b/xen/arch/x86/hvm/hvm.c > > @@ -4304,7 +4304,8 @@ static enum hvm_copy_result > > __hvm_clear(paddr_t addr, int size) > > p2m_type_t p2mt; > > char *p; > >

[Xen-devel] [PATCH v10 0/7] Add VT-d Posted-Interrupts support

2015-12-03 Thread Feng Wu
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. You can find the VT-d Posted-Interrtups Spec. in

[Xen-devel] [PATCH v10 1/7] VT-d Posted-intterrupt (PI) design

2015-12-03 Thread Feng Wu
Add the design doc for VT-d PI. CC: Kevin Tian CC: Jan Beulich CC: Keir Fraser CC: Andrew Cooper CC: George Dunlap Signed-off-by: Feng Wu Reviewed-by: Kevin Tian Reviewed-by: Konrad Rzeszutek Wilk --- v10: - Add some new definitions - Add more description in the vCPU block section - Use ch

[Xen-devel] [PATCH v10 2/7] vmx: Suppress posting interrupts when 'SN' is set

2015-12-03 Thread Feng Wu
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. CC: Kevin Tian CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper Signed-off-by: Feng Wu Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Ja

[Xen-devel] [PATCH v10 4/7] Update IRTE according to guest interrupt config changes

2015-12-03 Thread Feng Wu
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 lowest-priority interrupts, we use ve

[Xen-devel] [PATCH v10 5/7] vmx: Properly handle notification event when vCPU is running

2015-12-03 Thread Feng Wu
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. CC: Kevin Tian CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper Signed-of

[Xen-devel] [PATCH v10 7/7] Add a command line parameter for VT-d posted-interrupts

2015-12-03 Thread Feng Wu
Enable VT-d Posted-Interrupts and add a command line parameter for it. CC: Jan Beulich Signed-off-by: Feng Wu Reviewed-by: Kevin Tian Acked-by: Jan Beulich --- v6: - Change the default value to 'false' in xen-command-line.markdown docs/misc/xen-command-line.markdown | 9 - xen/driver

[Xen-devel] [PATCH v10 3/7] vt-d: Add API to update IRTE when VT-d PI is used

2015-12-03 Thread Feng Wu
This patch adds an API which is used to update the IRTE for posted-interrupt when guest changes MSI/MSI-X information. CC: Kevin Tian CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper Signed-off-by: Feng Wu Reviewed-by: Jan Beulich --- v10: - Add some comments v8: - Some minor adjustment v

[Xen-devel] [PATCH v10 6/7] vmx: VT-d posted-interrupt core logic handling

2015-12-03 Thread Feng Wu
This is the core logic handling for VT-d posted-interrupts. Basically it deals with how and when to update posted-interrupts during the following scenarios: - vCPU is preempted - vCPU is slept - vCPU is blocked When vCPU is preempted/slept, we update the posted-interrupts during scheduling by intr

Re: [Xen-devel] [PATCHv6] 02/28] build: build Kconfig and config rules

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 01:34, wrote: > On 12/1/15 5:22 AM, Jan Beulich wrote: > On 30.11.15 at 18:53, wrote: >>> On 11/30/15 8:36 AM, Jan Beulich wrote: >>> On 24.11.15 at 18:51, wrote: > +mainmenu "Xen/$SRCARCH $XEN_FULLVERSION Configuration" > + > +config SRCARCH > + string

Re: [Xen-devel] [PATCHv6] 04/28] build: convert HAS_PASSTHROUGH use to Kconfig

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 01:36, wrote: > On 11/30/15 8:50 AM, Jan Beulich wrote: > On 24.11.15 at 18:51, wrote: >>> @@ -348,9 +348,9 @@ static XSM_INLINE int >>> xsm_deassign_device(XSM_DEFAULT_ARG struct domain *d, uint >>> return xsm_default_action(action, current->domain, d); >>> } >>>

Re: [Xen-devel] [PATCH v2 4/4] x86/traps: honor EXT bit in error codes

2015-12-03 Thread Tian, Kevin
> From: Jan Beulich > Sent: Wednesday, November 11, 2015 5:23 PM > > The specification does not explicitly limit the use of this bit to > exceptions that can have selector style error codes, so to be on the > safe side we should deal with it being set even on error codes formally > documented to b

Re: [Xen-devel] [PATCHv6] 08/28] build: convert HAS_IOPORTS use to Kconfig

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 01:39, wrote: > On 11/30/15 9:01 AM, Jan Beulich wrote: > On 30.11.15 at 15:56, wrote: >> On 24.11.15 at 18:51, wrote: --- a/xen/drivers/char/Kconfig +++ b/xen/drivers/char/Kconfig @@ -3,3 +3,8 @@ config UART_NS16550 bool "16550-series UART suppo

Re: [Xen-devel] [PATCH 1/4] x86/HVM: don't inject #DB with error code

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 09:38, wrote: > btw are you still requiring Intel review for whole this patch set? still > looking at 4/4 now... Iirc the whole series went in meanwhile. I.e. I wouldn't call it "require", but "nice to have" (ensuring you don't spot an issue with what already got committed). J

[Xen-devel] [xen-4.6-testing test] 65299: regressions - FAIL

2015-12-03 Thread osstest service owner
flight 65299 xen-4.6-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/65299/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 16 guest-localmigrate/x10 fail in 65210 RE

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

2015-12-03 Thread Ian Campbell
On Thu, 2015-12-03 at 05:58 +, Tian, Kevin wrote: > > From: Ian Campbell [mailto:ian.campb...@citrix.com] > > Sent: Wednesday, December 02, 2015 9:51 PM > > > > > > According to > > > http://osstest.test-lab.xenproject.org/~osstest/pub/results/bisect/xe > > > n-un > > > stable/test-amd64-amd64

Re: [Xen-devel] [osstest test] 64958: regressions - trouble: broken/fail/pass

2015-12-03 Thread Ian Campbell
On Wed, 2015-12-02 at 18:33 -0700, Jim Fehlig wrote: > On 11/25/2015 08:32 AM, Ian Campbell wrote: > > On Wed, 2015-11-25 at 14:37 +, Ian Campbell wrote: > > > 2015-11-21 23:06:44 Z executing ssh ... root@172.16.144.44 virsh > > > domxml-from-native xen-xl /etc/xen/debian.jessie.guest.osstest.c

Re: [Xen-devel] Migration with linear p2m list

2015-12-03 Thread Andrew Cooper
On 03/12/15 07:41, Juergen Gross wrote: > I'm just working on a patch series to support migration via using > the virtual mapped linear p2m list. Migration seems to work quite > nice and now I'm looking into how to support changes of the p2m > list structure during migration. For this purpose we in

Re: [Xen-devel] [Minios-devel] [PATCH v4 0/] Begin to disentangle libxenctrl and provide some stable libraries

2015-12-03 Thread Ian Campbell
On Thu, 2015-11-19 at 16:20 +, Stefano Stabellini wrote: (Backing up this thread a bit). > > It seems like much of this would be candidates for adding to > > libxendevicemodel, but the underlying unstable interfaces pose a problem > > there. I'm going to leave this for another day. > > Does

Re: [Xen-devel] [PATCHv6] 00/28] Kconfig conversion

2015-12-03 Thread Ian Campbell
On Thu, 2015-12-03 at 01:29 -0700, Jan Beulich wrote: > > > > On 03.12.15 at 04:02, wrote: > > There's been quite a few comments on this series and I'll admit I'm a > > bit lost as to the requested direction for the series so just to clear > > things up I'm going to send this out and address all t

Re: [Xen-devel] [PATCHv2 2/3] mm: don't free pages until mm locks are released

2015-12-03 Thread Jan Beulich
>>> On 02.12.15 at 18:14, wrote: > On 02/12/15 16:46, Tim Deegan wrote: >> At 16:30 + on 02 Dec (1449073841), George Dunlap wrote: >>> On 02/12/15 16:23, Tim Deegan wrote: At 07:25 + on 02 Dec (1449041100), Tian, Kevin wrote: >> From: David Vrabel [mailto:david.vra...@citrix.com]

Re: [Xen-devel] Seeking input for 2016 Advisory Board budget (needed by Friday)

2015-12-03 Thread Dario Faggioli
On Wed, 2015-12-02 at 10:44 +, Lars Kurth wrote: > Hi everyone, > I am putting together the Advisory Board budget for 2016. Besides > items that are operational and spending on a new HW for the Test Lab, > are there any items which I should add that help the developer > community. > I think all

Re: [Xen-devel] [PATCH v2 0/3] VPMU fixes

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 07:16, wrote: >> From: Dietmar Hahn [mailto:dietmar.h...@ts.fujitsu.com] >> Sent: Wednesday, December 02, 2015 5:21 PM >> >> Am Mittwoch 02 Dezember 2015, 02:20:49 schrieb Tian, Kevin: >> > > From: Boris Ostrovsky [mailto:boris.ostrov...@oracle.com] >> > > Sent: Wednesday, Dec

Re: [Xen-devel] [V2 PATCH 1/9] x86/hvm: pkeys, add pkeys support for cpuid handling

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 02:53, wrote: > On Wed, 2015-12-02 at 04:06 -0700, Jan Beulich wrote: > >> > > ) >> > > +*ecx &= ~cpufeat_mask(X86_FEATURE_PKU); >> > > + >> > > +if ( (count == 0) && cpu_has_pku ) >> > > +*ecx |= (v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_PKE) >> >

Re: [Xen-devel] [V2 PATCH 8/9] x86/hvm: pkeys, add xstate support for pkeys

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 02:58, wrote: > On Wed, 2015-12-02 at 04:31 -0700, Jan Beulich wrote: >> > > > On 02.12.15 at 08:20, wrote: >> > > Does this even compile? There is already >> > > >> > > static void *get_xsave_addr(void *xsave, unsigned int >> > > xfeature_idx) >> > > >> > > higher in the sa

[Xen-devel] [PATCHv1] x86: rtc_cmos platform device requires legacy irqs

2015-12-03 Thread David Vrabel
Adding the rtc platform device when there are no legacy irqs (no legacy PIC) causes a conflict with other devices that end up using the same irq number. In a single VCPU Xen PV guest we should have: /proc/interrupts: CPU0 0: 4934 xen-percpu-virq timer0 1: 0 xe

Re: [Xen-devel] [V2 PATCH 9/9] x86/hvm: pkeys, add pkeys support for gva2gfn funcitons

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 09:50, wrote: > On Wed, 2015-12-02 at 04:35 -0700, Jan Beulich wrote: >> >>> On 27.11.15 at 10:52, wrote: >> > @@ -4439,7 +4443,8 @@ enum hvm_copy_result >> > hvm_copy_from_guest_virt_nofault( >> > { >> > return __hvm_copy(buf, vaddr, size, >> >HV

Re: [Xen-devel] [PATCH v2 0/3] VPMU fixes

2015-12-03 Thread Tian, Kevin
> From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: Thursday, December 03, 2015 6:36 PM > > >>> On 03.12.15 at 07:16, wrote: > >> From: Dietmar Hahn [mailto:dietmar.h...@ts.fujitsu.com] > >> Sent: Wednesday, December 02, 2015 5:21 PM > >> > >> Am Mittwoch 02 Dezember 2015, 02:20:49 schrieb Ti

Re: [Xen-devel] [PATCH] xen/arm: implement GICD_ICACTIVER read/write

2015-12-03 Thread Stefano Stabellini
On Mon, 30 Nov 2015, Julien Grall wrote: > Hi Stefano, > > On 25/11/15 16:40, Stefano Stabellini wrote: > > Implement GICD_ICACTIVER and GICD_ISACTIVER reads by looking for the > > GIC_IRQ_GUEST_ACTIVE bit in the relevant struct pending_irq. However > > given that the pending to active transaction

Re: [Xen-devel] unhandled word causes Xen crash with recent Linux kernels, was: Re: [PATCH v2 05/11] xen/arm: vgic: Properly emulate the full register

2015-12-03 Thread Stefano Stabellini
On Mon, 30 Nov 2015, Ian Campbell wrote: > On Mon, 2015-11-30 at 12:22 +, Julien Grall wrote: > > Hi Ian, > > > > On 25/11/15 12:26, Ian Campbell wrote: > > > On Wed, 2015-11-25 at 12:15 +, Stefano Stabellini wrote: > > > > On Wed, 25 Nov 2015, Shannon Zhao wrote: > > > > > Upstream Linux k

Re: [Xen-devel] [PATCHv2 2/3] mm: don't free pages until mm locks are released

2015-12-03 Thread George Dunlap
On Thu, Dec 3, 2015 at 10:22 AM, Jan Beulich wrote: On 02.12.15 at 18:14, wrote: >> On 02/12/15 16:46, Tim Deegan wrote: >>> At 16:30 + on 02 Dec (1449073841), George Dunlap wrote: On 02/12/15 16:23, Tim Deegan wrote: > At 07:25 + on 02 Dec (1449041100), Tian, Kevin wrote: >

Re: [Xen-devel] [V2 PATCH 8/9] x86/hvm: pkeys, add xstate support for pkeys

2015-12-03 Thread Andrew Cooper
On 03/12/15 01:58, Han, Huaitong wrote: > On Wed, 2015-12-02 at 04:31 -0700, Jan Beulich wrote: > On 02.12.15 at 08:20, wrote: Does this even compile? There is already static void *get_xsave_addr(void *xsave, unsigned int xfeature_idx) higher in the same file. >>

Re: [Xen-devel] [PATCHv6] 00/28] Kconfig conversion

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 10:50, wrote: > On Thu, 2015-12-03 at 01:29 -0700, Jan Beulich wrote: >> > > > On 03.12.15 at 04:02, wrote: >> > 1. Remove the KEXEC patch from this series and add it to the follow-on >> > series? >> >> I don't mind it being in the initial series. All I do mind is it being don

Re: [Xen-devel] [PATCH v2 0/3] VPMU fixes

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 11:46, wrote: >> From: Jan Beulich [mailto:jbeul...@suse.com] >> Sent: Thursday, December 03, 2015 6:36 PM >> >> >>> On 03.12.15 at 07:16, wrote: >> >> From: Dietmar Hahn [mailto:dietmar.h...@ts.fujitsu.com] >> >> Sent: Wednesday, December 02, 2015 5:21 PM >> >> >> >> Am Mit

[Xen-devel] [PATCH] ignore writes to GICD_ICACTIVER ... GICD_ICACTIVERN

2015-12-03 Thread Stefano Stabellini
Injecting a fault to the guest just because it is writing to one of the GICD_ICACTIVER registers, which are part of the GICv2 and GICv3 specs, is harsh. Additionally it causes recent linux kernels to fail to boot on Xen. Ignore writes to GICD_ICACTIVER ... GICD_ICACTIVERN instead, to solve the boo

Re: [Xen-devel] Emulating in response of an int3 vm_event

2015-12-03 Thread Jan Beulich
>>> On 02.12.15 at 19:34, wrote: > On 02/12/15 18:21, Tamas K Lengyel wrote: >> Why would that vmread fail there and why would the call trace tell me >> it's in vmx_vmenter_helper? > > The symbol information is incorrect because of the bugframe being inside > an UNLIKELY() block. > > I have a pa

Re: [Xen-devel] [PATCHv6] 00/28] Kconfig conversion

2015-12-03 Thread Ian Campbell
On Thu, 2015-12-03 at 04:00 -0700, Jan Beulich wrote: > > > > On 03.12.15 at 10:50, wrote: > > On Thu, 2015-12-03 at 01:29 -0700, Jan Beulich wrote: > > > > > > On 03.12.15 at 04:02, wrote: > > > > 1. Remove the KEXEC patch from this series and add it to the > > > > follow-on > > > > series? > >

Re: [Xen-devel] [PATCH v10 0/7] Add VT-d Posted-Interrupts support

2015-12-03 Thread Jan Beulich
>>> On 03.12.15 at 09:35, 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. > > You

Re: [Xen-devel] [PATCH] iommu/quirk: disable shared EPT for Sandybridge and earlier processors.

2015-12-03 Thread Andrew Cooper
On 03/12/15 08:50, Tian, Kevin wrote: >> From: Jan Beulich [mailto:jbeul...@suse.com] >> Sent: Thursday, December 03, 2015 4:18 PM >> > On 03.12.15 at 03:40, wrote: >>> Just confirmed internally with HW team. On SNB 4KB cache is always >>> used regardless of 4KB/2MB/1GB mapping. There'd be ano

[Xen-devel] [Minios-devel] [PATCH v6 0/] Begin to disentangle libxenctrl and provide some stable libraries

2015-12-03 Thread Ian Campbell
In <1431963008.4944.80.ca...@citrix.com> I proposed stabilising some parts of the libxenctrl API/ABI by disaggregating into separate libraries. This is v6 of that set of series against: xen qemu-xen qemu-xen-traditional mini-os NB: Samuel+minios-devel will only get the mini-os sid

[Xen-devel] [PATCH XEN v6 06/32] tools/libxc: Remove osdep indirection for xc_evtchn

2015-12-03 Thread Ian Campbell
The alternative backend (a xen-api/xapi shim) is no longer around and so this stuff is now just baggage which is getting in the way of refactoring libxenctrl. Note that the intention is to move this into a separate library shortly. Nested virt probably suffices for this use case now. One incorre

[Xen-devel] [PATCH XEN v6 23/32] tools/libs/evtchn: Review and update doc comments.

2015-12-03 Thread Ian Campbell
Remove the reference to pre-4.1, since this is now a new library. Fixup references to xc. Signed-off-by: Ian Campbell Acked-by: Wei Liu Acked-by: Ian Jackson --- tools/libs/evtchn/include/xenevtchn.h | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/libs/evtchn/i

[Xen-devel] [PATCH XEN v6 17/32] tools/libs/foreignmemory: provide xenforeignmemory_unmap.

2015-12-03 Thread Ian Campbell
And require it be used instead of direct munmap. This will allow e.g. Valgrind hooks to help track incorrect use of foreign mappings. Switch all uses of xenforeignmemory_map to use xenforeignmemory_unmap, not that foreign mappings via the libxc compat xc_map_foreign_* interface will not take adva

[Xen-devel] [PATCH XEN v6 14/32] tools: Remove xc_map_foreign_batch

2015-12-03 Thread Ian Campbell
It can trivially be replaced by xc_map_foreign_pages which is the interface I want to move to going forward (by standardising on _bulk but handling err=NULL as _pages does). The callers of _batch are checking a mixture of a NULL return or looking to see if the top nibble of the (usually sole) mfn

[Xen-devel] [PATCH XEN v6 20/32] tools/libs/foreignmemory: Support err == NULL to map.

2015-12-03 Thread Ian Campbell
The existing xc_map_foreign_bulk-like interface encourages callers to miss error checking for partial failure (by forgetting to scan the err array). Add support for passing err==NULL which behaves in a xc_map_foreign_pages-like manner and returns a global error for any failure. While documenting

[Xen-devel] [PATCH XEN v6 15/32] tools: Implement xc_map_foreign_range(s) in terms of common helper

2015-12-03 Thread Ian Campbell
Both Linux and FreeBSD already implemented these functions using identical helpers based on xc_map_foreign_pages. Make one copy of these common helpers and switch all OSes to use them, even those which previously had a specific lower level implementation of this functionality. This is makes two fe

[Xen-devel] [PATCH XEN v6 02/32] mce-test: do not include libxenguest internal headers

2015-12-03 Thread Ian Campbell
As far as I can tell there is no requirement for these and it builds fine without them. Signed-off-by: Ian Campbell --- v6: New patch --- tools/tests/mce-test/tools/Makefile | 2 -- tools/tests/mce-test/tools/xen-mceinj.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/tools/tests/mce-

[Xen-devel] [PATCH XEN v6 09/32] tools/libxc: Remove osdep indirection for xc_gnt{shr, tab}

2015-12-03 Thread Ian Campbell
The alternative backend (a xen-api/xapi shim) is no longer around and so this stuff is now just baggage which is getting in the way of refactoring libxenctrl. Nested virt probably suffices for this use case now. It is now necessary to provide explicit versions of things for platforms which do not

[Xen-devel] [PATCH XEN v6 22/32] tools/libs/foreignmemory: optimise map(num==1, err==NULL) case

2015-12-03 Thread Ian Campbell
This looks to be a reasonably common case (many of the previous callers to xc_map_foreign_pages use it) and it is easy enough to avoid a malloc for it. Signed-off-by: Ian Campbell --- v6: New I'm not 100% sure this is worth the complexity, hence not folding into the base patch yet, it could easi

[Xen-devel] [PATCH XEN v6 08/32] tools: Arrange to check public headers for ANSI compatiblity

2015-12-03 Thread Ian Campbell
Using the same rune as we use for the Xen public headers, except we do not need stdint.h here and we use -pedantic too. Signed-off-by: Ian Campbell Acked-by: Wei Liu --- .gitignore | 2 ++ tools/Rules.mk | 8 tools/libs/evtchn/Makefile | 4 +++- tools/lib

[Xen-devel] [PATCH XEN v6 11/32] tools/libxc: Remove osdep indirection for privcmd

2015-12-03 Thread Ian Campbell
The alternative backend (a xen-api/xapi shim) is no longer around and so this stuff is now just baggage which is getting in the way of refactoring libxenctrl. Nested virt probably suffices for this use case now. This was the last component of the osdep infrastructure, so all the dynamic loading e

[Xen-devel] [PATCH XEN v6 16/32] tools: Refactor foreign memory mapping into libxenforeignmemory

2015-12-03 Thread Ian Campbell
libxenforeignmemory will provide a stable API and ABI for mapping foreign domain memory (subject to appropriate privileges). The new library exposes an interface equivalent to xc_map_foreign_memory_bulk, which all the other xc_map_foreign_memory_* functions (which remain in libxc) are implemented

[Xen-devel] [PATCH XEN v6 00/32] Begin to disentangle libxenctrl and provide some stable libraries

2015-12-03 Thread Ian Campbell
We intend to stabilise some parts of the libxenctrl interface by splitting out some functionality into separate stable libraries. This is the xen part of the first phase of that change. This mail is (or is intended to be) a reply to a "0/" super-intro mail covering all of the related patch series

[Xen-devel] [PATCH XEN v6 19/32] tools/libs/foreignmemory: Mention restrictions on fork in docs.

2015-12-03 Thread Ian Campbell
Signed-off-by: Ian Campbell Acked-by: Wei Liu --- v6: Also discuss recovering the memory. --- tools/libs/foreignmemory/include/xenforeignmemory.h | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/libs/foreignmemory/include/xenforeignmemory.h b/tools/libs/fo

[Xen-devel] [PATCH XEN v6 13/32] tools/libxc: drop xc_map_foreign_bulk_compat wrappers

2015-12-03 Thread Ian Campbell
On Solaris and NetBSD xc_map_foreign_bulk is implemented by calling xc_map_foreign_bulk_compat and xc_map_foreign_bulk_compat is exposed as a symbol by libxenctrl.so. Remove these wrappers and turn the compat function into the real thing surrounded by the appropriate ifdef. As this is a compat fu

[Xen-devel] [PATCH XEN v6 05/32] tools: Refactor "xentoollog" into its own library

2015-12-03 Thread Ian Campbell
In attempting to disaggregate libxenctrl I found that many of the pieces were going to want access to this library, so split it out (as it probably should always have been). Various build adjustments are needed. In particular things which use xtl_* themselves now need to explicity link against the

[Xen-devel] [PATCH XEN v6 32/32] HACK: Update Config.mk to pull all the right bits from my xenbits trees

2015-12-03 Thread Ian Campbell
v4: Config.mk instead of .config --- Config.mk | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Config.mk b/Config.mk index 64fcf1b..09c6e80 100644 --- a/Config.mk +++ b/Config.mk @@ -242,20 +242,20 @@ endif ifeq ($(GIT_HTTP),y) OVMF_UPSTREAM_URL ?= http:/

[Xen-devel] [PATCH XEN v6 25/32] tools/libs/gnttab: Extensive updates to API documentation.

2015-12-03 Thread Ian Campbell
In particular around error handling, behaviour on fork and the unmap notification mechanism. Behaviour of xengnttab_map_*grant_refs and xengntshr_share_pages on partial failure has been confirmed/inferred (by inspection) on Linux and Mini-os (the only two known implementations. Likewise the behavi

[Xen-devel] [PATCH XEN v6 10/32] tools: Refactor /dev/xen/gnt{dev, shr} wrappers into libxengnttab.

2015-12-03 Thread Ian Campbell
libxengnttab will provide a stable API and ABI for accessing the grant table devices. The functions are moved into the xengnt{tab,shr} namespace to make a clean break from libxc and avoid ambiguity regarding which interfaces are stable. All in-tree users are updated to use the new names. Upon re

[Xen-devel] [PATCH XEN v6 01/32] x86/libxc: add an arch domain config parameter to xc_domain_create

2015-12-03 Thread Ian Campbell
From: Roger Pau Monne With the addition of HVMlite the hypervisor now always requires a non-null arch domain config, which is different between HVM and PV guests. Add a new parameter to xc_domain_create that contains a pointer to an arch domain config. If the pointer is null, create a default ar

[Xen-devel] [PATCH XEN v6 03/32] tools/ocaml: simplify compile/link of test apps

2015-12-03 Thread Ian Campbell
xtl doesn't require the full LDLIBS_libxenctrl, just the -L and xenlight.cmxa, the latter which contains LDLIBS_libxenctrl as needed. Fixing this avoids the need to be concerned about LDLIBS_libxenctrl becoming more than one word in the future. Since the tests are pure ocaml (no C components) CFLA

[Xen-devel] [PATCH XEN v6 24/32] tools/libs: Clean up hard tabs.

2015-12-03 Thread Ian Campbell
These were wrong in the context of libxc before this code was extracted, clean them up. Also add some emacs magic blocks Signed-off-by: Ian Campbell Acked-by: Wei Liu --- tools/libs/call/buffer.c | 4 ++-- tools/libs/call/core.c| 2 +- tools/libs/call/minios.c

[Xen-devel] [PATCH XEN v6 27/32] tools/libs/call: Describe return values and error semantics for xencall*

2015-12-03 Thread Ian Campbell
This behaviour has been confirmed by inspection on: - Linux - FreeBSD (NB: hcall->retval is the hypercall return value only for values >= 0. For negative values the underlying privcmd driver translates the value from Xen to FreeBSD errno space and returns it as the result of the ioctl,

[Xen-devel] [PATCH XEN v6 21/32] tools/libs/foreignmemory: pull array length argument to map forward

2015-12-03 Thread Ian Campbell
By having the "num" argument before the page and error arrays we can potentially use a variable-length-array argument ("int pages[num]") in the function prototype. However VLAs are a C99 feature and we are currently targetting C89 and later, so we don't actually make use of this here, merely arran

[Xen-devel] [PATCH XEN v6 04/32] tools/Rules.mk: Properly handle libraries with recursive dependencies.

2015-12-03 Thread Ian Campbell
In tree libraries which link against other in tree libraries in a way which is opaque to their callers need special handling, specifically correct use of -Wl,-rpath-link for the recusively used libraries. Currently this is rather simple, but up coming changes are going to introduce transitive depe

[Xen-devel] [PATCH XEN v6 18/32] tools/libs/foreignmemory: use size_t for size arguments.

2015-12-03 Thread Ian Campbell
Surprisingly it appears no callers need updating. Signed-off-by: Ian Campbell Acked-by: Wei Liu Acked-by: Ian Jackson --- v4: New patch --- tools/libs/foreignmemory/compat.c | 2 +- tools/libs/foreignmemory/freebsd.c | 4 ++-- .../libs/foreignmemory/include/x

[Xen-devel] [PATCH XEN v6 28/32] tools/libs/call: Avoid xc_memalign in netbsd and solaris backends

2015-12-03 Thread Ian Campbell
These are already arch specific, so just use the appropriate interfaces (as determined by looking at the xc_memalign backend). Signed-off-by: Ian Campbell Acked-by: Wei Liu --- tools/libs/call/netbsd.c | 4 ++-- tools/libs/call/solaris.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)

[Xen-devel] [PATCH QEMU-XEN v6 1/8] xen_console: correctly cleanup primary console on teardown.

2015-12-03 Thread Ian Campbell
All of the work in con_disconnect applies to the primary console case (when xendev->dev is NULL). Therefore remove the early check and bail and allow it to fall through. All of the existing code is correctly conditional already. The ->dev and ->gnttabdev handles are either both set or neither. For

[Xen-devel] [PATCH XEN v6 29/32] tools/libs/call: Use O_CLOEXEC when opening /dev/xen/privcmd on Linux

2015-12-03 Thread Ian Campbell
We stick with using FD_CLOEXEC on the legacy /proc/xen/privcmd fallback device since it was present in older kernel where O_CLOEXEC may not be assured. Signed-off-by: Ian Campbell --- v6: New --- tools/libs/call/linux.c | 57 - 1 file changed, 37 i

[Xen-devel] [PATCH QEMU-XEN v6 0/8] Begin to disentangle libxenctrl and provide some stable libraries

2015-12-03 Thread Ian Campbell
We intend to stabilise some parts of the libxenctrl interface by splitting out some functionality into separate stable libraries. This is the qemu-xen part of the first phase of that change. This mail is (or is intended to be) a reply to a "0/" super-intro mail covering all of the related patch s

[Xen-devel] [PATCH XEN v6 26/32] tools/libs/call: Update some log messages to not refer to xc.

2015-12-03 Thread Ian Campbell
Signed-off-by: Ian Campbell Acked-by: Wei Liu --- tools/libs/call/linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libs/call/linux.c b/tools/libs/call/linux.c index 55e1e83..3641e41 100644 --- a/tools/libs/call/linux.c +++ b/tools/libs/call/linux.c @@ -94,7 +

[Xen-devel] [PATCH QEMU-XEN-TRADITIONAL v6 0/5] Begin to disentangle libxenctrl and provide some stable libraries

2015-12-03 Thread Ian Campbell
We intend to stabilise some parts of the libxenctrl interface by splitting out some functionality into separate stable libraries. This is the qemu-xen-traditional part of the first phase of that change. This mail is (or is intended to be) a reply to a "0/" super-intro mail covering all of the rel

[Xen-devel] [PATCH QEMU-XEN v6 8/8] xen: make it possible to build without the Xen PV domain builder

2015-12-03 Thread Ian Campbell
Until the previous patch this relied on xc_fd(), which was only implemented for Xen 4.0 and earlier. Given this wasn't working since Xen 4.0 I have marked this as disabled by default. Removing this support drops the use of a bunch of symbols from libxenctrl, specifically: - xc_domain_create

[Xen-devel] [PATCH XEN v6 31/32] tools: Update CFLAGS for qemu-xen to allow it to use new libraries

2015-12-03 Thread Ian Campbell
This means adding -L for libxen{evtchn,gnttab,foreignmemory} so that it can link them directly (rather than using the libxenctrl compat layer exposed via -rpath-link). Also add -I for libxenforeignmemory. Signed-off-by: Ian Campbell Acked-by: Wei Liu --- tools/Makefile | 4 1 file changed,

[Xen-devel] [PATCH XEN v6 30/32] tools/libs/call: linux: avoid forking between mmap and madvise

2015-12-03 Thread Ian Campbell
Use pthread_atfork to prevent the application from forking before the madvisoe(), which would result in CoW mappings getting passed to hypercalls. (largely cribbed from libxl_fork.c) Signed-off-by: Ian Campbell --- v6: New --- tools/libs/call/buffer.c | 2 +- tools/libs/call/linux.c | 66

[Xen-devel] [PATCH QEMU-XEN v6 3/8] xen: Switch to libxengnttab interface for compat shims.

2015-12-03 Thread Ian Campbell
In Xen 4.7 we are refactoring parts libxenctrl into a number of separate libraries which will provide backward and forward API and ABI compatiblity. One such library will be libxengnttab which provides access to grant tables. In preparation for this switch the compatibility layer in xen_common.h

[Xen-devel] [PATCH QEMU-XEN-TRADITIONAL v6 1/5] qemu-xen-traditional: Use xentoollog as a separate library

2015-12-03 Thread Ian Campbell
This has been split out of libxenctrl, so the build needs to be able to find the header and the library. QEMU does not use xtl_* itself so -rpath-link is sufficient to allow linking to libxenctrl.so (which links against libxentoollog). Signed-off-by: Ian Campbell Acked-by: Ian Jackson --- v3: L

[Xen-devel] [PATCH QEMU-XEN-TRADITIONAL v6 5/5] qemu-xen-traditional: Add libxenforeignmemory to rpath-link

2015-12-03 Thread Ian Campbell
libxenctrl links against this library. Also, request the compat xc_map_foreign API from libxc. Signed-off-by: Ian Campbell Acked-by: Ian Jackson --- v3: Library moved to tools/libs/ --- xen-hooks.mak | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen-hooks.mak b/xen-hooks.mak index 229d

[Xen-devel] [PATCH XEN v6 12/32] tools: Refactor hypercall calling wrappers into libxencall.

2015-12-03 Thread Ian Campbell
libxencall will provide a stable API and ABI for calling hypercalls (although those hypercalls themselves may not have a stable API). As well as the hypercall buffer infrastructure needed in order to safely provide pointer arguments to hypercalls. libxenctrl encapsulates a instance of this interfa

[Xen-devel] [PATCH QEMU-XEN-TRADITIONAL v6 2/5] qemu-xen-traditional: Use libxenevtchn

2015-12-03 Thread Ian Campbell
/dev/xen/evtchn related wrappers have been moved out of libxenctrl into their own library. Note that i386-dm/helper2.c's xc_interface * was always really an xc_evtchn *, it's just they used to be typedefs to the same thing... Signed-off-by: Ian Campbell Acked-by: Ian Jackson --- v3: Library mov

[Xen-devel] [PATCH QEMU-XEN v6 2/8] xen: Switch to libxenevtchn interface for compat shims.

2015-12-03 Thread Ian Campbell
In Xen 4.7 we are refactoring parts libxenctrl into a number of separate libraries which will provide backward and forward API and ABI compatiblity. One such library will be libxenevtchn which provides access to event channels. In preparation for this switch the compatibility layer in xen_common.

[Xen-devel] [PATCH QEMU-XEN v6 5/8] xen: Switch uses of xc_map_foreign_{pages, bulk} to use libxenforeignmemory API.

2015-12-03 Thread Ian Campbell
In Xen 4.7 we are refactoring parts libxenctrl into a number of separate libraries which will provide backward and forward API and ABI compatiblity. One such library will be libxenforeignmemory which provides access to privileged foreign mappings and which will provide an interface equivalent to x

[Xen-devel] [PATCH QEMU-XEN-TRADITIONAL v6 3/5] qemu-xen-traditional: Use libxengnttab

2015-12-03 Thread Ian Campbell
/dev/xen/gntdev related wrappers have been moved out of libxenctrl into their own library. Signed-off-by: Ian Campbell Acked-by: Ian Jackson --- v3: Library moved to tools/libs/ --- hw/xen_backend.c | 4 ++-- hw/xen_backend.h | 2 +- hw/xen_common.h | 1 + hw/xen_console.c | 4 ++-- hw/xen

[Xen-devel] [PATCH QEMU-XEN v6 7/8] xen: domainbuild: reopen libxenctrl interface after forking for domain watcher.

2015-12-03 Thread Ian Campbell
Using an existing libxenctrl handle after a fork was never particularly safe (especially if foreign mappings existed at the time of the fork) and the xc fd has been unavailable for many releases. Reopen the handle after fork and therefore do away with xc_fd(). Signed-off-by: Ian Campbell Acked-b

[Xen-devel] [PATCH QEMU-XEN v6 6/8] xen: Use stable library interfaces when they are available.

2015-12-03 Thread Ian Campbell
In Xen 4.7 we are refactoring parts libxenctrl into a number of separate libraries which will provide backward and forward API and ABI compatiblity. Specifically libxenevtchn, libxengnttab and libxenforeignmemory. Previous patches have already laid the groundwork for using these by switching the

[Xen-devel] [PATCH MINI-OS v6 1/5] mini-os: Include libxentoollog with libxc

2015-12-03 Thread Ian Campbell
libxentoollog has just been split out from libxc. From mini-os's point of view we don't care about the distinction, so keep things simple by just including libxentoollog if libxc is enabled. Signed-off-by: Ian Campbell Acked-by: Samuel Thibault Acked-by: Wei Liu --- v2: Adjust for libs/$lib lay

[Xen-devel] [PATCH QEMU-XEN v6 4/8] xen: Switch uses of xc_map_foreign_range into xc_map_foreign_pages

2015-12-03 Thread Ian Campbell
In Xen 4.7 we are refactoring parts libxenctrl into a number of separate libraries which will provide backward and forward API and ABI compatiblity. One such library will be libxenforeignmemory which provides access to privileged foreign mappings and which will provide an interface equivalent to x

[Xen-devel] [PATCH QEMU-XEN-TRADITIONAL v6 4/5] qemu-xen-traditional: Add libxencall to rpath-link

2015-12-03 Thread Ian Campbell
libxenctrl links against this library Signed-off-by: Ian Campbell Acked-by: Ian Jackson --- v3: Library moved to tools/libs --- xen-hooks.mak | 1 + 1 file changed, 1 insertion(+) diff --git a/xen-hooks.mak b/xen-hooks.mak index 179a6b7..229d642 100644 --- a/xen-hooks.mak +++ b/xen-hooks.mak @

[Xen-devel] [PATCH MINI-OS v6 0/5] Begin to disentangle libxenctrl and provide some stable libraries

2015-12-03 Thread Ian Campbell
We intend to stabilise some parts of the libxenctrl interface by splitting out some functionality into separate stable libraries. This is the mini-os part of the first phase of that change. This mail is (or is intended to be) a reply to a "0/" super-intro mail covering all of the related patch se

[Xen-devel] [PATCH MINI-OS v6 4/5] mini-os: Include libxencall with libxc

2015-12-03 Thread Ian Campbell
libxencall has just been split out from libxc. From mini-os's point of view we don't care about the distinction, so keep things simple by just including libxencall if libxc is enabled. Signed-off-by: Ian Campbell Acked-by: Samuel Thibault Acked-by: Wei Liu --- v2: Adjust for libs/$lib layout. -

Re: [Xen-devel] [PATCH] iommu/quirk: disable shared EPT for Sandybridge and earlier processors.

2015-12-03 Thread Andrew Cooper
On 03/12/15 01:19, Tian, Kevin wrote: >> From: Andrew Cooper [mailto:andrew.coop...@citrix.com] >> Sent: Thursday, November 26, 2015 9:56 PM >> >> On 26/11/15 13:48, Malcolm Crossley wrote: >>> On 26/11/15 13:46, Jan Beulich wrote: >>> On 25.11.15 at 11:28, wrote: > The problem is that San

[Xen-devel] [PATCH MINI-OS v6 5/5] mini-os: Include libxenforeignmemory with libxc

2015-12-03 Thread Ian Campbell
libxenforeignmemory has just been split out from libxc. From mini-os's point of view we don't care about the distinction, so keep things simple by just including libxenforeignmemory if libxc is enabled. Signed-off-by: Ian Campbell Acked-by: Samuel Thibault Acked-by: Wei Liu --- v2: Adjust for l

  1   2   >