Re: [Xen-devel] [PATCH 1/2] x86/xstate: Use the CPUID policy in valid_xcr0(), rather than allowing all features

2018-07-19 Thread Jan Beulich
>>> On 18.07.18 at 18:36, wrote: > On 18/07/18 17:16, Jan Beulich wrote: > On 18.07.18 at 18:05, wrote: >>> On 18/07/18 15:48, Jan Beulich wrote: >>> On 18.07.18 at 14:30, wrote: > Backporting notes: This is safe in the restore case, but only back as far > as > the introduct

Re: [Xen-devel] [PATCH v2 1/2] x86/xstate: Use a guests CPUID policy, rather than allowing all features

2018-07-19 Thread Jan Beulich
>>> On 18.07.18 at 19:20, wrote: > It turns out that Xen has never enforced that a domain remain within the > xstate features advertised in CPUID. > > The check of new_bv against xfeature_mask ensures that a domain stays within > the set of features that Xen has enabled in hardware (and therefore

Re: [Xen-devel] [PATCH v2 2/2] x86/xstate: Make errors in xstate calculations more obvious by crashing the domain

2018-07-19 Thread Jan Beulich
>>> On 18.07.18 at 19:20, wrote: > --- a/xen/arch/x86/xstate.c > +++ b/xen/arch/x86/xstate.c > @@ -707,12 +707,27 @@ int handle_xsetbv(u32 index, u64 new_bv) > if ( index != XCR_XFEATURE_ENABLED_MASK ) > return -EOPNOTSUPP; > > -if ( (new_bv & ~xcr0_max) || > - (new_bv

Re: [Xen-devel] [PATCH] x86/kexec: harden kexec path by entering with NMIs latched

2018-07-19 Thread Jan Beulich
>>> On 18.07.18 at 23:38, wrote: > On certain occasions platform might generate NMIs during kexec transition. > It could be cascades of NMIs following the first one, escalated Master > Aborts following IOMMU shutdown on the transition itself, etc. > Purgatory code is now unprepared for any sort of

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

2018-07-19 Thread osstest service owner
flight 125287 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/125287/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl 10 debian-install fail REGR. vs. 125169 Tests which did n

Re: [Xen-devel] [PATCH v2 1/2] x86/xstate: Use a guests CPUID policy, rather than allowing all features

2018-07-19 Thread Andrew Cooper
On 19/07/2018 08:10, Jan Beulich wrote: > >> @@ -694,18 +699,18 @@ int validate_xstate(u64 xcr0, u64 xcr0_accum, const >> struct xsave_hdr *hdr) >> int handle_xsetbv(u32 index, u64 new_bv) >> { >> struct vcpu *curr = current; >> +const struct cpuid_policy *cp = curr->domain->arch.cpuid;

Re: [Xen-devel] [PATCH v3 03/13] iommu: make use of type-safe BFN and MFN in exported functions

2018-07-19 Thread Wei Liu
On Tue, Jul 17, 2018 at 02:38:06PM +0100, Paul Durrant wrote: > This patch modifies the declaration of the entry points to the IOMMU > sub-system to use bfn_t and mfn_t in place of unsigned long. A subsequent > patch will similarly modify the methods in the iommu_ops structure. > > Signed-off-by:

Re: [Xen-devel] [PATCH v3 02/13] iommu: introduce the concept of BFN...

2018-07-19 Thread Wei Liu
On Tue, Jul 17, 2018 at 02:38:05PM +0100, Paul Durrant wrote: > ...meaning 'bus frame number' i.e. a frame number mapped in the IOMMU > rather than the MMU. > > This patch is a largely cosmetic change that substitutes the terms 'gfn' > and 'gaddr' for 'bfn' and 'baddr' in all the places where the

Re: [Xen-devel] [PATCH v3 04/13] iommu: push use of type-safe BFN and MFN into iommu_ops

2018-07-19 Thread Wei Liu
On Tue, Jul 17, 2018 at 02:38:07PM +0100, Paul Durrant wrote: > This patch modifies the methods in struct iommu_ops to use type-safe BFN > and MFN. This follows on from the prior patch that modified the functions > exported in xen/iommu.h. > > Signed-off-by: Paul Durrant Reviewed-by: Wei Liu _

[Xen-devel] [PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table()

2018-07-19 Thread Dan Carpenter
The xen_drm_front_gem_get_sg_table() function is supposed to return error pointer. The current code, would trigger a NULL dereference in drm_gem_map_dma_buf(). Fixes: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display frontend") Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/dr

Re: [Xen-devel] [PATCH v3] x86/mm: Add mem access rights to NPT

2018-07-19 Thread Isaila Alexandru
On Mi, 2018-07-18 at 15:33 +, George Dunlap wrote: > > > > > On Jul 2, 2018, at 8:42 AM, Alexandru Isaila > om> wrote: > > > > From: Isaila Alexandru > > > > This patch adds access rights for the NPT pages. The access rights > > are > > saved in a radix tree with the root saved in p2m_dom

Re: [Xen-devel] [PATCH v3] x86/mm: Add mem access rights to NPT

2018-07-19 Thread Razvan Cojocaru
On 07/19/2018 11:18 AM, Isaila Alexandru wrote: > On Mi, 2018-07-18 at 15:33 +, George Dunlap wrote: >> >>> >>> On Jul 2, 2018, at 8:42 AM, Alexandru Isaila >> om> wrote: >>> >>> From: Isaila Alexandru >>> >>> This patch adds access rights for the NPT pages. The access rights >>> are >>> saved

Re: [Xen-devel] [PATCH v2 1/2] x86/xstate: Use a guests CPUID policy, rather than allowing all features

2018-07-19 Thread Jan Beulich
>>> On 19.07.18 at 09:59, wrote: > On 19/07/2018 08:10, Jan Beulich wrote: >> >>> @@ -694,18 +699,18 @@ int validate_xstate(u64 xcr0, u64 xcr0_accum, const >>> struct xsave_hdr *hdr) >>> int handle_xsetbv(u32 index, u64 new_bv) >>> { >>> struct vcpu *curr = current; >>> +const struct c

Re: [Xen-devel] [PATCH v2 4/6] x86: bring up all CPUs even if not all are supposed to be used

2018-07-19 Thread Jan Beulich
>>> On 19.07.18 at 01:48, wrote: > On Wed, Jul 18, 2018 at 02:21:53AM -0600, Jan Beulich wrote: >> Reportedly Intel CPUs which can't broadcast #MC to all targeted >> cores/threads because some have CR4.MCE clear will shut down. Therefore >> we want to keep CR4.MCE enabled when offlining a CPU, and

Re: [Xen-devel] [PATCH v2 1/2] x86/xstate: Use a guests CPUID policy, rather than allowing all features

2018-07-19 Thread Andrew Cooper
On 19/07/2018 09:21, Jan Beulich wrote: On 19.07.18 at 09:59, wrote: >> On 19/07/2018 08:10, Jan Beulich wrote: @@ -694,18 +699,18 @@ int validate_xstate(u64 xcr0, u64 xcr0_accum, const struct xsave_hdr *hdr) int handle_xsetbv(u32 index, u64 new_bv) { struct v

Re: [Xen-devel] [PATCH v3] x86/mm: Add mem access rights to NPT

2018-07-19 Thread Jan Beulich
>>> On 19.07.18 at 10:18, wrote: > On Mi, 2018-07-18 at 15:33 +, George Dunlap wrote: >> > On Jul 2, 2018, at 8:42 AM, Alexandru Isaila > > @@ -112,8 +117,37 @@ static unsigned long p2m_type_to_flags(const >> > struct p2m_domain *p2m, >> > flags |= _PAGE_PWT; >> > ASSER

Re: [Xen-devel] [PATCH v2 1/2] x86/xstate: Use a guests CPUID policy, rather than allowing all features

2018-07-19 Thread Jan Beulich
>>> On 19.07.18 at 10:26, wrote: > On 19/07/2018 09:21, Jan Beulich wrote: > On 19.07.18 at 09:59, wrote: >>> On 19/07/2018 08:10, Jan Beulich wrote: > @@ -694,18 +699,18 @@ int validate_xstate(u64 xcr0, u64 xcr0_accum, const > struct xsave_hdr *hdr) > int handle_xsetbv(u32 index, u

Re: [Xen-devel] [PATCH v3] x86/mm: Add mem access rights to NPT

2018-07-19 Thread Razvan Cojocaru
On 07/19/2018 11:30 AM, Jan Beulich wrote: On 19.07.18 at 10:18, wrote: >> On Mi, 2018-07-18 at 15:33 +, George Dunlap wrote: On Jul 2, 2018, at 8:42 AM, Alexandru Isaila >>> +break; +case p2m_access_x: +flags &= ~_PAGE_RW; +

[Xen-devel] [distros-debian-wheezy test] 74988: all pass

2018-07-19 Thread Platform Team regression test user
flight 74988 distros-debian-wheezy real [real] http://osstest.xs.citrite.net/~osstest/testlogs/logs/74988/ Perfect :-) All tests in this flight passed as required baseline version: flight 74961 jobs: build-amd64 pass build-armh

Re: [Xen-devel] [PATCH v2 1/2] x86/xstate: Use a guests CPUID policy, rather than allowing all features

2018-07-19 Thread Andrew Cooper
On 19/07/2018 09:34, Jan Beulich wrote: On 19.07.18 at 10:26, wrote: >> On 19/07/2018 09:21, Jan Beulich wrote: >> On 19.07.18 at 09:59, wrote: On 19/07/2018 08:10, Jan Beulich wrote: >> @@ -694,18 +699,18 @@ int validate_xstate(u64 xcr0, u64 xcr0_accum, >> const >> struct

Re: [Xen-devel] [PATCH v3 07/13] iommu: track reserved ranges using a rangeset

2018-07-19 Thread Wei Liu
On Tue, Jul 17, 2018 at 02:38:10PM +0100, Paul Durrant wrote: > Ranges that should be considered reserved in the IOMMU are not necessarily > limited to RMRRs. If iommu_inclusive_mapping is set then any frame number > falling within an E820 reserved region should also be considered as > reserved in

Re: [Xen-devel] [PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table()

2018-07-19 Thread Oleksandr Andrushchenko
Hi, Dan! Thank you for the patch and sorry I was clumsy sending v3. Do you want me to send v3 now with the fixes for both Xen and CMA? Thank you, Oleksandr On 07/19/2018 11:11 AM, Dan Carpenter wrote: The xen_drm_front_gem_get_sg_table() function is supposed to return error pointer. The cu

[Xen-devel] [ovmf bisection] complete build-i386-xsm

2018-07-19 Thread osstest service owner
branch xen-unstable xenbranch xen-unstable job build-i386-xsm testid xen-build Tree: ovmf https://github.com/tianocore/edk2.git Tree: qemu git://xenbits.xen.org/qemu-xen-traditional.git Tree: qemuu git://xenbits.xen.org/qemu-xen.git Tree: xen git://xenbits.xen.org/xen.git *** Found and reproduced

Re: [Xen-devel] [PATCH] mm, oom: distinguish blockable mode for mmu notifiers

2018-07-19 Thread Michal Hocko
Does anybody see any reasons why this should get into mmotm tree? I do not want to rush this in but if general feeling is to push it for the upcoming merge window then I will not object. -- Michal Hocko SUSE Labs ___ Xen-devel mailing list Xen-devel@lis

Re: [Xen-devel] [PATCH v2 03/21] xen: allow console_io hypercalls from certain DomUs

2018-07-19 Thread Julien Grall
Hi Stefano, On 18/07/18 18:10, Stefano Stabellini wrote: On Tue, 17 Jul 2018, Julien Grall wrote: Hi Stefano, On 17/07/2018 21:05, Stefano Stabellini wrote: On Mon, 9 Jul 2018, Julien Grall wrote: Hi, On 07/07/18 00:11, Stefano Stabellini wrote: Introduce an is_console option to allow cert

Re: [Xen-devel] [PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table()

2018-07-19 Thread Dan Carpenter
On Thu, Jul 19, 2018 at 12:06:38PM +0300, Oleksandr Andrushchenko wrote: > Hi, Dan! > > Thank you for the patch and sorry I was clumsy sending v3. > > Do you want me to send v3 now with the fixes for both Xen and CMA? > > Thank you, Sorry, I forgot that you had sent these earlier. After a whil

Re: [Xen-devel] [PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table()

2018-07-19 Thread Dan Carpenter
Oleksandr sent this patch already. Please disregard mine. regards, dan carpenter ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table()

2018-07-19 Thread Oleksandr Andrushchenko
On 07/19/2018 12:20 PM, Dan Carpenter wrote: On Thu, Jul 19, 2018 at 12:06:38PM +0300, Oleksandr Andrushchenko wrote: Hi, Dan! Thank you for the patch and sorry I was clumsy sending v3. Do you want me to send v3 now with the fixes for both Xen and CMA? Thank you, Sorry, I forgot that you had

[Xen-devel] [PATCH v3] drm: Replace NULL with error value in drm_prime_pages_to_sg

2018-07-19 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Dan Carpenter has reported that there is the following static checker warning: drivers/gpu/drm/drm_prime.c:317 drm_gem_map_dma_buf() warn: 'sgt' can also be NULL 314 sgt = obj->dev->driver->gem_prime_get_sg_table(obj); 315 316 if (!IS_ERR(sgt

Re: [Xen-devel] [PATCH v3 08/13] x86: add iommu_op to query reserved ranges

2018-07-19 Thread Wei Liu
On Tue, Jul 17, 2018 at 02:38:11PM +0100, Paul Durrant wrote: [...] > int compat_one_iommu_op(compat_iommu_op_buf_t *buf) > { > -compat_iommu_op_t cmp; > +compat_iommu_op_t cmp = {}; > +size_t offset; > +static const size_t op_size[] = { > +[XEN_IOMMUOP_query_reserved] = s

Re: [Xen-devel] [PATCH v3 09/13] vtd: add lookup_page method to iommu_ops

2018-07-19 Thread Wei Liu
On Tue, Jul 17, 2018 at 02:38:12PM +0100, Paul Durrant wrote: > This patch adds a new method to the VT-d IOMMU implementation to find the > MFN currently mapped by the specified BFN along with a wrapper function in > generic IOMMU code to call the implementation if it exists. > > This functionalit

[Xen-devel] [xen-4.9-testing test] 125292: regressions - FAIL

2018-07-19 Thread osstest service owner
flight 125292 xen-4.9-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/125292/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-xl-qemut-ws16-amd64 17 guest-stop fail in 125253 REGR. vs. 124248 test-amd64-

Re: [Xen-devel] [PATCH v3] x86/mm: Add mem access rights to NPT

2018-07-19 Thread Jan Beulich
>>> On 19.07.18 at 10:43, wrote: > On 07/19/2018 11:30 AM, Jan Beulich wrote: > On 19.07.18 at 10:18, wrote: >>> On Mi, 2018-07-18 at 15:33 +, George Dunlap wrote: > On Jul 2, 2018, at 8:42 AM, Alexandru Isaila +break; > +case p2m_access_x: > +

Re: [Xen-devel] [PATCH v3 08/13] x86: add iommu_op to query reserved ranges

2018-07-19 Thread Paul Durrant
> -Original Message- > From: Wei Liu [mailto:wei.l...@citrix.com] > Sent: 19 July 2018 10:37 > To: Paul Durrant > Cc: xen-devel@lists.xenproject.org; Jan Beulich ; > Andrew Cooper ; George Dunlap > ; Ian Jackson ; Konrad > Rzeszutek Wilk ; Stefano Stabellini > ; Tim (Xen.org) ; Wei Liu >

Re: [Xen-devel] [PATCH v2 1/2] x86/xstate: Use a guests CPUID policy, rather than allowing all features

2018-07-19 Thread Jan Beulich
>>> On 19.07.18 at 10:59, wrote: > On 19/07/2018 09:34, Jan Beulich wrote: > On 19.07.18 at 10:26, wrote: >>> On 19/07/2018 09:21, Jan Beulich wrote: >>> On 19.07.18 at 09:59, wrote: > On 19/07/2018 08:10, Jan Beulich wrote: >>> @@ -694,18 +699,18 @@ int validate_xstate(u64 xcr0,

Re: [Xen-devel] [PATCH v3] drm: Replace NULL with error value in drm_prime_pages_to_sg

2018-07-19 Thread Dan Carpenter
Reviewed-by: Dan Carpenter regards, dan carpenter ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PATCH v3 0/4] x86: allow to suppress use of hyper-threading

2018-07-19 Thread Jan Beulich
I've been considering to add a respective command line option for quite a long time, but never got around to. Now that the TLBleed information is public[1], we're at a point where we not only want, but need this, and where perhaps it needs to be the default on affected systems. The first 2 patches

Re: [Xen-devel] [PATCH v3] drm: Replace NULL with error value in drm_prime_pages_to_sg

2018-07-19 Thread Oleksandr Andrushchenko
On 07/19/2018 01:24 PM, Dan Carpenter wrote: Reviewed-by: Dan Carpenter Thank you, if nobody objects I'll push it to drm-misc-next next Monday regards, dan carpenter ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproje

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

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

[Xen-devel] [PATCH v3 1/4] x86: distinguish CPU offlining from CPU removal

2018-07-19 Thread Jan Beulich
In order to be able to service #MC on offlined CPUs, the GDT, IDT, stack, and per-CPU data (which includes the TSS) need to be kept allocated. They should only be freed upon CPU removal (which we currently don't support, so some code is becoming effectively dead for the moment). Note that for now

[Xen-devel] [PATCH v3 2/4] x86: possibly bring up all CPUs even if not all are supposed to be used

2018-07-19 Thread Jan Beulich
Reportedly Intel CPUs which can't broadcast #MC to all targeted cores/threads because some have CR4.MCE clear will shut down. Therefore we want to keep CR4.MCE enabled when offlining a CPU, and we need to bring up all CPUs in order to be able to set CR4.MCE in the first place. The use of clear_in_

[Xen-devel] [PATCH v3 3/4] x86: command line option to avoid use of secondary hyper-threads

2018-07-19 Thread Jan Beulich
Shared resources (L1 cache and TLB in particular) present a risk of information leak via side channels. Provide a means to avoid use of hyperthreads in such cases. Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné --- v3: Also change the actual option string to "smt". Don't default the

[Xen-devel] [PATCH v3 4/4] cpumask: tidy {,z}alloc_cpumask_var()

2018-07-19 Thread Jan Beulich
Drop unnecessary casts and use bool in favor of bool_t. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Reviewed-by: Wei Liu Reviewed-by: Roger Pau Monné --- a/xen/include/xen/cpumask.h +++ b/xen/include/xen/cpumask.h @@ -345,9 +345,9 @@ static inline int cpulist_scnprintf(char typed

Re: [Xen-devel] [PATCH v3 3/4] x86: command line option to avoid use of secondary hyper-threads

2018-07-19 Thread Andrew Cooper
On 19/07/18 11:32, Jan Beulich wrote: > Shared resources (L1 cache and TLB in particular) present a risk of > information leak via side channels. Provide a means to avoid use of > hyperthreads in such cases. > > Signed-off-by: Jan Beulich > Reviewed-by: Roger Pau Monné Reviewed-by: Andrew Coope

[Xen-devel] [PATCH 0/6] x86/HVM: implement memory read caching

2018-07-19 Thread Jan Beulich
Emulation requiring device model assistance uses a form of instruction re-execution, assuming that the second (and any further) pass takes exactly the same path. This is a valid assumption as far use of CPU registers goes (as those can't change without any other instruction executing in between), b

[Xen-devel] [PATCH v2] tboot: Avoid recursive fault in early boot panic with tboot

2018-07-19 Thread Jason Andryuk
If panic is called before init_idle_domain on a tboot-launched system, then Xen recursively faults in write_ptbase as seen below. (XEN)[] write_ptbase+0/0x10 (XEN)[] tboot_shutdown+0x6b/0x260 (XEN)[] machine_restart+0xac/0x2d0 (XEN)[] write_ptbase+0/0x10 (XEN)[] panic+0x111/0x1

Re: [Xen-devel] [PATCH v3 3/4] x86: command line option to avoid use of secondary hyper-threads

2018-07-19 Thread Jan Beulich
>>> On 19.07.18 at 12:37, wrote: > On 19/07/18 11:32, Jan Beulich wrote: >> Shared resources (L1 cache and TLB in particular) present a risk of >> information leak via side channels. Provide a means to avoid use of >> hyperthreads in such cases. >> >> Signed-off-by: Jan Beulich >> Reviewed-by: Ro

[Xen-devel] [PATCH 1/6] x86/mm: add optional cache to GLA->GFN translation

2018-07-19 Thread Jan Beulich
The caching isn't actually implemented here, this is just setting the stage. Touching these anyway also - make their return values gfn_t - gva -> gla in their names - name their input arguments gla At the use sites do the conversion to gfn_t as suitable. Signed-off-by: Jan Beulich --- a/xen/ar

[Xen-devel] [PATCH 2/6] x86/mm: use optional cache in guest_walk_tables()

2018-07-19 Thread Jan Beulich
The caching isn't actually implemented here, this is just setting the stage. Signed-off-by: Jan Beulich --- a/xen/arch/x86/hvm/emulate.c +++ b/xen/arch/x86/hvm/emulate.c @@ -2572,6 +2572,18 @@ void hvm_dump_emulation_state(const char hvmemul_ctxt->insn_buf); } +bool hvmemul_read_c

[Xen-devel] [PATCH 4/6] VMX: correct PDPTE load checks

2018-07-19 Thread Jan Beulich
Checking the low 5 bits of CR3 is not the job of vmx_load_pdptrs(). Instead it should #GP upon bad PDPTE values, rather than causing a VM entry failure. Signed-off-by: Jan Beulich --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -1361,20 +1361,18 @@ static void vmx_set_interr

[Xen-devel] [PATCH 3/6] x86/HVM: implement memory read caching

2018-07-19 Thread Jan Beulich
Emulation requiring device model assistance uses a form of instruction re-execution, assuming that the second (and any further) pass takes exactly the same path. This is a valid assumption as far use of CPU registers goes (as those can't change without any other instruction executing in between), b

[Xen-devel] [PATCH 5/6] x86/HVM: prefill cache with PDPTEs when possible

2018-07-19 Thread Jan Beulich
Since strictly speaking it is incorrect for guest_walk_tables() to read L3 entries during PAE page walks, try to overcome this where possible by pre-loading the values from hardware into the cache. Sadly the information is available in the EPT case only. On the positive side for NPT the spec spells

[Xen-devel] [PATCH 6/6] x86/shadow: a little bit of style cleanup

2018-07-19 Thread Jan Beulich
Correct indentation of a piece of code, adjusting comment style at the same time. Constify gl3e pointers and drop a bogus (and useless once corrected) cast. Signed-off-by: Jan Beulich --- a/xen/arch/x86/mm/shadow/multi.c +++ b/xen/arch/x86/mm/shadow/multi.c @@ -3989,9 +3989,8 @@ sh_update_cr3(st

Re: [Xen-devel] [PATCH v2] tboot: Avoid recursive fault in early boot panic with tboot

2018-07-19 Thread Jan Beulich
>>> On 19.07.18 at 12:39, wrote: > If panic is called before init_idle_domain on a tboot-launched system, > then Xen recursively faults in write_ptbase as seen below. > > (XEN)[] write_ptbase+0/0x10 > (XEN)[] tboot_shutdown+0x6b/0x260 > (XEN)[] machine_restart+0xac/0x2d0 > (XEN)[]

Re: [Xen-devel] [PATCH v3 2/4] x86: possibly bring up all CPUs even if not all are supposed to be used

2018-07-19 Thread Joao Martins
On 07/19/2018 11:32 AM, Jan Beulich wrote: > Note: On one of my test systems the parked CPUs get _PSD data reported > by Dom0 that is different from the non-parked ones (coord_type is > 0xFC instead of 0xFE). Giving Dom0 enough vCPU-s eliminates this > problem, so there is apparen

Re: [Xen-devel] [PATCH 5/6] x86/HVM: prefill cache with PDPTEs when possible

2018-07-19 Thread Andrew Cooper
On 19/07/18 11:50, Jan Beulich wrote: > Since strictly speaking it is incorrect for guest_walk_tables() to read > L3 entries during PAE page walks, try to overcome this where possible by > pre-loading the values from hardware into the cache. Sadly the > information is available in the EPT case only

[Xen-devel] [PATCH v3 2/2] x86/xstate: Make errors in xstate calculations more obvious by crashing the domain

2018-07-19 Thread Andrew Cooper
If xcr0_max exceeds xfeature_mask, then something is broken with the CPUID policy derivation or auditing logic. If hardware rejects new_bv, then something is broken with Xen's xstate logic. In both cases, crash the domain with an obvious error message, to help highlight the issues. Signed-off-by

[Xen-devel] [PATCH v3 0/2] x86/xstate: Fixes and improvements to xsetbv handling

2018-07-19 Thread Andrew Cooper
Andrew Cooper (2): x86/xstate: Use a guests CPUID policy, rather than allowing all features x86/xstate: Make errors in xstate calculations more obvious by crashing the domain xen/arch/x86/domctl.c| 2 +- xen/arch/x86/hvm/hvm.c | 2 +- xen/arch/x86/xstate.c| 37 +++

[Xen-devel] [PATCH v3 1/2] x86/xstate: Use a guests CPUID policy, rather than allowing all features

2018-07-19 Thread Andrew Cooper
It turns out that Xen has never enforced that a domain remain within the xstate features advertised in CPUID. The check of new_bv against xfeature_mask ensures that a domain stays within the set of features that Xen has enabled in hardware (and therefore isn't a security problem), but this does me

Re: [Xen-devel] [PATCH v3 2/4] x86: possibly bring up all CPUs even if not all are supposed to be used

2018-07-19 Thread Jan Beulich
>>> On 19.07.18 at 13:16, wrote: > On 07/19/2018 11:32 AM, Jan Beulich wrote: >> Note: On one of my test systems the parked CPUs get _PSD data reported >> by Dom0 that is different from the non-parked ones (coord_type is >> 0xFC instead of 0xFE). Giving Dom0 enough vCPU-s eliminates th

Re: [Xen-devel] [PATCH 5/6] x86/HVM: prefill cache with PDPTEs when possible

2018-07-19 Thread Jan Beulich
>>> On 19.07.18 at 13:15, wrote: > On 19/07/18 11:50, Jan Beulich wrote: >> Since strictly speaking it is incorrect for guest_walk_tables() to read >> L3 entries during PAE page walks, try to overcome this where possible by >> pre-loading the values from hardware into the cache. Sadly the >> infor

Re: [Xen-devel] [PATCH 5/6] x86/HVM: prefill cache with PDPTEs when possible

2018-07-19 Thread Andrew Cooper
On 19/07/18 12:47, Jan Beulich wrote: On 19.07.18 at 13:15, wrote: >> On 19/07/18 11:50, Jan Beulich wrote: >>> Since strictly speaking it is incorrect for guest_walk_tables() to read >>> L3 entries during PAE page walks, try to overcome this where possible by >>> pre-loading the values from

[Xen-devel] [ovmf test] 125407: regressions - FAIL

2018-07-19 Thread osstest service owner
flight 125407 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/125407/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64-xsm 6 xen-buildfail REGR. vs. 125295 build-amd64

[Xen-devel] [libvirt test] 125300: regressions - FAIL

2018-07-19 Thread osstest service owner
flight 125300 libvirt real [real] http://logs.test-lab.xenproject.org/osstest/logs/125300/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-arm64-libvirt 6 libvirt-buildfail REGR. vs. 123814 build-i386-libvirt

Re: [Xen-devel] [PATCH v3] x86/mm: Add mem access rights to NPT

2018-07-19 Thread Isaila Alexandru
On Jo, 2018-07-19 at 04:02 -0600, Jan Beulich wrote: > > > > > > > > > > > > > On 19.07.18 at 10:43, wrote: > > On 07/19/2018 11:30 AM, Jan Beulich wrote: > > > > > > > > > > > > > > > > > > > > > > > > On 19.07.18 at 10:18, wrote: > > > > On Mi, 2018-07-18 at 15:33 +, George Dunlap wr

Re: [Xen-devel] [PATCH 1/6] x86/mm: add optional cache to GLA->GFN translation

2018-07-19 Thread Paul Durrant
> -Original Message- > From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: 19 July 2018 11:46 > To: xen-devel > Cc: Razvan Cojocaru ; Andrew Cooper > ; Paul Durrant ; > George Dunlap ; ta...@tklengyel.com; Tim > (Xen.org) > Subject: [PATCH 1/6] x86/mm: add optional cache to GLA->GFN tran

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

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

Re: [Xen-devel] [PATCH 2/6] x86/mm: use optional cache in guest_walk_tables()

2018-07-19 Thread Paul Durrant
> -Original Message- > From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: 19 July 2018 11:47 > To: xen-devel > Cc: Andrew Cooper ; Paul Durrant > ; George Dunlap > Subject: [PATCH 2/6] x86/mm: use optional cache in guest_walk_tables() > > The caching isn't actually implemented here, th

[Xen-devel] [ovmf bisection] complete build-i386

2018-07-19 Thread osstest service owner
branch xen-unstable xenbranch xen-unstable job build-i386 testid xen-build Tree: ovmf https://github.com/tianocore/edk2.git Tree: qemu git://xenbits.xen.org/qemu-xen-traditional.git Tree: qemuu git://xenbits.xen.org/qemu-xen.git Tree: xen git://xenbits.xen.org/xen.git *** Found and reproduced pro

[Xen-devel] [PATCH] xen/spinlock: Don't use pvqspinlock if only 1 vCPU

2018-07-19 Thread Waiman Long
On a VM with only 1 vCPU, the locking fast paths will always be successful. In this case, there is no need to use the the PV qspinlock code which has higher overhead on the unlock side than the native qspinlock code. Signed-off-by: Waiman Long --- arch/x86/xen/spinlock.c | 3 ++- 1 file changed,

[Xen-devel] [PATCH v13 08/11] x86/hvm: Add handler for save_one funcs

2018-07-19 Thread Alexandru Isaila
Signed-off-by: Alexandru Isaila --- Changes since V8: - Add comment for the handler return values. --- xen/arch/x86/cpu/mcheck/vmce.c | 1 + xen/arch/x86/hvm/hpet.c| 2 +- xen/arch/x86/hvm/hvm.c | 6 +- xen/arch/x86/hvm/i8254.c | 2 +- xen/arch/x86/hvm/irq.c

[Xen-devel] [PATCH v13 07/11] x86/hvm: Introduce viridian_save_vcpu_ctxt_one() func

2018-07-19 Thread Alexandru Isaila
This is used to save data from a single instance. Signed-off-by: Alexandru Isaila Reviewed-by: Paul Durrant --- Changes since V12: - Remove blank line - Apply coding style to for_each. --- xen/arch/x86/hvm/viridian.c | 30 +++--- 1 file changed, 19 inser

[Xen-devel] [PATCH v13 00/11] x86/domctl: Save info for one vcpu instance

2018-07-19 Thread Alexandru Isaila
Hi all, This patch series addresses the ideea of saving data from a single vcpu instance. First it starts by adding *save_one functions, then it introduces a handler for the new save_one* funcs and makes use of it in the hvm_save and hvm_save_one funcs. The final 2 patches are used for clean up.

[Xen-devel] [PATCH v13 04/11] x86/hvm: Introduce hvm_save_cpu_xsave_states_one

2018-07-19 Thread Alexandru Isaila
This is used to save data from a single instance. Signed-off-by: Alexandru Isaila --- Changes since V11: - hvm_save_cpu_xsave_states_one() returns the err from _hvm_init_entry(). - hvm_save_cpu_xsave_states() returns err from hvm_save_cpu_xsave_states_one(); -

[Xen-devel] [PATCH v13 11/11] x86/hvm: Remove save_one handler

2018-07-19 Thread Alexandru Isaila
Signed-off-by: Alexandru Isaila --- xen/arch/x86/cpu/mcheck/vmce.c | 1 - xen/arch/x86/hvm/hpet.c| 2 +- xen/arch/x86/hvm/hvm.c | 5 + xen/arch/x86/hvm/i8254.c | 2 +- xen/arch/x86/hvm/irq.c | 6 +++--- xen/arch/x86/hvm/mtrr.c| 2 +- xen/arch/x86/hv

[Xen-devel] [PATCH v13 09/11] x86/domctl: Don't pause the whole domain if only getting vcpu state

2018-07-19 Thread Alexandru Isaila
This patch is focused on moving the for loop to the caller so now we can save info for a single vcpu instance with the save_one handlers. Signed-off-by: Alexandru Isaila --- Changes since V11: - Changed the CONTINUE return to return 0. --- xen/arch/x86/hvm/hvm.c | 19 --- xen/arch

[Xen-devel] [PATCH v13 02/11] x86/hvm: Introduce hvm_save_tsc_adjust_one() func

2018-07-19 Thread Alexandru Isaila
This is used to save data from a single instance. Signed-off-by: Alexandru Isaila --- Changes since V9: - Change return of the save_one func to return hvm_save_entry. --- xen/arch/x86/hvm/hvm.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/xen/arch/x

[Xen-devel] [PATCH v13 10/11] x86/hvm: Remove redundant save functions

2018-07-19 Thread Alexandru Isaila
This patch removes the redundant save functions and renames the save_one* to save. It then changes the domain param to vcpu in the save funcs. Signed-off-by: Alexandru Isaila --- Changes since V11: - Remove enum return type for save funcs. --- xen/arch/x86/cpu/mcheck/vmce.c | 19 ++-

[Xen-devel] [PATCH v13 03/11] x86/hvm: Introduce hvm_save_cpu_ctxt_one func

2018-07-19 Thread Alexandru Isaila
This is used to save data from a single instance. Signed-off-by: Alexandru Isaila --- Changes since V12: - Changed memset to {} init. --- xen/arch/x86/hvm/hvm.c | 214 + 1 file changed, 111 insertions(+), 103 deletions(-) diff --git a/xen

[Xen-devel] [PATCH v13 05/11] x86/hvm: Introduce hvm_save_cpu_msrs_one func

2018-07-19 Thread Alexandru Isaila
This is used to save data from a single instance. Signed-off-by: Alexandru Isaila Reviewed-by: Paul Durrant --- Changes since V11: - hvm_save_cpu_msrs() returns err from hvm_save_cpu_msrs_one(). --- xen/arch/x86/hvm/hvm.c | 105 +++-- 1 file

[Xen-devel] [PATCH v13 06/11] x86/hvm: Introduce hvm_save_mtrr_msr_one func

2018-07-19 Thread Alexandru Isaila
This is used to save data from a single instance. Signed-off-by: Alexandru Isaila --- Changes since v11: - hvm_save_mtrr_msr() now returns err from hvm_save_mtrr_msr_one(). Note: This patch is based on Roger Pau Monne's series[1] --- xen/arch/x86/hvm/mtrr.c | 81 +++

[Xen-devel] [PATCH v13 01/11] x86/cpu: Introduce vmce_save_vcpu_ctxt_one() func

2018-07-19 Thread Alexandru Isaila
This is used to save data from a single instance. Signed-off-by: Alexandru Isaila --- Changes since V11: - Removed the memset and added init with {}. --- xen/arch/x86/cpu/mcheck/vmce.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/xen/arch/x8

Re: [Xen-devel] [PATCH 3/6] x86/HVM: implement memory read caching

2018-07-19 Thread Paul Durrant
> -Original Message- > From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: 19 July 2018 11:49 > To: xen-devel > Cc: Brian Woods ; Suravee Suthikulpanit > ; Andrew Cooper > ; Paul Durrant ; > George Dunlap ; Jun Nakajima > ; Kevin Tian ; Boris > Ostrovsky ; Tim (Xen.org) > Subject: [PATCH

[Xen-devel] [PATCH] automation/build: Fix command, improve explanation

2018-07-19 Thread Anthony PERARD
Fix the command to use shell syntax for environment variables. Make it more explicite that the command `make` is going to modifie the current directory. Also include an example of what a container is. Signed-off-by: Anthony PERARD --- I'm attempted to change the short options by their long eq

Re: [Xen-devel] [PATCH] automation/build: Fix command, improve explanation

2018-07-19 Thread Wei Liu
On Thu, Jul 19, 2018 at 03:30:52PM +0100, Anthony PERARD wrote: > Fix the command to use shell syntax for environment variables. > > Make it more explicite that the command `make` is going to modifie the typo: explicit and modify. > current directory. > > Also include an example of what a conta

Re: [Xen-devel] [PATCH v3] x86/mm: Add mem access rights to NPT

2018-07-19 Thread Tamas K Lengyel
On Thu, Jul 19, 2018 at 2:30 AM Jan Beulich wrote: > > >>> On 19.07.18 at 10:18, wrote: > > On Mi, 2018-07-18 at 15:33 +, George Dunlap wrote: > >> > On Jul 2, 2018, at 8:42 AM, Alexandru Isaila >> > @@ -112,8 +117,37 @@ static unsigned long p2m_type_to_flags(const > >> > struct p2m_domain *

[Xen-devel] [ovmf test] 125426: regressions - FAIL

2018-07-19 Thread osstest service owner
flight 125426 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/125426/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64-xsm 6 xen-buildfail REGR. vs. 125295 build-amd64

Re: [Xen-devel] [Notes for xen summit 2018 design session] Process changes: is the 6 monthly release Cadence too short, Security Process, ...

2018-07-19 Thread Juergen Gross
On 12/07/18 11:24, Lars Kurth wrote: > > > On 06/07/2018, 17:42, "Lars Kurth" wrote: > > Hi all, (I also moved the AB to BCC) > > I summarized the discussion in > https://docs.google.com/document/d/1W7OuISUau-FtPG6tIinD4GXYFb-hKDjaqTj84pogNrA/edit?usp=sharing > > > I m

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

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

Re: [Xen-devel] [PATCH] shim: Fix generation of compat/callback.i: allow redef of OBJECT vars

2018-07-19 Thread Stefano Stabellini
On Thu, 19 Jul 2018, Jan Beulich wrote: > > Signed-off-by: Christopher Clark > > --- > > Please use my gmail address for any correspondence to me. > > I think it is generally considered bad practice to have From: and S-o-b > differ. Why? That is perfectly fine. Signed-off-by is about copyright o

Re: [Xen-devel] [PATCH v2 20/21] xen: support console_switching between Dom0 and DomUs on ARM

2018-07-19 Thread Stefano Stabellini
On Thu, 19 Jul 2018, Jan Beulich wrote: > >>> On 18.07.18 at 18:59, wrote: > > On 18/07/18 08:12, Jan Beulich wrote: > > On 17.07.18 at 22:29, wrote: > >>> On 07/07/2018 00:12, Stefano Stabellini wrote: > Today Ctrl-AAA is used to switch between Xen and Dom0. Extend the > mechanism

[Xen-devel] [PATCH] libxl: Handle deprecation of QEMU's -usbdevice

2018-07-19 Thread Anthony PERARD
-usbdevice is deprecated as of QEMU 2.10. This patch replace the few options documented in xl.cfg(5) by the recommanded syntax. And if the option isn't recognize, simply use -usbdevice with a warning, the options isn't entirely removed from QEMU upstream. Also, remove from the manual the sentence

[Xen-devel] [ovmf test] 125434: regressions - FAIL

2018-07-19 Thread osstest service owner
flight 125434 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/125434/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64-xsm 6 xen-buildfail REGR. vs. 125295 build-amd64

Re: [Xen-devel] [Notes for xen summit 2018 design session] Process changes: is the 6 monthly release Cadence too short, Security Process, ...

2018-07-19 Thread Lars Kurth
On 19/07/2018, 08:40, "Juergen Gross" wrote: > **ACTION: George will put together a survey for the committers outlining the issue and > trade-offs and then go from there** > Ping? Anything new? I'd like to know the dates for 4.12... Adding George: He was doing the

Re: [Xen-devel] [PATCH] shim: Fix generation of compat/callback.i: allow redef of OBJECT vars

2018-07-19 Thread Jan Beulich
>>> Stefano Stabellini 07/19/18 7:00 PM >>> >On Thu, 19 Jul 2018, Jan Beulich wrote: >> > Signed-off-by: Christopher Clark >> > --- >> > Please use my gmail address for any correspondence to me. >> >> I think it is generally considered bad practice to have From: and S-o-b >> differ. > >Why? Tha

Re: [Xen-devel] [PATCH 5/6] x86/HVM: prefill cache with PDPTEs when possible

2018-07-19 Thread Jan Beulich
>>> Andrew Cooper 07/19/18 1:55 PM >>> >On 19/07/18 12:47, Jan Beulich wrote: > On 19.07.18 at 13:15, wrote: >>> On 19/07/18 11:50, Jan Beulich wrote: Since strictly speaking it is incorrect for guest_walk_tables() to read L3 entries during PAE page walks, try to overcome this where

Re: [Xen-devel] [PATCH v3] x86/mm: Add mem access rights to NPT

2018-07-19 Thread Jan Beulich
>>> Tamas K Lengyel 07/19/18 5:09 PM >>> >On Thu, Jul 19, 2018 at 2:30 AM Jan Beulich wrote: > >>> On 19.07.18 at 10:18, wrote: > > On Mi, 2018-07-18 at 15:33 +, George Dunlap wrote: > >> > On Jul 2, 2018, at 8:42 AM, Alexandru Isaila > >> > +break; >> >> > +case p2m_acce

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

2018-07-19 Thread osstest service owner
flight 125304 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/125304/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-xl-arndale broken test-armhf-armhf-xl-

Re: [Xen-devel] [PATCH 5/6] x86/HVM: prefill cache with PDPTEs when possible

2018-07-19 Thread Andrew Cooper
On 19/07/18 19:37, Jan Beulich wrote: Andrew Cooper 07/19/18 1:55 PM >>> >> On 19/07/18 12:47, Jan Beulich wrote: >> On 19.07.18 at 13:15, wrote: On 19/07/18 11:50, Jan Beulich wrote: > Since strictly speaking it is incorrect for guest_walk_tables() to read > L3 entries duri

Re: [Xen-devel] [PATCH v3 0/2] x86/xstate: Fixes and improvements to xsetbv handling

2018-07-19 Thread Jan Beulich
>>> Andrew Cooper 07/19/18 1:46 PM >>> >Andrew Cooper (2): >x86/xstate: Use a guests CPUID policy, rather than allowing all features >x86/xstate: Make errors in xstate calculations more obvious by crashing the >domain Reviewed-by: Jan Beulich ___ X

  1   2   >