Re: [Xen-devel] [PATCH 4/4] x86: add multiboot2 protocol support for EFI platforms

2017-01-16 Thread Doug Goldstein
On 1/16/17 7:02 AM, Jan Beulich wrote: On 13.01.17 at 20:21, wrote: >> Doug v1 - fix incorrect assembly (identified by Andrew Cooper) >> - fix issue where the trampoline size was left as 0 and the >> way the memory is allocated for the trampolines we

Re: [Xen-devel] [PATCH V3] x86/HVM: Introduce struct hvm_pi_ops

2017-01-16 Thread Suravee Suthikulpanit
Kevin, On 1/16/17 09:13, Tian, Kevin wrote: diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 7b2c50c..0854e17 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -103,6 +103,47 @@ void vmx_pi_per_cpu_init(unsigned int cpu)

Re: [Xen-devel] IOMMU fault with IGD passthrough setup on XEN 4.8.0

2017-01-16 Thread G.R.
On Mon, Jan 16, 2017 at 8:37 PM, Jan Beulich wrote: > >>> On 16.01.17 at 10:25, wrote: > > Here are some relevant logs, please help comment what's going on here and > > what's the next step of diagnose. > > It appears that the fault address

Re: [Xen-devel] [PATCH 4/4] x86: add multiboot2 protocol support for EFI platforms

2017-01-16 Thread Doug Goldstein
On 1/16/17 7:50 AM, Daniel Kiper wrote: > On Mon, Jan 16, 2017 at 05:02:05AM -0700, Jan Beulich wrote: > On 13.01.17 at 20:21, wrote: >>> Doug v1 - fix incorrect assembly (identified by Andrew Cooper) >>> - fix issue where the trampoline size was left as 0 and the

Re: [Xen-devel] [PATCH V3] x86/HVM: Introduce struct hvm_pi_ops

2017-01-16 Thread Suravee Suthikulpanit
Jan, I would like to updated the following to be more correct. On 1/12/17 19:37, Jan Beulich wrote: On 12.01.17 at 05:47, wrote: --- a/xen/include/asm-x86/hvm/domain.h +++ b/xen/include/asm-x86/hvm/domain.h @@ -72,6 +72,38 @@ struct hvm_ioreq_server {

Re: [Xen-devel] [PATCH] xen/common: Drop function calls for Xen compile/version information

2017-01-16 Thread Andrew Cooper
On 16/01/17 13:18, Jan Beulich wrote: On 16.01.17 at 14:04, wrote: >> The chageset/version/compile information is currently exported as a set of >> function calls into a separate translation unit, which is inefficient for all >> callers. >> >> Replace the function

Re: [Xen-devel] [PATCH] x86/pv: Check that emulate_privileged_op() don't change any unexpected flags

2017-01-16 Thread Jan Beulich
>>> On 16.01.17 at 14:03, wrote: > No bits, other than arithmetic ones and the resume flag (which will most > likely change from 1 to 0), can be changed by the instructions we permit. > Extend the check to cover other flags. > > Signed-off-by: Andrew Cooper

Re: [Xen-devel] [PATCH] xen/common: Drop function calls for Xen compile/version information

2017-01-16 Thread Jan Beulich
>>> On 16.01.17 at 14:04, wrote: > The chageset/version/compile information is currently exported as a set of > function calls into a separate translation unit, which is inefficient for all > callers. > > Replace the function calls with externs pointing appropriately

[Xen-devel] [PATCH] xen/common: Drop function calls for Xen compile/version information

2017-01-16 Thread Andrew Cooper
The chageset/version/compile information is currently exported as a set of function calls into a separate translation unit, which is inefficient for all callers. Replace the function calls with externs pointing appropriately into .rodata, which allows all users to generate code referencing the

[Xen-devel] [PATCH] x86/pv: Check that emulate_privileged_op() don't change any unexpected flags

2017-01-16 Thread Andrew Cooper
No bits, other than arithmetic ones and the resume flag (which will most likely change from 1 to 0), can be changed by the instructions we permit. Extend the check to cover other flags. Signed-off-by: Andrew Cooper --- CC: Jan Beulich v2: * Extend

Re: [Xen-devel] [PATCH 3/8] x86emul: support BMI1 insns

2017-01-16 Thread Jan Beulich
>>> On 16.01.17 at 13:43, wrote: On 16.01.17 at 12:59, wrote: >> On 16/01/17 11:19, Jan Beulich wrote: >> On 13.01.17 at 18:40, wrote: On 13/01/17 15:31, Jan Beulich wrote: > @@ -5866,6 +5879,67 @@

Re: [Xen-devel] [PATCH] x86/hvm: Conditionally leave CPUID Faulting active in HVM context

2017-01-16 Thread Jan Beulich
>>> On 16.01.17 at 12:17, wrote: > If the hardware supports faulting, and the guest has chosen to use it, leave > faulting active in HVM context. > > It is more efficient to have hardware convert CPUID to a #GP fault (which we > don't intercept), than to take a VMExit

Re: [Xen-devel] [PATCH 4/4] x86: add multiboot2 protocol support for EFI platforms

2017-01-16 Thread Daniel Kiper
On Mon, Jan 16, 2017 at 05:02:05AM -0700, Jan Beulich wrote: > >>> On 13.01.17 at 20:21, wrote: > > Doug v1 - fix incorrect assembly (identified by Andrew Cooper) > > - fix issue where the trampoline size was left as 0 and the > > way the memory is allocated

Re: [Xen-devel] [PATCH] x86/emul: Calculate not_64bit during instruction decode

2017-01-16 Thread Jan Beulich
>>> On 16.01.17 at 11:49, wrote: > ... rather than repeating "generate_exception_if(mode_64bit(), EXC_UD);" in > the emulation switch statement. > > Bloat-o-meter shows: > > add/remove: 0/0 grow/shrink: 1/2 up/down: 8/-495 (-487) > function

Re: [Xen-devel] [PATCH 3/8] x86emul: support BMI1 insns

2017-01-16 Thread Jan Beulich
>>> On 16.01.17 at 12:59, wrote: > On 16/01/17 11:19, Jan Beulich wrote: > On 13.01.17 at 18:40, wrote: >>> On 13/01/17 15:31, Jan Beulich wrote: @@ -5866,6 +5879,67 @@ x86_emulate( break; #endif +

Re: [Xen-devel] [PATCH v3 4/5] Xen: Select correct dom0 console

2017-01-16 Thread Julien Grall
Hi Mark, On 03/01/17 17:29, Mark Rutland wrote: On Thu, Dec 15, 2016 at 12:27:17PM +, Andre Przywara wrote: From: Ian Campbell If Xen is enabled, tell Dom0 to use the 'hvc0' console, and fall back to the usual ttyAMA0 otherwise. Signed-off-by: Ian Campbell

Re: [Xen-devel] IOMMU fault with IGD passthrough setup on XEN 4.8.0

2017-01-16 Thread Jan Beulich
>>> On 16.01.17 at 10:25, wrote: > Here are some relevant logs, please help comment what's going on here and > what's the next step of diagnose. > It appears that the fault address 0xcfxx falls within the host RMRR > region. Might be a problem in the RMRR

Re: [Xen-devel] xc_evtchn_status fails with EFAULT on HVM, the same on PV works

2017-01-16 Thread Jan Beulich
>>> On 14.01.17 at 03:52, wrote: > On Sat, Jan 14, 2017 at 01:47:49AM +, Andrew Cooper wrote: >> In a native situation, SMAP raises #PF if hardware tries to follow a >> user pointer outside of an area whitelisted by the kernel. (The >> copy_*_guest path

Re: [Xen-devel] [PATCH 4/4] x86: add multiboot2 protocol support for EFI platforms

2017-01-16 Thread Jan Beulich
>>> On 13.01.17 at 20:21, wrote: > Doug v1 - fix incorrect assembly (identified by Andrew Cooper) > - fix issue where the trampoline size was left as 0 and the > way the memory is allocated for the trampolines we would go to > the end of an available

Re: [Xen-devel] [PATCH 3/8] x86emul: support BMI1 insns

2017-01-16 Thread Andrew Cooper
On 16/01/17 11:19, Jan Beulich wrote: On 13.01.17 at 18:40, wrote: >> On 13/01/17 15:31, Jan Beulich wrote: >>> @@ -5866,6 +5879,67 @@ x86_emulate( >>> break; >>> #endif >>> >>> +case X86EMUL_OPC_VEX(0x0f38, 0xf2):/* andn r/m,r,r */ >>> +

Re: [Xen-devel] [PATCH 0/4] multiboot2 protocol support

2017-01-16 Thread Jan Beulich
>>> On 13.01.17 at 20:21, wrote: > This is a series based on v11 of Daniel Kiper's > "x86: multiboot2 protocol support" series. It aims to collect up all the > fixes and changes that Andrew Cooper, Jan Beulich and myself discovered in > code review and testing on actual

Re: [Xen-devel] [PATCH 3/4] efi: create new early memory allocator

2017-01-16 Thread Jan Beulich
>>> On 13.01.17 at 20:21, wrote: > From: Daniel Kiper > > There is a problem with place_string() which is used as early memory > allocator. It gets memory chunks starting from start symbol and goes > down. Sadly this does not work when Xen is loaded

Re: [Xen-devel] [PATCH 4/6] tools/libxc: Remove xsave calculations from libxc

2017-01-16 Thread Wei Liu
On Mon, Jan 16, 2017 at 11:40:28AM +, Andrew Cooper wrote: > libxc performs a lot of calculations for the xstate leaf when generating a > guests cpuid policy. To correctly construct a policy for an HVM guest, this > logic depends on native cpuid leaking through from real hardware. > > In

[Xen-devel] [PATCH 5/6] x86/cpuid: Don't offer HVM hypervisor leaves to PV guests

2017-01-16 Thread Andrew Cooper
Xen leaf 4 is HVM-only. Report a lower max_leaf to PV guests, so they don't go and investigate a leaf which will return all zeros. Signed-off-by: Andrew Cooper --- CC: Jan Beulich --- xen/arch/x86/traps.c | 10 +++--- 1 file changed, 7

[Xen-devel] [PATCH 3/6] x86/cpuid: Move all xstate leaf handling into guest_cpuid()

2017-01-16 Thread Andrew Cooper
The xstate union now contains sanitised values, so it can be handled fully in the non-legacy path. c/s 1c0bc709d "x86/cpuid: Perform max_leaf calculations in guest_cpuid()" accidentally introduced a boundary error for the subleaf check, although it was masked by the correct logic in the legacy

[Xen-devel] [PATCH 4/6] tools/libxc: Remove xsave calculations from libxc

2017-01-16 Thread Andrew Cooper
libxc performs a lot of calculations for the xstate leaf when generating a guests cpuid policy. To correctly construct a policy for an HVM guest, this logic depends on native cpuid leaking through from real hardware. In particular, the logic is potentially wrong for an HVM-based toolstack domain

[Xen-devel] [PATCH 0/6] Further CPUID improvements

2017-01-16 Thread Andrew Cooper
The main purpose of this series is move all all xstate handling to the non-legacy path. Andrew Cooper (6): x86/xstate: Fix array overrun on hardware with LWP x86/cpuid: Introduce recalculate_xstate() x86/cpuid: Move all xstate leaf handling into guest_cpuid() tools/libxc: Remove xsave

[Xen-devel] [PATCH 2/6] x86/cpuid: Introduce recalculate_xstate()

2017-01-16 Thread Andrew Cooper
All data in the xstate union, other than the Da1 feature word, is derived from other state; either feature bits from other words, or layout information which has already been collected by Xen's xstate driver. Recalculate the xstate information for each policy object when the feature bits may have

[Xen-devel] [PATCH 6/6] x86/cpuid: Offer ITSC to domains which are automatically non-migrateable

2017-01-16 Thread Andrew Cooper
Dom0 doesn't have a toolstack to explicitly decide that ITSC is safe to offer. For domains which are constructed with disable_migrate set, offer ITSC automatically. This is important for HVM-based dom0, and for when cpuid faulting is imposed on the control domain. Signed-off-by: Andrew Cooper

[Xen-devel] [PATCH 1/6] x86/xstate: Fix array overrun on hardware with LWP

2017-01-16 Thread Andrew Cooper
c/s da62246e4c "x86/xsaves: enable xsaves/xrstors/xsavec in xen" introduced setup_xstate_features() to allocate and fill xstate_offsets[] and xstate_sizes[]. However, fls() casts xfeature_mask to 32bits which truncates LWP out of the calculation. As a result, the arrays are allocated too short,

Re: [Xen-devel] Xen 4.8 + Linux 4.9 + Credit2 = can't bootup

2017-01-16 Thread Ian Jackson
Boris Ostrovsky writes ("Re: [Xen-devel] Xen 4.8 + Linux 4.9 + Credit2 = can't bootup"): > Hopefully I should be able to filter on "X-Osstest-Failures includes > "linux-linus:". Indeed. > > linux-linus > > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git ... > I think

Re: [Xen-devel] [PATCH 5/8] x86emul: support TBM insns

2017-01-16 Thread Jan Beulich
>>> On 13.01.17 at 19:48, wrote: > On 13/01/17 15:32, Jan Beulich wrote: >> --- a/xen/arch/x86/x86_emulate/x86_emulate.c >> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c >> @@ -1355,6 +1355,7 @@ static bool vcpu_has( >> #define vcpu_has_cr8_legacy()

Re: [Xen-devel] [PATCH 4/8] x86emul: support BMI2 insns

2017-01-16 Thread Jan Beulich
>>> On 13.01.17 at 19:20, wrote: > On 13/01/17 15:32, Jan Beulich wrote: >> Note that the adjustment to the mode_64bit() definition is so that we >> can avoid "#ifdef __x86_64__" around the 64-bit asm() portions. An >> alternative would be single asm()s with a

Re: [Xen-devel] [OSSTEST PATCH v9 3/3] Create a flight to test OpenStack with xen-unstable and libvirt

2017-01-16 Thread Anthony PERARD
On Fri, Jan 13, 2017 at 07:38:28PM +, Ian Jackson wrote: > Ian Jackson writes ("Re: [OSSTEST PATCH v9 3/3] Create a flight to test > OpenStack with xen-unstable and libvirt"): > > Can you provide this series to me as a git branch (catch me on irc > > with the url perhaps) ? I will queue it

Re: [Xen-devel] STAO spec in xen.git

2017-01-16 Thread Ian Jackson
Stefano Stabellini writes ("Re: STAO spec in xen.git"): > In that case, I think we should still commit it as ODT, but convert it > automatically to PDF when we publish it (we do something similar with > the markdown docs, converting them from markdown to html). Exactly. The fact that git diff

[Xen-devel] [PATCH v2 2/2] swiotlb-xen: implement xen_swiotlb_get_sgtable callback

2017-01-16 Thread Andrii Anisov
From: Andrii Anisov Signed-off-by: Andrii Anisov --- arch/arm/xen/mm.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c index ff812a2..dc83a35 100644 --- a/arch/arm/xen/mm.c +++

[Xen-devel] [PATCH v2 0/2] XEN SWIOTLB for ARM dma operations extension

2017-01-16 Thread Andrii Anisov
From: Andrii Anisov Some drivers need additional dma ops to be provided by xen swiotlb. Because common operations implementation came from x86 world and does not suite ARM needs we have to provide needed XEN SWIOTLB for ARM callbacks. dma_mmap patch is a port of an

[Xen-devel] [PATCH v2 1/2] swiotlb-xen: implement xen_swiotlb_dma_mmap callback

2017-01-16 Thread Andrii Anisov
From: Stefano Stabellini This function creates userspace mapping for the DMA-coherent memory. Signed-off-by: Stefano Stabellini Signed-off-by: Oleksandr Dmytryshyn Signed-off-by: Andrii

[Xen-devel] [PATCH v2 2/2] swiotlb-xen: implement xen_swiotlb_get_sgtable callback

2017-01-16 Thread Andrii Anisov
From: Andrii Anisov Signed-off-by: Andrii Anisov --- arch/arm/xen/mm.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c index ff812a2..dc83a35 100644 --- a/arch/arm/xen/mm.c +++

[Xen-devel] [PATCH v2 1/2] swiotlb-xen: implement xen_swiotlb_dma_mmap callback

2017-01-16 Thread Andrii Anisov
From: Stefano Stabellini This function creates userspace mapping for the DMA-coherent memory. Signed-off-by: Stefano Stabellini Signed-off-by: Oleksandr Dmytryshyn Signed-off-by: Andrii

[Xen-devel] [PATCH v2 0/2] XEN SWIOTLB for ARM dma operations extension

2017-01-16 Thread Andrii Anisov
From: Andrii Anisov Some drivers need additional dma ops to be provided by xen swiotlb. Because common operations implementation came from x86 world and does not suite ARM needs we have to provide needed XEN SWIOTLB for ARM callbacks. dma_mmap patch is a port of an

Re: [Xen-devel] [PATCH 3/8] x86emul: support BMI1 insns

2017-01-16 Thread Jan Beulich
>>> On 13.01.17 at 18:40, wrote: > On 13/01/17 15:31, Jan Beulich wrote: >> @@ -5866,6 +5879,67 @@ x86_emulate( >> break; >> #endif >> >> +case X86EMUL_OPC_VEX(0x0f38, 0xf2):/* andn r/m,r,r */ >> +case X86EMUL_OPC_VEX(0x0f38, 0xf7):/* bextr

[Xen-devel] [PATCH] x86/hvm: Conditionally leave CPUID Faulting active in HVM context

2017-01-16 Thread Andrew Cooper
If the hardware supports faulting, and the guest has chosen to use it, leave faulting active in HVM context. It is more efficient to have hardware convert CPUID to a #GP fault (which we don't intercept), than to take a VMExit and have Xen re-inject a #GP fault. Signed-off-by: Andrew Cooper

Re: [Xen-devel] PVH CPU hotplug design document

2017-01-16 Thread Jan Beulich
>>> On 14.01.17 at 02:44, wrote: > On 01/13/2017 10:51 AM, Jan Beulich wrote: > On 12.01.17 at 13:13, wrote: >>> # Introduction >>> >>> One of the design goals of PVH is to be able to remove as much Xen PV >>> specific >>> code as possible,

[Xen-devel] [distros-debian-sid test] 68374: trouble: blocked/broken

2017-01-16 Thread Platform Team regression test user
flight 68374 distros-debian-sid real [real] http://osstest.xs.citrite.net/~osstest/testlogs/logs/68374/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf 3 host-install(3) broken REGR.

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

2017-01-16 Thread Jan Beulich
>>> On 16.01.17 at 06:25, wrote: > One thing noted though. The original patch from Quan is actually orthogonal > to this ASSERT. Regardless of whether intack.vector is larger or smaller > than pt_vector, we always require the trick as long as pt_vector is not the > one being

[Xen-devel] [PATCH] x86/emul: Calculate not_64bit during instruction decode

2017-01-16 Thread Andrew Cooper
... rather than repeating "generate_exception_if(mode_64bit(), EXC_UD);" in the emulation switch statement. Bloat-o-meter shows: add/remove: 0/0 grow/shrink: 1/2 up/down: 8/-495 (-487) function old new delta per_cpu__state

Re: [Xen-devel] [PATCH 1/2] tools/xenstore: start with empty data base

2017-01-16 Thread George Dunlap
On Tue, Jan 10, 2017 at 4:13 PM, Juergen Gross wrote: > - if (tdb_ctx) { > - /* XXX When we make xenstored able to restart, this will have Ah, the optimism of a young project. :-) -George ___ Xen-devel mailing

Re: [Xen-devel] [PATCH] tools/misc: add AVX512 vpopcntdq in xen-cpuid.c

2017-01-16 Thread Andrew Cooper
On 16/01/17 09:41, Wei Liu wrote: > CC Andrew and Jan > > On Mon, Jan 16, 2017 at 04:05:03PM +0800, He Chen wrote: >> Add AVX512 vpopcntdq information in xen-cpuid.c >> >> Signed-off-by: He Chen Reviewed-by: Andrew Cooper

Re: [Xen-devel] [RFC PATCH 08/24] ARM: GICv3: introduce separate pending_irq structs for LPIs

2017-01-16 Thread André Przywara
On 13/01/17 19:37, Stefano Stabellini wrote: > On Thu, 12 Jan 2017, Andre Przywara wrote: Hi Stefano, ... +list_for_each_entry(lpi_irq, >arch.vgic.pending_lpi_list, entry) +{ +if ( lpi_irq->pirq.irq == lpi ) +return _irq->pirq; + +

Re: [Xen-devel] [PATCH] tools/misc: add AVX512 vpopcntdq in xen-cpuid.c

2017-01-16 Thread Wei Liu
CC Andrew and Jan On Mon, Jan 16, 2017 at 04:05:03PM +0800, He Chen wrote: > Add AVX512 vpopcntdq information in xen-cpuid.c > > Signed-off-by: He Chen > --- > tools/misc/xen-cpuid.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git

[Xen-devel] IOMMU fault with IGD passthrough setup on XEN 4.8.0

2017-01-16 Thread G.R.
Hi all, I have a working IGD passthrough setup running for 4 years on XEN 4.3.2. And it no longer works after I upgraded to XEN4.8.0 yesterday. Really need suggestions this time. My previous setup was built upon some local fixes in qemu-xen-traditional (for vendor specific pci cap). With the same

[Xen-devel] [ovmf test] 104186: trouble: blocked/broken

2017-01-16 Thread osstest service owner
flight 104186 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/104186/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: build-i386-xsm3 host-install(3)broken REGR. vs. 104163

[Xen-devel] [PATCH] tools/misc: add AVX512 vpopcntdq in xen-cpuid.c

2017-01-16 Thread He Chen
Add AVX512 vpopcntdq information in xen-cpuid.c Signed-off-by: He Chen --- tools/misc/xen-cpuid.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c index 5d66e94..106be0f 100644 ---

<    1   2