[Xen-devel] Ping: [PATCH RFC] x86/HVM: also stuff RSB upon exit to guest

2018-08-17 Thread Jan Beulich
>>> On 27.07.18 at 16:20, wrote: > In order to mostly eliminate abuse of what Xen leaves in the RSB by > guest level attackers, fill the RSB with almost-NULL pointers right > before entering guest context. > > The placement of the initialization code is intentional: If it was put > in e.g.

[Xen-devel] [PATCH v3 0/2] x86: HW vulnerability mitigation logging improvements

2018-08-17 Thread Jan Beulich
I'm not really convinced of the change done in v3, even less so with x86'es pv/domain.h not really having been suitable for inclusion in spec-ctrl.c (needed an extra, seemingly unrelated adjustment), but in the interest of getting this done, here you go. 1: x86: report use of PCID together with

Re: [Xen-devel] [PATCH v2 2/2] x86/spec-ctrl: add support for modifying SSBD VIA LS_CFG MSR

2018-08-17 Thread Jan Beulich
>>> On 16.08.18 at 22:02, wrote: > On Wed, Aug 15, 2018 at 10:00:48AM -0600, Jan Beulich wrote: >> >>> On 09.08.18 at 21:42, wrote: >> > --- a/xen/arch/x86/spec_ctrl.c >> > +++ b/xen/arch/x86/spec_ctrl.c >> >> First of all - I'm not convinced some of the AMD specific code here >> wouldn't

[Xen-devel] [PATCH] x86/mm: re-arrange get_page_from_le() vs pv_l1tf_check_le

2018-08-17 Thread Jan Beulich
Restore symmetry between get_page_from_le(): pv_l1tf_check_le is uniformly invoked from outside of them. They're no longer getting called for non-present PTEs. This way the slightly odd three-way return value meaning of the higher level ones can also be got rid of. Introduce local variables

[Xen-devel] [PATCH v2 1/2] x86/mmcfg: Rename pt_pci_init() and call it in acpi_mmcfg_init()

2018-08-17 Thread Zhenzhong Duan
Given what pt_pci_init() actually does, rename it properly and move its declaration to pci.h, move the only call in acpi_mmcfg_init(). No functional change. Signed-off-by: Zhenzhong Duan Tested-by: Gopalasetty, Manoj --- xen/arch/x86/setup.c |2 --

[Xen-devel] [PATCH v2 2/2] x86/mmcfg/drhd: Move acpi_mmcfg_init() call before calling acpi_parse_dmar()

2018-08-17 Thread Zhenzhong Duan
pci_conf_read8() needs pci mmcfg mapping to work on multiple pci segments system such as HPE Superdome-Flex. Move acpi_mmcfg_init() call in acpi_boot_init() before calling acpi_parse_dmar() so that when pci_conf_read8() is called in acpi_parse_dev_scope(), we already have the mapping set up.

[Xen-devel] [PATCH v3 1/2] x86: report use of PCID together with reporting XPTI status

2018-08-17 Thread Jan Beulich
Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné --- v3: Move declaration to pv/domain.h. Re-base. v2: Add CONFIG_PV conditional. --- a/xen/arch/x86/pv/domain.c +++ b/xen/arch/x86/pv/domain.c @@ -289,6 +289,12 @@ int pv_domain_initialise(struct domain * return rc; } +bool __init

[Xen-devel] [PATCH v3 0/5] x86: improve PDX <-> PFN and alike translations

2018-08-17 Thread Jan Beulich
1: remove page.h and processor.h inclusion from asm_defns.h 2: use PDEP/PEXT for maddr/direct-map-offset conversion when available 3: use PDEP/PEXT for PFN/PDX conversion when available 4: use MOV for PFN/PDX conversion when possible 5: use PDEP for PTE flags insertion when available

Re: [Xen-devel] [PATCH v2] libxl/arm: Fix build on arm64 + acpi w/ gcc 8.2

2018-08-17 Thread Wei Liu
On Thu, Aug 16, 2018 at 01:22:41PM -0700, Christopher Clark wrote: > Add zero-padding to #defined ACPI table strings that are copied. > Provides sufficient characters to satisfy the length required to > fully populate the destination and prevent array-bounds warnings. > Add BUILD_BUG_ON sizeof

[Xen-devel] [ovmf baseline-only test] 75076: tolerable FAIL

2018-08-17 Thread Platform Team regression test user
This run is configured for baseline tests only. flight 75076 ovmf real [real] http://osstest.xensource.com/osstest/logs/75076/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-i386-xl-qemuu-ovmf-amd64 10 debian-hvm-install fail like 75068

[Xen-devel] [xen-unstable-smoke test] 126021: regressions - FAIL

2018-08-17 Thread osstest service owner
flight 126021 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/126021/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-xl 12 guest-start fail REGR. vs. 125923 Tests which

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

2018-08-17 Thread Jan Beulich
>>> On 17.08.18 at 06:52, wrote: > flight 126019 xen-unstable-smoke real [real] > http://logs.test-lab.xenproject.org/osstest/logs/126019/ > > Regressions :-( > > Tests which did not succeed and are blocking, > including tests which could not be run: > test-armhf-armhf-xl 12

Re: [Xen-devel] [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread Greg Kroah-Hartman
On Fri, Aug 17, 2018 at 09:59:00AM +0200, David Hildenbrand wrote: > From: Vitaly Kuznetsov > > Well require to call add_memory()/add_memory_resource() with > device_hotplug_lock held, to avoid a lock inversion. Allow external modules > (e.g. hv_balloon) that make use of

Re: [Xen-devel] [PATCH v3 4/5] x86: use MOV for PFN/PDX conversion when possible

2018-08-17 Thread Andrew Cooper
On 17/08/2018 08:23, Jan Beulich wrote: > ... and (of course) also maddr / direct-map-offset ones. > > Most x86 systems don't actually require the use of PDX compression. Now > that we have patching for the conversion code in place anyway, extend it > to use simple MOV when possible. Introduce a

Re: [Xen-devel] [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread David Hildenbrand
On 17.08.2018 10:41, Greg Kroah-Hartman wrote: > On Fri, Aug 17, 2018 at 09:59:00AM +0200, David Hildenbrand wrote: >> From: Vitaly Kuznetsov >> >> Well require to call add_memory()/add_memory_resource() with >> device_hotplug_lock held, to avoid a lock inversion. Allow external modules >> (e.g.

[Xen-devel] [PATCH v3 2/5] x86: use PDEP/PEXT for maddr/direct-map-offset conversion when available

2018-08-17 Thread Jan Beulich
This allows to fold 6 instructions into a single one, reducing code size quite a bit, especially when not considering the fallback functions (which won't ever need to be brought into iCache or their mappings into iTLB on systems supporting BMI2). Make use of gcc's new V operand modifier, even if

[Xen-devel] [PATCH v3 1/5] x86: remove page.h and processor.h inclusion from asm_defns.h

2018-08-17 Thread Jan Beulich
Subsequent changes require this (too wide anyway imo) dependency to be dropped. Signed-off-by: Jan Beulich --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include ---

Re: [Xen-devel] [PATCH] x86: use VMLOAD for PV context switch

2018-08-17 Thread Jan Beulich
>>> On 17.08.18 at 00:04, wrote: > On Tue, Jul 10, 2018 at 04:14:11AM -0600, Jan Beulich wrote: >> Having noticed that VMLOAD alone is about as fast as a single of the >> involved WRMSRs, I thought it might be a reasonable idea to also use it >> for PV. Measurements, however, have shown that an

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

2018-08-17 Thread osstest service owner
flight 125914 linux-3.18 real [real] http://logs.test-lab.xenproject.org/osstest/logs/125914/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-libvirt-raw broken Tests which are

Re: [Xen-devel] [PATCH v3 0/4] x86/iommu: PVH Dom0 workarounds for missing RMRR entries

2018-08-17 Thread Jan Beulich
>>> On 16.08.18 at 18:43, wrote: > Booting just linux with both options works just fine, I grepped the > dmesg log for the device that causes the issues with Xen but there are > no errors in the log: Well, this as well as ... > I double checked and the option is set properly but I'm still

Re: [Xen-devel] [PATCH RFC 2/2] mm/memory_hotplug: fix online/offline_pages called w.o. mem_hotplug_lock

2018-08-17 Thread Rafael J. Wysocki
On Fri, Aug 17, 2018 at 9:59 AM David Hildenbrand wrote: > > There seem to be some problems as result of 30467e0b3be ("mm, hotplug: > fix concurrent memory hot-add deadlock"), which tried to fix a possible > lock inversion reported and discussed in [1] due to the two locks > a)

Re: [Xen-devel] [PATCH v3 1/5] x86: remove page.h and processor.h inclusion from asm_defns.h

2018-08-17 Thread Andrew Cooper
On 17/08/2018 08:20, Jan Beulich wrote: > Subsequent changes require this (too wide anyway imo) dependency to be > dropped. > > Signed-off-by: Jan Beulich Acked-by: Andrew Cooper ___ Xen-devel mailing list Xen-devel@lists.xenproject.org

Re: [Xen-devel] [PATCH v3 0/4] x86/iommu: PVH Dom0 workarounds for missing RMRR entries

2018-08-17 Thread Roger Pau Monné
On Thu, Aug 16, 2018 at 10:43:54AM -0600, Tamas K Lengyel wrote: > I double checked and the option is set properly but I'm still getting > the same non-present entry faults as before. At the moment I don't > have serial access so not sure how to verify that the option took > effect. This is my

Re: [Xen-devel] [PATCH v3 2/5] x86: use PDEP/PEXT for maddr/direct-map-offset conversion when available

2018-08-17 Thread Andrew Cooper
On 17/08/2018 08:21, Jan Beulich wrote: > --- a/xen/include/asm-x86/asm_defns.h > +++ b/xen/include/asm-x86/asm_defns.h > @@ -186,6 +186,20 @@ void ret_from_intr(void); > UNLIKELY_END_SECTION "\n" \ > ".Llikely." #tag ".%=:" > > +#define LINKONCE_PROLOGUE(sym)

Re: [Xen-devel] [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread Rafael J. Wysocki
On Fri, Aug 17, 2018 at 10:56 AM David Hildenbrand wrote: > > On 17.08.2018 10:41, Greg Kroah-Hartman wrote: > > On Fri, Aug 17, 2018 at 09:59:00AM +0200, David Hildenbrand wrote: > >> From: Vitaly Kuznetsov > >> > >> Well require to call add_memory()/add_memory_resource() with > >>

[Xen-devel] [PATCH v3 2/2] x86/spec-ctrl: split reporting for PV and HVM guests

2018-08-17 Thread Jan Beulich
Putting them on separate lines was suggested before, and is going to become necessary eventually anyway as things get added here. Split them now, and put the respective pieces in CONFIG_* conditionals at the same time. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper Reviewed-by: Roger Pau

[Xen-devel] [xen-4.11-testing baseline-only test] 75075: tolerable FAIL

2018-08-17 Thread Platform Team regression test user
This run is configured for baseline tests only. flight 75075 xen-4.11-testing real [real] http://osstest.xensource.com/osstest/logs/75075/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-xl-qemut-win10-i386 10 windows-installfail

[Xen-devel] [PATCH v3 3/5] x86: use PDEP/PEXT for PFN/PDX conversion when available

2018-08-17 Thread Jan Beulich
Both replace 6 instructions by a single one, further reducing code size, cache, and TLB footprint (in particular on systems supporting BMI2). Signed-off-by: Jan Beulich --- v2: Avoid quoted symbols; use gcc's new V operand modifier instead. Re-base. --- a/xen/arch/x86/mm.c +++

[Xen-devel] [PATCH v3 4/5] x86: use MOV for PFN/PDX conversion when possible

2018-08-17 Thread Jan Beulich
... and (of course) also maddr / direct-map-offset ones. Most x86 systems don't actually require the use of PDX compression. Now that we have patching for the conversion code in place anyway, extend it to use simple MOV when possible. Introduce a new pseudo-CPU-feature to key the patching off of.

[Xen-devel] [PATCH v3 5/5] x86: use PDEP for PTE flags insertion when available

2018-08-17 Thread Jan Beulich
This replaces 5 instructions by a single one, further reducing code size, cache, and TLB footprint (in particular on systems supporting BMI2). Signed-off-by: Jan Beulich --- Irrespective of the note regarding a possible alternative route, I think the change here is an improvement until someone

[Xen-devel] [PATCH RFC 2/2] mm/memory_hotplug: fix online/offline_pages called w.o. mem_hotplug_lock

2018-08-17 Thread David Hildenbrand
There seem to be some problems as result of 30467e0b3be ("mm, hotplug: fix concurrent memory hot-add deadlock"), which tried to fix a possible lock inversion reported and discussed in [1] due to the two locks a) device_lock() b) mem_hotplug_lock While add_memory() first takes b),

[Xen-devel] [PATCH RFC 0/2] mm: online/offline_pages called w.o. mem_hotplug_lock

2018-08-17 Thread David Hildenbrand
Reading through the code and studying how mem_hotplug_lock is to be used, I noticed that there are two places where we can end up calling device_online()/device_offline() - online_pages()/offline_pages() without the mem_hotplug_lock. And there are other places where we call

[Xen-devel] [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread David Hildenbrand
From: Vitaly Kuznetsov Well require to call add_memory()/add_memory_resource() with device_hotplug_lock held, to avoid a lock inversion. Allow external modules (e.g. hv_balloon) that make use of add_memory()/add_memory_resource() to lock device hotplug. Signed-off-by: Vitaly Kuznetsov [modify

Re: [Xen-devel] [PATCH RFC 2/2] mm/memory_hotplug: fix online/offline_pages called w.o. mem_hotplug_lock

2018-08-17 Thread David Hildenbrand
On 17.08.2018 10:20, Rafael J. Wysocki wrote: > On Fri, Aug 17, 2018 at 9:59 AM David Hildenbrand wrote: >> >> There seem to be some problems as result of 30467e0b3be ("mm, hotplug: >> fix concurrent memory hot-add deadlock"), which tried to fix a possible >> lock inversion reported and discussed

Re: [Xen-devel] [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread Rafael J. Wysocki
On Fri, Aug 17, 2018 at 10:41 AM Greg Kroah-Hartman wrote: > > On Fri, Aug 17, 2018 at 09:59:00AM +0200, David Hildenbrand wrote: > > From: Vitaly Kuznetsov > > > > Well require to call add_memory()/add_memory_resource() with > > device_hotplug_lock held, to avoid a lock inversion. Allow

[Xen-devel] [qemu-upstream-unstable test] 125919: tolerable FAIL - PUSHED

2018-08-17 Thread osstest service owner
flight 125919 qemu-upstream-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/125919/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 14 saverestore-support-checkfail like 122862

Re: [Xen-devel] [PATCH v5 4/8] mm: introduce a helper to get the memory type of a page

2018-08-17 Thread Jan Beulich
>>> On 17.08.18 at 12:17, wrote: On 14.08.18 at 15:43, wrote: >> +switch ( e820.map[i].type ) >> +{ >> +case E820_RAM: >> +return RAM_TYPE_CONVENTIONAL; >> + >> +case E820_RESERVED: >> +return RAM_TYPE_RESERVED;

Re: [Xen-devel] [PATCH v5 3/8] iommu: make iommu_inclusive_mapping a suboption of dom0-iommu

2018-08-17 Thread Roger Pau Monné
On Fri, Aug 17, 2018 at 04:04:34AM -0600, Jan Beulich wrote: > >>> On 14.08.18 at 15:43, wrote: > > --- a/xen/drivers/passthrough/vtd/iommu.c > > +++ b/xen/drivers/passthrough/vtd/iommu.c > > @@ -1304,11 +1304,9 @@ static void __hwdom_init > > intel_iommu_hwdom_init(struct domain *d) > > { > >

[Xen-devel] [xen-unstable-smoke test] 126043: regressions - FAIL

2018-08-17 Thread osstest service owner
flight 126043 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/126043/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-xl 12 guest-start fail REGR. vs. 125923 Tests which

Re: [Xen-devel] [PATCH v5 5/8] x86/iommu: switch the hwdom mapping function to use page_get_type

2018-08-17 Thread Jan Beulich
>>> On 14.08.18 at 15:43, wrote: > +static bool __hwdom_init hwdom_iommu_map(const struct domain *d, Unused function parameter? > + unsigned long pfn, > + unsigned long max_pfn) > +{ > +/* > + * Set up 1:1

Re: [Xen-devel] [PATCH v5 3/8] iommu: make iommu_inclusive_mapping a suboption of dom0-iommu

2018-08-17 Thread Jan Beulich
>>> On 17.08.18 at 12:32, wrote: > On Fri, Aug 17, 2018 at 04:04:34AM -0600, Jan Beulich wrote: >> >>> On 14.08.18 at 15:43, wrote: >> > --- a/xen/drivers/passthrough/vtd/iommu.c >> > +++ b/xen/drivers/passthrough/vtd/iommu.c >> > @@ -1304,11 +1304,9 @@ static void __hwdom_init >> >

Re: [Xen-devel] [PATCH v5 5/8] x86/iommu: switch the hwdom mapping function to use page_get_type

2018-08-17 Thread Jan Beulich
>>> On 14.08.18 at 15:43, wrote: > --- a/xen/drivers/passthrough/x86/iommu.c > +++ b/xen/drivers/passthrough/x86/iommu.c > @@ -134,6 +134,37 @@ void arch_iommu_domain_destroy(struct domain *d) > { > } > > +static bool __hwdom_init hwdom_iommu_map(const struct domain *d, > +

Re: [Xen-devel] [PATCH v5 6/8] dom0/pvh: change the order of the MMCFG initialization

2018-08-17 Thread Jan Beulich
>>> On 14.08.18 at 15:43, wrote: > So it's done before the iommu is initialized. This is required in > order to be able to fetch the MMCFG regions from the domain struct. > > No functional change. > > Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich

Re: [Xen-devel] [PATCH v5 7/8] vpci: introduce a helper to check MMCFG ranges

2018-08-17 Thread Jan Beulich
>>> On 14.08.18 at 15:43, wrote: > The helpers returns whether a given memory address belongs to a domain > MMCFG range. > > Signed-off-by: Roger Pau Monné I'd prefer if this was part of the patch actually using the new function. Jan ___ Xen-devel

Re: [Xen-devel] [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread David Hildenbrand
On 17.08.2018 12:06, Greg Kroah-Hartman wrote: > On Fri, Aug 17, 2018 at 11:41:24AM +0200, David Hildenbrand wrote: >> On 17.08.2018 11:03, Rafael J. Wysocki wrote: >>> On Fri, Aug 17, 2018 at 10:56 AM David Hildenbrand wrote: On 17.08.2018 10:41, Greg Kroah-Hartman wrote: > On Fri,

Re: [Xen-devel] [PATCH v5 8/8] x86/iommu: add map-reserved dom0-iommu option to map reserved memory ranges

2018-08-17 Thread Jan Beulich
>>> On 14.08.18 at 15:43, wrote: > @@ -138,13 +139,20 @@ static bool __hwdom_init hwdom_iommu_map(const struct > domain *d, > unsigned long pfn, > unsigned long max_pfn) > { > +unsigned int i; > + > /*

Re: [Xen-devel] [PATCH v5 8/8] x86/iommu: add map-reserved dom0-iommu option to map reserved memory ranges

2018-08-17 Thread Roger Pau Monné
On Fri, Aug 17, 2018 at 05:08:08AM -0600, Jan Beulich wrote: > >>> On 14.08.18 at 15:43, wrote: > > @@ -185,7 +219,13 @@ void __hwdom_init arch_iommu_hwdom_init(struct domain > > *d) > > if ( !hwdom_iommu_map(d, pfn, max_pfn) ) > > continue; > > > > -rc =

Re: [Xen-devel] [PATCH] rangeset: make inquiry functions tolerate NULL inputs

2018-08-17 Thread Roger Pau Monné
On Fri, Aug 17, 2018 at 03:20:11AM -0600, Jan Beulich wrote: > Rather than special casing the ->iomem_caps check in x86's > get_page_from_l1e() for the dom_xen case, let's be more tolerant in > general, along the lines of rangeset_is_empty(): A never allocated > rangeset can't possibly contain or

Re: [Xen-devel] [PATCH v3 2/5] x86: use PDEP/PEXT for maddr/direct-map-offset conversion when available

2018-08-17 Thread Jan Beulich
>>> On 17.08.18 at 10:59, wrote: > On 17/08/2018 08:21, Jan Beulich wrote: >> --- a/xen/include/asm-x86/asm_defns.h >> +++ b/xen/include/asm-x86/asm_defns.h >> @@ -186,6 +186,20 @@ void ret_from_intr(void); >> UNLIKELY_END_SECTION "\n" \ >> ".Llikely." #tag ".%=:" >>

Re: [Xen-devel] [PATCH v5 1/8] iommu: rename iommu_dom0_strict and iommu_passthrough

2018-08-17 Thread Jan Beulich
>>> On 14.08.18 at 15:43, wrote: > To iommu_hwdom_strict and iommu_hwdom_passthrough which is more > descriptive of their usage. Also change their type from bool_t to > bool. > > No functional change. > > Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich with one remark: > @@ -175,7

Re: [Xen-devel] [PATCH] rangeset: make inquiry functions tolerate NULL inputs

2018-08-17 Thread Roger Pau Monné
On Fri, Aug 17, 2018 at 03:41:31AM -0600, Jan Beulich wrote: > >>> On 17.08.18 at 11:29, wrote: > > As said in the commit message, this is done to avoid an extra check in > > get_page_from_l1e I assume, so should the extra check also be dropped > > here? > > I'm afraid I don't understand: I

Re: [Xen-devel] [PATCH] libxc: copy back the result of XEN_DOMCTL_createdomain

2018-08-17 Thread Andrew Cooper
On 17/08/2018 10:52, Roger Pau Monné wrote: > On Fri, Aug 17, 2018 at 11:50:53AM +0200, Roger Pau Monne wrote: >> Fixes the ARM build breakage introduced by 54ed251dc7. > It's not a build fix but a runtime fix, so the 'build' in the above > sentence should be removed if this ends up in the repo.

Re: [Xen-devel] [PATCH v5 3/8] iommu: make iommu_inclusive_mapping a suboption of dom0-iommu

2018-08-17 Thread Jan Beulich
>>> On 14.08.18 at 15:43, wrote: > --- a/xen/drivers/passthrough/vtd/iommu.c > +++ b/xen/drivers/passthrough/vtd/iommu.c > @@ -1304,11 +1304,9 @@ static void __hwdom_init intel_iommu_hwdom_init(struct > domain *d) > { > struct acpi_drhd_unit *drhd; > > -if ( !iommu_hwdom_passthrough

Re: [Xen-devel] [PATCH v5 4/8] mm: introduce a helper to get the memory type of a page

2018-08-17 Thread Jan Beulich
>>> On 14.08.18 at 15:43, wrote: > --- a/xen/arch/arm/mm.c > +++ b/xen/arch/arm/mm.c > @@ -1181,6 +1181,12 @@ int page_is_ram_type(unsigned long mfn, unsigned long > mem_type) > return 0; > } > > +int page_get_type(unsigned long mfn) > +{ > +ASSERT_UNREACHABLE(); > +return -1; >

[Xen-devel] [PATCH] rangeset: make inquiry functions tolerate NULL inputs

2018-08-17 Thread Jan Beulich
Rather than special casing the ->iomem_caps check in x86's get_page_from_l1e() for the dom_xen case, let's be more tolerant in general, along the lines of rangeset_is_empty(): A never allocated rangeset can't possibly contain or overlap any range. Reported-by: Andrew Cooper Signed-off-by: Jan

Re: [Xen-devel] [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread David Hildenbrand
On 17.08.2018 11:03, Rafael J. Wysocki wrote: > On Fri, Aug 17, 2018 at 10:56 AM David Hildenbrand wrote: >> >> On 17.08.2018 10:41, Greg Kroah-Hartman wrote: >>> On Fri, Aug 17, 2018 at 09:59:00AM +0200, David Hildenbrand wrote: From: Vitaly Kuznetsov Well require to call

Re: [Xen-devel] [PATCH] rangeset: make inquiry functions tolerate NULL inputs

2018-08-17 Thread Jan Beulich
>>> On 17.08.18 at 11:29, wrote: > On Fri, Aug 17, 2018 at 03:20:11AM -0600, Jan Beulich wrote: >> Rather than special casing the ->iomem_caps check in x86's >> get_page_from_l1e() for the dom_xen case, let's be more tolerant in >> general, along the lines of rangeset_is_empty(): A never

Re: [Xen-devel] [PATCH] libxc: copy back the result of XEN_DOMCTL_createdomain

2018-08-17 Thread Roger Pau Monné
On Fri, Aug 17, 2018 at 11:50:53AM +0200, Roger Pau Monne wrote: > Fixes the ARM build breakage introduced by 54ed251dc7. It's not a build fix but a runtime fix, so the 'build' in the above sentence should be removed if this ends up in the repo. ___

Re: [Xen-devel] [PATCH v5 2/8] iommu: introduce dom0-iommu option

2018-08-17 Thread Jan Beulich
>>> On 14.08.18 at 15:43, wrote: > --- a/docs/misc/xen-command-line.markdown > +++ b/docs/misc/xen-command-line.markdown > @@ -681,6 +681,19 @@ Flag that makes a dom0 boot in PVHv2 mode. > Flag that makes a dom0 use shadow paging. Only works when "pvh" is > enabled. > > +### dom0-iommu > +>

[Xen-devel] [PATCH] libxc: copy back the result of XEN_DOMCTL_createdomain

2018-08-17 Thread Roger Pau Monne
Fixes the ARM build breakage introduced by 54ed251dc7. Signed-off-by: Roger Pau Monné --- I've only build-tested this on x86. --- Cc: Ian Jackson Cc: Wei Liu --- tools/libxc/xc_domain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index

Re: [Xen-devel] [PATCH] rangeset: make inquiry functions tolerate NULL inputs

2018-08-17 Thread Wei Liu
On Fri, Aug 17, 2018 at 03:20:11AM -0600, Jan Beulich wrote: > Rather than special casing the ->iomem_caps check in x86's > get_page_from_l1e() for the dom_xen case, let's be more tolerant in > general, along the lines of rangeset_is_empty(): A never allocated > rangeset can't possibly contain or

Re: [Xen-devel] [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread Greg Kroah-Hartman
On Fri, Aug 17, 2018 at 11:41:24AM +0200, David Hildenbrand wrote: > On 17.08.2018 11:03, Rafael J. Wysocki wrote: > > On Fri, Aug 17, 2018 at 10:56 AM David Hildenbrand wrote: > >> > >> On 17.08.2018 10:41, Greg Kroah-Hartman wrote: > >>> On Fri, Aug 17, 2018 at 09:59:00AM +0200, David

Re: [Xen-devel] [PATCH] libxc: copy back the result of XEN_DOMCTL_createdomain

2018-08-17 Thread Wei Liu
On Fri, Aug 17, 2018 at 11:50:53AM +0200, Roger Pau Monne wrote: > Fixes the ARM build breakage introduced by 54ed251dc7. > > Signed-off-by: Roger Pau Monné Acked-by: Wei Liu ___ Xen-devel mailing list Xen-devel@lists.xenproject.org

[Xen-devel] Virtualization fundamental.

2018-08-17 Thread Jason Long
Hello. Can anyone show me a book about learning Virtualization fundamental? Thank you. ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread Heiko Carstens
On Fri, Aug 17, 2018 at 01:04:58PM +0200, David Hildenbrand wrote: > >> If there are no objections, I'll go into that direction. But I'll wait > >> for more comments regarding the general concept first. > > > > It is the middle of the merge window, and maintainers are really busy > > right now.

Re: [Xen-devel] [PATCH v5 8/8] x86/iommu: add map-reserved dom0-iommu option to map reserved memory ranges

2018-08-17 Thread Jan Beulich
>>> On 17.08.18 at 13:17, wrote: > On Fri, Aug 17, 2018 at 05:08:08AM -0600, Jan Beulich wrote: >> >>> On 14.08.18 at 15:43, wrote: >> > @@ -185,7 +219,13 @@ void __hwdom_init arch_iommu_hwdom_init(struct domain >> > *d) >> > if ( !hwdom_iommu_map(d, pfn, max_pfn) ) >> >

Re: [Xen-devel] [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug

2018-08-17 Thread David Hildenbrand
On 17.08.2018 13:28, Heiko Carstens wrote: > On Fri, Aug 17, 2018 at 01:04:58PM +0200, David Hildenbrand wrote: If there are no objections, I'll go into that direction. But I'll wait for more comments regarding the general concept first. >>> >>> It is the middle of the merge window, and

[Xen-devel] [linux-next test] 125915: regressions - FAIL

2018-08-17 Thread osstest service owner
flight 125915 linux-next real [real] http://logs.test-lab.xenproject.org/osstest/logs/125915/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qcow210 debian-di-installfail REGR. vs. 125872

Re: [Xen-devel] [PATCH v2 1/2] x86/mmcfg: Rename pt_pci_init() and call it in acpi_mmcfg_init()

2018-08-17 Thread Jan Beulich
>>> On 17.08.18 at 09:01, wrote: > Given what pt_pci_init() actually does, rename it properly and move its > declaration to pci.h, move the only call in acpi_mmcfg_init(). > > No functional change. > > Signed-off-by: Zhenzhong Duan > Tested-by: Gopalasetty, Manoj Acked-by: Jan Beulich

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-17 Thread Jan Beulich
>>> On 15.08.18 at 19:57, wrote: > --- a/xen/arch/x86/Rules.mk > +++ b/xen/arch/x86/Rules.mk > @@ -29,6 +29,10 @@ $(call as-option-add,CFLAGS,CC,"invpcid > (%rax)$$(comma)%rax",-DHAVE_AS_INVPCID) > $(call as-option-add,CFLAGS,CC,\ > ".if ((1 > 0) < 0); .error

[Xen-devel] [PATCH 33/34] x86/pvshim: disable HVM for PV shim

2018-08-17 Thread Wei Liu
Signed-off-by: Wei Liu --- tools/firmware/xen-dir/shim.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/firmware/xen-dir/shim.config b/tools/firmware/xen-dir/shim.config index 21d7075..de53dfe 100644 --- a/tools/firmware/xen-dir/shim.config +++

[Xen-devel] [PATCH 15/34] x86/nestedhvm: make it build with !CONFIG_HVM

2018-08-17 Thread Wei Liu
Make two functions static inline so that they can be referenced in p2m code. Check nestedhvm is enabled before calling nestedhvm_vmcx_flushtlb (which also has a side effect of not issuing unnecessary IPIs for non-nested case). While moving, reformat code and use proper boolean. Signed-off-by:

Re: [Xen-devel] [PATCH] x86: use VMLOAD for PV context switch

2018-08-17 Thread Brian Woods
On Fri, Aug 17, 2018 at 01:33:43AM -0600, Jan Beulich wrote: > >>> On 17.08.18 at 00:04, wrote: > > On Tue, Jul 10, 2018 at 04:14:11AM -0600, Jan Beulich wrote: > >> Having noticed that VMLOAD alone is about as fast as a single of the > >> involved WRMSRs, I thought it might be a reasonable idea

[Xen-devel] [PATCH] xen: xen.lds should depend on Kconfig's auto.conf

2018-08-17 Thread Wei Liu
xen.lds.S uses on some of the config options set by Kconfig. Signed-off-by: Wei Liu --- xen/arch/arm/Makefile | 2 +- xen/arch/x86/Makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index b9b141dc84..4d732df1eb 100644

[Xen-devel] [PATCH 00/34] Make CONFIG_HVM work

2018-08-17 Thread Wei Liu
This series goes through x86 code to make CONFIG_HVM work. With this series, it is possible to build Xen with PV support only. Running `xl info` on a host with PV only Xen: root@lcy2-dt108:~# xl info host : lcy2-dt108 release: 4.17.0-0.bpo.1-amd64 version

[Xen-devel] [PATCH 09/34] x86: guard HAS_VPCI with CONFIG_HVM

2018-08-17 Thread Wei Liu
VPCI is only useful for PVH / HVM guests. Ideally CONFIG_HVM should imply !PV_SHIM_EXCLUSIVE, but we still want to build PV_SHIM_EXCLUSIVE with CONFIG_HVM at this stage because a lot of things are still entangled. Signed-off-by: Wei Liu --- xen/arch/x86/Kconfig | 2 +- 1 file changed, 1

[Xen-devel] [PATCH 01/34] x86: fix building !CONFIG_LOCK_PROFILE

2018-08-17 Thread Wei Liu
The init function shouldn't be built or called at all when !CONFIG_LOCK_PROFILE. Signed-off-by: Wei Liu --- xen/common/spinlock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c index 8f2ba08..36e31c9 100644 --- a/xen/common/spinlock.c +++

[Xen-devel] [PATCH 07/34] x86: only call memory_type_changed for HVM guests

2018-08-17 Thread Wei Liu
Jan indicated that for PV guests the memory type is not changed, for HVM guests memory_type_changed is needed for EPT's effective memory type calculation. Call memory_type_changed for HVM guests only. Signed-off-by: Wei Liu --- xen/arch/x86/domctl.c | 4 ++-- xen/common/domctl.c

[Xen-devel] [PATCH 03/34] x86: HVM_FEP should depend on HVM

2018-08-17 Thread Wei Liu
Signed-off-by: Wei Liu --- xen/arch/x86/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 63b286a..ba5cb62 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -94,6 +94,7 @@ config BIGMEM config HVM_FEP bool "HVM

[Xen-devel] [PATCH 05/34] xen: is_hvm_domain should evaluate to 0 when !CONFIG_HVM

2018-08-17 Thread Wei Liu
Since it is defined in common header file, introduce CONFIG_HVM to Arm to avoid breakage. Signed-off-by: Wei Liu --- xen/arch/arm/Kconfig| 3 +++ xen/include/xen/sched.h | 6 ++ 2 files changed, 9 insertions(+) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index

[Xen-devel] [PATCH 04/34] x86/mm: don't reference hvm_funcs directly

2018-08-17 Thread Wei Liu
It is generally not a good idea to reference the internal data structure of the another subsystem directly. Introduce a wrapper function for the invlpg hook. No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/mm.c | 2 +- xen/include/asm-x86/hvm/hvm.h | 5 + 2 files

[Xen-devel] [PATCH 08/34] x86: enclose hvm_op and dm_op in CONFIG_HVM in PV hypercall table

2018-08-17 Thread Wei Liu
PV guest (Dom0) needs to able to use these two hypercalls in order to serve HVM guests. But if xen doesn't support HVM at all there is no point in exposing them to PV guests. Signed-off-by: Wei Liu --- xen/arch/x86/pv/hypercall.c | 4 1 file changed, 4 insertions(+) diff --git

[Xen-devel] [PATCH 02/34] x86/vvmx: make get_shadow_eptp static function

2018-08-17 Thread Wei Liu
Its callers live within the same file. Signed-off-by: Wei Liu --- xen/arch/x86/hvm/vmx/vvmx.c| 2 +- xen/include/asm-x86/hvm/vmx/vvmx.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index 918d47d..b7d9a1a

Re: [Xen-devel] [PATCH v2 2/2] x86/mmcfg/drhd: Move acpi_mmcfg_init() call before calling acpi_parse_dmar()

2018-08-17 Thread Jan Beulich
>>> On 17.08.18 at 09:01, wrote: > pci_conf_read8() needs pci mmcfg mapping to work on multiple pci segments > system such as HPE Superdome-Flex. > > Move acpi_mmcfg_init() call in acpi_boot_init() before calling > acpi_parse_dmar() so that when pci_conf_read8() is called in >

Re: [Xen-devel] [PATCH] xen: xen.lds should depend on Kconfig's auto.conf

2018-08-17 Thread Wei Liu
On Fri, Aug 17, 2018 at 03:56:29PM +0100, Wei Liu wrote: > xen.lds.S uses on some of the config options set by Kconfig. > > Signed-off-by: Wei Liu Ignore this patch, the path is wrong. Wei. ___ Xen-devel mailing list Xen-devel@lists.xenproject.org

[Xen-devel] [PATCH v2] xen: xen.lds should depend on Kconfig's auto.conf

2018-08-17 Thread Wei Liu
xen.lds.S uses on some of the config options set by Kconfig. Signed-off-by: Wei Liu --- v2: correct the path used in the patch. --- xen/arch/arm/Makefile | 2 +- xen/arch/x86/Makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/Makefile

[Xen-devel] [PATCH 14/34] x86/pt: add HVM check to XEN_DOMCTL_unbind_pt_irq

2018-08-17 Thread Wei Liu
Its counterpart is HVM only. Add the check to help dead code elimination to figure out the call to pt_irq_destroy_bind is not needed when HVM is not enabled. Signed-off-by: Wei Liu --- xen/arch/x86/domctl.c | 4 1 file changed, 4 insertions(+) diff --git a/xen/arch/x86/domctl.c

[Xen-devel] [PATCH 27/34] x86: make hvm_inject_* functions build when !CONFIG_HVM

2018-08-17 Thread Wei Liu
They reference hvm_inject_event which is HVM code (not compiled). They aren't used by code outside HVM code anyway. Signed-off-by: Wei Liu --- xen/include/asm-x86/hvm/hvm.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h

[Xen-devel] [PATCH 26/34] x86/mm/shadow: split out HVM only code

2018-08-17 Thread Wei Liu
Move the code previously enclosed in CONFIG_HVM into its own file. Note that although some code explicitly check is_hvm_*, which hints it can be used for PV too, I can't find a code path that would be the case. Signed-off-by: Wei Liu --- Can be squashed into previous patch if that's preferable.

[Xen-devel] [PATCH 13/34] x86/pt: split out HVM functions from vtd.c

2018-08-17 Thread Wei Liu
Functions are moved to hvm.c. Reorder makefile items while at it. Signed-off-by: Wei Liu --- xen/drivers/passthrough/vtd/x86/Makefile | 3 +- xen/drivers/passthrough/vtd/x86/hvm.c| 77 +- xen/drivers/passthrough/vtd/x86/vtd.c| 45 +--- 3 files

[Xen-devel] [PATCH 20/34] x86/mtrr: move is_var_mtrr_overlapped

2018-08-17 Thread Wei Liu
Move it to x86 generic code. While at it, use proper boolean type. Signed-off-by: Wei Liu --- xen/arch/x86/cpu/mtrr/generic.c | 31 +++ xen/arch/x86/hvm/mtrr.c | 31 --- xen/include/asm-x86/mtrr.h | 2 +- 3 files changed, 32

[Xen-devel] [PATCH 21/34] x86/mm: p2m_flush and nvcpu_flush are HVM only

2018-08-17 Thread Wei Liu
p2m_flush is only called by HAP code, nvcpu_flush is only useful for nestedhvm, both of which depend on HVM support. Enclose their code in CONFIG_HVM. Add assertions. Signed-off-by: Wei Liu --- xen/arch/x86/mm/p2m.c | 6 ++ 1 file changed, 6 insertions(+) diff --git

[Xen-devel] [PATCH 31/34] xen: refuse to create HVM guests when !CONFIG_HVM

2018-08-17 Thread Wei Liu
Signed-off-by: Wei Liu --- xen/common/domain.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index 171d25e..a22df12 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -318,8 +318,14 @@ struct domain

[Xen-devel] [PATCH 24/34] x86/mem_access: put HVM only function under CONFIG_HVM

2018-08-17 Thread Wei Liu
Signed-off-by: Wei Liu --- xen/arch/x86/mm/mem_access.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c index 03a8641..e1525fd 100644 --- a/xen/arch/x86/mm/mem_access.c +++ b/xen/arch/x86/mm/mem_access.c @@ -138,6 +138,7 @@ bool

[Xen-devel] [PATCH 10/34] x86: stub out has_* testing for emulation flags

2018-08-17 Thread Wei Liu
Most are all HVM only. Provide stubs for !CONFIG_HVM. One exception is PIT emulation, which is available to both PV and HVM. Signed-off-by: Wei Liu --- xen/include/asm-x86/domain.h | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git

[Xen-devel] [PATCH 11/34] xen/pt: io.c contains HVM only code

2018-08-17 Thread Wei Liu
We still need to test CONFIG_X86 because Arm also defines CONFIG_HVM. Signed-off-by: Wei Liu --- xen/drivers/passthrough/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/Makefile b/xen/drivers/passthrough/Makefile index 6087333..6b2d2e0

[Xen-devel] [PATCH 16/34] x86/hvm: enclose hvm_enabled and hvm_funcs in CONFIG_HVM

2018-08-17 Thread Wei Liu
This helps to take advantage of dead code elimination. Turn hvm_enabled into proper bool while at it. Providing an empty hvm_funcs resolves a lot of undefined references to it in the header. It is safe to do so because those functions / macros are not expected to be used. Signed-off-by: Wei Liu

[Xen-devel] [PATCH 22/34] x86/mm: put HVM only code under CONFIG_HVM

2018-08-17 Thread Wei Liu
Going through the code, nested EPT, EPT, and ALTP2M depend on HVM code. Put these components under CONFIG_HVM. This further requires putting one of the vm event under CONFIG_HVM. Also make hap_enabled evaluate to false when !CONFIG_HVM. This in turn requires marking a variable in p2m_set_entry as

[Xen-devel] [PATCH 25/34] x86/mm/shadow: make it build with !CONFIG_HVM

2018-08-17 Thread Wei Liu
Enclose HVM only emulation code under CONFIG_HVM. Add some BUG()s to to catch any issue. Note that although some code checks is_hvm_*, which hints it can be called for PV as well, I can't find such paths. Signed-off-by: Wei Liu --- xen/arch/x86/mm/shadow/common.c | 18 --

[Xen-devel] [PATCH 28/34] x86/vm_event: put vm_event_fill_regs under CONFIG_HVM

2018-08-17 Thread Wei Liu
Ideally the HVM specific part of VM event should be moved into hvm/ at some point, but this will do for now. Signed-off-by: Wei Liu --- xen/arch/x86/vm_event.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c index f91aade..b4f6afb 100644

  1   2   >