Re: [Xen-devel] [PATCH v4 1/4] ring.h: introduce macros to handle monodirectional rings with multiple req sizes

2017-03-27 Thread Jan Beulich
>>> On 24.03.17 at 19:31, wrote: > --- a/xen/include/public/io/ring.h > +++ b/xen/include/public/io/ring.h > @@ -27,7 +27,18 @@ > #ifndef __XEN_PUBLIC_IO_RING_H__ > #define __XEN_PUBLIC_IO_RING_H__ > > +/* > + * When #include'ing this header, you need to provide the

Re: [Xen-devel] [PATCH 0/2] libxl: add PV display device driver interface

2017-03-27 Thread Wei Liu
On Fri, Mar 24, 2017 at 12:35:22PM +0200, Oleksandr Grytsov wrote: > To summarize: > > There are two ways to rework the patches: > > 1. Keep interface between xl an libxl as is and put duplicated code into > libxl_device_type specific functions. > > 2. Change interface to call libxl_device_type

Re: [Xen-devel] [PATCH v2 09/12] x86/vmce, tools/libxl: expose LMCE capability in guest MSR_IA32_MCG_CAP

2017-03-27 Thread Wei Liu
On Fri, Mar 17, 2017 at 02:46:11PM +0800, Haozhong Zhang wrote: > If LMCE is supported by host and ' mca_caps = [ "lmce" ] ' is present > in xl config, the LMCE capability will be exposed in guest MSR_IA32_MCG_CAP. > By default, LMCE is not exposed to guest so as to keep the backwards migration >

Re: [Xen-devel] [PATCH v1 1/9] mm: Separate free page chunk merging into its own routine

2017-03-27 Thread Boris Ostrovsky
On 03/27/2017 12:03 PM, Jan Beulich wrote: On 27.03.17 at 17:16, wrote: >> On Fri, Mar 24, 2017 at 01:04:56PM -0400, Boris Ostrovsky wrote: >>> --- a/xen/common/page_alloc.c >>> +++ b/xen/common/page_alloc.c >>> @@ -924,11 +924,61 @@ static int

Re: [Xen-devel] [PATCH v2 2/7] x86/hvm: introduce hvm_domain_irq macro

2017-03-27 Thread Jan Beulich
>>> On 27.03.17 at 12:18, wrote: > Introduce a macro to get a pointer to the hvm_irq for a HVM domain. What does this buy us? I don't (yet?) see the connection to this series. Jan ___ Xen-devel mailing list

Re: [Xen-devel] [PATCH v4] tools/firmware: add ACPI device for Windows laptop/slate mode switch

2017-03-27 Thread Wei Liu
On Fri, Mar 24, 2017 at 01:31:39PM +, Paul Durrant wrote: > Microsoft have defined an ACPI device to support switching Windows 10 > between laptop/desktop mode and slate/tablet mode [1]. > > This patch adds an SSDT containing such a device. The presence of the > device is controlled by a new

[Xen-devel] [PATCH 1/2] x86/io: rename misleading dpci_ prefixed functions to hvm_

2017-03-27 Thread Roger Pau Monne
The dpci_ prefix used on those IO handlers is misleading, there's nothing PCI specific in them, they simply map a guest IO port into a machine (physical) IO port. They don't specifically trap the PCI IO port range in any way (0xcf8/0xcfc). Rename them to use the hvm_ prefix in order to avoid this

[Xen-devel] [PATCH 2/2] x86/io: move the list of guest to machine IO ports out of domain_iommu

2017-03-27 Thread Roger Pau Monne
There's no reason to store that list inside of the domain_iommu struct, the forwarding of guest IO ports into machine IO ports is not tied to the presence of an IOMMU. Move it inside of the hvm_domain struct instead. Signed-off-by: Roger Pau Monné --- Cc: Jan Beulich

[Xen-devel] [PATCH 0/2] x86/io: fix dpci_ IO port handlers

2017-03-27 Thread Roger Pau Monne
Hello, The following series contain two cosmetic fixes for the HVM IO port handlers. The first one renames them to use the hvm_ prefix instead of the dpci_ one, since those handlers are not trapping the PCI config space in any way. The second fix moves the list of ports from the domain_iommu

Re: [Xen-devel] [PATCH] libxl/xl: add support for Xen 9pfs

2017-03-27 Thread Wei Liu
On Thu, Mar 23, 2017 at 04:36:19PM -0700, Stefano Stabellini wrote: > docs/man/xl.cfg.pod.5.in | 31 + > tools/libxl/Makefile | 2 +- > tools/libxl/libxl.h | 10 + > tools/libxl/libxl_9pfs.c | 87 >

Re: [Xen-devel] [PATCH v4 2/4] xen: introduce a C99 headers check

2017-03-27 Thread Jan Beulich
>>> On 24.03.17 at 19:31, wrote: > Introduce a C99 headers check, for non-ANSI compliant headers. No > headers are added to the check yet. > > In addition to the usual -include stdint.h, also add -include string.h > to the C99 check to get the declaration of memcpy and

[Xen-devel] [xen-unstable-smoke test] 106936: regressions - trouble: broken/fail/pass

2017-03-27 Thread osstest service owner
flight 106936 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/106936/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-xl 15 guest-start/debian.repeat fail REGR. vs. 106935 Tests which

Re: [Xen-devel] ARM: SMMUv3 support

2017-03-27 Thread Goel, Sameer
Hi, I am working on adding this support. The work is in initial stages and will target ACPI systems to start with. Do you have a specific requirement? Or even better: want to help with DT testing ? :) Thanks, Sameer On 3/20/2017 11:58 PM, Vijay Kilari wrote: > Hi, > > Is there any effort

Re: [Xen-devel] [PATCH v2 1/2] xen: sched: don't call hooks of the wrong scheduler via VCPU2OP

2017-03-27 Thread Dario Faggioli
On Mon, 2017-03-27 at 12:49 +0100, George Dunlap wrote: > On 17/03/17 18:19, Dario Faggioli wrote: > > Fix this by dealing explicitly, in VCPU2OP, with > > idle vcpus, returning the scheduler of the pCPU > > they (always) run on. > > > > While there, rename VCPU2OP itself to something > > that

Re: [Xen-devel] [PATCH v2 2/2] xen: sched: improve robustness (and rename) DOM2OP()

2017-03-27 Thread Dario Faggioli
On Mon, 2017-03-27 at 14:23 +0100, George Dunlap wrote: > On 17/03/17 18:19, Dario Faggioli wrote: > > --- a/xen/common/schedule.c > > +++ b/xen/common/schedule.c > > @@ -77,8 +77,25 @@ static struct scheduler __read_mostly ops; > >   (( (opsptr)->fn != NULL ) ? (opsptr)->fn(opsptr, > >

Re: [Xen-devel] [PATCH v2 2/7] x86/hvm: introduce hvm_domain_irq macro

2017-03-27 Thread Roger Pau Monne
On Mon, Mar 27, 2017 at 09:41:40AM -0600, Jan Beulich wrote: > >>> On 27.03.17 at 12:18, wrote: > > Introduce a macro to get a pointer to the hvm_irq for a HVM domain. > > What does this buy us? I don't (yet?) see the connection to this > series. It's a pre-patch to make

Re: [Xen-devel] [PATCH v1 1/9] mm: Separate free page chunk merging into its own routine

2017-03-27 Thread Jan Beulich
>>> On 27.03.17 at 17:16, wrote: > On Fri, Mar 24, 2017 at 01:04:56PM -0400, Boris Ostrovsky wrote: >> --- a/xen/common/page_alloc.c >> +++ b/xen/common/page_alloc.c >> @@ -924,11 +924,61 @@ static int reserve_offlined_page(struct page_info >> *head) >> return count; >>

Re: [Xen-devel] [PATCH v2 1/7] x86/vioapic: introduce a internal vIO APIC structure

2017-03-27 Thread Roger Pau Monne
On Mon, Mar 27, 2017 at 09:38:49AM -0600, Jan Beulich wrote: > >>> On 27.03.17 at 12:18, wrote: > > The reason to expand the hvm_vioapic structure instead of the hvm_hw_vioapic > > one is that the variable number of pins functionality is only going to be > > used > > by the

Re: [Xen-devel] [PATCH] Fix a typo in lopartsetup

2017-03-27 Thread Stefano Stabellini
On Sat, 25 Mar 2017, Géza Gémes wrote: > Signed-off-by: Géza Gémes Thank you for the quick fix, committed. > --- > scripts/lopartsetup | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/lopartsetup b/scripts/lopartsetup > index

Re: [Xen-devel] [PATCH 04/10] Introduce cirros-pygrub-pv test

2017-03-27 Thread Stefano Stabellini
On Sat, 25 Mar 2017, Géza Gémes wrote: > This test verifies booting the cirros image using pygrub > > Signed-off-by: Géza Gémes Reviewed-by: Stefano Stabellini > --- > tests/cirros-pygrub-pv | 25 + > tests/series

Re: [Xen-devel] [PATCH 05/10] Introduce cirros-pvgrub2-pv test

2017-03-27 Thread Stefano Stabellini
On Sat, 25 Mar 2017, Géza Gémes wrote: > This test verifies booting the cirros image using pvgrub2 > > Signed-off-by: Géza Gémes Reviewed-by: Stefano Stabellini > --- > tests/cirros-pvgrub2-pv | 33 + >

Re: [Xen-devel] [PATCH v2 3/7] x86/hvm: convert gsi_assert_count into a variable size array

2017-03-27 Thread Roger Pau Monne
On Mon, Mar 27, 2017 at 09:59:42AM -0600, Jan Beulich wrote: > >>> On 27.03.17 at 12:18, wrote: > > --- a/xen/arch/x86/hvm/hvm.c > > +++ b/xen/arch/x86/hvm/hvm.c > > @@ -457,7 +457,7 @@ void hvm_migrate_pirqs(struct vcpu *v) > > { > > struct domain *d = v->domain; > >

Re: [Xen-devel] [PATCH 05/10] Introduce cirros-pvgrub2-pv test

2017-03-27 Thread Gémes Géza
2017-03-27 19:24 keltezéssel, Stefano Stabellini írta: On Mon, 27 Mar 2017, Stefano Stabellini wrote: On Sat, 25 Mar 2017, Géza Gémes wrote: This test verifies booting the cirros image using pvgrub2 Signed-off-by: Géza Gémes Reviewed-by: Stefano Stabellini

[Xen-devel] [xen-unstable-smoke test] 106940: tolerable trouble: broken/fail/pass - PUSHED

2017-03-27 Thread osstest service owner
flight 106940 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/106940/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-arm64-arm64-xl-xsm 1 build-check(1) blocked n/a test-amd64-amd64-libvirt 12

Re: [Xen-devel] [PATCH 09/10] Introduce cirros-minios-stubdom-pvhvm test

2017-03-27 Thread Stefano Stabellini
On Sat, 25 Mar 2017, Géza Gémes wrote: > This test is similar to cirros-minios-stubdom-hvm test, differing by > explicitly exposing the xen netfront and blockfront drivers > > Signed-off-by: Géza Gémes Reviewed-by: Stefano Stabellini > --- >

Re: [Xen-devel] [PATCH 08/10] Introduce cirros-qemu-pvhvm test

2017-03-27 Thread Stefano Stabellini
On Sat, 24 Mar 2017, Géza Gémes wrote: > This test is similar to cirros-qemu-hvm test, differing by > explicitly exposing the xen netfront and blockfront drivers > > Signed-off-by: Géza Gémes Reviewed-by: Stefano Stabellini > --- >

Re: [Xen-devel] [PATCH] xen: additionally restrict xenforeignmemory operations

2017-03-27 Thread Stefano Stabellini
On Mon, 27 Mar 2017, Paul Durrant wrote: > > -Original Message- > [snip] > > > > This is OK but the file is growing too entangled. What do you think of > > the following, which moves the if CONFIG_XEN_CTRL_INTERFACE_VERSION > > < > > 40701 at the top? This way we don't have to add yet

Re: [Xen-devel] [PATCH 03/10] Introduce cirros-separate-kernel-pv test

2017-03-27 Thread Stefano Stabellini
On Sat, 25 Mar 2017, Géza Gémes wrote: > This test is the cirros equivalent of the busybox-pv test > > Signed-off-by: Géza Gémes Reviewed-by: Stefano Stabellini > --- > tests/cirros-separate-kernel-pv | 28 >

Re: [Xen-devel] [PATCH 07/10] Introduce cirros-minios-stubdom-hvm test

2017-03-27 Thread Stefano Stabellini
On Sat, 25 Mar 2017, Géza Gémes wrote: > This test verifies a cirros based hvm domain using a minios based > stubdom as its device model > > Signed-off-by: Géza Gémes Reviewed-by: Stefano Stabellini > --- > tests/cirros-minios-stubdom-hvm | 27

Re: [Xen-devel] [PATCH 06/10] Introduce cirros-qemu-hvm test

2017-03-27 Thread Stefano Stabellini
On Sat, 25 Mar 2017, Géza Gémes wrote: > This test is the cirros equivalent of the busybox-hvm test > > Signed-off-by: Géza Gémes Reviewed-by: Stefano Stabellini > --- > tests/cirros-qemu-hvm | 26 ++ > tests/series

Re: [Xen-devel] [PATCH 02/10] Introduce cirros tests

2017-03-27 Thread Stefano Stabellini
On Sat, 25 Mar 2017, Géza Gémes wrote: > Add support for using cirros images in raisin tests > > Signed-off-by: Géza Gémes It looks good to me, thanks! Reviewed-by: Stefano Stabellini > --- > lib/common-functions.sh| 33 +++

Re: [Xen-devel] [PATCH v2 09/27] ARM: GICv3: introduce separate pending_irq structs for LPIs

2017-03-27 Thread Stefano Stabellini
On Mon, 27 Mar 2017, Julien Grall wrote: > Hi, > > On 27/03/17 10:02, Andre Przywara wrote: > > On 24/03/17 17:26, Stefano Stabellini wrote: > > > On Fri, 24 Mar 2017, Andre Przywara wrote: > > I am afraid that this would lead to situations where we needlessly > > allocate and deallocate

[Xen-devel] [ovmf test] 106938: all pass - PUSHED

2017-03-27 Thread osstest service owner
flight 106938 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/106938/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 2d120489583a23386bec454a8a01f3ee1bc11e1e baseline version: ovmf

Re: [Xen-devel] [PATCH 05/10] Introduce cirros-pvgrub2-pv test

2017-03-27 Thread Stefano Stabellini
On Mon, 27 Mar 2017, Gémes Géza wrote: > 2017-03-27 19:24 keltezéssel, Stefano Stabellini írta: > > On Mon, 27 Mar 2017, Stefano Stabellini wrote: > > > On Sat, 25 Mar 2017, Géza Gémes wrote: > > > > This test verifies booting the cirros image using pvgrub2 > > > > > > > > Signed-off-by: Géza

Re: [Xen-devel] [PATCH v2 09/27] ARM: GICv3: introduce separate pending_irq structs for LPIs

2017-03-27 Thread Stefano Stabellini
CC'ing Andrew, Jan and George to get more feedback on the security impact of this patch. I'll make a quick summary for you: we need to allocate a 56 bytes struct (called pending_irq) for each potential interrupt injected to guests (dom0 and domUs). With the new ARM interrupt controller there

Re: [Xen-devel] [PATCH 01/10] Fix installation of python libs

2017-03-27 Thread Stefano Stabellini
On Sat, 25 Mar 2017, Géza Gémes wrote: > Change deb package build in order to move content of the > site-packages folder to dist-packages in this way having > the libs inluded in the default PYTHONPATH > > Signed-off-by: Géza Gémes Reviewed-by: Stefano Stabellini

Re: [Xen-devel] [PATCH 05/10] Introduce cirros-pvgrub2-pv test

2017-03-27 Thread Stefano Stabellini
On Mon, 27 Mar 2017, Stefano Stabellini wrote: > On Sat, 25 Mar 2017, Géza Gémes wrote: > > This test verifies booting the cirros image using pvgrub2 > > > > Signed-off-by: Géza Gémes > > Reviewed-by: Stefano Stabellini > > > > --- > >

Re: [Xen-devel] [PATCH v2 09/27] ARM: GICv3: introduce separate pending_irq structs for LPIs

2017-03-27 Thread Julien Grall
Hi Stefano, On 27/03/17 18:44, Stefano Stabellini wrote: On Mon, 27 Mar 2017, Julien Grall wrote: Hi, On 27/03/17 10:02, Andre Przywara wrote: On 24/03/17 17:26, Stefano Stabellini wrote: On Fri, 24 Mar 2017, Andre Przywara wrote: I am afraid that this would lead to situations where we

Re: [Xen-devel] [PATCH] tools/libxenforeignmemory: add a call to restrict the handle

2017-03-27 Thread Julien Grall
Hi Andre, On 24/03/17 20:10, Andrew Cooper wrote: On 22/03/17 11:25, Paul Durrant wrote: diff --git a/tools/libs/foreignmemory/libxenforeignmemory.map b/tools/libs/foreignmemory/libxenforeignmemory.map index df206b3..5c9806c 100644 --- a/tools/libs/foreignmemory/libxenforeignmemory.map +++

Re: [Xen-devel] arm64: dma_to_phys/phys_to_dma need to be properly implemented

2017-03-27 Thread Stefano Stabellini
Hello Oleksandr, Just to clarify, you are talking about dma_to_phys/phys_to_dma in Linux (not in Xen), right? Drivers shouldn't use those functions directly (see the comment in arch/arm64/include/asm/dma-mapping.h), they should call the appropriate dma_map_ops functions instead. The dma_map_ops

[Xen-devel] raisin and minios stubdom

2017-03-27 Thread Gémes Géza
Hi, Currently the xen build system has optional support for building a minios (+needed libraries and tools) based stubdom. What is your opinion about moving support for building this into raisin and once that is stable drop support in the xen build system? Cheers, Geza

Re: [Xen-devel] raisin and minios stubdom

2017-03-27 Thread Konrad Rzeszutek Wilk
On Mon, Mar 27, 2017 at 09:28:14PM +0200, Gémes Géza wrote: > Hi, > > Currently the xen build system has optional support for building a minios > (+needed libraries and tools) based stubdom. > > What is your opinion about moving support for building this into raisin and > once that is stable

Re: [Xen-devel] maybe revert commit c275a57f5ec3 "xen/balloon: Set balloon's initial state to number of existing RAM pages"

2017-03-27 Thread Dan Streetman
On Fri, Mar 24, 2017 at 9:33 PM, Boris Ostrovsky wrote: > >> >> I think we can all agree that the *ideal* situation would be, for the >> balloon driver to not immediately hotplug memory so it can add 11 more >> pages, so maybe I just need to figure out why the balloon

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

2017-03-27 Thread osstest service owner
flight 106933 linux-next real [real] http://logs.test-lab.xenproject.org/osstest/logs/106933/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-winxpsp3 6 xen-boot fail REGR. vs. 106927

[Xen-devel] [qemu-upstream-4.5-testing baseline-only test] 71106: trouble: blocked/broken

2017-03-27 Thread Platform Team regression test user
This run is configured for baseline tests only. flight 71106 qemu-upstream-4.5-testing real [real] http://osstest.xs.citrite.net/~osstest/testlogs/logs/71106/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf

Re: [Xen-devel] [PATCH v2] configure: use pkg-config for obtaining xen version

2017-03-27 Thread Stefano Stabellini
On Mon, 27 Mar 2017, Paul Durrant wrote: > > -Original Message- > > From: Juergen Gross [mailto:jgr...@suse.com] > > Sent: 27 March 2017 10:15 > > To: Paul Durrant ; qemu-de...@nongnu.org; xen- > > de...@lists.xenproject.org > > Cc: Anthony Perard

Re: [Xen-devel] [PATCH v2 3/7] x86/hvm: convert gsi_assert_count into a variable size array

2017-03-27 Thread Jan Beulich
>>> On 27.03.17 at 12:18, wrote: > Rearrange the fields of hvm_irq so that gsi_assert_count can be converted into > a variable size array and add a new field to account the number of GSIs. > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -457,7 +457,7 @@

Re: [Xen-devel] [PATCH v2 4/7] x86/vioapic: allow the vIO APIC to have a variable number of pins

2017-03-27 Thread Jan Beulich
>>> On 27.03.17 at 12:18, wrote: > @@ -431,9 +431,8 @@ static int ioapic_save(struct domain *d, > hvm_domain_context_t *h) > if ( !has_vioapic(d) ) > return 0; > > -BUILD_BUG_ON(sizeof(struct hvm_hw_vioapic) != > - sizeof(struct

Re: [Xen-devel] [PATCH v2 16/27] ARM: vITS: handle CLEAR command

2017-03-27 Thread Andre Przywara
Hi, On 24/03/17 17:17, Stefano Stabellini wrote: > On Fri, 24 Mar 2017, Andre Przywara wrote: >> Hi, >> >> On 24/03/17 14:27, Julien Grall wrote: >>> Hi Andre, >>> >>> On 03/16/2017 11:20 AM, Andre Przywara wrote: This introduces the ITS command handler for the CLEAR command, which

[Xen-devel] [PATCH v3] xen/arm: alternative: Register re-mapped Xen area as a temporary virtual region

2017-03-27 Thread Wei Chen
While I was using the alternative patching in the SErrors patch series [1]. I used a branch instruction as alternative instruction. ALTERNATIVE("nop", "b skip_check", SKIP_CHECK_PENDING_VSERROR) Unfortunately, I got a system panic message with this

[Xen-devel] [PATCH RFC 11/20] libxc/migration: correct hvm record ordering specification

2017-03-27 Thread Joshua Otto
The libxc migration stream specification document asserts that, within an hvm migration stream, "HVM_PARAMS must precede HVM_CONTEXT, as certain parameters can affect the validity of architectural state in the context." This sounds reasonable, but the in-tree implementation of hvm domain save

[Xen-devel] [PATCH RFC 14/20] libxc/migration: implement the sender side of postcopy live migration

2017-03-27 Thread Joshua Otto
Add a new 'postcopy' phase to the live migration algorithm, during which unmigrated domain memory is paged over the network on-demand _after_ the guest has been resumed at the destination. To do so: - Add a new precopy policy option, XGS_POLICY_POSTCOPY, that policies can use to request a

Re: [Xen-devel] [PATCH v2] configure: use pkg-config for obtaining xen version

2017-03-27 Thread Juergen Gross
On 27/03/17 11:07, Paul Durrant wrote: >> -Original Message- >> From: Juergen Gross [mailto:jgr...@suse.com] >> Sent: 27 March 2017 08:43 >> To: qemu-de...@nongnu.org; xen-de...@lists.xenproject.org >> Cc: Anthony Perard ; kra...@redhat.com; >>

Re: [Xen-devel] [PATCH] xen: additionally restrict xenforeignmemory operations

2017-03-27 Thread Paul Durrant
> -Original Message- [snip] > > This is OK but the file is growing too entangled. What do you think of > the following, which moves the if CONFIG_XEN_CTRL_INTERFACE_VERSION > < > 40701 at the top? This way we don't have to add yet another ifdef. > Yes, this looks better and appears to

[Xen-devel] [PATCH v3 5/6] x86/pagewalk: Improve the logic behind setting access and dirty bits

2017-03-27 Thread Andrew Cooper
The boolean pse2M is misnamed, because it might refer to a 4M superpage. Switch the logic to be in terms of the level of the leaf entry, and rearrange the calls to set_ad_bits() to be a fallthrough switch statement, to make it easier to follow. Alter set_ad_bits() to take properly typed pointers

[Xen-devel] [PATCH v3 3/6] x86/pagewalk: Re-implement the pagetable walker

2017-03-27 Thread Andrew Cooper
The existing pagetable walker has complicated return semantics, which squeeze multiple pieces of information into single integer. This would be fine if the information didn't overlap, but it does. Specifically, _PAGE_INVALID_BITS for 3-level guests alias _PAGE_PAGED and _PAGE_SHARED. A guest

[Xen-devel] [PATCH v3 2/6] x86/pagewalk: Helpers for reserved bit handling

2017-03-27 Thread Andrew Cooper
Some bits are unconditionally reserved in pagetable entries, or reserved because of alignment restrictions. Other bits are reserved because of control register configuration. Introduce helpers which take an individual vcpu and guest pagetable entry, and calculates whether any reserved bits are

[Xen-devel] [PATCH v3 0/6] Fixes to pagetable handling

2017-03-27 Thread Andrew Cooper
This series has been a long time in preparation (i.e. most of the 4.8 and 4.9 dev cycles). It started when I tried to make an XTF PoC for XSA-176, and stumbled upon the the _PAGE_PAGED aliasing issue (see patch 7) which caused by PoC to be descheduled waiting for (a non-existent) paging agent to

[Xen-devel] [PATCH v3 6/6] x86/pagewalk: non-functional cleanup

2017-03-27 Thread Andrew Cooper
* Drop trailing whitespace * Consistently apply Xen style * Introduce a local variable block Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Acked-by: Tim Deegan --- CC: Tim Deegan CC: George Dunlap

Re: [Xen-devel] [PATCH V8 1/3] irq: Add flags to request_percpu_irq function

2017-03-27 Thread Andrew Jones
On Thu, Mar 23, 2017 at 06:42:01PM +0100, Daniel Lezcano wrote: > diff --git a/drivers/clocksource/timer-nps.c b/drivers/clocksource/timer-nps.c > index da1f798..dbdb622 100644 > --- a/drivers/clocksource/timer-nps.c > +++ b/drivers/clocksource/timer-nps.c > @@ -256,7 +256,7 @@ static int __init

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

2017-03-27 Thread osstest service owner
flight 106931 libvirt real [real] http://logs.test-lab.xenproject.org/osstest/logs/106931/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf-libvirt 5 libvirt-buildfail REGR. vs. 106829 Tests which did not

[Xen-devel] [PATCH RFC 06/20] libxc/xc_sr: factor helpers out of handle_page_data()

2017-03-27 Thread Joshua Otto
When processing a PAGE_DATA record, the restore code: 1) applies a number of sanity checks on the record's headers and size 2) decodes the list of packed page info into pfns and their types 3) using the pfn and type info, populates and fills the pages into the guest using process_page_data()

[Xen-devel] [PATCH RFC 07/20] migration: defer precopy policy to libxl

2017-03-27 Thread Joshua Otto
The precopy phase of the xc_domain_save() live migration algorithm has historically been implemented to run until either a) (almost) no pages are dirty or b) some fixed, hard-coded maximum number of precopy iterations has been exceeded. This policy and its implementation are less than ideal for a

[Xen-devel] [PATCH RFC 08/20] libxl/migration: add precopy tuning parameters

2017-03-27 Thread Joshua Otto
In the context of the live migration algorithm, the precopy iteration count refers to the number of page-copying iterations performed prior to the suspension of the guest and transmission of the final set of dirty pages. Similarly, the precopy dirty threshold refers to the dirty page count below

Re: [Xen-devel] [PATCH 0/6] xen: sched: improve scalability of Credit1, and optimize a bit both Credit1 and Credit2

2017-03-27 Thread Dario Faggioli
On Thu, 2017-03-02 at 11:37 +0100, Dario Faggioli wrote: > Hello, > Hey, George, About this series. I was re-looking at it, and I figured out that: > Dario Faggioli (6): >   xen: credit1: simplify csched_runq_steal() a little bit. >   xen: credit: (micro) optimize csched_runq_steal(). >

[Xen-devel] [PATCH RFC 09/20] libxc/xc_sr_save: introduce save batch types

2017-03-27 Thread Joshua Otto
To write guest pages into the stream, the save logic builds up batches of pfns to be written and performs all of the work necessary to write them whenever a full batch has been accumulated. Writing a PAGE_DATA batch entails determining the types of all pfns in the batch, mapping the subset of

[Xen-devel] [PATCH RFC 02/20] libxc/xc_sr: parameterise write_record() on fd

2017-03-27 Thread Joshua Otto
Right now, write_split_record() - which is delegated to by write_record() - implicitly writes to ctx->fd. This means it can't be used with the restore context's send_back_fd, which is unhandy. Add an 'fd' parameter to both write_record() and write_split_record(), and mechanically update all

[Xen-devel] [PATCH RFC 10/20] libxc/xc_sr_save.c: initialise rec.data before free()

2017-03-27 Thread Joshua Otto
colo_merge_secondary_dirty_bitmap() unconditionally free()s the .data member of its local xc_sr_record structure rec on its exit path. However, if the initial call to read_record() fails then this member is uninitialised. Initialise it. Signed-off-by: Joshua Otto ---

[Xen-devel] [PATCH RFC 20/20] tools: expose postcopy live migration support in libxl and xl

2017-03-27 Thread Joshua Otto
- Add a 'memory_strategy' parameter to libxl_domain_live_migrate(), which specifies how the remainder of the memory migration should be approached after the iterative precopy phase is completed. - Plug this parameter into the libxl migration precopy policy implementation. - Add --postcopy to

Re: [Xen-devel] [PATCH v9 08/25] x86: refactor psr: L3 CAT: implement get value flow.

2017-03-27 Thread Jan Beulich
>>> On 16.03.17 at 12:07, wrote: > --- a/xen/arch/x86/domctl.c > +++ b/xen/arch/x86/domctl.c > @@ -1455,23 +1455,26 @@ long arch_do_domctl( > break; > > case XEN_DOMCTL_PSR_CAT_OP_GET_L3_CBM: > -ret = psr_get_l3_cbm(d,

Re: [Xen-devel] [PATCH v2] configure: use pkg-config for obtaining xen version

2017-03-27 Thread Paul Durrant
> -Original Message- > From: Juergen Gross [mailto:jgr...@suse.com] > Sent: 27 March 2017 10:15 > To: Paul Durrant ; qemu-de...@nongnu.org; xen- > de...@lists.xenproject.org > Cc: Anthony Perard ; kra...@redhat.com; >

[Xen-devel] [PATCH 06/10] tools/insn-fuzz: Correct hook prototypes, and assert() appropriate segments

2017-03-27 Thread Andrew Cooper
The correct prototypes for the hooks are to use enum x86_segment rather than unsigned int. It is implementation specific as to whether this compiles. assert() that the emulator never passes an inappropriate segment. The only hook which may legitimately be passed x86_seg_none is invlpg().

[Xen-devel] [PATCH 05/10] tools/insn-fuzz: Fix a stability bug in afl-clang-fast mode

2017-03-27 Thread Andrew Cooper
The fuzzing harness conditionally disables hooks to test error paths in the emulator. However, fuzz_emulops is a static structure. c/s 69f4633 "tools/insn-fuzz: Support AFL's afl-clang-fast mode" introduced persistent mode, but because fuzz_emulops is static, the clobbering of hooks accumulates

[Xen-devel] [PATCH 00/10] x86 emulation bugfixes and fuzzer improvements

2017-03-27 Thread Andrew Cooper
Andrew Cooper (10): x86/emul: Correct the decoding of vlddqu x86/emul: Add feature check for clzero tools/insn-fuzz: Don't use memcpy() for zero-length reads tools/insn-fuzz: Avoid making use of static data tools/insn-fuzz: Fix a stability bug in afl-clang-fast mode tools/insn-fuzz:

[Xen-devel] [PATCH 07/10] tools/insn-fuzz: Provide IA32_DEBUGCTL consistently to the emulator

2017-03-27 Thread Andrew Cooper
x86_emulates()'s is_branch_step() performs a speculative read of IA32_DEBUGCTL, but doesn't squash exceptions should they arise. In reality, this MSR is always available. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: George Dunlap

[Xen-devel] [PATCH 04/10] tools/insn-fuzz: Avoid making use of static data

2017-03-27 Thread Andrew Cooper
AFL has a measure of stability, where it passes the same corpus into the fuzzing harness and observes whether the execution path changes from before. Any instability in the fuzzing harness reduces its effectiveness, as an observed crash may not reliably be caused by the original corpus. In

[Xen-devel] [PATCH 01/10] x86/emul: Correct the decoding of vlddqu

2017-03-27 Thread Andrew Cooper
vlddqu is encoded with 0xf2 which causes it to fall into the Scalar general case in x86_decode_twobyte(). However, it really does have just two operands, so must remain TwoOp AFL discovered that the instruction c5 5b f0 3c e5 95 0a cd 63 was considered valid despite it being a two operand

[Xen-devel] [PATCH 03/10] tools/insn-fuzz: Don't use memcpy() for zero-length reads

2017-03-27 Thread Andrew Cooper
For control-flow changes, the emulator needs to perform a zero-length instruction fetch at the target offset. It also passes NULL for the destination buffer, as there is no instruction stream to collect. This trips up UBSAN, even with a size of 0. Exclude zero-length reads from using memcpy(),

[Xen-devel] [PATCH v2 6/7] x86/ioapic: add prototype for apic_gsi_base to io_apic.h

2017-03-27 Thread Roger Pau Monne
So that the function can be called from other files without adding prototypes to each of them. Signed-off-by: Roger Pau Monné --- Cc: Jan Beulich Cc: Andrew Cooper --- Changes since v1: - Add io_ prefix to avoid confusion. -

[Xen-devel] [PATCH v2 5/7] x86/vioapic: introduce support for multiple vIO APICS

2017-03-27 Thread Roger Pau Monne
Add support for multiple vIO APICs on the same domain, thus turning d->arch.hvm_domain.vioapic into an array of vIO APIC control structures. Note that this functionality is not exposed to unprivileged guests, and will only be used by PVHv2 Dom0. Signed-off-by: Roger Pau Monné

[Xen-devel] [PATCH v2 2/7] x86/hvm: introduce hvm_domain_irq macro

2017-03-27 Thread Roger Pau Monne
Introduce a macro to get a pointer to the hvm_irq for a HVM domain. No functional change. Signed-off-by: Roger Pau Monné --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Kevin Tian --- xen/arch/x86/hvm/irq.c

[Xen-devel] [PATCH v2 1/7] x86/vioapic: introduce a internal vIO APIC structure

2017-03-27 Thread Roger Pau Monne
This is required in order to have a variable number of vIO APIC pins, instead of the current fixed value (48). Note that this patch only expands the fields of the hvm_vioapic struct, without actually introducing any new fields or functionality. The reason to expand the hvm_vioapic structure

[Xen-devel] [PATCH v2 7/7] x86/vioapic: allow PVHv2 Dom0 to have more than one IO APIC

2017-03-27 Thread Roger Pau Monne
The base address, id and number of pins of the vIO APICs exposed to PVHv2 Dom0 is the same as the values found on bare metal. Signed-off-by: Roger Pau Monné --- Cc: Jan Beulich Cc: Andrew Cooper ---

Re: [Xen-devel] [PATCH v9 03/25] x86: refactor psr: implement main data structures.

2017-03-27 Thread Jan Beulich
>>> On 27.03.17 at 04:38, wrote: > On 17-03-24 10:19:30, Jan Beulich wrote: >> >>> On 16.03.17 at 12:07, wrote: >> > +struct psr_cat_hw_info { >> > +unsigned int cbm_len; >> > +unsigned int cos_max; >> >> So you have this field, and

Re: [Xen-devel] [PATCH v9 05/25] x86: refactor psr: L3 CAT: implement CPU init and free flow.

2017-03-27 Thread Jan Beulich
>>> On 27.03.17 at 06:41, wrote: > On 17-03-24 10:52:34, Jan Beulich wrote: >> >>> On 16.03.17 at 12:07, wrote: >> > @@ -46,6 +50,9 @@ >> > */ >> > #define MAX_COS_REG_CNT 128 >> > >> > +/* CAT features use 1 COS register in one access.

[Xen-devel] [PATCH RFC 03/13] x86/mm: export vcpumask_to_pcpumask

2017-03-27 Thread Wei Liu
Prefix it with "mm_". No functional change. Signed-off-by: Wei Liu --- It used to be a inline function, but I don't think there is no point in making it inline because PV mmu operations are already expensive. Having a callq to another function won't make noticeable

[Xen-devel] [PATCH RFC 08/13] x86/mm: extract adjust_guest_l*e macros to mm.h

2017-03-27 Thread Wei Liu
No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/mm.c| 46 -- xen/include/asm-x86/mm.h | 47 +++ 2 files changed, 47 insertions(+), 46 deletions(-) diff --git

[Xen-devel] [PATCH RFC 02/13] x86/mm: move MEM_LOG to asm-x86/mm.h

2017-03-27 Thread Wei Liu
It will be needed later when we split mm.c. No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/mm.c| 2 -- xen/include/asm-x86/mm.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index

[Xen-devel] [PATCH RFC 12/20] libxc/migration: specify postcopy live migration

2017-03-27 Thread Joshua Otto
- allocate the new postcopy record type numbers - augment the stream format specification to include these new types and their role in the protocol Signed-off-by: Joshua Otto --- docs/specs/libxc-migration-stream.pandoc | 177 ++-

[Xen-devel] [PATCH RFC 09/13] x86/mm: export a bunch of {get, put}_page functions

2017-03-27 Thread Wei Liu
They will be needed by common code and PV specific code later. No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/mm.c| 41 ++--- xen/include/asm-x86/mm.h | 16 2 files changed, 34 insertions(+), 23

[Xen-devel] [PATCH RFC 00/13] Refactor x86/mm.c

2017-03-27 Thread Wei Liu
This series splits x86/mm.c into PV and HVM specific files. The long term goal is to have clear separation of guest supporting code so that we can disable modes as we see fit. This would also help a later project to move PV interface into a PVH container. I think if I try harder some of the page

[Xen-devel] [PATCH RFC 01/13] x86/mm: export {get,put}_pg_owner

2017-03-27 Thread Wei Liu
Prefix them with "mm_" and add declarations to asm-x86/mm.h. They will be needed when we split PV specific code out of x86/mm.c. No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/mm.c| 20 ++-- xen/include/asm-x86/mm.h | 4 2

[Xen-devel] [PATCH RFC 04/13] x86/mm: carve out create_grant_pv_mapping

2017-03-27 Thread Wei Liu
We will later split out PV specific code to pv/mm.c. No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/mm.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 4bf94227cc..b44d44c782

[Xen-devel] [PATCH RFC 06/13] x86/mm: extract page table masks to mm.h

2017-03-27 Thread Wei Liu
The masks are going to be needed by common page table management code and PV page table management code. No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/mm.c| 21 + xen/include/asm-x86/mm.h | 21 + 2 files

[Xen-devel] [PATCH RFC 05/13] x86/mm: carve out replace_grant_pv_mapping

2017-03-27 Thread Wei Liu
We will later split out PV specific code to pv/mm.c. No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/mm.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index

[Xen-devel] [PATCH RFC 07/13] x86/mm: extract PAGE_CACHE_ATTRS to mm.h

2017-03-27 Thread Wei Liu
No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/mm.c| 2 -- xen/include/asm-x86/mm.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 93eb848e72..888b4532f4 100644 ---

[Xen-devel] [PATCH RFC 15/20] libxc/migration: implement the receiver side of postcopy live migration

2017-03-27 Thread Joshua Otto
Add the receive-side logic for a new 'postcopy' phase in the live migration algorithm. To support this migration phase: - Augment the main restore record-processing logic to recognize and handle the postcopy-initiation records. - Add the core logic for the phase, postcopy_restore(), which marks

[Xen-devel] [PATCH RFC 13/13] x86/mm: split HVM grant table code to hvm/mm.c

2017-03-27 Thread Wei Liu
PG_external requires hardware support so the code guarded by that is HVM only. No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/hvm/Makefile | 1 + xen/arch/x86/hvm/mm.c | 84 +++ xen/arch/x86/mm.c | 48

[Xen-devel] [PATCH RFC 11/13] x86/mm: export create_pae_xen_mappings

2017-03-27 Thread Wei Liu
No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/mm.c| 2 +- xen/include/asm-x86/mm.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 0f49671191..92e79d7fb6 100644 --- a/xen/arch/x86/mm.c

[Xen-devel] [PATCH RFC 10/13] x86/mm: export invalidate_shadow_ldt

2017-03-27 Thread Wei Liu
No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/mm.c| 2 +- xen/include/asm-x86/mm.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 13c8dd8ac0..0f49671191 100644 --- a/xen/arch/x86/mm.c

  1   2   3   >