Re: [Xen-devel] [PATCH v9 3/3] VT-d: Fix vt-d Device-TLB flush timeout issue

2016-04-10 Thread Xu, Quan
On April 05, 2016 5:48pm, Jan Beulich wrote: > >>> On 01.04.16 at 16:47, wrote: > > +static void dev_invalidate_iotlb_timeout(struct iommu *iommu, u16 did, > > + u16 seg, u8 bus, u8 devfn) > { > > +struct domain *d = NULL; > > +struct pci_dev *pdev;

[Xen-devel] R: Xen crash in cpupool_assign_cpu_locked spinlock

2016-04-10 Thread Dario Faggioli
Thanks for reporting, and thanks Andrew for Cc-ing me. I saw what the issue is already, I'll patch it first thing Monday morning. I did some last minute refactoring during which I wrongly replaced one pcpu_schedule_lock_irq(), with just pcpu_schedule_lock(), and did the last round of testing wi

Re: [Xen-devel] [RFC PATCH v6 00/28] libxl: Deprivilege qemu

2016-04-10 Thread Stefano Stabellini
I take that this series is going to miss 4.7 at this stage, right? On Tue, 22 Dec 2015, Ian Jackson wrote: > This is a new version of Stefano Stabellini's series > [PATCH v5 0/6] libxl: xs_restrict QEMU > > I took Stefano's code as a spec for how to interact with qemu, and > have reworked the w

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

2016-04-10 Thread Konrad Rzeszutek Wilk
On Sat, Apr 09, 2016 at 10:36:02PM -0400, Konrad Rzeszutek Wilk wrote: > On Thu, Apr 07, 2016 at 09:43:38AM -0600, Jan Beulich wrote: > > >>> On 07.04.16 at 05:09, wrote: > > >> > +uint8_t *old_ptr; > > >> > + > > >> > +BUILD_BUG_ON(PATCH_INSN_SIZE > sizeof(func->undo)); > > >> > +BUIL

Re: [Xen-devel] [PATCH 28/28] libxl: xsrestrict QEMU

2016-04-10 Thread Stefano Stabellini
On Tue, 22 Dec 2015, Ian Jackson wrote: > If QEMU supports xsrestrict, pass xsrestrict=on to it (by default). > > XXX We need to do this only if xenstored supports it, and AFAICT there > is not a particularly easy way to test this. Should we open a new > test xenstore connection to query this inf

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

2016-04-10 Thread Stefano Stabellini
On Thu, 7 Apr 2016, Juergen Gross wrote: > 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-

Re: [Xen-devel] pv-grub guest booting fail with recent qemu-xen

2016-04-10 Thread Samuel Thibault
Hello, > > > > +if (prod - out_cons >= XENFB_OUT_RING_LEN) { > > > > +return; > > > > +} This test seems overzealous to me: AIUI, the producer can produce XENFB_OUT_RING_LEN events, and thus prod - out_cons is exactly XENFB_OUT_RING_LEN, i.e. there is no room left at all. The fro

Re: [Xen-devel] [for-4.7 2/5] xen/arm: acpi: The boot CPU does not always match the first entry in the MADT

2016-04-10 Thread Stefano Stabellini
On Thu, 7 Apr 2016, Julien Grall wrote: > Since the ACPI 6.0 errata document [1], the first entry in the MADT > does not have to correspond to the boot CPU. > > Introduce a new variable to know if a MADT entry matching the boot CPU > is found. Furthermore, it's not necessary to check if the MPIDR

Re: [Xen-devel] [for-4.7 3/5] xen/arm: acpi: Fix SMP support when booting with ACPI

2016-04-10 Thread Stefano Stabellini
On Thu, 7 Apr 2016, Julien Grall wrote: > The variable enabled_cpus is used to know the number of CPU enabled in > the MADT. > > Currently this variable is used to check the validity of the boot CPU. > It will be considered invalid when "enabled_cpus > 1". > > However, this condition also means t

Re: [Xen-devel] [for-4.7 4/5] xen/arm: acpi: Remove uncessary check in acpi_map_gic_cpu_interface

2016-04-10 Thread Stefano Stabellini
On Thu, 7 Apr 2016, Julien Grall wrote: > This part of the code will never be executed when the entry > corresponds to the boot CPU. > > Also print an error message rather when arch_cpu_init has failed. > > Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini > xen/arch/arm/acpi/boot

Re: [Xen-devel] [for-4.7 5/5] xen/arm: acpi: Print more error messages in acpi_map_gic_cpu_interface

2016-04-10 Thread Stefano Stabellini
On Thu, 7 Apr 2016, Julien Grall wrote: > It's helpful to spot any error without having to modify the hypervisor > code. > > Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini > xen/arch/arm/acpi/boot.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/xen/arch/arm/ac

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

2016-04-10 Thread Stefano Stabellini
On Sun, 10 Apr 2016, Konrad Rzeszutek Wilk wrote: > On Sat, Apr 09, 2016 at 10:36:02PM -0400, Konrad Rzeszutek Wilk wrote: > > On Thu, Apr 07, 2016 at 09:43:38AM -0600, Jan Beulich wrote: > > > >>> On 07.04.16 at 05:09, wrote: > > > >> > +uint8_t *old_ptr; > > > >> > + > > > >> > +BUILD_BU

[Xen-devel] [PATCH v7 06/24] arm/x86/vmap: Add vmalloc_xen, vfree_xen and vm_init_type

2016-04-10 Thread Konrad Rzeszutek Wilk
For those users who want to use the virtual addresses that are in the hypervisor's virtual address space - these threej 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

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

2016-04-10 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 v7 14/24] xsplice: Add support for bug frames.

2016-04-10 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 Reviewed-by: A

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

2016-04-10 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 v7 13/24] x86, xsplice: Print payload's symbol name and payload name in backtraces

2016-04-10 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 v7 24/24] MAINTAINERS/xsplice: Add myself and Ross as the maintainers.

2016-04-10 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 Reviewed-by: Andrew Cooper --- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan v5: Sort them F: fields (Jan) v7: Added Andrew's Reviewed-by --- --- MAINTAINE

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

2016-04-10 Thread Konrad Rzeszutek Wilk
Hey! Changelog: v6: http://lists.xen.org/archives/html/xen-devel/2016-04/msg00871.html - Acted on all comments from Andrew, Julien, and Jan. - Got help from Andrew on one of them over the weekend. - Finally got my EFI box working (tests passed). v5: http://lists.xen.org/archives/html/xen-devel/

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

2016-04-10 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 v7 11/24] x86/xen_hello_world.xsplice: Test payload for patching 'xen_extra_version'.

2016-04-10 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 v7 01/24] xsplice: Design document

2016-04-10 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 v7 18/24] HYPERCALL_version_op: Add VERSION_build_id to retrieve build-id.

2016-04-10 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 v7 07/24] x86/mm: Introduce modify_xen_mappings()

2016-04-10 Thread Konrad Rzeszutek Wilk
From: Andrew Cooper To simply change the permissions on existing Xen mappings. The existing destroy_xen_mappings() is altered to support a change the PTE permissions. A new destroy_xen_mappings() is introduced, as the special case of not passing _PAGE_PRESENT to modify_xen_mappings(). As clean

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

2016-04-10 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 v7 09/24] xsplice: Implement payload loading

2016-04-10 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 v7 17/24] build_id: Provide ld-embedded build-ids

2016-04-10 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. The man-page for ld --build-id says it is: "Request the creation of a ".note.gnu.build-id" ELF note section or a ".build-id" COFF section. The contents of the note are unique bits i

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

2016-04-10 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 v7 20/24] xsplice: Print build_id in keyhandler and on bootup.

2016-04-10 Thread Konrad Rzeszutek Wilk
As it should be an useful debug mechanism. Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Jan Beulich Reviewed-by: Andrew Cooper -- 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 s

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

2016-04-10 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 v7 04/24] xen-xsplice: Tool to manipulate xsplice payloads

2016-04-10 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 v7 10/24] xsplice: Implement support for applying/reverting/replacing patches.

2016-04-10 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

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

2016-04-10 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 v7 23/24] xsplice: Prevent duplicate payloads from being loaded.

2016-04-10 Thread Konrad Rzeszutek Wilk
From: Ross Lagerwall Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper --- 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-devel] [PATCH v7 19/24] libxl: info: Display build_id of the hypervisor using XEN_VERSION_build_id

2016-04-10 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 v7 16/24] xsplice: Add support for alternatives

2016-04-10 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 v7 22/24] xsplice/xen_replace_world: Test-case for XSPLICE_ACTION_REPLACE

2016-04-10 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] [xen-unstable-smoke test] 90828: tolerable FAIL - PUSHED

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

[Xen-devel] [PATCH] Fix cpumap setting before passing to XEN

2016-04-10 Thread Zhenzhong Duan
It's tool's duty to pass a correct cpumap to XEN. On a host with less than 64 CPUS, it just shows below error. [root@localhost /]# xm vcpu-pin 3 all all Error: Cannot pin vcpu: 0 to cpu: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29

Re: [Xen-devel] [PATCH 2/2] IOMMU/MMU: Adjust low level functions for VT-d Device-TLB flush error.

2016-04-10 Thread Xu, Quan
On March 29, 2016 3:37pm, Jan Beulich wrote: > >>> On 25.03.16 at 10:27, wrote: > > On March 18, 2016 6:20pm, wrote: > >> >>> On 17.03.16 at 07:54, wrote: > >> > --- a/xen/drivers/passthrough/iommu.c > >> > +++ b/xen/drivers/passthrough/iommu.c > >> > @@ -554,11 +555,24 @@ static void iommu_flu

Re: [Xen-devel] [PATCH 2/2] IOMMU/MMU: Adjust low level functions for VT-d Device-TLB flush error.

2016-04-10 Thread Xu, Quan
On April 11, 2016 11:10am, wrote: > On March 29, 2016 3:37pm, Jan Beulich wrote: > > >>> On 25.03.16 at 10:27, wrote: > > > On March 18, 2016 6:20pm, wrote: > > >> >>> On 17.03.16 at 07:54, wrote: > > >> > --- a/xen/drivers/passthrough/iommu.c > > >> > +++ b/xen/drivers/passthrough/iommu.c > >

[Xen-devel] [libvirt bisection] complete build-amd64-libvirt

2016-04-10 Thread osstest service owner
branch xen-unstable xenbranch xen-unstable job build-amd64-libvirt testid libvirt-build Tree: libvirt git://libvirt.org/libvirt.git Tree: libvirt_gnulib git://git.sv.gnu.org/gnulib.git Tree: qemu git://xenbits.xen.org/qemu-xen-traditional.git Tree: qemuu git://xenbits.xen.org/qemu-xen.git Tree: xe

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

2016-04-10 Thread Rusty Russell
"Luis R. Rodriguez" writes: > 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. Rodr

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

2016-04-10 Thread Juergen Gross
On 10/04/16 22:00, Stefano Stabellini wrote: > On Thu, 7 Apr 2016, Juergen Gross wrote: >> 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, 1

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

2016-04-10 Thread Juergen Gross
On 08/04/16 20:27, Andrew Cooper wrote: > +Xenstore the backend information is presented there. is built >>> That looks to be missing an verb, no it has a verb, something is off with >>> that. >>> >>> XenStore presents the backend information there? >> No, qemu is presenting the information

Re: [Xen-devel] HVMLite / PVHv2 - using x86 EFI boot entry

2016-04-10 Thread Juergen Gross
On 08/04/16 22:40, Luis R. Rodriguez wrote: > On Wed, Apr 06, 2016 at 10:40:08AM +0100, David Vrabel wrote: >> On 06/04/16 03:40, Luis R. Rodriguez wrote: >>> >>> * You don't need full EFI emulation >> >> I think needing any EFI emulation inside Xen (which is where it would >> need to be for do

[Xen-devel] [linux-3.16 test] 90844: regressions - trouble: blocked/broken/fail/pass

2016-04-10 Thread osstest service owner
flight 90844 linux-3.16 real [real] http://logs.test-lab.xenproject.org/osstest/logs/90844/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-libvirt-pair 21 guest-migrate/src_host/dst_host fail REGR. vs. 85048 Tests which are

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

2016-04-10 Thread Juergen Gross
On 09/04/16 01:40, Luis R. Rodriguez wrote: > 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 specif

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

2016-04-10 Thread Juergen Gross
On 09/04/16 01:40, Luis R. Rodriguez wrote: > 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

Re: [Xen-devel] [PATCH v9 2/3] VT-d: wrap a _sync version for all VT-d flush interfaces

2016-04-10 Thread Tian, Kevin
> From: Xu, Quan > Sent: Thursday, April 07, 2016 3:45 PM > > On April 05, 2016 5:35pm, Jan Beulich wrote: > > >>> On 01.04.16 at 16:47, wrote: > > > The dev_invalidate_iotlb() scans ats_devices list to flush ATS > > > devices, and the invalidate_sync() is put after dev_invalidate_iotlb() > > >