[Xen-devel] [PATCH v3] xen/arm: map_dev_mmio_region: printk should be ratelimited

2016-04-06 Thread Shannon Zhao
From: Shannon Zhao The function map_dev_mmio_region is used in a hypercall. Therefore all printks should be ratelimited to avoid a malicious guest flooding the console. Signed-off-by: Shannon Zhao Reviewed-by: Konrad Rzeszutek Wilk --- v3: update commit message --- xen/arch/arm/p2m.c | 2 +-

[Xen-devel] [PATCH] docs: add misc/qemu-backends.txt

2016-04-06 Thread Juergen Gross
Document the interface between qemu and libxl regarding backends supported by qemu. Signed-off-by: Juergen Gross --- docs/misc/qemu-backends.txt | 19 +++ 1 file changed, 19 insertions(+) create mode 100644 docs/misc/qemu-backends.txt diff --git a/docs/misc/qemu-backends.txt b/

[Xen-devel] [ovmf bisection] complete test-amd64-amd64-xl-qemuu-ovmf-amd64

2016-04-06 Thread osstest service owner
branch xen-unstable xenbranch xen-unstable job test-amd64-amd64-xl-qemuu-ovmf-amd64 testid debian-hvm-install Tree: linux git://xenbits.xen.org/linux-pvops.git Tree: linuxfirmware git://xenbits.xen.org/osstest/linux-firmware.git Tree: ovmf https://github.com/tianocore/edk2.git Tree: qemu git://xen

Re: [Xen-devel] [PATCH v2 08/11] xen: sched: allow for choosing credit2 runqueues configuration at boot

2016-04-06 Thread Juergen Gross
On 06/04/16 19:23, Dario Faggioli wrote: > In fact, credit2 uses CPU topology to decide how to arrange > its internal runqueues. Before this change, only 'one runqueue > per socket' was allowed. However, experiments have shown that, > for instance, having one runqueue per physical core improves > p

Re: [Xen-devel] [PATCH v2 01/11] xen: sched: make implementing .alloc_pdata optional

2016-04-06 Thread Juergen Gross
On 06/04/16 19:22, Dario Faggioli wrote: > The .alloc_pdata scheduler hook must, before this change, > be implemented by all schedulers --even those ones that > don't need to allocate anything. > > Make it possible to just use the SCHED_OP(), like for > the other hooks, by using ERR_PTR() and IS_E

[Xen-devel] [PATCH v6 24/24] MAINTAINERS/xsplice: Add myself and Ross as the maintainers.

2016-04-06 Thread Konrad Rzeszutek Wilk
If you have a patch for xSplice send it our way! Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan v5: Sort them F: fields (Jan) --- --- MAINTAINERS | 10 ++ 1 file changed, 10 insertions(+) diff

[Xen-devel] [PATCH v6 08/24] xsplice: Add helper elf routines

2016-04-06 Thread Konrad Rzeszutek Wilk
From: Ross Lagerwall Add Elf routines and data structures in preparation for loading an xSplice payload. We make an assumption that the max number of sections an ELF payload can have is 64. We can in future make this be dependent on the names of the sections and verifying against a list, but for

[Xen-devel] [PATCH v6 19/24] libxl: info: Display build_id of the hypervisor using XEN_VERSION_build_id

2016-04-06 Thread Konrad Rzeszutek Wilk
If the hypervisor is built with we will display it. Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Wei Liu --- Cc: Ian Jackson Cc: Stefano Stabellini Cc: Wei Liu v2: Include HAVE_*, use libxl_zalloc, s/rc/ret/ v3: Retry with different size if 1020 is not enough. v4: Use VERSION_OP subops in

[Xen-devel] [PATCH v6 12/24] xsplice, symbols: Implement symbol name resolution on address.

2016-04-06 Thread Konrad Rzeszutek Wilk
From: Ross Lagerwall If in the payload we do not have the old_addr we can resolve the virtual address based on the UNDEFined symbols. We also use an boolean flag: new_symbol to track symbols. The usual case this is used is by: * A payload may introduce a new symbol * A payload may override an e

[Xen-devel] [PATCH v6 03/24] libxc: Implementation of XEN_XSPLICE_op in libxc

2016-04-06 Thread Konrad Rzeszutek Wilk
The underlaying toolstack code to do the basic operations when using the XEN_XSPLICE_op syscalls: - upload the payload, - get status of an payload, - list all the payloads, - apply, check, replace, and revert the payload. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Ross Lagerwall Ack

[Xen-devel] [PATCH v6 05/24] arm/x86: Use struct virtual_region to do bug, symbol, and (x86) exception tables lookup.

2016-04-06 Thread Konrad Rzeszutek Wilk
During execution of the hypervisor we have two regions of executable code - stext -> _etext, and _sinittext -> _einitext. The later is not needed after bootup. We also have various built-in macros and functions to search in between those two swaths depending on the state of the system. That is e

[Xen-devel] [PATCH v6 02/24] xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op

2016-04-06 Thread Konrad Rzeszutek Wilk
The implementation does not actually do any patching. It just adds the framework for doing the hypercalls, keeping track of ELF payloads, and the basic operations: - query which payloads exist, - query for specific payloads, - check*1, apply*1, replace*1, and unload payloads. *1: Which of cour

[Xen-devel] [PATCH v6 06/24] x86: Alter nmi_callback_t typedef

2016-04-06 Thread Konrad Rzeszutek Wilk
Drop paranthesis and function pointer on nmi_callback_t typedef. Make it more inline with how x86 maintainers want function typedefs to be. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan v6: New in patchset. --- --- xen/arch/x86/alte

[Xen-devel] [PATCH v6 16/24] xsplice: Add support for alternatives

2016-04-06 Thread Konrad Rzeszutek Wilk
From: Ross Lagerwall Add support for applying alternative sections within xsplice payload. At payload load time, apply an alternative sections that are found. Also we add an test-case exercising a rather useless alternative (patching a NOP with a NOP) - but it does exercise the code-path. Signe

[Xen-devel] [PATCH v6 13/24] x86, xsplice: Print payload's symbol name and payload name in backtraces

2016-04-06 Thread Konrad Rzeszutek Wilk
From: Ross Lagerwall Naturally the backtrace is presented when an instruction hits an bug_frame or %p is used. The payloads do not support bug_frames yet - however the functions the payloads call could hit an BUG() or WARN(). The traps.c has logic to scan for it this - and eventually it will fi

[Xen-devel] [PATCH v6 17/24] build_id: Provide ld-embedded build-ids

2016-04-06 Thread Konrad Rzeszutek Wilk
This patch enables the Elf to be built with the build-id and provide in the Xen hypervisor the code to extract it. One can also retrieve the value of the build-id by doing 'readelf -n xen-syms'. For EFI builds we re-use the same build-id that the xen-syms was built with. The version of ld that f

[Xen-devel] [PATCH v6 11/24] x86/xen_hello_world.xsplice: Test payload for patching 'xen_extra_version'.

2016-04-06 Thread Konrad Rzeszutek Wilk
This change demonstrates how to generate an xSplice ELF payload. The idea here is that we want to patch in the hypervisor the 'xen_version_extra' function with an function that will return 'Hello World'. The 'xl info | grep extraversion' will reflect the new value after the patching. To generate

[Xen-devel] [PATCH v6 22/24] xsplice/xen_replace_world: Test-case for XSPLICE_ACTION_REPLACE

2016-04-06 Thread Konrad Rzeszutek Wilk
With this third payload one can do: -bash-4.1# xen-xsplice load xen_hello_world.xsplice Uploading xen_hello_world.xsplice (10148 bytes) Performing check: completed Performing apply:. completed [xen_hello_world depends on hypervisor build-id] -bash-4.1# xen-xsplice load xen_bye_world.xsplice Uploa

[Xen-devel] [PATCH v6 14/24] xsplice: Add support for bug frames.

2016-04-06 Thread Konrad Rzeszutek Wilk
From: Ross Lagerwall Add support for handling bug frames contained with xsplice modules. If a trap occurs search either the kernel bug table or an applied payload's bug table depending on the instruction pointer. Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Keir

[Xen-devel] [PATCH v6] xSplice v1 design and implementation.

2016-04-06 Thread Konrad Rzeszutek Wilk
Hey! Changelog: v5: http://lists.xen.org/archives/html/xen-devel/2016-03/msg03286.html - Acked on ALL comments from Jan, mentioned which ones this one does not have (ran out of time). - test on 8 socket machine with tons of patches - check the ELF types, not just the names, - impro

[Xen-devel] [PATCH v6 23/24] xsplice: Prevent duplicate payloads from being loaded.

2016-04-06 Thread Konrad Rzeszutek Wilk
From: Ross Lagerwall Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan v6: Drop recursive lock - also now the caller is holding the lock Move the code up in the code above. --- --- xen/common/xsplice.c

[Xen-devel] [PATCH v6 18/24] HYPERCALL_version_op: Add VERSION_build_id to retrieve build-id.

2016-04-06 Thread Konrad Rzeszutek Wilk
The VERSION hypercall provides the flexibility to expose the size of the build-id (so the callers can allocate the proper size before trying to retrieve it). It also allows in one nice swoop to retrieve the hypervisor build-id in the provided buffer. Signed-off-by: Konrad Rzeszutek Wilk Acked-by:

[Xen-devel] [PATCH v6 21/24] xsplice: Stacking build-id dependency checking.

2016-04-06 Thread Konrad Rzeszutek Wilk
We now expect that the ELF payloads be built with the --build-id. Also the .xsplice.deps section has to have the contents of the hypervisor (or a preceding payload) build-id. We already have the code to verify the Elf_Note build-id so export parts of it. This dependency means the hypervisor MUST

[Xen-devel] [PATCH v6 01/24] xsplice: Design document

2016-04-06 Thread Konrad Rzeszutek Wilk
A mechanism is required to binarily patch the running hypervisor with new opcodes that have come about due to primarily security updates. This document describes the design of the API that would allow us to upload to the hypervisor binary patches. This document has been shaped by the input from:

[Xen-devel] [PATCH v6 15/24] xsplice: Add support for exception tables.

2016-04-06 Thread Konrad Rzeszutek Wilk
From: Ross Lagerwall Add support for exception tables contained within xSplice payloads. If an exception occurs search either the main exception table or a particular active payload's exception table depending on the instruction pointer. Also we add an test-case to make sure we have an exception

[Xen-devel] [PATCH v6 20/24] xsplice: Print build_id in keyhandler and on bootup.

2016-04-06 Thread Konrad Rzeszutek Wilk
As it should be an useful debug mechanism. Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Jan Beulich -- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan v2: s/char */const void * v5: s/ssize_t/unsigned int/ v6: Remove pointless initializers, use string literal instead of %s,

[Xen-devel] [PATCH v6 07/24] arm/x86/vmap: Add vmalloc_type and vm_init_type

2016-04-06 Thread Konrad Rzeszutek Wilk
For those users who want to use the virtual addresses that are in the hypervisor's virtual address space - these two new functions allow that. Along with providing the underlaying MFNs for the user's (such as changing page table permissions). Implementation wise the vmap API keeps track of two vir

[Xen-devel] [PATCH v6 04/24] xen-xsplice: Tool to manipulate xsplice payloads

2016-04-06 Thread Konrad Rzeszutek Wilk
A simple tool that allows an system admin to perform basic xsplice operations: - Upload a xsplice file (with an unique name) - List all the xsplice payloads loaded. - Apply, revert, replace, or unload the payload using the unique name. - Do all two - upload, and apply the payload in one go

[Xen-devel] [PATCH v6 09/24] xsplice: Implement payload loading

2016-04-06 Thread Konrad Rzeszutek Wilk
From: Ross Lagerwall Add support for loading xsplice payloads. This is somewhat similar to the Linux kernel module loader, implementing the following steps: - Verify the elf file. - Parse the elf file. - Allocate a region of memory mapped within a free area of [xen_virt_end, XEN_VIRT_END]. - Co

[Xen-devel] [PATCH v6 10/24] xsplice: Implement support for applying/reverting/replacing patches.

2016-04-06 Thread Konrad Rzeszutek Wilk
From: Ross Lagerwall Implement support for the apply, revert and replace actions. To perform and action on a payload, the hypercall sets up a data structure to schedule the work. A hook is added in the reset_stack_and_jump to check for work and execute it if needed (specifically we check an per

Re: [Xen-devel] [PATCH v5 13/28] xsplice, symbols: Implement symbol name resolution on address.

2016-04-06 Thread Konrad Rzeszutek Wilk
On Fri, Apr 01, 2016 at 09:11:40AM -0600, Jan Beulich wrote: > >>> On 24.03.16 at 21:00, wrote: > > --- a/xen/arch/x86/Makefile > > +++ b/xen/arch/x86/Makefile > > @@ -113,12 +113,14 @@ $(TARGET)-syms: prelink.o xen.lds > > $(BASEDIR)/common/symbols-dummy.o > > $(LD) $(LDFLAGS) -T xen.lds -N

Re: [Xen-devel] [PATCH v5 18/28] xsplice: Add support for alternatives

2016-04-06 Thread Konrad Rzeszutek Wilk
On Fri, Apr 01, 2016 at 10:20:40AM -0600, Jan Beulich wrote: > >>> On 24.03.16 at 21:00, wrote: > > --- a/xen/arch/x86/alternative.c > > +++ b/xen/arch/x86/alternative.c > > @@ -28,7 +28,7 @@ > > extern struct alt_instr __alt_instructions[], __alt_instructions_end[]; > > > > #ifdef K8_NOP1 > >

Re: [Xen-devel] [PATCH v5 11/28] xsplice: Implement support for applying/reverting/replacing patches.

2016-04-06 Thread Konrad Rzeszutek Wilk
> That's for an individual patch I suppose? What if REPLACE has to > revert dozens or hundreds of patches? I don't know. That is sometihng I need to figure out. I also need to test this out on the 8 socket machine.. > > +void arch_xsplice_apply_jmp(struct xsplice_patch_func *func) > > +{ > > +

Re: [Xen-devel] [PATCH v5 11/28] xsplice: Implement support for applying/reverting/replacing patches.

2016-04-06 Thread Konrad Rzeszutek Wilk
> >> So you check for there being one such section. Is having multiple > >> of them okay / meaningful? > > > > /me blinks. You can have multiple ELF sections with the same name? > > I will double-check the spec over the weekend to see. > > Of course you can. Remember me telling you that using sec

Re: [Xen-devel] [PATCH v5 19/28] build_id: Provide ld-embedded build-ids

2016-04-06 Thread Konrad Rzeszutek Wilk
On Mon, Apr 04, 2016 at 06:46:24AM -0600, Jan Beulich wrote: > >>> On 24.03.16 at 21:00, wrote: > > The version of ld that first implemented --build-id is v2.18. > > Hence we check for that or later version - if older version > > found we do not build the hypervisor with the build-id > > (and the

[Xen-devel] [PATCH V8 1/2] x86/xsaves: fix two miscellaneous issues

2016-04-06 Thread Shuai Ruan
From: Shuai Ruan 1. get_xsave_addr() will only be called when xsave_area_compressed(xsave) is true. So drop the conditional expression. 2. expand_xsave_states() will memset the area when get NULL from get_xsave_addr(). Reported-by: Jan Beulich Signed-off-by: Shuai Ruan --- v2: Address comment

[Xen-devel] [PATCH V8 0/2] xsaves bug fix

2016-04-06 Thread Shuai Ruan
From: Shuai Ruan This patchset fix xsaves related bugs. Shuai Ruan (2): x86/xsaves: fix two miscellaneous issues x86/xsaves: ebx may return wrong value using CPUID eax=0xd,ecx =1 xen/arch/x86/hvm/hvm.c | 12 xen/arch/x86/xstate.c| 13 ++--- xen/include/as

[Xen-devel] [PATCH V8 2/2] x86/xsaves: ebx may return wrong value using CPUID eax=0xd, ecx =1

2016-04-06 Thread Shuai Ruan
From: Shuai Ruan Refer to SDM Volume 1 Extended Region of an XSAVE Area. The value returned by ecx[1] with cpuid function 0xd and sub-function i (i>1) indicates the alignment of the state component i when the compacted format of the extended region of an xsave area is used. So when hvm guest usi

Re: [Xen-devel] Bug in x86 instruction emulator?

2016-04-06 Thread Jan Beulich
>>> 04/07/16 3:28 AM >>> >On 2016-04-06 10:55, Andrew Cooper wrote: >> Can you grab the full register state at the point of Xorgs crash? >> `info >> regs` in gdb? >> >> The instruction in use, `movaps` is specified to fault if the memory >> operand isn't aligned on a 16byte boundary. Therefore

Re: [Xen-devel] [PATCH v9 1/3] VT-d: add a command line parameter for Queued Invalidation

2016-04-06 Thread Tian, Kevin
> From: Xu, Quan > Sent: Thursday, April 07, 2016 9:49 AM > > > > > > > +In current code, VT-d Queued Invalidation includes Device-TLB, IOTLB, > > > +Context and IEC flush. If Device-TLB flush timed out, we would hide > > > +the target ATS device and crash the domain owning this ATS device. > > >

Re: [Xen-devel] [PATCH v9 1/3] VT-d: add a command line parameter for Queued Invalidation

2016-04-06 Thread Xu, Quan
On April 05, 2016 5:09pm, wrote: > >>> On 01.04.16 at 16:47, wrote: > > The subject should mention "timeout", perhaps either in addition to or in > place > of "command line". > I prefer "VT-d: add a timeout parameter for Queued Invalidation". > > --- a/docs/misc/xen-command-line.markdown > >

Re: [Xen-devel] [PATCH v10 00/17] Add ACPI support for Xen Dom0 on ARM64

2016-04-06 Thread Shannon Zhao
Hi Julien, On 2016/4/6 19:32, Julien Grall wrote: > Hi Shannon, > > On 01/04/2016 16:48, Shannon Zhao wrote: >> This patch set adds ACPI support for Xen Dom0 on ARM64. The relevant Xen >> ACPI on ARM64 design document could be found from [1]. >> >> This patch set adds a new FDT node "uefi" under

Re: [Xen-devel] [PATCH v10 06/17] Xen: ARM: Add support for mapping platform device mmio

2016-04-06 Thread Shannon Zhao
On 2016/4/6 20:16, Julien Grall wrote: >> +gpfns[j] = XEN_PFN_DOWN(r->start) + j; >> +idxs[j] = XEN_PFN_DOWN(r->start) + j; >> +} >> + >> +xatp.domid = DOMID_SELF; >> +xatp.size = nr; >> +xatp.space = XENMAPSPACE_dev_mmio; >> + >> +s

Re: [Xen-devel] Bug in x86 instruction emulator?

2016-04-06 Thread wogiz
On 2016-04-06 10:55, Andrew Cooper wrote: On 06/04/16 00:57, Mihai Donțu wrote: On Wed, 06 Apr 2016 01:38:32 +0200 wo...@openmailbox.org wrote: I'm running Xen 4.6.1 with Alpine Linux 3.3.3 in dom0. In a HVM domU with vga="qxl", Xorg will segfault instantly if tried started. Multiple Linux di

Re: [Xen-devel] [PATCH v5 23/28] xsplice: Stacking build-id dependency checking.

2016-04-06 Thread Jan Beulich
>>> Konrad Rzeszutek Wilk 04/06/16 10:05 PM >>> >> > --- a/xen/include/xen/version.h >> > +++ b/xen/include/xen/version.h >> > @@ -17,4 +17,7 @@ const char *xen_deny(void); >> > #include >> > int xen_build_id(const void **p, unsigned int *len); >> > >> > +#include >> > +int xen_build_id_chec

Re: [Xen-devel] [PATCH v5 17/28] xsplice: Add support for exception tables.

2016-04-06 Thread Jan Beulich
>>> Konrad Rzeszutek Wilk 04/06/16 4:42 PM >>> >On Fri, Apr 01, 2016 at 10:06:54AM -0600, Jan Beulich wrote: >> >>> On 24.03.16 at 21:00, wrote: >> > --- a/xen/common/xsplice.c >> > +++ b/xen/common/xsplice.c >> > @@ -573,6 +573,25 @@ static int prepare_payload(struct payload *payload, >> >

Re: [Xen-devel] [PATCH v5 15/28] xsplice: Add .xsplice.hooks functions and test-case

2016-04-06 Thread Jan Beulich
>>> Martin Pohlack 04/06/16 8:42 AM >>> >On 06.04.2016 04:42, Konrad Rzeszutek Wilk wrote: >> The normal use-case is to modify structures values where we have to >> be delicate about it and can't just replace the value. As in we >> may have to recompute the value. > >Agree on the default use (e.g.

Re: [Xen-devel] [PATCH v5 15/28] xsplice: Add .xsplice.hooks functions and test-case

2016-04-06 Thread Jan Beulich
>>> Konrad Rzeszutek Wilk 04/06/16 4:44 AM >>> >On Fri, Apr 01, 2016 at 09:50:31AM -0600, Jan Beulich wrote: >> >>> On 24.03.16 at 21:00, wrote: >> > From: Ross Lagerwall >> > >> > Add hook functions which run during patch apply and patch revert. >> > Hook functions are used by xsplice payloads

Re: [Xen-devel] [PATCH v5 14/28] x86, xsplice: Print payload's symbol name and payload name in backtraces

2016-04-06 Thread Jan Beulich
>>> Konrad Rzeszutek Wilk 04/06/16 4:39 AM >>> >On Fri, Apr 01, 2016 at 09:23:15AM -0600, Jan Beulich wrote: >> >>> On 24.03.16 at 21:00, wrote: >> > @@ -331,16 +332,17 @@ static char *pointer(char *str, char *end, const >> > char **fmt_ptr, >> > { >> > unsigned long sym_size, sym_

Re: [Xen-devel] [PATCH v5 12/28] x86/xen_hello_world.xsplice: Test payload for patching 'xen_extra_version'.

2016-04-06 Thread Jan Beulich
>>> Konrad Rzeszutek Wilk 04/06/16 4:05 AM >>> >On Fri, Apr 01, 2016 at 07:33:54AM -0600, Jan Beulich wrote: >> >>> On 24.03.16 at 21:00, wrote: >> > --- a/xen/arch/x86/Makefile >> > +++ b/xen/arch/x86/Makefile >> > @@ -75,7 +75,12 @@ efi-y := $(shell if [ ! -r >> > $(BASEDIR)/include/xen/compil

Re: [Xen-devel] [PATCH v4 26/26] tools/libxc: Calculate xstate cpuid leaf from guest information

2016-04-06 Thread Jan Beulich
>>> Andrew Cooper 04/07/16 2:40 AM >>> >On 07/04/2016 01:16, Jan Beulich wrote: > Andrew Cooper 04/05/16 7:49 PM >>> >>> There is no possible way of avoiding having a whitelist somewhere, which >>> limits what Xen will tolerate supporting for the guest. >> Right, but preferably in exactly one

Re: [Xen-devel] [PATCH v5 10/28] xsplice: Implement payload loading

2016-04-06 Thread Jan Beulich
Konrad Rzeszutek Wilk 04/05/16 7:49 PM >>> >On Tue, Apr 05, 2016 at 12:45:44PM -0400, Konrad Rzeszutek Wilk wrote: >> > > +void *vm_alloc(unsigned int nr, unsigned int align) >> > > +{ >> > > +return vm_alloc_type(nr, align, VMAP_VIRT); >> > > +} >> > >> > Inline/macro wrapper? > >I woul

Re: [Xen-devel] [PATCH v5 10/28] xsplice: Implement payload loading

2016-04-06 Thread Jan Beulich
>>> Konrad Rzeszutek Wilk 04/05/16 6:46 PM >>> >> > +if ( mfn_array ) >> > +*mfn_array = mfn; >> > +else >> > +xfree(mfn); >> >> What's this? I certainly assumed this wouldn't be needed anymore >> now. > >I still need the MFNs so I can change the page table attributes once

Re: [Xen-devel] [PATCH v4 26/26] tools/libxc: Calculate xstate cpuid leaf from guest information

2016-04-06 Thread Andrew Cooper
On 07/04/2016 01:16, Jan Beulich wrote: Andrew Cooper 04/05/16 7:49 PM >>> >> On 31/03/16 08:48, Jan Beulich wrote: >> On 23.03.16 at 17:36, wrote: switch ( input[1] ) { -case 0: +case 0: /* EAX: low 32bits of xfeature_enabled_mask */

Re: [Xen-devel] [PATCH v5 09/28] xsplice: Add helper elf routines

2016-04-06 Thread Jan Beulich
>>> Konrad Rzeszutek Wilk 04/06/16 3:40 AM >>> >> > +struct xsplice_elf_sym { >> > +Elf_Sym *sym; >> >> const? > >.. this is much harder. I end up computing the values for >these symbols and have to write to this this structure a couple of times >(at worst). So I've intentionally added quest

Re: [Xen-devel] [PATCH V7 3/3] x86/xsaves: ebx may return wrong value using CPUID eax=0xdh, ecx =1

2016-04-06 Thread Jan Beulich
>>> Shuai Ruan 04/06/16 8:59 AM >>> >Another question is whether we should add this in pv_cpuid() or not. >(which we have discussed in the previous thread). > >Refer to SDM Volume 1 >"13.2 ENUMERATION OF CPU SUPPORT FOR XSAVE INSTRUCTIONS AND XSAVE- >SUPPORTED FEATURES" >— CPUID function 0DH, sub

[Xen-devel] [xen-unstable-smoke test] 89250: tolerable FAIL - PUSHED

2016-04-06 Thread osstest service owner
flight 89250 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/89250/ Failures :-/ but no regressions. Regressions which are regarded as allowable (not blocking): build-amd64-libvirt 5 libvirt-buildfail like 88802 Tests which did not suc

Re: [Xen-devel] [PATCH v4 26/26] tools/libxc: Calculate xstate cpuid leaf from guest information

2016-04-06 Thread Jan Beulich
>>> Andrew Cooper 04/05/16 7:49 PM >>> >On 31/03/16 08:48, Jan Beulich wrote: > On 23.03.16 at 17:36, wrote: >>> switch ( input[1] ) >>> { >>> -case 0: >>> +case 0: >>> /* EAX: low 32bits of xfeature_enabled_mask */ >>> -regs[0] = info->xfeature_mask & 0xFF

[Xen-devel] [PATCH v4 06/14] x86/init: use a platform legacy quirk for ebda

2016-04-06 Thread Luis R. Rodriguez
This replaces the paravirt_enabled() check with a proper x86 legacy platform quirk. Signed-off-by: Luis R. Rodriguez --- arch/x86/include/asm/x86_init.h | 3 +++ arch/x86/kernel/head.c| 2 +- arch/x86/kernel/platform-quirks.c | 4 3 files changed, 8 insertions(+), 1 deletion(-

[Xen-devel] [PATCH v4 11/14] pnpbios: replace paravirt_enabled() check with legacy device check

2016-04-06 Thread Luis R. Rodriguez
Since we are removing paravirt_enabled() replace it with a logical equivalent. Even though PNPBIOS is x86 specific we add an arch-specific type call, which can be implemented by any architecture to show how other legacy attribute devices can later be also checked for with other ACPI legacy attribut

[Xen-devel] [PATCH v4 00/14] x86: remove paravirt_enabled

2016-04-06 Thread Luis R. Rodriguez
Now that Andy's ASM paravirt_enabled() use is merged all we need is to address the rest of the C code uses. This completes that work by providing proper semantics for platform legacy settings and quirks as suggested by Ingo, this in turn can also be extended later for benefit of further processing

[Xen-devel] [PATCH v4 02/14] x86/xen: use X86_SUBARCH_XEN for PV guest boots

2016-04-06 Thread Luis R. Rodriguez
The use of subarch should have no current effect on Xen PV guests, as such this should have no current functional effects. Signed-off-by: Luis R. Rodriguez --- arch/x86/xen/enlighten.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 9

[Xen-devel] [PATCH v4 14/14] x86/paravirt: remove paravirt_enabled()

2016-04-06 Thread Luis R. Rodriguez
That that paravirt_enabled() is replaced with proper x86 semantics we can remove it. Signed-off-by: Luis R. Rodriguez --- arch/x86/include/asm/paravirt.h | 5 - arch/x86/include/asm/paravirt_types.h | 1 - arch/x86/include/asm/processor.h | 1 - arch/x86/kernel/kvm.c

[Xen-devel] [PATCH v4 01/14] x86/boot: enumerate documentation for the x86 hardware_subarch

2016-04-06 Thread Luis R. Rodriguez
Although hardware_subarch has been in place since the x86 boot protocol 2.07 it hasn't been used much. Enumerate current possible values to avoid misuses and help with semantics later at boot time should this be used further. These enums should only ever be used by architecture x86 code, and all t

[Xen-devel] [PATCH v4 12/14] x86, ACPI: parse ACPI_FADT_LEGACY_DEVICES

2016-04-06 Thread Luis R. Rodriguez
ACPI 5.2.9.3 IA-PC Boot Architecture flag ACPI_FADT_LEGACY_DEVICES can be used to determine if a system has legacy devices LPC or ISA devices. The x86 platform already has a struct which lists known associated legacy devices, we start off careful only by disabling root devices we should not regress

[Xen-devel] [PATCH v4 10/14] x86/cpu/intel: remove not needed paravirt_enabled() for f00f work around

2016-04-06 Thread Luis R. Rodriguez
The X86_BUG_F00F work around is responsible for fixing up the error generated on attempted F00F exploitation from an OOPS to a SIGILL. There is no reason why this code should not be allowed to run on PV guest on a F00F-affected CPU -- it would simply never trigger. The pv_enabled() check was there

[Xen-devel] [PATCH v4 04/14] x86/rtc: replace paravirt rtc check with platform legacy quirk

2016-04-06 Thread Luis R. Rodriguez
We have 4 types of x86 platforms that disable RTC: * Intel MID * Lguest - uses paravirt * Xen dom-U - uses paravirt * x86 on legacy systems annotated with an ACPI legacy flag We can consolidate all of these into a platform specific legacy quirk set early in boot through i386_start_kernel(

[Xen-devel] [PATCH v4 03/14] tools/lguest: make lguest launcher use X86_SUBARCH_LGUEST explicitly

2016-04-06 Thread Luis R. Rodriguez
Be explicit and make use of X86_SUBARCH_LGUEST directly. Signed-off-by: Luis R. Rodriguez --- tools/lguest/lguest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c index 80159e6811c2..ff0aa580c6e1 100644 --- a/tools/lguest/lgu

[Xen-devel] [PATCH v4 13/14] x86/init: rename ebda code file

2016-04-06 Thread Luis R. Rodriguez
This makes it clearer what this is. Signed-off-by: Luis R. Rodriguez --- arch/x86/Makefile | 2 +- arch/x86/kernel/Makefile | 2 +- arch/x86/kernel/{head.c => ebda.c} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename arch/x86/kernel/{head.c => ebda.c} (100%

[Xen-devel] [PATCH v4 05/14] x86, ACPI: move ACPI_FADT_NO_CMOS_RTC check to ACPI boot code

2016-04-06 Thread Luis R. Rodriguez
This moves the ACPI specific check into the ACPI boot code, it also takes advantage of the x86_platform.legacy.rtc which is checked for already on the RTC initialization code. This lets us remove the nasty #ifdefery and consolidate the checks to use only one toggle to disable the RTC init code. Th

[Xen-devel] [PATCH v4 08/14] apm32: remove paravirt_enabled() use

2016-04-06 Thread Luis R. Rodriguez
There is already a check for apm_info.bios == 0, the apm_info.bios is set from the boot_params.apm_bios_info. Both Xen and lguest, which are also the only ones that set paravirt_enabled to true, never set the apm_bios.info. The Xen folks are sure force disable to 0 is not needed, we recently force

[Xen-devel] [PATCH v4 07/14] tools/lguest: force disable tboot and apm

2016-04-06 Thread Luis R. Rodriguez
The paravirt_enabled() check is going away, the area tossed to the kernel on lguest is not zerored out, so ensure lguest force disables tboot and apm just in case the kernel file being read might have this set for whatever reason. Signed-off-by: Luis R. Rodriguez --- tools/lguest/lguest.c | 6 ++

[Xen-devel] [PATCH v4 09/14] x86/tboot: remove paravirt_enabled()

2016-04-06 Thread Luis R. Rodriguez
There is already a check for boot_params.tboot_addr prior to paravirt_enabled(). Both Xen and lguest, which are also the only ones that set paravirt_enabled to true, never set the boot_params.tboot_addr. The Xen folks are sure a force disable to 0 is not needed, we recently forced disabled this on

Re: [Xen-devel] [PATCH] xen: Add comment for missing FROZEN notifier transitions

2016-04-06 Thread Stefano Stabellini
On Wed, 6 Apr 2016, David Vrabel wrote: > On 04/04/16 13:32, Anna-Maria Gleixner wrote: > > Xen guests do not offline/online CPUs during suspend/resume and > > therefore FROZEN notifier transitions are not required. Add this > > explanation as a comment in the code to get not confused why > > CPU_T

Re: [Xen-devel] [PATCH] xen: Add comment for missing FROZEN notifier transitions

2016-04-06 Thread Stefano Stabellini
On Tue, 5 Apr 2016, Juergen Gross wrote: > On 04/04/16 18:48, Boris Ostrovsky wrote: > > On 04/04/2016 12:30 PM, David Vrabel wrote: > >> On 04/04/16 17:21, Julien Grall wrote: > >>> (CC Stefano new e-mail address) > >>> > >>> Hello Anna-Maria, > >>> > >>> On 04/04/2016 13:32, Anna-Maria Gleixner w

Re: [Xen-devel] Regarding Outreachy project on Improving CR Dashboard

2016-04-06 Thread Jesus M. Gonzalez-Barahona
On Wed, 2016-04-06 at 17:30 +0530, Priya wrote: > Hello, > > Thanks for your suggestions. > I have made the appropriate changes as you had mentioned. > It took a little time to change from python3 to python3.4 as perceval > supports python3.4. I have updated the changes in my github. You can > see

Re: [Xen-devel] [PATCH v1] libxc: fix uninitialized variable when changing rtds scheduling parameters

2016-04-06 Thread Dario Faggioli
On Wed, 2016-04-06 at 21:35 +0100, Andrew Cooper wrote: > On 06/04/16 21:30, Chong Li wrote: > > > > Commit 046c2b503a89d21b41e4d555a9f75d02af00dbc6 introduces a build > > failure: in some cases (e.g., num_vcpus <=0), > > xc_sched_rtds_vcpu_get/set returns an uninitialized variable. > > > > Fix i

Re: [Xen-devel] [PATCH] libxl: libxl_domain_create_restore has an extra argument

2016-04-06 Thread Doug Goldstein
On 4/5/16 9:20 AM, Wei Liu wrote: > In the latest libxenlight code, libxl_domain_create_restore accepts a > new argument. Update libvirt's libxl driver for that. Use the macro > provided by libxenlight to detect which version should be used. > > The new parameter (send_back_fd) is set to -1 becaus

Re: [Xen-devel] [PATCH v1] libxc: fix uninitialized variable when changing rtds scheduling parameters

2016-04-06 Thread Andrew Cooper
On 06/04/16 21:30, Chong Li wrote: > Commit 046c2b503a89d21b41e4d555a9f75d02af00dbc6 introduces a build > failure: in some cases (e.g., num_vcpus <=0), > xc_sched_rtds_vcpu_get/set returns an uninitialized variable. > > Fix it. > > Signed-off-by: Chong Li > > --- > CC: > CC: > CC: > CC: > CC:

[Xen-devel] [PATCH v1] libxc: fix uninitialized variable when changing rtds scheduling parameters

2016-04-06 Thread Chong Li
Commit 046c2b503a89d21b41e4d555a9f75d02af00dbc6 introduces a build failure: in some cases (e.g., num_vcpus <=0), xc_sched_rtds_vcpu_get/set returns an uninitialized variable. Fix it. Signed-off-by: Chong Li --- CC: CC: CC: CC: CC: CC: CC: --- tools/libxc/xc_rt.c | 4 ++-- 1 file changed

Re: [Xen-devel] [PATCH v5 23/28] xsplice: Stacking build-id dependency checking.

2016-04-06 Thread Konrad Rzeszutek Wilk
> > --- a/xen/include/xen/version.h > > +++ b/xen/include/xen/version.h > > @@ -17,4 +17,7 @@ const char *xen_deny(void); > > #include > > int xen_build_id(const void **p, unsigned int *len); > > > > +#include > > +int xen_build_id_check(const Elf_Note *n, const void **p, unsigned int > > *l

Re: [Xen-devel] [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS

2016-04-06 Thread Dario Faggioli
On Wed, 2016-04-06 at 20:49 +0100, Wei Liu wrote: > On Wed, Apr 06, 2016 at 02:41:31PM -0500, Chong Li wrote: > > On Wed, Apr 6, 2016 at 2:30 PM, Wei Liu > > wrote: > > > On Wed, Apr 06, 2016 at 02:20:55PM -0500, Chong Li wrote: > > > Not sure what kind of sanity check you were thinking about. But

Re: [Xen-devel] [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS

2016-04-06 Thread Wei Liu
On Wed, Apr 06, 2016 at 02:41:31PM -0500, Chong Li wrote: > On Wed, Apr 6, 2016 at 2:30 PM, Wei Liu wrote: > > On Wed, Apr 06, 2016 at 02:20:55PM -0500, Chong Li wrote: > >> On Wed, Apr 6, 2016 at 1:54 PM, Andrew Cooper > >> wrote: > >> > On 06/04/16 17:41, Chong Li wrote: > >> >> On Wed, Apr 6,

Re: [Xen-devel] [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS

2016-04-06 Thread Chong Li
On Wed, Apr 6, 2016 at 2:30 PM, Wei Liu wrote: > On Wed, Apr 06, 2016 at 02:20:55PM -0500, Chong Li wrote: >> On Wed, Apr 6, 2016 at 1:54 PM, Andrew Cooper >> wrote: >> > On 06/04/16 17:41, Chong Li wrote: >> >> On Wed, Apr 6, 2016 at 11:36 AM, Dario Faggioli >> >> wrote: >> >>> On Wed, 2016-04

[Xen-devel] [PATCH v2] flask: change default state to enforcing

2016-04-06 Thread Daniel De Graaf
The previous default of "permissive" is meant for developing or debugging a disaggregated system. However, this default makes it too easy to accidentally boot a machine in this state, which does not place any restrictions on guests. This is not suitable for normal systems because any guest can pe

Re: [Xen-devel] [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS

2016-04-06 Thread Wei Liu
On Wed, Apr 06, 2016 at 02:20:55PM -0500, Chong Li wrote: > On Wed, Apr 6, 2016 at 1:54 PM, Andrew Cooper > wrote: > > On 06/04/16 17:41, Chong Li wrote: > >> On Wed, Apr 6, 2016 at 11:36 AM, Dario Faggioli > >> wrote: > >>> On Wed, 2016-04-06 at 16:38 +0100, Ian Jackson wrote: > Ian Jackso

Re: [Xen-devel] [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS

2016-04-06 Thread Andrew Cooper
On 06/04/16 20:20, Chong Li wrote: > On Wed, Apr 6, 2016 at 1:54 PM, Andrew Cooper > wrote: >> On 06/04/16 17:41, Chong Li wrote: >>> On Wed, Apr 6, 2016 at 11:36 AM, Dario Faggioli >>> wrote: On Wed, 2016-04-06 at 16:38 +0100, Ian Jackson wrote: > Ian Jackson writes ("Re: [PATCH v9 for

Re: [Xen-devel] [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS

2016-04-06 Thread Chong Li
On Wed, Apr 6, 2016 at 1:54 PM, Andrew Cooper wrote: > On 06/04/16 17:41, Chong Li wrote: >> On Wed, Apr 6, 2016 at 11:36 AM, Dario Faggioli >> wrote: >>> On Wed, 2016-04-06 at 16:38 +0100, Ian Jackson wrote: Ian Jackson writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU par

Re: [Xen-devel] [PATCH v3] arm: Fix asynchronous aborts (SError exceptions) due to bogus PTEs

2016-04-06 Thread Shanker Donthineni
Hi Julien/Stefano, Any other comments to be addressed? Please propose an alternative solution to fix the problem if this patch changes are not appropriate. On 03/28/2016 11:46 PM, Shanker Donthineni wrote: > From: Vikram Sethi > > ARMv8 architecture allows performing prefetch data/instructions >

Re: [Xen-devel] [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS

2016-04-06 Thread Andrew Cooper
On 06/04/16 17:41, Chong Li wrote: > On Wed, Apr 6, 2016 at 11:36 AM, Dario Faggioli > wrote: >> On Wed, 2016-04-06 at 16:38 +0100, Ian Jackson wrote: >>> Ian Jackson writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable >>> per-VCPU parameter for RTDS"): Dario points out on irc that perhaps

Re: [Xen-devel] [PATCH v3] arm: Fix asynchronous aborts (SError exceptions) due to bogus PTEs

2016-04-06 Thread Shanker Donthineni
Hi Stefano/Julien, Any other comments to be addressed? Please propose an alternative solution to fix the problem if this patch changes are not appropriate. On 03/28/2016 11:46 PM, Shanker Donthineni wrote: > From: Vikram Sethi > > ARMv8 architecture allows performing prefetch data/instructions >

Re: [Xen-devel] [PATCH v5 3/6] smp: add function to execute a function synchronously on a cpu

2016-04-06 Thread Peter Zijlstra
On Wed, Apr 06, 2016 at 04:17:43PM +0200, Juergen Gross wrote: > On some hardware models (e.g. Dell Studio 1555 laptop) some hardware > related functions (e.g. SMIs) are to be executed on physical cpu 0 > only. Instead of open coding such a functionality multiple times in > the kernel add a service

[Xen-devel] [PATCH v2 03/11] xen: sched: move pCPU initialization in an helper

2016-04-06 Thread Dario Faggioli
That will turn out useful in following patches, where such code will need to be called more than just once. Create an helper now, and move the code there, to avoid mixing code motion and functional changes later. In Credit2, some style cleanup is also done. No functional change intended. Signed-

[Xen-devel] [PATCH v2 02/11] xen: sched: implement .init_pdata in Credit, Credit2 and RTDS

2016-04-06 Thread Dario Faggioli
In fact, if a scheduler needs per-pCPU information, that needs to be initialized appropriately. So, we take the code that is performing initializations from (right now) .alloc_pdata, and use it for .init_pdata, leaving only actualy allocations in the former, if any (which is the case in RTDS and Cr

[Xen-devel] [PATCH v2 11/11] xen: sched: implement vcpu hard affinity in Credit2

2016-04-06 Thread Dario Faggioli
From: Justin Weaver as it was still missing. Note that this patch "only" implements hard affinity, i.e., the possibility of specifying on what pCPUs a certain vCPU can run. Soft affinity (which express a preference for vCPUs to run on certain pCPUs) is still not supported by Credit2, even after

[Xen-devel] [PATCH v2 10/11] xen: sched: privde some scratch space for not putting cpumasks on stack

2016-04-06 Thread Dario Faggioli
directly, from schedule.c, for any scheduler that needs it to use it. In fact, Credit1 and RTDS needs this already. Credit2 is also going to need it, for supporting hard affinity (which is, typically, what requires a lot of cpumask manipulations, inside various functions). Therefore, let's define

[Xen-devel] [PATCH v2 06/11] xen: sched: on Credit2, don't reprogram the timer if idle

2016-04-06 Thread Dario Faggioli
as other schedulers are doing already: if the idle vcpu is picked and scheduled, there is no need to reprogram the scheduler timer to fire and invoke csched2_schedule() again in future. Tickling or external events will serve as pokes, when necessary, but until we can, we should just stay idle. Si

[Xen-devel] [PATCH v2 07/11] xen: sched: fix per-socket runqueue creation in credit2

2016-04-06 Thread Dario Faggioli
The credit2 scheduler tries to setup runqueues in such a way that there is one of them per each socket. However, that does not work. The issue is described in bug #36 "credit2 only uses one runqueue instead of one runq per socket" (http://bugs.xenproject.org/xen/bug/36), and a solution has been att

[Xen-devel] [PATCH v2 08/11] xen: sched: allow for choosing credit2 runqueues configuration at boot

2016-04-06 Thread Dario Faggioli
In fact, credit2 uses CPU topology to decide how to arrange its internal runqueues. Before this change, only 'one runqueue per socket' was allowed. However, experiments have shown that, for instance, having one runqueue per physical core improves performance, especially in case hyperthreading is av

[Xen-devel] [PATCH v2 09/11] xen: sched: per-core runqueues as default in credit2

2016-04-06 Thread Dario Faggioli
Experiments have shown that arranging the scheduing runqueues on a per-core basis yields better results, in most cases. Such evaluation has been done, for the first time, by Uma Sharma, during her participation to OPW. Some of the results she got are summarized here: http://lists.xen.org/archive

  1   2   3   >