Re: [Xen-devel] [PATCH 1/2] efi: Process MEMATTR table only if EFI_MEMMAP

2017-06-21 Thread Ard Biesheuvel
On 20 June 2017 at 22:14, Daniel Kiper wrote: > Otherwise e.g. Xen dom0 on x86_64 EFI platforms crashes. > > In theory we can check EFI_PARAVIRT too, however, > EFI_MEMMAP looks more generic and covers more cases. > > Signed-off-by: Daniel Kiper

Re: [Xen-devel] [PATCH v7 20/36] x86, mpparse: Use memremap to map the mpf and mpc data

2017-06-21 Thread Borislav Petkov
On Fri, Jun 16, 2017 at 01:53:38PM -0500, Tom Lendacky wrote: > The SMP MP-table is built by UEFI and placed in memory in a decrypted > state. These tables are accessed using a mix of early_memremap(), > early_memunmap(), phys_to_virt() and virt_to_phys(). Change all accesses > to use

Re: [Xen-devel] [PATCH v7 08/36] x86/mm: Add support to enable SME in early boot processing

2017-06-21 Thread Thomas Gleixner
On Fri, 16 Jun 2017, Tom Lendacky wrote: > diff --git a/arch/x86/include/asm/mem_encrypt.h > b/arch/x86/include/asm/mem_encrypt.h > index a105796..988b336 100644 > --- a/arch/x86/include/asm/mem_encrypt.h > +++ b/arch/x86/include/asm/mem_encrypt.h > @@ -15,16 +15,24 @@ > > #ifndef __ASSEMBLY__

Re: [Xen-devel] [PATCH 2/2] xen/input: add multi-touch support

2017-06-21 Thread Dmitry Torokhov
On Thu, Jun 08, 2017 at 09:45:18AM +0300, Oleksandr Andrushchenko wrote: > Hi, Dmitry! > > On 06/07/2017 07:56 PM, Dmitry Torokhov wrote: > >On Wed, May 31, 2017 at 12:06:56PM +0300, Oleksandr Andrushchenko wrote: > >>Hi, Dmitry! > >> > >>On 05/30/2017 07:37 PM, Dmitry Torokhov wrote: > >>>On

Re: [Xen-devel] [PATCH v7 10/36] x86/mm: Provide general kernel support for memory encryption

2017-06-21 Thread Borislav Petkov
On Wed, Jun 21, 2017 at 09:18:59AM +0200, Thomas Gleixner wrote: > That looks wrong. It's not decrypted it's rather unencrypted, right? Yeah, it previous versions of the patchset, "decrypted" and "unencrypted" were both present so we settled on "decrypted" for the nomenclature. --

Re: [Xen-devel] [PATCH v7 10/36] x86/mm: Provide general kernel support for memory encryption

2017-06-21 Thread Thomas Gleixner
On Fri, 16 Jun 2017, Tom Lendacky wrote: > > +#ifndef pgprot_encrypted > +#define pgprot_encrypted(prot) (prot) > +#endif > + > +#ifndef pgprot_decrypted That looks wrong. It's not decrypted it's rather unencrypted, right? Thanks, tglx

Re: [Xen-devel] Lockup/High ksoftirqd when rate-limiting is enabled

2017-06-21 Thread Jean-Louis Dupond
Thanks for this quick patch. I was able to test it today, and the high ksoftirqd cpu usage is gone. Great! Is there a chance this can get pushed into stable kernel versions (3.18.x, 4.4.x, etc)? There is not really a backport work, as the netback driver hasn't changed alot recently.

Re: [Xen-devel] stub domain crash related to bind_interdomain

2017-06-21 Thread Jan Beulich
>>> On 20.06.17 at 19:36, wrote: > On 06/20/2017 01:24 AM, Jan Beulich wrote: > On 20.06.17 at 01:39, wrote: >>> I have gotten messages like this sporadically in the qemu-dm log for stub >>> domains, both at domain start and domain reboot: >>> >>>

Re: [Xen-devel] [PATCH 2/2] x86/xen/efi: Init only efi struct members used by Xen

2017-06-21 Thread Ard Biesheuvel
On 20 June 2017 at 22:14, Daniel Kiper wrote: > Current approach, wholesale efi struct initialization from efi_xen, is not > good. Usually if new member is defined then it is properly initialized in > drivers/firmware/efi/efi.c but not in arch/x86/xen/efi.c. As I saw it

Re: [Xen-devel] [PATCH 2/2] x86/xen/efi: Init only efi struct members used by Xen

2017-06-21 Thread Andrew Cooper
On 20/06/2017 21:14, Daniel Kiper wrote: > Current approach, wholesale efi struct initialization from efi_xen, is not > good. Usually if new member is defined then it is properly initialized in > drivers/firmware/efi/efi.c but not in arch/x86/xen/efi.c. As I saw it happened > a few times until

Re: [Xen-devel] [PATCH] xen/disk: don't leak stack data via response ring

2017-06-21 Thread Jan Beulich
>>> On 20.06.17 at 23:48, wrote: > On Tue, 20 Jun 2017, Jan Beulich wrote: >> @@ -36,13 +33,7 @@ struct blkif_x86_32_request_discard { >> blkif_sector_t sector_number;/* start sector idx on disk (r/w only) >> */ >> uint64_t nr_sectors; /* # of

Re: [Xen-devel] [PATCH v4 04/27] x86: move PV invalid op emulation code

2017-06-21 Thread Jan Beulich
>>> On 20.06.17 at 18:25, wrote: > On Tue, Jun 20, 2017 at 10:21:27AM -0600, Jan Beulich wrote: >> >>> On 08.06.17 at 19:11, wrote: >> > @@ -1053,8 +982,8 @@ void do_invalid_op(struct cpu_user_regs *regs) >> > >> > if ( likely(guest_mode(regs)) )

[Xen-devel] [PATCH RFC] Implement hypercall for tracing of program counters

2017-06-21 Thread Felix Schmoll
This commit makes the changes to the hypervisor, the build system as well as libxc necessary in order to facilitate tracing of program counters. A discussion of the design can be found in the mailing list: https://lists.xen.org/archives/html/xen-devel/2017-05/threads.html#02210 The list of files

Re: [Xen-devel] [PATCH v7 07/36] x86/mm: Don't use phys_to_virt in ioremap() if SME is active

2017-06-21 Thread Thomas Gleixner
On Fri, 16 Jun 2017, Tom Lendacky wrote: > Currently there is a check if the address being mapped is in the ISA > range (is_ISA_range()), and if it is then phys_to_virt() is used to > perform the mapping. When SME is active, however, this will result > in the mapping having the encryption bit set

Re: [Xen-devel] [PATCH v4 04/27] x86: move PV invalid op emulation code

2017-06-21 Thread Jan Beulich
>>> On 21.06.17 at 10:57, wrote: > +int pv_emulate_invalid_op(struct cpu_user_regs *regs) > +{ > +return !emulate_invalid_rdtscp(regs) && !emulate_forced_invalid_op(regs); > +} This way you want to make the function return bool. Alternatively you would want to preserve

Re: [Xen-devel] [PATCH v4 04/27] x86: move PV invalid op emulation code

2017-06-21 Thread Wei Liu
On Wed, Jun 21, 2017 at 03:09:41AM -0600, Jan Beulich wrote: > >>> On 21.06.17 at 10:57, wrote: > > +int pv_emulate_invalid_op(struct cpu_user_regs *regs) > > +{ > > +return !emulate_invalid_rdtscp(regs) && > > !emulate_forced_invalid_op(regs); > > +} > > This way you

[Xen-devel] [PATCH 07/11] x86: fold identical error paths in xenmem_add_to_physmap_one()

2017-06-21 Thread Jan Beulich
Signed-off-by: Jan Beulich --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -4899,11 +4899,8 @@ int xenmem_add_to_physmap_one( if ( !paging_mode_translate(d) || (mfn == 0) ) { -if ( page ) -put_page(page); -if ( space ==

[Xen-devel] [PATCH 06/11] ARM: simplify page type handling

2017-06-21 Thread Jan Beulich
There's no need to have anything here on ARM other than the distinction between writable and non-writable pages (and even that could likely be eliminated, but with a more intrusive change). Limit type to a single bit and drop pinned and validated flags altogether. Signed-off-by: Jan Beulich

Re: [Xen-devel] [PATCH 1/3] xen-disk: only advertize feature-persistent if grant copy is not available

2017-06-21 Thread Paul Durrant
> -Original Message- > From: Roger Pau Monne > Sent: 21 June 2017 10:18 > To: Stefano Stabellini > Cc: Paul Durrant ; xen-de...@lists.xenproject.org; > qemu-de...@nongnu.org; qemu-bl...@nongnu.org; Anthony Perard >

[Xen-devel] [PATCH] x86/mm: consolidate setting of TLB flush time stamps

2017-06-21 Thread Jan Beulich
Move code and comment into a helper function instead of repeating it in multiple places. Signed-off-by: Jan Beulich --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -602,6 +602,20 @@ static inline void guest_get_eff_kern_l1 TOGGLE_MODE(); } +static inline void

Re: [Xen-devel] [PATCH v2 1/3] libxl: add PV display device driver interface

2017-06-21 Thread Oleksandr Grytsov
On Tue, Jun 20, 2017 at 4:54 PM, Wei Liu wrote: > On Thu, May 25, 2017 at 03:17:29PM +0300, Oleksandr Grytsov wrote: >> From: Oleksandr Grytsov >> Hi Wei, Thank you for your reply. > I'm sorry, patch like this is impossible to review because:

Re: [Xen-devel] [PATCH 06/14 v4] xen/arm: vpl011: Add a new domctl API to initialize vpl011

2017-06-21 Thread Bhupinder Thakur
Hi Julien, On 20 June 2017 at 16:46, Julien Grall wrote: > On 06/19/2017 02:11 PM, Bhupinder Thakur wrote: >> >> Hi Wei, > > > Hi Bhupinder, > > >> On 19 June 2017 at 17:17, Wei Liu wrote: >>> >>> On Mon, Jun 19, 2017 at 12:01:32PM +0100, Julien Grall

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

2017-06-21 Thread osstest service owner
flight 110901 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/110901/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-xl-credit2 16 guest-start.2fail REGR. vs. 110478 Regressions

[Xen-devel] [PATCH 0/2] x86/p2m: some code simplification

2017-06-21 Thread Jan Beulich
1: simplify p2m_next_level() 2: make p2m_alloc_ptp() return an MFN Signed-off-by: Jan Beulich ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 02/11] gnttab: remove redundant xenheap check from gnttab_transfer()

2017-06-21 Thread Andrew Cooper
On 21/06/17 10:31, Jan Beulich wrote: > The message isn't very useful, and the check is being done by > steal_page() anyway. > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper ___ Xen-devel mailing

Re: [Xen-devel] [PATCH 04/11] domctl: restrict DOMCTL_set_target to HVM domains

2017-06-21 Thread Andrew Cooper
On 21/06/17 10:33, Jan Beulich wrote: > Both the XSA-217 fix and > lists.xenproject.org/archives/html/xen-devel/2017-04/msg02945.html > make this assumption, so let's enforce it. > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper , although...

Re: [Xen-devel] [PATCH 05/11] evtchn: convert evtchn_port_is_*() to plain bool

2017-06-21 Thread Andrew Cooper
On 21/06/17 10:34, Jan Beulich wrote: > ... at once reducing overall source size by combining some statements > and constifying a few pointers. > > Signed-off-by: Jan Beulich Ah - I was planning to do precisely this. I'm glad I hadn't started yet. Reviewed-by: Andrew Cooper

Re: [Xen-devel] [PATCH] x86/mmuext: don't allow copying/clearing non-RAM pages

2017-06-21 Thread Jan Beulich
>>> On 21.06.17 at 12:51, wrote: > On 21/06/17 11:10, Jan Beulich wrote: >> The two operations really aren't meant for anything else. >> >> Signed-off-by: Jan Beulich > > Reviewed-by: Andrew Cooper , however... > >> >>

Re: [Xen-devel] [PATCH 2/2] xen/input: add multi-touch support

2017-06-21 Thread Oleksandr Andrushchenko
Hi, Dmitry! On 06/21/2017 10:24 AM, Dmitry Torokhov wrote: On Thu, Jun 08, 2017 at 09:45:18AM +0300, Oleksandr Andrushchenko wrote: Hi, Dmitry! On 06/07/2017 07:56 PM, Dmitry Torokhov wrote: On Wed, May 31, 2017 at 12:06:56PM +0300, Oleksandr Andrushchenko wrote: Hi, Dmitry! On 05/30/2017

Re: [Xen-devel] [PATCH v4 04/27] x86: move PV invalid op emulation code

2017-06-21 Thread Wei Liu
On Wed, Jun 21, 2017 at 12:15:46AM -0600, Jan Beulich wrote: > >>> On 20.06.17 at 18:25, wrote: > > On Tue, Jun 20, 2017 at 10:21:27AM -0600, Jan Beulich wrote: > >> >>> On 08.06.17 at 19:11, wrote: > >> > @@ -1053,8 +982,8 @@ void do_invalid_op(struct

[Xen-devel] [PATCH net] xen-netback: correctly schedule rate-limited queues

2017-06-21 Thread Wei Liu
Add a flag to indicate if a queue is rate-limited. Test the flag in NAPI poll handler and avoid rescheduling the queue if true, otherwise we risk locking up the host. The rescheduling will be done in the timer callback function. Reported-by: Jean-Louis Dupond Signed-off-by:

Re: [Xen-devel] [PATCH v4 04/27] x86: move PV invalid op emulation code

2017-06-21 Thread Wei Liu
On Wed, Jun 21, 2017 at 03:26:12AM -0600, Jan Beulich wrote: > >>> On 21.06.17 at 11:14, wrote: > > On Wed, Jun 21, 2017 at 03:09:41AM -0600, Jan Beulich wrote: > >> >>> On 21.06.17 at 10:57, wrote: > >> > +int pv_emulate_invalid_op(struct cpu_user_regs

[Xen-devel] [PATCH 09/11] gnttab: avoid spurious maptrack handle allocation failures

2017-06-21 Thread Jan Beulich
When no memory is available in the hypervisor, rather than immediately failing the request try to steal a handle from another vCPU. Reported-by: George Dunlap Signed-off-by: Jan Beulich --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c

[Xen-devel] [PATCH 08/11] gnttab: remove host map in the event of a grant_map failure

2017-06-21 Thread Jan Beulich
From: George Dunlap The current code appropriately removes the reference and type counts on failure, but leaves the mapping set up. As the only path which can trigger this is failure from IOMMU manipulation, and as unprivileged domains are being crashed in that case,

Re: [Xen-devel] [PATCH v7 23/36] x86, realmode: Decrypt trampoline area if memory encryption is active

2017-06-21 Thread Borislav Petkov
On Fri, Jun 16, 2017 at 01:54:12PM -0500, Tom Lendacky wrote: > When Secure Memory Encryption is enabled, the trampoline area must not > be encrypted. A CPU running in real mode will not be able to decrypt > memory that has been encrypted because it will not be able to use addresses > with the

Re: [Xen-devel] [PATCH v3 3/9] xen/mm: move modify_identity_mmio to global file and drop __init

2017-06-21 Thread Roger Pau Monne
On Fri, May 19, 2017 at 07:35:39AM -0600, Jan Beulich wrote: > >>> On 27.04.17 at 16:35, wrote: > > And also allow it to do non-identity mappings by adding a new parameter. > > This > > function will be needed in other parts apart from PVH Dom0 build. While > > there > >

Re: [Xen-devel] [PATCH RFC] Implement hypercall for tracing of program counters

2017-06-21 Thread Wei Liu
On Wed, Jun 21, 2017 at 09:20:20AM +0200, Felix Schmoll wrote: > This commit makes the changes to the hypervisor, the build system as > well as libxc necessary in order to facilitate tracing of program counters. > > A discussion of the design can be found in the mailing list: >

Re: [Xen-devel] [PATCH 1/3] xen-disk: only advertize feature-persistent if grant copy is not available

2017-06-21 Thread Roger Pau Monné
On Tue, Jun 20, 2017 at 03:19:33PM -0700, Stefano Stabellini wrote: > On Tue, 20 Jun 2017, Paul Durrant wrote: > > If grant copy is available then it will always be used in preference to > > persistent maps. In this case feature-persistent should not be advertized > > to the frontend, otherwise it

Re: [Xen-devel] [PATCH 2/2] x86/xen/efi: Init only efi struct members used by Xen

2017-06-21 Thread Ingo Molnar
* Daniel Kiper wrote: > -static const struct efi efi_xen __initconst = { > - .systab = NULL, /* Initialized later. */ > - .runtime_version = 0,/* Initialized later. */ > - .mps = EFI_INVALID_TABLE_ADDR, > -

[Xen-devel] [PATCH 03/11] make steal_page() return a proper error value

2017-06-21 Thread Jan Beulich
... and use it where suitable (the tmem caller doesn't propagate an error code). While it doesn't matter as much, also make donate_page() follow suit on x86 (on ARM it already returns -ENOSYS). Also move their declarations to common code and add __must_check. Signed-off-by: Jan Beulich

Re: [Xen-devel] [PATCH 2/2] x86/xen/efi: Init only efi struct members used by Xen

2017-06-21 Thread Daniel Kiper
On Wed, Jun 21, 2017 at 11:24:06AM +0200, Ingo Molnar wrote: > > * Daniel Kiper wrote: > > > -static const struct efi efi_xen __initconst = { > > - .systab = NULL, /* Initialized later. */ > > - .runtime_version = 0,/* Initialized later.

[Xen-devel] [PATCH 1/2] x86/p2m: simplify p2m_next_level()

2017-06-21 Thread Jan Beulich
Calculate entry PFN and flags just once, making the respective variables (and also pg) function wide. Take the opportunity and also make the induction variable unsigned. Signed-off-by: Jan Beulich --- a/xen/arch/x86/mm/p2m-pt.c +++ b/xen/arch/x86/mm/p2m-pt.c @@ -195,7 +195,9

[Xen-devel] [PATCH 2/2] x86/p2m: make p2m_alloc_ptp() return an MFN

2017-06-21 Thread Jan Beulich
None of the callers really needs the struct page_info pointer. Signed-off-by: Jan Beulich --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -569,7 +569,7 @@ int p2m_set_entry(struct p2m_domain *p2m return rc; } -struct page_info *p2m_alloc_ptp(struct

Re: [Xen-devel] [PATCH] x86/mm: drop redundant domain parameter from get_page_from_gfn_p2m()

2017-06-21 Thread Andrew Cooper
On 21/06/17 11:12, Jan Beulich wrote: > It can always be read from the passed p2m. Take the opportunity and > also rename the function, making the "p2m" suffix a prefix, to match > other p2m functions, and convert the "gfn" parameter's type. > > Signed-off-by: Jan Beulich

Re: [Xen-devel] [Qemu-devel] [PATCH 1/3] xen-disk: only advertize feature-persistent if grant copy is not available

2017-06-21 Thread Paul Durrant
> -Original Message- > From: Qemu-devel [mailto:qemu-devel- > bounces+paul.durrant=citrix@nongnu.org] On Behalf Of Paul Durrant > Sent: 21 June 2017 10:36 > To: Roger Pau Monne ; Stefano Stabellini > > Cc: Kevin Wolf ;

Re: [Xen-devel] [Qemu-devel] [PATCH 1/3] xen-disk: only advertize feature-persistent if grant copy is not available

2017-06-21 Thread Paul Durrant
> -Original Message- > From: Roger Pau Monne > Sent: 21 June 2017 11:51 > To: Paul Durrant > Cc: Stefano Stabellini ; Kevin Wolf > ; qemu-bl...@nongnu.org; qemu-de...@nongnu.org; > Max Reitz ; Anthony

Re: [Xen-devel] [PATCH 01/11] public: adjust documentation following XSA-217

2017-06-21 Thread Andrew Cooper
On 21/06/17 10:30, Jan Beulich wrote: > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 07/11] x86: fold identical error paths in xenmem_add_to_physmap_one()

2017-06-21 Thread Andrew Cooper
On 21/06/17 10:36, Jan Beulich wrote: > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper I think this function is another one which could benefit from explicitly counting the number of references it collects, as per XSA-224. > > ---

Re: [Xen-devel] [PATCH 2/2] x86/xen/efi: Init only efi struct members used by Xen

2017-06-21 Thread Daniel Kiper
On Wed, Jun 21, 2017 at 09:10:51AM +0100, Andrew Cooper wrote: > On 20/06/2017 21:14, Daniel Kiper wrote: > > Current approach, wholesale efi struct initialization from efi_xen, is not > > good. Usually if new member is defined then it is properly initialized in > > drivers/firmware/efi/efi.c but

Re: [Xen-devel] Notes on stubdoms and latency on ARM

2017-06-21 Thread Julien Grall
On 20/06/17 17:23, Volodymyr Babchuk wrote: Hi Julien, Hi Volodymyr, On 20 June 2017 at 03:45, Julien Grall wrote: On 19 June 2017 at 10:54, Stefano Stabellini wrote: But given the conversation so far, it seems likely that that is mainly

Re: [Xen-devel] [PATCH v7 25/36] swiotlb: Add warnings for use of bounce buffers with SME

2017-06-21 Thread Borislav Petkov
On Fri, Jun 16, 2017 at 01:54:36PM -0500, Tom Lendacky wrote: > Add warnings to let the user know when bounce buffers are being used for > DMA when SME is active. Since the bounce buffers are not in encrypted > memory, these notifications are to allow the user to determine some > appropriate

Re: [Xen-devel] [Qemu-devel] [PATCH 1/3] xen-disk: only advertize feature-persistent if grant copy is not available

2017-06-21 Thread Roger Pau Monne
On Wed, Jun 21, 2017 at 11:40:00AM +0100, Paul Durrant wrote: > > -Original Message- > > From: Qemu-devel [mailto:qemu-devel- > > bounces+paul.durrant=citrix@nongnu.org] On Behalf Of Paul Durrant > > Sent: 21 June 2017 10:36 > > To: Roger Pau Monne ; Stefano

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

2017-06-21 Thread osstest service owner
flight 110924 xen-unstable-coverity real [real] http://logs.test-lab.xenproject.org/osstest/logs/110924/ Perfect :-) All tests in this flight passed as required version targeted for testing: xen d8f1b48fd665d7aad1711de2f073540d07d2d041 baseline version: xen

[Xen-devel] [xen-4.6-testing test] 110899: regressions - FAIL

2017-06-21 Thread osstest service owner
flight 110899 xen-4.6-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/110899/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-xtf-amd64-amd64-3 45 xtf/test-hvm64-lbr-tsx-vmentry fail REGR. vs. 110386

Re: [Xen-devel] [PATCH 03/11] make steal_page() return a proper error value

2017-06-21 Thread Andrew Cooper
On 21/06/17 10:32, Jan Beulich wrote: > ... and use it where suitable (the tmem caller doesn't propagate an > error code). While it doesn't matter as much, also make donate_page() > follow suit on x86 (on ARM it already returns -ENOSYS). > > Also move their declarations to common code and add

[Xen-devel] [PATCH 00/11] assorted follow-ups to recent XSAs

2017-06-21 Thread Jan Beulich
01: public: adjust documentation following XSA-217 02: gnttab: remove redundant xenheap check from gnttab_transfer() 03: make steal_page() return a proper error value 04: domctl: restrict DOMCTL_set_target to HVM domains 05: evtchn: convert evtchn_port_is_*() to plain bool 06: ARM: simplify page

Re: [Xen-devel] [PATCH v4 04/27] x86: move PV invalid op emulation code

2017-06-21 Thread Jan Beulich
>>> On 21.06.17 at 11:14, wrote: > On Wed, Jun 21, 2017 at 03:09:41AM -0600, Jan Beulich wrote: >> >>> On 21.06.17 at 10:57, wrote: >> > +int pv_emulate_invalid_op(struct cpu_user_regs *regs) >> > +{ >> > +return !emulate_invalid_rdtscp(regs) && >>

[Xen-devel] [PATCH 01/11] public: adjust documentation following XSA-217

2017-06-21 Thread Jan Beulich
Signed-off-by: Jan Beulich --- a/xen/include/public/grant_table.h +++ b/xen/include/public/grant_table.h @@ -411,12 +411,13 @@ typedef struct gnttab_dump_table gnttab_ DEFINE_XEN_GUEST_HANDLE(gnttab_dump_table_t); /* - * GNTTABOP_transfer_grant_ref: Transfer to a foreign

[Xen-devel] [PATCH 02/11] gnttab: remove redundant xenheap check from gnttab_transfer()

2017-06-21 Thread Jan Beulich
The message isn't very useful, and the check is being done by steal_page() anyway. Signed-off-by: Jan Beulich --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -1843,15 +1843,6 @@ gnttab_transfer( } page = mfn_to_page(mfn); -if (

[Xen-devel] [PATCH 10/11] gnttab: limit mapkind()'s iteration count

2017-06-21 Thread Jan Beulich
There's no need for the function to observe increases of the maptrack table (which can occur as the maptrack lock isn't being held) - actual population of maptrack entries is excluded while we're here (by way of holding the respective grant table lock for writing, while code populating entries

Re: [Xen-devel] [PATCH net] xen-netback: correctly schedule rate-limited queues

2017-06-21 Thread Paul Durrant
> -Original Message- > From: Wei Liu [mailto:wei.l...@citrix.com] > Sent: 21 June 2017 10:21 > To: net...@vger.kernel.org > Cc: Xen-devel ; Paul Durrant > ; David Miller ; jean- > lo...@dupond.be; Wei Liu

[Xen-devel] [PATCH 11/11] gnttab: drop useless locking

2017-06-21 Thread Jan Beulich
Holding any lock while accessing the maptrack entry fields is pointless, as these entries are protected by their associated active entry lock (which is being acquired later, before re-validating the fields read without holding the lock). Signed-off-by: Jan Beulich ---

[Xen-devel] [PATCH] passthrough: give XEN_DOMCTL_test_assign_device more sane semantics

2017-06-21 Thread Jan Beulich
So far callers of the libxc interface passed in a domain ID which was then ignored in the hypervisor. Instead, make the hypervisor honor it (accepting DOMID_INVALID to obtain original behavior), allowing to query whether a device is assigned to a particular domain. Ignore the passed in domain ID

[Xen-devel] [PATCH] x86/mm: drop redundant domain parameter from get_page_from_gfn_p2m()

2017-06-21 Thread Jan Beulich
It can always be read from the passed p2m. Take the opportunity and also rename the function, making the "p2m" suffix a prefix, to match other p2m functions, and convert the "gfn" parameter's type. Signed-off-by: Jan Beulich --- a/xen/arch/x86/mm/hap/guest_walk.c +++

Re: [Xen-devel] [PATCH] x86/mm: consolidate setting of TLB flush time stamps

2017-06-21 Thread Andrew Cooper
On 21/06/17 11:11, Jan Beulich wrote: > Move code and comment into a helper function instead of repeating it in > multiple places. > > Signed-off-by: Jan Beulich Reivewed-by: Andrew Cooper ___ Xen-devel

Re: [Xen-devel] [PATCH 2/3] xen-disk: add support for multi-page shared rings

2017-06-21 Thread Paul Durrant
> -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 20 June 2017 23:51 > To: Paul Durrant > Cc: xen-de...@lists.xenproject.org; qemu-de...@nongnu.org; qemu- > bl...@nongnu.org; Stefano Stabellini ;

Re: [Xen-devel] [PATCH] x86/mmuext: don't allow copying/clearing non-RAM pages

2017-06-21 Thread Andrew Cooper
On 21/06/17 11:10, Jan Beulich wrote: > The two operations really aren't meant for anything else. > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper , however... > > --- a/xen/arch/x86/mm.c > +++ b/xen/arch/x86/mm.c > @@ -3229,6 +3229,7 @@

[Xen-devel] [PATCH 00/17] x86: emulator enhancements

2017-06-21 Thread Jan Beulich
01: support remaining AVX insns 02: re-order cases of main switch statement 03: build SIMD tests with -Os 04: support F16C insns 05: support FMA4 insns 06: support FMA insns 07: support most remaining AVX2 insns 08: fold/eliminate some local variables 09: support AVX2 gather insns 10: add tables

Re: [Xen-devel] Lockup/High ksoftirqd when rate-limiting is enabled

2017-06-21 Thread Wei Liu
On Wed, Jun 21, 2017 at 10:35:11AM +0200, Jean-Louis Dupond wrote: > Thanks for this quick patch. > I was able to test it today, and the high ksoftirqd cpu usage is gone. > > Great! > > Is there a chance this can get pushed into stable kernel versions (3.18.x, > 4.4.x, etc)? > There is not

[Xen-devel] [PATCH 04/11] domctl: restrict DOMCTL_set_target to HVM domains

2017-06-21 Thread Jan Beulich
Both the XSA-217 fix and lists.xenproject.org/archives/html/xen-devel/2017-04/msg02945.html make this assumption, so let's enforce it. Signed-off-by: Jan Beulich --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -1071,7 +1071,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe

[Xen-devel] [PATCH 05/11] evtchn: convert evtchn_port_is_*() to plain bool

2017-06-21 Thread Jan Beulich
... at once reducing overall source size by combining some statements and constifying a few pointers. Signed-off-by: Jan Beulich --- a/xen/common/event_2l.c +++ b/xen/common/event_2l.c @@ -61,7 +61,7 @@ static void evtchn_2l_unmask(struct doma } } -static bool_t

Re: [Xen-devel] [PATCH v7 24/36] x86, swiotlb: Add memory encryption support

2017-06-21 Thread Borislav Petkov
On Fri, Jun 16, 2017 at 01:54:24PM -0500, Tom Lendacky wrote: > Since DMA addresses will effectively look like 48-bit addresses when the > memory encryption mask is set, SWIOTLB is needed if the DMA mask of the > device performing the DMA does not support 48-bits. SWIOTLB will be > initialized to

Re: [Xen-devel] Fwd: VM Live Migration with Local Storage

2017-06-21 Thread Paul Durrant
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xen.org] On Behalf Of > Konrad Rzeszutek Wilk > Sent: 20 June 2017 18:57 > To: Bruno Alvisio > Cc: xen-devel@lists.xen.org > Subject: Re: [Xen-devel] Fwd: VM Live Migration with Local Storage >

[Xen-devel] [PATCH] x86/mmuext: don't allow copying/clearing non-RAM pages

2017-06-21 Thread Jan Beulich
The two operations really aren't meant for anything else. Signed-off-by: Jan Beulich --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -3229,6 +3229,7 @@ long do_mmuext_op( switch ( op.cmd ) { struct page_info *page; +p2m_type_t

[Xen-devel] [PATCH v2] VT-d: fix VF of RC integrated endpoint matched to wrong VT-d unit

2017-06-21 Thread Chao Gao
The problem is a VF of RC integrated PF (e.g. PF's BDF is 00:02.0), we would wrongly use 00:00.0 to search VT-d unit. To search VT-d unit for a VF, the BDF of the PF is used. And If the PF is an Extended Function, the BDF of one traditional function is used. The following line (from

Re: [Xen-devel] [PATCH v3 3/9] xen/mm: move modify_identity_mmio to global file and drop __init

2017-06-21 Thread Jan Beulich
>>> On 21.06.17 at 13:11, wrote: > On Fri, May 19, 2017 at 07:35:39AM -0600, Jan Beulich wrote: >> >>> On 27.04.17 at 16:35, wrote: >> > And also allow it to do non-identity mappings by adding a new parameter. >> > This >> > function will be needed in

[Xen-devel] [PATCH 10/17] x86emul: add tables for XOP 08 and 09 extension spaces

2017-06-21 Thread Jan Beulich
Convert the few existing opcodes so far supported. Also adjust two vex_* case labels to better be ext_* (the values are identical). Signed-off-by: Jan Beulich --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -458,6 +458,20 @@

[Xen-devel] [PATCH 08/17] x86emul: fold/eliminate some local variables

2017-06-21 Thread Jan Beulich
Make i switch-wide (at once makeing it unsigned, as it should have been) and introduce n (for immediate use in enter and aam/aad handling). Eliminate on-stack arrays in pusha/popa handling. Use ea.val insatead of a custom variable in bound handling. No (intended) functional change.

Re: [Xen-devel] [PATCH] xen: Replace ASSERT(0) with ASSERT_UNREACHABLE()

2017-06-21 Thread Jan Beulich
>>> On 21.06.17 at 14:40, wrote: > No functional change, but the result is more informative both in the code and > error messages if the assertions do get hit. > > Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich

[Xen-devel] [PATCH v3 0/2][XTF] FPU test improvements

2017-06-21 Thread Jan Beulich
1: add FPU/SIMD register state test 2: extend FPU exception tests Signed-off-by: Jan Beulich ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v7 06/36] x86/mm: Add Secure Memory Encryption (SME) support

2017-06-21 Thread Tom Lendacky
On 6/20/2017 3:49 PM, Thomas Gleixner wrote: On Fri, 16 Jun 2017, Tom Lendacky wrote: +config ARCH_HAS_MEM_ENCRYPT + def_bool y + depends on X86 That one is silly. The config switch is in the x86 KConfig file, so X86 is on. If you intended to move this to some generic place

[Xen-devel] [PATCH 02/17] x86emul: re-order cases of main switch statement

2017-06-21 Thread Jan Beulich
Re-store intended numerical ordering, which has become "violated" mostly by incremental additions where moving around bigger chunks did not seem advisable. One exception though at the very top of the switch(): Keeping the arithmetic ops together seems preferable over entirely strict ordering.

[Xen-devel] [PATCH 03/17] x86emul: build SIMD tests with -Os

2017-06-21 Thread Jan Beulich
Namely in the context of putting together subsequent patches I've noticed that together with the touch() macro using -Os further increases the chances of the compiler using memory operands for the instructions we actually care to test. Signed-off-by: Jan Beulich ---

[Xen-devel] [PATCH 14/17] x86emul: abstract out XCRn accesses

2017-06-21 Thread Jan Beulich
Use hooks, just like done for other special purpose registers. This includes moving XCR0 checks from hvmemul_get_fpu() to the emulator itself as well as adding support for XGETBV emulation. For now fuzzer reads will obtain the real values (minus the fuzzing of the hook pointer itself).

[Xen-devel] [PATCH 13/17] x86emul: re-order checks in test harness

2017-06-21 Thread Jan Beulich
On older systems printing the "n/a" messages (resulting from the compiler not being new enough to deal with some of the test code) isn't very useful: If both CPU and compiler are too old for a certain test, we can as well omit those messages, as those tests wouldn't be run even if the compiler did

Re: [Xen-devel] [PATCH 10/11] gnttab: limit mapkind()'s iteration count

2017-06-21 Thread Andrew Cooper
On 21/06/17 10:38, Jan Beulich wrote: > There's no need for the function to observe increases of the maptrack > table (which can occur as the maptrack lock isn't being held) - actual > population of maptrack entries is excluded while we're here (by way of > holding the respective grant table lock

Re: [Xen-devel] [PATCH v3 3/9] xen/mm: move modify_identity_mmio to global file and drop __init

2017-06-21 Thread Roger Pau Monne
On Wed, Jun 21, 2017 at 05:57:19AM -0600, Jan Beulich wrote: > >>> On 21.06.17 at 13:11, wrote: > > On Fri, May 19, 2017 at 07:35:39AM -0600, Jan Beulich wrote: > >> >>> On 27.04.17 at 16:35, wrote: > >> > +int modify_mmio(struct domain *d, gfn_t gfn,

Re: [Xen-devel] [PATCH] xen: Replace ASSERT(0) with ASSERT_UNREACHABLE()

2017-06-21 Thread Julien Grall
Hi Andrew, On 21/06/17 13:40, Andrew Cooper wrote: No functional change, but the result is more informative both in the code and error messages if the assertions do get hit. Signed-off-by: Andrew Cooper For ARM bits: Reviewed-by: Julien Grall

Re: [Xen-devel] [PATCH v3 3/9] xen/mm: move modify_identity_mmio to global file and drop __init

2017-06-21 Thread Roger Pau Monne
On Wed, Jun 21, 2017 at 06:51:32AM -0600, Jan Beulich wrote: > >>> On 21.06.17 at 14:43, wrote: > > On Wed, Jun 21, 2017 at 05:57:19AM -0600, Jan Beulich wrote: > >> >>> On 21.06.17 at 13:11, wrote: > >> > On Fri, May 19, 2017 at 07:35:39AM -0600, Jan

[Xen-devel] [PATCH v3 2/2][XTF] extend FPU exception tests

2017-06-21 Thread Jan Beulich
Also test #MF and #XM handling. Signed-off-by: Jan Beulich --- v3: New. --- /dev/null +++ b/arch/x86/include/arch/simd.h @@ -0,0 +1,32 @@ +#ifndef XTF_X86_SIMD_H +#define XTF_X86_SIMD_H + +#define X86_MXCSR_IE 0x0001 +#define X86_MXCSR_DE 0x0002 +#define

[Xen-devel] [PATCH v3 1/2][XTF] add FPU/SIMD register state test

2017-06-21 Thread Jan Beulich
Add tests to verify that - FPU insns leave correct (guest) values in FIP/FDP/FOP/FCS/FDS (at the example for FSTPS), - FPU insns writing memory don't update FPU register state when the write faults (at the example of FISTPS), - VCVTPS2PH (once implemented in the emulator) doesn't update MXCSR

[Xen-devel] [PATCH 07/17] x86emul: support most remaining AVX2 insns

2017-06-21 Thread Jan Beulich
I.e. those not being equivalents of SSEn ones, but with the exception of the various gather operations. Signed-off-by: Jan Beulich --- a/tools/tests/x86_emulator/Makefile +++ b/tools/tests/x86_emulator/Makefile @@ -11,9 +11,9 @@ all: $(TARGET) run: $(TARGET)

Re: [Xen-devel] [PATCH 09/11] gnttab: avoid spurious maptrack handle allocation failures

2017-06-21 Thread Andrew Cooper
On 21/06/17 10:37, Jan Beulich wrote: > When no memory is available in the hypervisor, rather than immediately > failing the request try to steal a handle from another vCPU. "request, try" > > Reported-by: George Dunlap > Signed-off-by: Jan Beulich

[Xen-devel] [PATCH 17/17] x86/HVM: eliminate custom #MF/#XM handling

2017-06-21 Thread Jan Beulich
Use the generic stub exception handling instead. Signed-off-by: Jan Beulich --- a/tools/tests/x86_emulator/x86_emulate.c +++ b/tools/tests/x86_emulator/x86_emulate.c @@ -134,8 +134,6 @@ int emul_test_read_xcr( } int emul_test_get_fpu( -void (*exception_callback)(void

[Xen-devel] [PATCH 16/17] x86emul: make all FPU emulation use the stub

2017-06-21 Thread Jan Beulich
While this means quite some reduction of (source) code, the main purpose is to no longer have exceptions raised from other than stubs. Signed-off-by: Jan Beulich --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -1261,28 +1261,25 @@

Re: [Xen-devel] [PATCH v3 3/9] xen/mm: move modify_identity_mmio to global file and drop __init

2017-06-21 Thread Jan Beulich
>>> On 21.06.17 at 14:43, wrote: > On Wed, Jun 21, 2017 at 05:57:19AM -0600, Jan Beulich wrote: >> >>> On 21.06.17 at 13:11, wrote: >> > On Fri, May 19, 2017 at 07:35:39AM -0600, Jan Beulich wrote: >> >> >>> On 27.04.17 at 16:35,

Re: [Xen-devel] [PATCH v3 3/9] xen/mm: move modify_identity_mmio to global file and drop __init

2017-06-21 Thread Jan Beulich
>>> On 21.06.17 at 15:10, wrote: > On Wed, Jun 21, 2017 at 06:51:32AM -0600, Jan Beulich wrote: >> Otoh >> to prevent hangs we simply call process_pending_softirqs() >> every once in a while in a few other cases, so maybe doing that >> would already suffice here. > > That's

[Xen-devel] [PATCH 01/17] x86emul: support remaining AVX insns

2017-06-21 Thread Jan Beulich
I.e. those not being equivalents of SSEn ones. There's one necessary change to generic code: Faulting behavior of VMASKMOVP{S,D} requires us to do partial reads/writes. Signed-off-by: Jan Beulich --- a/.gitignore +++ b/.gitignore @@ -224,7 +224,7 @@

[Xen-devel] [PATCH 05/17] x86emul: support FMA4 insns

2017-06-21 Thread Jan Beulich
Signed-off-by: Jan Beulich --- a/.gitignore +++ b/.gitignore @@ -226,7 +226,7 @@ tools/tests/x86_emulator/asm tools/tests/x86_emulator/avx*.[ch] tools/tests/x86_emulator/blowfish.h +tools/tests/x86_emulator/fma*.[ch] tools/tests/x86_emulator/sse*.[ch]

[Xen-devel] [PATCH 06/17] x86emul: support FMA insns

2017-06-21 Thread Jan Beulich
Signed-off-by: Jan Beulich --- a/tools/tests/x86_emulator/Makefile +++ b/tools/tests/x86_emulator/Makefile @@ -12,7 +12,7 @@ run: $(TARGET) ./$(TARGET) SIMD := sse sse2 sse4 avx -FMA := fma4 +FMA := fma4 fma TESTCASES := blowfish $(SIMD) sse2-avx sse4-avx $(FMA)

  1   2   3   >