[Xen-devel] [PATCH v4 1/4] x86emul: Support GFNI insns

2018-01-03 Thread Yang Zhong
Signed-off-by: Yang Zhong --- xen/arch/x86/x86_emulate/x86_emulate.c | 21 + xen/include/asm-x86/cpufeature.h | 3 +++ 2 files changed, 24 insertions(+) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index 54a2756..2d331ea

[Xen-devel] [PATCH v4 2/4] x86emul: Support vpclmulqdq

2018-01-03 Thread Yang Zhong
The previous vpclmulqdq only support AVX128. Icelake added AVX256 support. Signed-off-by: Yang Zhong --- xen/arch/x86/x86_emulate/x86_emulate.c | 10 -- xen/include/asm-x86/cpufeature.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/x86_emulate/

[Xen-devel] [PATCH v4 4/4] x86/cpuid: Enable new SSE/AVX/AVX512 cpu features

2018-01-03 Thread Yang Zhong
Intel IceLake cpu has added new cpu features: AVX512VBMI2/GFNI/ VAES/AVX512VNNI/AVX512BITALG/VPCLMULQDQ. Those new cpu features need expose to guest. The bit definition: CPUID.(EAX=7,ECX=0):ECX[bit 06] AVX512VBMI2 CPUID.(EAX=7,ECX=0):ECX[bit 08] GFNI CPUID.(EAX=7,ECX=0):ECX[bit 09] VAES CPUID.(EAX

[Xen-devel] [PATCH v4 0/4] x86/cpuid: enable new cpu features

2018-01-03 Thread Yang Zhong
The new cpu features in intel icelake: AVX512VBMI2/GFNI/VAES/ AVX512VNNI/AVX512BITALG/VPCLMULQDQ. v4: changes from Jan's comments in v3 patch 1: simd_size set issue. remove else. add vex.w exception check. gfni insns comments issue. double blank lines issue.

[Xen-devel] [PATCH v4 3/4] x86emul: Support vaes insns

2018-01-03 Thread Yang Zhong
The previous aes insns only support legacy and AVX128. Icelake added AVX256 support. Signed-off-by: Yang Zhong --- xen/arch/x86/x86_emulate/x86_emulate.c | 17 - xen/include/asm-x86/cpufeature.h | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/xen/arc

[Xen-devel] [linux-4.9 test] 117560: regressions - FAIL

2018-01-03 Thread osstest service owner
flight 117560 linux-4.9 real [real] http://logs.test-lab.xenproject.org/osstest/logs/117560/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64-pvops 6 kernel-build fail REGR. vs. 117255 build-i386-pvops

Re: [Xen-devel] [PATCH v4 4/4] x86/cpuid: Enable new SSE/AVX/AVX512 cpu features

2018-01-03 Thread Jan Beulich
>>> On 03.01.18 at 09:26, wrote: > Intel IceLake cpu has added new cpu features: AVX512VBMI2/GFNI/ > VAES/AVX512VNNI/AVX512BITALG/VPCLMULQDQ. Those new cpu features > need expose to guest. > > The bit definition: > CPUID.(EAX=7,ECX=0):ECX[bit 06] AVX512VBMI2 > CPUID.(EAX=7,ECX=0):ECX[bit 08] GFNI

Re: [Xen-devel] [PATCH v2] x86/hvm: Add MSR old value

2018-01-03 Thread Jan Beulich
>>> On 22.12.17 at 10:09, wrote: > On 12/05/2017 11:07 AM, Jan Beulich wrote: > On 04.12.17 at 16:45, wrote: On Fri, Oct 13, 2017 at 03:50:57PM +0300, Alexandru Isaila wrote: > This patch adds the old value param and the onchangeonly option > to the VM_EVENT_REASON_MOV_TO_MSR ev

Re: [Xen-devel] [PATCH v2] x86/hvm: Add MSR old value

2018-01-03 Thread Razvan Cojocaru
On 01/03/2018 12:00 PM, Jan Beulich wrote: On 22.12.17 at 10:09, wrote: >> On 12/05/2017 11:07 AM, Jan Beulich wrote: >> On 04.12.17 at 16:45, wrote: > On Fri, Oct 13, 2017 at 03:50:57PM +0300, Alexandru Isaila wrote: >> This patch adds the old value param and the onchangeonly o

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

2018-01-03 Thread osstest service owner
flight 117598 xen-unstable-coverity real [real] http://logs.test-lab.xenproject.org/osstest/logs/117598/ Perfect :-) All tests in this flight passed as required version targeted for testing: xen 971d299c04df379734d10c44d637433e9e564f36 baseline version: xen 1b33

[Xen-devel] [xen-4.7-testing test] 117541: regressions - trouble: broken/fail/pass

2018-01-03 Thread osstest service owner
flight 117541 xen-4.7-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/117541/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-win10-i386 broken test-amd64-i386-xl-qemut-ws16-

Re: [Xen-devel] [PATCH] xen: Add EFI_LOAD_OPTION support

2018-01-03 Thread Jan Beulich
>>> On 02.01.18 at 16:56, wrote: > When booting Xen via UEFI the Xen config file can contain multiple sections > each describing different boot options. It is currently only possible to > choose > which section to boot with if Xen is started through an EFI Shell. Is this true? I thought that EFI

Re: [Xen-devel] [PATCH v6 10/16 RESEND] rbtree: coding style adjustments

2018-01-03 Thread Jan Beulich
>>> On 21.11.17 at 16:20, wrote: > From: Michel Lespinasse > > Set comment and indentation style to be consistent with linux coding style > and the rest of the file, as suggested by Peter Zijlstra > > Signed-off-by: Michel Lespinasse > Cc: Andrea Arcangeli > Acked-by: David Woodhouse > Cc: R

[Xen-devel] [xtf test] 117575: all pass - PUSHED

2018-01-03 Thread osstest service owner
flight 117575 xtf real [real] http://logs.test-lab.xenproject.org/osstest/logs/117575/ Perfect :-) All tests in this flight passed as required version targeted for testing: xtf bade68b7087acd6b5ca6310a7460faeea48e4b1c baseline version: xtf 167052779c0546e99aadd2

Re: [Xen-devel] [PATCH v6 11/16 RESEND] rbtree: optimize fetching of sibling node

2018-01-03 Thread Jan Beulich
>>> On 21.11.17 at 16:20, wrote: > From: Michel Lespinasse > > When looking to fetch a node's sibling, we went through a sequence of: > - check if node is the parent's left child > - if it is, then fetch the parent's right child > > This can be replaced with: > - fetch the parent's right child

Re: [Xen-devel] [PATCH v6 12/16 RESEND] rbtree: add __rb_change_child() helper function

2018-01-03 Thread Jan Beulich
>>> On 21.11.17 at 16:20, wrote: > From: Michel Lespinasse > > Add __rb_change_child() as an inline helper function to replace code that > would otherwise be duplicated 4 times in the source. > > No changes to binary size or speed. > > Signed-off-by: Michel Lespinasse > Reviewed-by: Rik van R

Re: [Xen-devel] [PATCH v6 13/16 RESEND] rbtree: place easiest case first in rb_erase()

2018-01-03 Thread Jan Beulich
>>> On 21.11.17 at 16:20, wrote: > From: Michel Lespinasse > > In rb_erase, move the easy case (node to erase has no more than > 1 child) first. I feel the code reads easier that way. > > Signed-off-by: Michel Lespinasse > Reviewed-by: Rik van Riel > Cc: Peter Zijlstra > Cc: Andrea Arcangeli

Re: [Xen-devel] [PATCH v6 14/16] rbtree: handle 1-child recoloring in rb_erase() instead of rb_erase_color()

2018-01-03 Thread Jan Beulich
>>> On 21.11.17 at 16:20, wrote: > From: Michel Lespinasse > > An interesting observation for rb_erase() is that when a node has > exactly one child, the node must be black and the child must be red. > An interesting consequence is that removing such a node can be done by > simply replacing it w

Re: [Xen-devel] [PATCH v6 15/16 RESEND] rbtree: low level optimizations in rb_erase()

2018-01-03 Thread Jan Beulich
>>> On 21.11.17 at 16:20, wrote: > From: Michel Lespinasse > > Various minor optimizations in rb_erase(): > - Avoid multiple loading of node->__rb_parent_color when computing parent > and color information (possibly not in close sequence, as there might > be further branches in the algorithm

Re: [Xen-devel] [PATCH v6 16/16 RESEND] rbtree: fix typo in comment of rb_insert_color

2018-01-03 Thread Jan Beulich
>>> On 21.11.17 at 16:20, wrote: > From: Wei Yang > > In case 1, it passes down the BLACK color from G to p and u, and maintains > the color of n. By doing so, it maintains the black height of the sub-tree. > > While in the comment, it marks the color of n to BLACK. This is a typo > and not c

[Xen-devel] [distros-debian-squeeze test] 73828: trouble: blocked/broken

2018-01-03 Thread Platform Team regression test user
flight 73828 distros-debian-squeeze real [real] http://osstest.xs.citrite.net/~osstest/testlogs/logs/73828/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf-pvopsbroken build-i3

[Xen-devel] [PATCH v17 09/11] tools/libxenforeignmemory: reduce xenforeignmemory_restrict code footprint

2018-01-03 Thread Paul Durrant
By using a static inline stub in private.h for OS where this functionality is not implemented, the various duplicate stubs in the OS-specific source modules can be avoided. Signed-off-by: Paul Durrant Reviewed-by: Roger Pau Monné Acked-by: Wei Liu --- Cc: Ian Jackson v4: - Removed extraneous

[Xen-devel] [PATCH v17 07/11] x86/mm: add an extra command to HYPERVISOR_mmu_update...

2018-01-03 Thread Paul Durrant
...to allow the calling domain to prevent translation of specified l1e value. Despite what the comment in public/xen.h might imply, specifying a command value of MMU_NORMAL_PT_UPDATE will not simply update an l1e with the specified value. Instead, mod_l1_entry() tests whether foreign_dom has PG_tr

[Xen-devel] [PATCH v17 02/11] x86/hvm/ioreq: simplify code and use consistent naming

2018-01-03 Thread Paul Durrant
This patch re-works much of the ioreq server initialization and teardown code: - The hvm_map/unmap_ioreq_gfn() functions are expanded to call through to hvm_alloc/free_ioreq_gfn() rather than expecting them to be called separately by outer functions. - Several functions now test the validity o

[Xen-devel] [PATCH v17 04/11] x86/hvm/ioreq: defer mapping gfns until they are actually requested

2018-01-03 Thread Paul Durrant
A subsequent patch will introduce a new scheme to allow an emulator to map ioreq server pages directly from Xen rather than the guest P2M. This patch lays the groundwork for that change by deferring mapping of gfns until their values are requested by an emulator. To that end, the pad field of the

[Xen-devel] [PATCH v17 03/11] x86/hvm/ioreq: use gfn_t in struct hvm_ioreq_page

2018-01-03 Thread Paul Durrant
This patch adjusts the ioreq server code to use type-safe gfn_t values where possible. No functional change. Signed-off-by: Paul Durrant Reviewed-by: Roger Pau Monné Reviewed-by: Wei Liu Acked-by: Jan Beulich --- Cc: Andrew Cooper --- xen/arch/x86/hvm/ioreq.c | 44 +++

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

2018-01-03 Thread Paul Durrant
... XENMEM_resource_ioreq_server This patch adds support for a new resource type that can be mapped using the XENMEM_acquire_resource memory op. If an emulator makes use of this resource type then, instead of mapping gfns, the IOREQ server will allocate pages from the heap. These pages will never

[Xen-devel] [PATCH v17 00/11] x86: guest resource mapping

2018-01-03 Thread Paul Durrant
This series introduces support for direct mapping of guest resources. The resources are: - IOREQ server pages - Grant tables v17: - Make sure ioreq page free-ing is done at domain destruction v16: - Fix default ioreq server code and verified with qemu trad v15: - Correct page ownership of i

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

2018-01-03 Thread Paul Durrant
Certain memory resources associated with a guest are not necessarily present in the guest P2M. This patch adds the boilerplate for new memory op to allow such a resource to be priv-mapped directly, by either a PV or HVM tools domain. NOTE: Whilst the new op is not intrinsicly specific to the x86

[Xen-devel] [PATCH v17 08/11] tools/libxenforeignmemory: add support for resource mapping

2018-01-03 Thread Paul Durrant
A previous patch introduced a new HYPERVISOR_memory_op to acquire guest resources for direct priv-mapping. This patch adds new functionality into libxenforeignmemory to make use of a new privcmd ioctl [1] that uses the new memory op to make such resources available via mmap(2). [1] http://xenbit

[Xen-devel] [PATCH v17 01/11] x86/hvm/ioreq: maintain an array of ioreq servers rather than a list

2018-01-03 Thread Paul Durrant
A subsequent patch will remove the current implicit limitation on creation of ioreq servers which is due to the allocation of gfns for the ioreq structures and buffered ioreq ring. It will therefore be necessary to introduce an explicit limit and, since this limit should be small, it simplifies th

[Xen-devel] [PATCH v17 10/11] common: add a new mappable resource type: XENMEM_resource_grant_table

2018-01-03 Thread Paul Durrant
This patch allows grant table frames to be mapped using the XENMEM_acquire_resource memory op. NOTE: This patch expands the on-stack mfn_list array in acquire_resource() but it is still small enough to remain on-stack. Signed-off-by: Paul Durrant Reviewed-by: Jan Beulich --- Cc: Andrew Co

[Xen-devel] [PATCH v17 11/11] tools/libxenctrl: use new xenforeignmemory API to seed grant table

2018-01-03 Thread Paul Durrant
A previous patch added support for priv-mapping guest resources directly (rather than having to foreign-map, which requires P2M modification for HVM guests). This patch makes use of the new API to seed the guest grant table unless the underlying infrastructure (i.e. privcmd) doesn't support it, in

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

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

Re: [Xen-devel] [BUG] kernel bug encountered at drivers/net/xen-netback/netback.c:430!

2018-01-03 Thread Paul Durrant
> -Original Message- > From: Alex Braunegg [mailto:alex.braun...@gmail.com] > Sent: 28 December 2017 19:32 > To: 'Michael Collins' ; 'Juergen Gross' > ; xen-devel@lists.xenproject.org > Cc: Paul Durrant ; Wei Liu > Subject: RE: [Xen-devel] [BUG] kernel bug encountered at drivers/net/xen- >

[Xen-devel] [PATCH v3] x86/hvm: Add MSR old value

2018-01-03 Thread Alexandru Isaila
This patch adds the old value param and the onchangeonly option to the VM_EVENT_REASON_MOV_TO_MSR event. The param was added to the vm_event_mov_to_msr struct and to the hvm_monitor_msr function. Finally I've changed the bool_t param to a bool for the hvm_msr_write_intercept function. Signed-off-

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

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

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

2018-01-03 Thread Jan Beulich
>>> On 03.01.18 at 13:19, wrote: > +static void hvm_free_ioreq_mfn(struct hvm_ioreq_server *s, bool buf) > +{ > +struct domain *d = s->domain; > +struct hvm_ioreq_page *iorp = buf ? &s->bufioreq : &s->ioreq; > + > +if ( !iorp->page ) > +return; > + > +page_list_add_tail(ior

Re: [Xen-devel] [PATCH] xen: Add EFI_LOAD_OPTION support

2018-01-03 Thread Tamas K Lengyel
On Wed, Jan 3, 2018 at 4:20 AM, Jan Beulich wrote: On 02.01.18 at 16:56, wrote: >> When booting Xen via UEFI the Xen config file can contain multiple sections >> each describing different boot options. It is currently only possible to >> choose >> which section to boot with if Xen is starte

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

2018-01-03 Thread Paul Durrant
> -Original Message- > From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: 03 January 2018 15:48 > To: Paul Durrant > Cc: JulienGrall ; Andrew Cooper > ; Wei Liu ; George > Dunlap ; Ian Jackson ; > Stefano Stabellini ; xen-devel@lists.xenproject.org; > Konrad Rzeszutek Wilk ; Tim (Xen.org

[Xen-devel] [xen-4.9-testing test] 117535: regressions - trouble: blocked/broken/fail/pass

2018-01-03 Thread osstest service owner
flight 117535 xen-4.9-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/117535/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-multivcpu broken test-amd64-i386-xl-qemut-ws16-amd64

Re: [Xen-devel] [PATCH] xen: Add EFI_LOAD_OPTION support

2018-01-03 Thread Jan Beulich
>>> On 03.01.18 at 17:04, wrote: > On Wed, Jan 3, 2018 at 4:20 AM, Jan Beulich wrote: > On 02.01.18 at 16:56, wrote: >>> +if ( elo->Attributes & LOAD_OPTION_ACTIVE ) >> >> Without any other (earlier) check, how can you reliably tell this >> being a pointer to EFI_LOAD_OPTION from it

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

2018-01-03 Thread Jan Beulich
>>> On 03.01.18 at 17:06, wrote: >> -Original Message- >> From: Jan Beulich [mailto:jbeul...@suse.com] >> Sent: 03 January 2018 15:48 >> To: Paul Durrant >> Cc: JulienGrall ; Andrew Cooper >> ; Wei Liu ; George >> Dunlap ; Ian Jackson ; >> Stefano Stabellini ; xen-devel@lists.xenproject.

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

2018-01-03 Thread Paul Durrant
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xenproject.org] On Behalf > Of Jan Beulich > Sent: 03 January 2018 16:41 > To: Paul Durrant > Cc: StefanoStabellini ; Wei Liu > ; Andrew Cooper ; Tim > (Xen.org) ; George Dunlap ; > JulienGrall ; xen-devel@lists.xenproj

Re: [Xen-devel] [PATCH] xen: Add EFI_LOAD_OPTION support

2018-01-03 Thread Tamas K Lengyel
On Wed, Jan 3, 2018 at 9:36 AM, Jan Beulich wrote: On 03.01.18 at 17:04, wrote: >> On Wed, Jan 3, 2018 at 4:20 AM, Jan Beulich wrote: >> On 02.01.18 at 16:56, wrote: +if ( elo->Attributes & LOAD_OPTION_ACTIVE ) >>> >>> Without any other (earlier) check, how can you reliabl

Re: [Xen-devel] [PATCH v4 1/4] x86emul: Support GFNI insns

2018-01-03 Thread Jan Beulich
>>> On 03.01.18 at 09:26, wrote: > @@ -7741,6 +7752,16 @@ x86_emulate( > op_bytes = 16; > goto simd_0f3a_common; > > +case X86EMUL_OPC_66(0x0f3a, 0xce): /* gf2p8affineqb > $imm8,xmm/m128,xmm,xmm */ > +case X86EMUL_OPC_VEX_66(0x0f3a, 0xce): /* vgf2p8affineqb > $imm

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

2018-01-03 Thread Jan Beulich
>>> On 03.01.18 at 17:48, wrote: >> -Original Message- >> From: Xen-devel [mailto:xen-devel-boun...@lists.xenproject.org] On Behalf >> Of Jan Beulich >> >>> On 03.01.18 at 17:06, wrote: >> >> From: Jan Beulich [mailto:jbeul...@suse.com] >> >> Sent: 03 January 2018 15:48 >> >> >>> On 03.0

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

2018-01-03 Thread Paul Durrant
> -Original Message- > From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: 03 January 2018 17:05 > To: Paul Durrant > Cc: JulienGrall ; Andrew Cooper > ; George Dunlap > ; Ian Jackson ; Wei Liu > ; StefanoStabellini ; xen- > de...@lists.xenproject.org; Tim (Xen.org) > Subject: RE: [Xen-d

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

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

[Xen-devel] [linux-3.18 test] 117581: trouble: blocked/broken/fail/pass

2018-01-03 Thread osstest service owner
flight 117581 linux-3.18 real [real] http://logs.test-lab.xenproject.org/osstest/logs/117581/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemut-debianhvm-amd64 broken test-amd64-

Re: [Xen-devel] PCI Device Subtree Change from Traditional to Upstream

2018-01-03 Thread Anthony PERARD
On Wed, Dec 20, 2017 at 11:40:03AM -0600, Kevin Stange wrote: > Hi, > > I've been working on transitioning a number of Windows guests under HVM > from using QEMU traditional to QEMU upstream as is recommended in the > documentation. When I move these guests, the PCI subtree for Xen > devices chan

Re: [Xen-devel] [BUG] kernel bug encountered at drivers/net/xen-netback/netback.c:430!

2018-01-03 Thread Alex Braunegg
> How easy is it to trigger this? I'm assuming, from the original description, > that I can probably trigger it by forcibly terminating a running domain and > then trying to restart it. For me the trigger was just having 2 VM's running and then within 24 hr's one would crash with the debug data

[Xen-devel] [seabios test] 117584: regressions - FAIL

2018-01-03 Thread osstest service owner
flight 117584 seabios real [real] http://logs.test-lab.xenproject.org/osstest/logs/117584/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-ws16-amd64 17 guest-stop fail REGR. vs. 115539 Tests which did not suc

[Xen-devel] [xen-4.10-testing test] 117549: trouble: blocked/broken/fail/pass

2018-01-03 Thread osstest service owner
flight 117549 xen-4.10-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/117549/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64-xtf broken build-amd64-pvop

Re: [Xen-devel] [BUG] kernel bug encountered at drivers/net/xen-netback/netback.c:430!

2018-01-03 Thread Christoph Moench-Tegeder
## Paul Durrant (paul.durr...@citrix.com): > How easy is it to trigger this? I'm assuming, from the original > description, that I can probably trigger it by forcibly terminating > a running domain and then trying to restart it. As Alex said: in the "common cases" (like his and mine) it seems to

[Xen-devel] Xen Security Advisory 254 - Information leak via side effects of speculative execution

2018-01-03 Thread Xen . org security team
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Xen Security Advisory XSA-254 Information leak via side effects of speculative execution ISSUE DESCRIPTION = Processors give the illusion of a sequence of instructions executed one-by-one. However, in o

Re: [Xen-devel] PCI Device Subtree Change from Traditional to Upstream

2018-01-03 Thread Kevin Stange
On 01/03/2018 11:57 AM, Anthony PERARD wrote: > On Wed, Dec 20, 2017 at 11:40:03AM -0600, Kevin Stange wrote: >> Hi, >> >> I've been working on transitioning a number of Windows guests under HVM >> from using QEMU traditional to QEMU upstream as is recommended in the >> documentation. When I move

[Xen-devel] [xen-unstable test] 117557: trouble: broken/fail/pass

2018-01-03 Thread osstest service owner
flight 117557 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/117557/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-credit2 broken test-amd64-i386-qemu

[Xen-devel] [PATCH v6.5 00/26] x86: Mitigations for SP2/CVE-2017-5715/Branch Target Injection

2018-01-03 Thread Andrew Cooper
Due to the foreshortening of the embargo, I've posted what is currently available. I have yet to complete all the feedback from v6 review, but what is here should be functionally correct, if a little rough around the edges. *Important:* In addition to this software series, you will need the foll

[Xen-devel] [PATCH v6.5 04/26] x86: Introduce a common cpuid_policy_updated()

2018-01-03 Thread Andrew Cooper
No practical change at the moment, but future changes will need to react irrespective of guest type. Signed-off-by: Andrew Cooper Reviewed-by: Wei Liu Acked-by: Jan Beulich --- xen/arch/x86/domain.c| 12 xen/arch/x86/domctl.c| 4 ++-- xen/arch/x86/hvm/hvm.c

[Xen-devel] [PATCH v6.5 03/26] x86/hvm: Rename update_guest_vendor() callback to cpuid_policy_changed()

2018-01-03 Thread Andrew Cooper
It will shortly be used for more than just changing the vendor. Signed-off-by: Andrew Cooper Reviewed-by: Wei Liu Reviewed-by: Jan Beulich --- v3: * Drop forward declaration of vmx_update_guest_vendor() --- xen/arch/x86/domctl.c | 17 ++--- xen/arch/x86/hvm/hvm.c|

[Xen-devel] [PATCH v6.5 01/26] x86/alt: Break out alternative-asm into a separate header file

2018-01-03 Thread Andrew Cooper
Signed-off-by: Andrew Cooper Reviewed-by: Wei Liu Acked-by: Jan Beulich --- xen/include/asm-x86/alternative-asm.h | 31 +++ xen/include/asm-x86/alternative.h | 13 +++-- 2 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 xen/include/as

[Xen-devel] [PATCH v6.5 02/26] x86/alt: Introduce ALTERNATIVE{, _2} macros

2018-01-03 Thread Andrew Cooper
To help creating alternative frames in assembly. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- v3: * Drop the now-unused ALTERNATIVE_2 * Use .L\@ rather than opencoded numbers v4: * Extra @progbits * Reinstate ALTERNATIVE_2 --- xen/include/asm-x86/alternative-asm.h | 46

[Xen-devel] [PATCH v6.5 09/26] x86: Support compiling with indirect branch thunks

2018-01-03 Thread Andrew Cooper
Use -mindirect-branch=thunk-extern/-mindirect-branch-register when available. To begin with, use the retpoline thunk. Later work will add alternative thunks which can be selected at boot time. Signed-off-by: Andrew Cooper --- v4: * New --- xen/arch/x86/Makefile | 1 + xen/arch/x86/Rul

[Xen-devel] [PATCH v6.5 08/26] x86/entry: Erase guest GPR state on entry to Xen

2018-01-03 Thread Andrew Cooper
This reduces the number of code gadgets which can be attacked with arbitrary guest-controlled GPR values. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Reviewed-by: Wei Liu --- xen/include/asm-x86/asm_defns.h | 16 1 file changed, 16 insertions(+) diff --git a/xen/inc

[Xen-devel] [PATCH v6.5 06/26] x86/entry: Rearrange RESTORE_ALL to restore register in stack order

2018-01-03 Thread Andrew Cooper
Results in a more predictable (i.e. linear) memory access pattern. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Reviewed-by: Wei Liu --- xen/include/asm-x86/asm_defns.h | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --gi

[Xen-devel] [PATCH v6.5 05/26] x86/entry: Remove support for partial cpu_user_regs frames

2018-01-03 Thread Andrew Cooper
Save all GPRs on entry to Xen. The entry_int82() path is via a DPL1 gate, only usable by 32bit PV guests, so can get away with only saving the 32bit registers. All other entrypoints can be reached from 32 or 64bit contexts. Signed-off-by: Andrew Cooper Reviewed-by: Wei Liu --- tools/tests/x86

[Xen-devel] [PATCH v6.5 07/26] x86/hvm: Use SAVE_ALL to construct the cpu_user_regs frame after VMExit

2018-01-03 Thread Andrew Cooper
No practical change. One side effect in debug builds is that %rbp is inverted in the manner expected by the stack unwinder to indicate a interrupt frame. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Reviewed-by: Wei Liu --- xen/arch/x86/hvm/svm/entry.S | 22 -- xe

[Xen-devel] [PATCH v6.5 16/26] x86/cmdline: Introduce a command line option to disable IBRS/IBPB, STIBP and IBPB

2018-01-03 Thread Andrew Cooper
Instead of gaining yet another top level boolean, introduce a more generic cpuid= option. Also introduce a helper function to parse a generic boolean value. Signed-off-by: Andrew Cooper --- CC: Jan Beulich v3: * New v4: * Rename "xen-cpuid" to "cpuid" * Adjust comment in parse_boolean() ---

[Xen-devel] [PATCH v6.5 10/26] common/wait: Clarifications to wait infrastructure

2018-01-03 Thread Andrew Cooper
This logic is not as clear as it could be. Add some comments to help. Rearrange the asm block in __prepare_to_wait() to separate the GPR saving/restoring from the internal logic. While tweaking, add an unreachable() following the jmp in check_wakeup_from_wait(). No functional change. Signed-of

[Xen-devel] [PATCH v6.5 13/26] x86/amd: Try to set lfence as being Dispatch Serialising

2018-01-03 Thread Andrew Cooper
This property is required for the AMD's recommended mitigation for Branch Target Injection, but Xen needs to cope with being unable to detect or modify the MSR. Signed-off-by: Andrew Cooper --- v4: * New v5: * Use mnemonics. --- xen/arch/x86/cpu/amd.c| 35 ++

[Xen-devel] [PATCH v6.5 22/26] x86/boot: Calculate the most appropriate BTI mitigation to use

2018-01-03 Thread Andrew Cooper
Signed-off-by: Andrew Cooper --- v4: * New v5: * Whitespace fixes --- docs/misc/xen-command-line.markdown | 6 ++- xen/arch/x86/spec_ctrl.c| 103 ++-- 2 files changed, 104 insertions(+), 5 deletions(-) diff --git a/docs/misc/xen-command-line.markdo

[Xen-devel] [PATCH v6.5 23/26] x86/entry: Clobber the Return Stack Buffer on entry to Xen

2018-01-03 Thread Andrew Cooper
ret instructions are unconditionally speculated based on values in the RSB. If any path in Xen executes more ret than call instructions, speculation can start following a guest controlled RSB entry. There is at least one path (wake from waitqueue) which can end up executing more ret than call inst

[Xen-devel] [PATCH v6.5 18/26] x86/migrate: Move MSR_SPEC_CTRL on migrate

2018-01-03 Thread Andrew Cooper
Signed-off-by: Andrew Cooper Reviewed-by: Wei Liu Reviewed-by: Jan Beulich --- xen/arch/x86/domctl.c | 2 ++ xen/arch/x86/hvm/hvm.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 5973d9f..72b4489 100644 --- a/xen/arch/x86/domctl.c +++

[Xen-devel] [PATCH v6.5 19/26] x86/hvm: Permit guests direct access to MSR_{SPEC_CTRL, PRED_CMD}

2018-01-03 Thread Andrew Cooper
For performance reasons, HVM guests should have direct access to these MSRs when possible. Signed-off-by: Andrew Cooper --- v4: * Redo almost from scratch to support AMD v6: * Allow direct access to PRED_CMD for IBPB --- xen/arch/x86/domctl.c | 19 +++ xen/arch/x86/hvm/svm

[Xen-devel] [PATCH v6.5 11/26] x86: Support indirect thunks from assembly code

2018-01-03 Thread Andrew Cooper
Introduce CALL_THUNK and JMP_THUNK which either degrade to a normal indirect branch, or dispatch to the __x86.indirect_thunk.* symbols. Update all the manual indirect branches in to use the new thunks. The indirect branches in the early boot and kexec path are left intact as we can't use the comp

[Xen-devel] [PATCH v6.5 24/26] x86/ctxt: Issue a speculation barrier between vcpu contexts

2018-01-03 Thread Andrew Cooper
Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- v4: * Adjust for AMD changes --- docs/misc/xen-command-line.markdown | 5 - xen/arch/x86/domain.c | 3 +++ xen/arch/x86/spec_ctrl.c| 13 ++--- xen/include/asm-x86/cpufeature.h| 1 + 4 files ch

[Xen-devel] [PATCH v6.5 14/26] x86: Introduce alternative indirect thunks

2018-01-03 Thread Andrew Cooper
Depending on hardware and microcode availability, we will want to replace IND_THUNK_REPOLINE with other implementations. For AMD hardware, choose IND_THUNK_LFENCE in preference to retpoline if lfence is known to be (or was successfully made) dispatch serialising. Signed-off-by: Andrew Cooper ---

[Xen-devel] [PATCH v6.5 12/26] x86/boot: Report details of speculative mitigations

2018-01-03 Thread Andrew Cooper
Nothing very interesting at the moment, but the logic will grow as new mitigations are added. Signed-off-by: Andrew Cooper --- v3: * New v4: * Drop the else-clause printk * Rebase over AMD additions --- xen/arch/x86/Makefile | 1 + xen/arch/x86/setup.c| 3 ++ xen/arch/

[Xen-devel] [PATCH v6.5 17/26] x86/msr: Emulation of MSR_{SPEC_CTRL, PRED_CMD} for guests

2018-01-03 Thread Andrew Cooper
Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- v3: * Brackets around && (.. & ..) operation * Extend host to uint32_t for the benefit of the asm code. v4: * Extend MSR_PRED_CMD availability logic for AMD. --- xen/arch/x86/msr.c| 35 +++ xen/i

[Xen-devel] [PATCH v6.5 26/26] x86/idle: Clear SPEC_CTRL while idle

2018-01-03 Thread Andrew Cooper
On contemporary hardware, setting IBRS/STIBP has a performance impact on adjacent hyperthreads. It is therefore recommended to clear the setting before becoming idle, to avoid an idle core preventing adjacent userspace execution from running at full performance. Care must be taken to ensure there

[Xen-devel] [PATCH v6.5 20/26] x86: Protect unaware domains from meddling hyperthreads

2018-01-03 Thread Andrew Cooper
Signed-off-by: Andrew Cooper --- v3: * Spelling corrections v4: * Rebase over AMD changes v6: * Fix cpuid_policy_updated() to not corrupt vp->spec_ctrl.host on migrate, or on older versions of Xen where feature flags start as 0 rather than the domain maximum. --- xen/arch/x86/domain.c

[Xen-devel] [PATCH v6.5 25/26] x86/cpuid: Offer Indirect Branch Controls to guests

2018-01-03 Thread Andrew Cooper
With all infrastructure in place, it is now safe to let guests see and use these features. Allow AMD's IBPB to be set even on Intel hardware, so the toolstack can express "IBPB only" to guests. This also requires updating the libxc logic to understand the e8b feature leaf, which has the side effe

[Xen-devel] [PATCH v6.5 21/26] x86/entry: Use MSR_SPEC_CTRL at each entry/exit point

2018-01-03 Thread Andrew Cooper
Set or clear IBRS in Xen context, and appropriate guest values in guest context. See the documentation in asm-x86/spec_ctrl_asm.h for details. Two semi-unrelated bugfixes are that various asm_defn.h macros have a hidden dependency on PAGE_SIZE, which results in an assembler error if used in a .ma

[Xen-devel] [PATCH v6.5 15/26] x86/feature: Definitions for Indirect Branch Controls

2018-01-03 Thread Andrew Cooper
Contemporary processors are gaining Indirect Branch Controls via microcode updates. Intel are introducing one bit to indicate IBRS and IBPB support, and a second bit for STIBP. AMD are introducing IPBP only, so enumerate it with a separate bit. Furthermore, depending on compiler and microcode av

Re: [Xen-devel] [PATCH v6.5 15/26] x86/feature: Definitions for Indirect Branch Controls

2018-01-03 Thread Doug Goldstein
On 1/3/18 6:15 PM, Andrew Cooper wrote: > Contemporary processors are gaining Indirect Branch Controls via microcode > updates. Intel are introducing one bit to indicate IBRS and IBPB support, and > a second bit for STIBP. AMD are introducing IPBP only, so enumerate it with a > separate bit. s/I

Re: [Xen-devel] [PATCH v6.5 15/26] x86/feature: Definitions for Indirect Branch Controls

2018-01-03 Thread Andrew Cooper
On 04/01/2018 01:14, Doug Goldstein wrote: > On 1/3/18 6:15 PM, Andrew Cooper wrote: >> Contemporary processors are gaining Indirect Branch Controls via microcode >> updates. Intel are introducing one bit to indicate IBRS and IBPB support, >> and >> a second bit for STIBP. AMD are introducing IP

Re: [Xen-devel] [PATCH v6.5 15/26] x86/feature: Definitions for Indirect Branch Controls

2018-01-03 Thread Anthony Liguori
On Wed, Jan 3, 2018 at 5:14 PM, Doug Goldstein wrote: > On 1/3/18 6:15 PM, Andrew Cooper wrote: >> Contemporary processors are gaining Indirect Branch Controls via microcode >> updates. Intel are introducing one bit to indicate IBRS and IBPB support, >> and >> a second bit for STIBP. AMD are in

[Xen-devel] [linux-linus test] 117585: regressions - trouble: broken/fail/pass

2018-01-03 Thread osstest service owner
flight 117585 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/117585/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-qemuu-nested-intel broken test-amd64-amd64-libvirt

Re: [Xen-devel] [PATCH v4 4/4] x86/cpuid: Enable new SSE/AVX/AVX512 cpu features

2018-01-03 Thread Yang Zhong
On Wed, Jan 03, 2018 at 01:46:09AM -0700, Jan Beulich wrote: > > --- a/xen/include/public/arch-x86/cpufeatureset.h > > +++ b/xen/include/public/arch-x86/cpufeatureset.h > > @@ -228,6 +228,12 @@ XEN_CPUFEATURE(AVX512VBMI,6*32+ 1) /*A AVX-512 > > Vector Byte Manipulation Ins > > XEN_CPUFEATUR

Re: [Xen-devel] [PATCH v4 0/4] x86/cpuid: enable new cpu features

2018-01-03 Thread Yang Zhong
On Wed, Jan 03, 2018 at 01:38:13AM -0700, Jan Beulich wrote: > >>> On 03.01.18 at 09:26, wrote: > > The new cpu features in intel icelake: AVX512VBMI2/GFNI/VAES/ > > AVX512VNNI/AVX512BITALG/VPCLMULQDQ. > > Could you please play by patch submission rules: They are to be > sent _to_ the list, with

Re: [Xen-devel] [RFC XEN PATCH v4 01/41] x86_64/mm: fix the PDX group check in mem_hotadd_check()

2018-01-03 Thread Chao Peng
On Thu, 2017-12-07 at 18:09 +0800, Haozhong Zhang wrote: > The current check refuses the hot-plugged memory that falls in one > unused PDX group, which should be allowed. > Reviewed-by: Chao Peng > Signed-off-by: Haozhong Zhang > --- > Cc: Jan Beulich > Cc: Andrew Cooper > --- >  xen/arch/x86

Re: [Xen-devel] [RFC XEN PATCH v4 02/41] x86_64/mm: avoid cleaning the unmapped frame table

2018-01-03 Thread Chao Peng
On Thu, 2017-12-07 at 18:09 +0800, Haozhong Zhang wrote: > cleanup_frame_table() initializes the entire newly added frame table > to all -1's. If it's called after extend_frame_table() failed to map > the entire frame table, the initialization will hit a page fault. > > Move the cleanup of partial

Re: [Xen-devel] [RFC XEN PATCH v4 03/41] hvmloader/util: do not compare characters after '\0' in strncmp

2018-01-03 Thread Chao Peng
On Thu, 2017-12-07 at 18:09 +0800, Haozhong Zhang wrote: > ... to make its behavior the same as C standard (e.g., C99 and C11). > > Signed-off-by: Haozhong Zhang > --- > Cc: Jan Beulich > Cc: Andrew Cooper > Cc: Ian Jackson > Cc: Wei Liu > --- >  tools/firmware/hvmloader/util.c | 7 +++ >

[Xen-devel] [xen-4.8-testing test] 117586: regressions - trouble: broken/fail/pass

2018-01-03 Thread osstest service owner
flight 117586 xen-4.8-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/117586/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-debianhvm-amd64-xsm broken test-amd64-amd64-livepatch