[Xen-devel] [PATCH] x86/xen/64: Fix the reported SS and CS in SYSCALL

2017-08-14 Thread Andy Lutomirski
When I cleaned up the Xen SYSCALL entries, I inadvertently changed the reported segment registers. Before my patch, regs->ss was __USER(32)_DS and regs->cs was __USER(32)_CS. After the patch, they are FLAT_USER_CS/DS(32). This had a couple unfortunate effects. It confused the opportunistic

[Xen-devel] [ovmf baseline-only test] 71975: all pass

2017-08-14 Thread Platform Team regression test user
This run is configured for baseline tests only. flight 71975 ovmf real [real] http://osstest.xs.citrite.net/~osstest/testlogs/logs/71975/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 4ad5f597153c7cb20a968236c2c7d6ff01994350 baseline

[Xen-devel] [patch] honour maxmem from config

2017-08-14 Thread James Dingwall
Hi, >From xl.cfg(5): maxmem=MBYTES Specifies the maximum amount of memory a guest can ever see. The value of maxmem= must be equal or greater than memory=. In combination with memory= it will start the guest "pre-ballooned", if the values of memory= and maxmem= differ.

[Xen-devel] [xen-unstable test] 112632: regressions - trouble: blocked/broken/fail/pass

2017-08-14 Thread osstest service owner
flight 112632 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/112632/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf-pvops 4 host-install(4)broken REGR. vs. 112544 build-armhf-pvops

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

2017-08-14 Thread osstest service owner
flight 112636 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/112636/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 4ad5f597153c7cb20a968236c2c7d6ff01994350 baseline version: ovmf

[Xen-devel] [PATCH XTF v3] Functional: Add a UMIP test

2017-08-14 Thread Boqun Feng (Intel)
Add a "umip" test for the User-Model Instruction Prevention. The test simply tries to run sgdt/sidt/sldt/str/smsw in guest user-mode with CR4_UMIP = 1. Signed-off-by: Boqun Feng (Intel) --- v1 --> v2: * add a new write_cr4_safe() * use %pe for exception

Re: [Xen-devel] [PATCH V2 2/3] xen-pt: bind/unbind interrupt remapping format MSI

2017-08-14 Thread Lan Tianyu
Hi Anthony: On 2017年08月12日 02:04, Anthony PERARD wrote: > On Wed, Aug 09, 2017 at 04:51:21PM -0400, Lan Tianyu wrote: >> From: Chao Gao >> >> If a vIOMMU is exposed to guest, guest will configure the msi to remapping >> format. The original code isn't suitable to the new

Re: [Xen-devel] [PATCH for-2.10 1/2] hw/acpi: Call acpi_set_pci_info when no ACPI tables needed

2017-08-14 Thread Michael S. Tsirkin
On Mon, Aug 14, 2017 at 05:45:02PM +0100, Anthony PERARD wrote: > On Mon, Aug 14, 2017 at 06:53:14PM +0300, Michael S. Tsirkin wrote: > > On Mon, Aug 14, 2017 at 03:55:50PM +0100, Anthony PERARD wrote: > > > On Fri, Aug 11, 2017 at 08:18:28PM +0300, Michael S. Tsirkin wrote: > > > > On Fri, Aug

Re: [Xen-devel] [PATCH v3 10/13] xen/pvcalls: implement recvmsg

2017-08-14 Thread Boris Ostrovsky
On 07/31/2017 06:57 PM, Stefano Stabellini wrote: Implement recvmsg by copying data from the "in" ring. If not enough data is available and the recvmsg call is blocking, then wait on the inflight_conn_req waitqueue. Take the active socket in_mutex so that only one function can access the ring

Re: [Xen-devel] [PATCH v3 09/13] xen/pvcalls: implement sendmsg

2017-08-14 Thread Boris Ostrovsky
On 07/31/2017 06:57 PM, Stefano Stabellini wrote: Send data to an active socket by copying data to the "out" ring. Take the active socket out_mutex so that only one function can access the ring at any given time. If not enough room is available on the ring, rather than returning immediately

Re: [Xen-devel] [PATCH v3 08/13] xen/pvcalls: implement accept command

2017-08-14 Thread Boris Ostrovsky
+ +ret = bedata->rsp[req_id].ret; You can just return bedata->rsp[req_id].ret; Or maybe not. The slot may get reused by the time you get to the end. -boris -boris +/* read ret, then set this rsp slot to be reused */ +smp_mb(); +WRITE_ONCE(bedata->rsp[req_id].req_id,

Re: [Xen-devel] [PATCH v3 08/13] xen/pvcalls: implement accept command

2017-08-14 Thread Boris Ostrovsky
On 07/31/2017 06:57 PM, Stefano Stabellini wrote: Introduce a waitqueue to allow only one outstanding accept command at any given time and to implement polling on the passive socket. Introduce a flags field to keep track of in-flight accept and poll commands. Send PVCALLS_ACCEPT to the

[Xen-devel] [linux-next test] 112629: regressions - trouble: blocked/broken/fail/pass

2017-08-14 Thread osstest service owner
flight 112629 linux-next real [real] http://logs.test-lab.xenproject.org/osstest/logs/112629/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-xl-qemuu-debianhvm-amd64 7 xen-boot fail REGR. vs. 112551

Re: [Xen-devel] [stage1-xen PATCH v1] init: Add `glide.lock`

2017-08-14 Thread Stefano Stabellini
Thank you for the patch. Usually the description that you sent in the previous email is written here. I like the build.sh changes and I think introducing init/glide.yaml is a great idea. But I don't think that introducing init/glide.lock is necessary, is it? We could let glide generate it on the

[Xen-devel] [qemu-mainline test] 112631: regressions - trouble: blocked/broken/fail/pass

2017-08-14 Thread osstest service owner
flight 112631 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/112631/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-libvirt-raw 5 host-ping-check-native fail REGR. vs. 112610 Regressions

Re: [Xen-devel] stage1-xen for Fedora

2017-08-14 Thread Stefano Stabellini
Sorry for the late reply, I am usually much faster replying to emails, I have been caught in a personal issue. On Tue, 8 Aug 2017, Rajiv Ranganath wrote: > Hi Stefano, > > On Wed, Aug 2, 2017 at 12:15 AM, Stefano Stabellini > wrote: > > [...] > > > The main thing that

[Xen-devel] [linux-linus test] 112626: regressions - trouble: blocked/broken/fail/pass

2017-08-14 Thread osstest service owner
flight 112626 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/112626/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-examine 7 reboot fail REGR. vs. 110515

Re: [Xen-devel] [PATCH v8 11/13] arm/mem_access: Add long-descriptor based gpt

2017-08-14 Thread Sergej Proskurin
Hi Julien, On 08/14/2017 07:37 PM, Julien Grall wrote: > Hi Sergej, > > On 09/08/17 09:20, Sergej Proskurin wrote: >> +/* >> + * According to to ARM DDI 0487B.a J1-5927, we return an error if >> the found > > Please drop one of the 'to'. The rest looks good to me. > Great, thanks. I

Re: [Xen-devel] [PATCH 3/3] xen: remove not used trace functions

2017-08-14 Thread Steven Rostedt
On Fri, 4 Aug 2017 15:35:06 -0400 Boris Ostrovsky wrote: > On 08/04/2017 07:36 AM, Juergen Gross wrote: > > There are some Xen specific trace functions defined in > > include/trace/events/xen.h. Remove them. > > > > Signed-off-by: Juergen Gross >

Re: [Xen-devel] [PATCH 2/3] xen: remove unused function xen_set_domain_pte()

2017-08-14 Thread Steven Rostedt
On Fri, 4 Aug 2017 15:20:30 -0400 Boris Ostrovsky wrote: > On 08/04/2017 07:36 AM, Juergen Gross wrote: > > The function xen_set_domain_pte() is used nowhere in the kernel. > > Remove it. > > > > Signed-off-by: Juergen Gross > > Reviewed-by: Boris

[Xen-devel] [ovmf baseline-only test] 71974: all pass

2017-08-14 Thread Platform Team regression test user
This run is configured for baseline tests only. flight 71974 ovmf real [real] http://osstest.xs.citrite.net/~osstest/testlogs/logs/71974/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 0024172d909ec73a9ce9ffdfc9fdd4382080e110 baseline

[Xen-devel] [linux-4.9 test] 112627: regressions - trouble: blocked/broken/fail/pass

2017-08-14 Thread osstest service owner
flight 112627 linux-4.9 real [real] http://logs.test-lab.xenproject.org/osstest/logs/112627/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf-xsm 6 xen-buildfail REGR. vs. 112513 Tests which did not

Re: [Xen-devel] [xen-unstable test] 112618: regressions - trouble: blocked/broken/fail/pass

2017-08-14 Thread Julien Grall
Hi, On 14/08/17 00:20, osstest service owner wrote: flight 112618 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/112618/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-armhf-pvops 6

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

2017-08-14 Thread osstest service owner
flight 112628 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/112628/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 0024172d909ec73a9ce9ffdfc9fdd4382080e110 baseline version: ovmf

Re: [Xen-devel] [PATCH v8 11/13] arm/mem_access: Add long-descriptor based gpt

2017-08-14 Thread Julien Grall
Hi Sergej, On 09/08/17 09:20, Sergej Proskurin wrote: +/* + * According to to ARM DDI 0487B.a J1-5927, we return an error if the found Please drop one of the 'to'. The rest looks good to me. + * PTE is invalid or holds a reserved entry (PTE<1:0> == x0)) or if the PTE + *

Re: [Xen-devel] [PATCH v8 09/13] arm/guest_access: Rename vgic_access_guest_memory

2017-08-14 Thread Julien Grall
Hi Sergej, On 09/08/17 09:20, Sergej Proskurin wrote: This commit renames the function vgic_access_guest_memory to access_guest_memory_by_ipa. As the function name suggests, the functions expects an IPA as argument. All invocations of this function have been adapted accordingly. Apart from

Re: [Xen-devel] [PATCH] xen: lift hypercall_cancel_continuation to sched.h

2017-08-14 Thread Julien Grall
Hi Wei, On 14/08/17 16:46, Wei Liu wrote: The function is the same on both x86 and arm. Lift it to sched.h to save a function call, make it take a pointer to vcpu to avoid resolving current every time it gets called. Take the chance to change its callers to only use one current in code.

Re: [Xen-devel] [PATCH v3 3/3] arm: traps: handle SMC32 in check_conditional_instr()

2017-08-14 Thread Julien Grall
Hi Volodymyr, On 14/08/17 18:15, Volodymyr Babchuk wrote: On ARMv8 architecture we need to ensure that conditional check was passed for a trapped SMC instruction that originates from AArch32 state (ARM DDI 0487B.a page D7-2271). Thus, we should not skip it while checking HSR.EC value. For this

Re: [Xen-devel] [PATCH v3 1/3] arm: processor: add new struct hsr_smc32 into hsr union

2017-08-14 Thread Julien Grall
Hi Volodymyr, On 14/08/17 18:15, Volodymyr Babchuk wrote: On ARMv8, one of conditional exceptions (SMC that originates from AArch32 state) has extra field in HSR.ISS encoding: CCKNOWNPASS, bit [19] Indicates whether the instruction might have failed its condition code check. 0 - The

[Xen-devel] [PATCH v3 3/3] arm: traps: handle SMC32 in check_conditional_instr()

2017-08-14 Thread Volodymyr Babchuk
On ARMv8 architecture we need to ensure that conditional check was passed for a trapped SMC instruction that originates from AArch32 state (ARM DDI 0487B.a page D7-2271). Thus, we should not skip it while checking HSR.EC value. For this type of exception special coding of HSR.ISS is used. There

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

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

[Xen-devel] [PATCH v3 1/3] arm: processor: add new struct hsr_smc32 into hsr union

2017-08-14 Thread Volodymyr Babchuk
On ARMv8, one of conditional exceptions (SMC that originates from AArch32 state) has extra field in HSR.ISS encoding: CCKNOWNPASS, bit [19] Indicates whether the instruction might have failed its condition code check. 0 - The instruction was unconditional, or was conditional and passed its

[Xen-devel] [PATCH v3 2/3] arm: traps: handle unknown exceptions in check_conditional_instr()

2017-08-14 Thread Volodymyr Babchuk
According to ARM architecture reference manual (ARM DDI 0487B.a page D7-2259, ARM DDI 0406C.c page B3-1426), exception with unknown reason (HSR.EC == 0) has no valid bits in HSR (apart from HSR.EC), so we can't check if that was caused by conditional instruction. We need to assume that it is

[Xen-devel] [PATCH v3 0/3] arm: allign check_conditional_instr() with ARMv8

2017-08-14 Thread Volodymyr Babchuk
Hello all, This is third version of series. * Dropped patch that renames hsr.iss to hsr.res0 * Updated references to ARMv8 ARM (latest revision is used) * Added better explanation about ARMv7 and ARMv8 compatibility * No code changes. Only comments and commit messages. Volodymyr Babchuk

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-14 Thread Tim Deegan
At 18:21 +0200 on 14 Aug (1502734919), Dario Faggioli wrote: > On Mon, 2017-08-14 at 14:54 +0100, Tim Deegan wrote: > > At 15:24 +0200 on 14 Aug (1502724279), Dario Faggioli wrote: > > > About the former... I'm not sure which check of rcp->cur you're > > > referring to. I think it's the one in

Re: [Xen-devel] [PATCH for-2.10 1/2] hw/acpi: Call acpi_set_pci_info when no ACPI tables needed

2017-08-14 Thread Anthony PERARD
On Mon, Aug 14, 2017 at 06:53:14PM +0300, Michael S. Tsirkin wrote: > On Mon, Aug 14, 2017 at 03:55:50PM +0100, Anthony PERARD wrote: > > On Fri, Aug 11, 2017 at 08:18:28PM +0300, Michael S. Tsirkin wrote: > > > On Fri, Aug 11, 2017 at 04:11:37PM +0100, Anthony PERARD wrote: > > > > To do PCI

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-14 Thread Dario Faggioli
On Mon, 2017-08-14 at 14:54 +0100, Tim Deegan wrote: > At 15:24 +0200 on 14 Aug (1502724279), Dario Faggioli wrote: > > About the former... I'm not sure which check of rcp->cur you're > > referring to. I think it's the one in rcu_check_quiescent_state(), > > but > > then, I'm not sure where to

Re: [Xen-devel] [PATCH v5] x86/hvm: Allow guest_request vm_events coming from userspace

2017-08-14 Thread Tamas K Lengyel
On Tue, Aug 8, 2017 at 2:27 AM, Alexandru Isaila wrote: > > In some introspection usecases, an in-guest agent needs to communicate > with the external introspection agent. An existing mechanism is > HVMOP_guest_request_vm_event, but this is restricted to kernel usecases

Re: [Xen-devel] [PATCH for-2.10 1/2] hw/acpi: Call acpi_set_pci_info when no ACPI tables needed

2017-08-14 Thread Michael S. Tsirkin
On Mon, Aug 14, 2017 at 03:55:50PM +0100, Anthony PERARD wrote: > On Fri, Aug 11, 2017 at 08:18:28PM +0300, Michael S. Tsirkin wrote: > > On Fri, Aug 11, 2017 at 04:11:37PM +0100, Anthony PERARD wrote: > > > To do PCI passthrough with Xen, the property acpi-pcihp-bsel needs to be > > > set, but

[Xen-devel] [PATCH] xen: lift hypercall_cancel_continuation to sched.h

2017-08-14 Thread Wei Liu
The function is the same on both x86 and arm. Lift it to sched.h to save a function call, make it take a pointer to vcpu to avoid resolving current every time it gets called. Take the chance to change its callers to only use one current in code. Signed-off-by: Wei Liu ---

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

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

Re: [Xen-devel] [PATCH v7 6/9] spinlock: Introduce spin_lock_cb()

2017-08-14 Thread Boris Ostrovsky
On 08/14/2017 10:42 AM, Julien Grall wrote: > > > On 14/08/17 15:39, Boris Ostrovsky wrote: >> +#define spin_lock_kick(l) \ +({ \to understand why you need a stronger one here +smp_mb();

Re: [Xen-devel] [PATCH v2 48/52] xen: add hypercall for setting parameters at runtime

2017-08-14 Thread Daniel De Graaf
On 08/14/2017 03:08 AM, Juergen Gross wrote: Add a sysctl hypercall to support setting parameters similar to command line parameters, but at runtime. The parameters to set are specified as a string, just like the boot parameters. Acked-by: Daniel De Graaf

Re: [Xen-devel] [PATCH v2 38/52] xen/xsm/flask/flask_op.c: let custom parameter parsing routines return errno

2017-08-14 Thread Daniel De Graaf
On 08/14/2017 03:08 AM, Juergen Gross wrote: Modify the custom parameter parsing routines in: xen/xsm/flask/flask_op.c to indicate whether the parameter value was parsed successfully. Acked-by: Daniel De Graaf ___ Xen-devel

Re: [Xen-devel] [PATCH for-2.10 1/2] hw/acpi: Call acpi_set_pci_info when no ACPI tables needed

2017-08-14 Thread Anthony PERARD
On Fri, Aug 11, 2017 at 08:18:28PM +0300, Michael S. Tsirkin wrote: > On Fri, Aug 11, 2017 at 04:11:37PM +0100, Anthony PERARD wrote: > > To do PCI passthrough with Xen, the property acpi-pcihp-bsel needs to be > > set, but this was done only when ACPI tables are built which is not > > needed for

Re: [Xen-devel] [PATCH v7 6/9] spinlock: Introduce spin_lock_cb()

2017-08-14 Thread Julien Grall
On 14/08/17 15:39, Boris Ostrovsky wrote: +#define spin_lock_kick(l) \ +({ \to understand why you need a stronger one here +smp_mb(); \ arch_lock_signal() has already a barrier for

Re: [Xen-devel] [PATCH v7 6/9] spinlock: Introduce spin_lock_cb()

2017-08-14 Thread Boris Ostrovsky
>> >> +#define spin_lock_kick(l) \ >> +({ \to understand why >> you need a stronger one here >> +smp_mb(); \ > > arch_lock_signal() has already a barrier for ARM. So we have a double > barrier

Re: [Xen-devel] [PATCH] include/public: add new elf note for support of huge physical addresses

2017-08-14 Thread Jan Beulich
>>> On 14.08.17 at 16:23, wrote: > On 14/08/17 15:18, Jan Beulich wrote: >> IOW the note needs to be present for a restriction to >> be enforced, which in turn means the hypervisor first needs to >> honor the note. > > I don't think so. How would you get the note into already

Re: [Xen-devel] [PATCH v2 22/52] xen/arch/x86/x86_64/mmconfig-shared.c: let custom parameter parsing routines return errno

2017-08-14 Thread Juergen Gross
On 14/08/17 15:40, Jan Beulich wrote: On 14.08.17 at 09:08, wrote: >> @@ -37,13 +37,24 @@ static void __init parse_mmcfg(char *s) >> if ( ss ) >> *ss = '\0'; >> >> -if ( !parse_bool(s) ) >> +switch ( parse_bool(s) ) { >> +case

Re: [Xen-devel] [PATCH v2 20/52] xen/arch/x86/shutdown.c: let custom parameter parsing routines return errno

2017-08-14 Thread Juergen Gross
On 14/08/17 15:39, Jan Beulich wrote: On 14.08.17 at 09:08, wrote: >> --- a/xen/arch/x86/shutdown.c >> +++ b/xen/arch/x86/shutdown.c >> @@ -51,7 +51,7 @@ static int reboot_mode; >> * efiUse the EFI reboot (if running under EFI) >> */ >> static enum reboot_type

[Xen-devel] [PATCH v5 04/11] x86/physdev: enable PHYSDEVOP_pci_mmcfg_reserved for PVH Dom0

2017-08-14 Thread Roger Pau Monne
So that MMCFG regions not present in the MCFG ACPI table can be added at run time by the hardware domain. Signed-off-by: Roger Pau Monné --- Cc: Jan Beulich Cc: Andrew Cooper --- Changes since v4: - Change the hardware_domain

[Xen-devel] [PATCH v5 10/11] vpci: add a priority parameter to the vPCI register initializer

2017-08-14 Thread Roger Pau Monne
This is needed for MSI-X, since MSI-X will need to be initialized before parsing the BARs, so that the header BAR handlers are aware of the MSI-X related holes and make sure they are not mapped in order for the trap handlers to work properly. Signed-off-by: Roger Pau Monné

[Xen-devel] [PATCH v5 02/11] vpci: introduce basic handlers to trap accesses to the PCI config space

2017-08-14 Thread Roger Pau Monne
This functionality is going to reside in vpci.c (and the corresponding vpci.h header), and should be arch-agnostic. The handlers introduced in this patch setup the basic functionality required in order to trap accesses to the PCI config space, and allow decoding the address and finding the

[Xen-devel] [PATCH v5 08/11] vpci/bars: add handlers to map the BARs

2017-08-14 Thread Roger Pau Monne
Introduce a set of handlers that trap accesses to the PCI BARs and the command register, in order to snoop BAR sizing and BAR relocation. The command handler is used to detect changes to bit 2 (response to memory space accesses), and maps/unmaps the BARs of the device into the guest p2m. A

Re: [Xen-devel] [PATCH v7 2/9] mm: Place unscrubbed pages at the end of pagelist

2017-08-14 Thread Boris Ostrovsky
On 08/14/2017 06:37 AM, Jan Beulich wrote: On 08.08.17 at 23:45, wrote: >> .. so that it's easy to find pages that need to be scrubbed (those pages are >> now marked with _PGC_need_scrub bit). >> >> We keep track of the first unscrubbed page in a page buddy using

[Xen-devel] [PATCH v5 06/11] pci: split code to size BARs from pci_add_device

2017-08-14 Thread Roger Pau Monne
So that it can be called from outside in order to get the size of regular PCI BARs. This will be required in order to map the BARs from PCI devices into PVH Dom0 p2m. Signed-off-by: Roger Pau Monné --- Cc: Jan Beulich --- Changes since v4: - Restore

[Xen-devel] [PATCH v5 00/11] vpci: PCI config space emulation

2017-08-14 Thread Roger Pau Monne
Hello, The following series contain an implementation of handlers for the PCI configuration space inside of Xen. This allows Xen to detect accesses to the PCI configuration space and react accordingly. Why is this needed? IMHO, there are two main points of doing all this emulation inside of Xen,

[Xen-devel] [PATCH v5 11/11] vpci/msix: add MSI-X handlers

2017-08-14 Thread Roger Pau Monne
Add handlers for accesses to the MSI-X message control field on the PCI configuration space, and traps for accesses to the memory region that contains the MSI-X table and PBA. This traps detect attempts from the guest to configure MSI-X interrupts and properly sets them up. Note that accesses to

[Xen-devel] [PATCH v5 09/11] vpci/msi: add MSI handlers

2017-08-14 Thread Roger Pau Monne
Add handlers for the MSI control, address, data and mask fields in order to detect accesses to them and setup the interrupts as requested by the guest. Note that the pending register is not trapped, and the guest can freely read/write to it. Signed-off-by: Roger Pau Monné

[Xen-devel] [PATCH v5 07/11] pci: add support to size ROM BARs to pci_size_mem_bar

2017-08-14 Thread Roger Pau Monne
Signed-off-by: Roger Pau Monné --- Cc: Jan Beulich --- Changes since v4: - New in this version. --- xen/drivers/passthrough/pci.c | 24 +--- xen/include/xen/pci.h | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-)

[Xen-devel] [PATCH v5 01/11] x86/pci: introduce hvm_pci_decode_addr

2017-08-14 Thread Roger Pau Monne
And use it in the ioreq code to decode accesses to the PCI IO ports into bus, slot, function and register values. Signed-off-by: Roger Pau Monné --- Cc: Paul Durrant Cc: Jan Beulich Cc: Andrew Cooper

[Xen-devel] [PATCH v5 05/11] mm: move modify_identity_mmio to global file and drop __init

2017-08-14 Thread Roger Pau Monne
And also allow it to do non-identity mappings by adding a new parameter. This function will be needed in order to map the BARs from PCI devices into the Dom0 p2m (and is also used by the x86 Dom0 builder). While there fix the function to use gfn_t and mfn_t instead of unsigned long for memory

[Xen-devel] [PATCH v5 03/11] x86/mmcfg: add handlers for the PVH Dom0 MMCFG areas

2017-08-14 Thread Roger Pau Monne
Introduce a set of handlers for the accesses to the MMCFG areas. Those areas are setup based on the contents of the hardware MMCFG tables, and the list of handled MMCFG areas is stored inside of the hvm_domain struct. The read/writes are forwarded to the generic vpci handlers once the address is

Re: [Xen-devel] [PATCH v2 03/52] xen/arch/arm/traps.c: let custom parameter parsing routines return errno

2017-08-14 Thread Julien Grall
Hi Juergen, On 14/08/17 08:08, Juergen Gross wrote: Modify the custom parameter parsing routines in: xen/arch/arm/traps.c to indicate whether the parameter value was parsed successfully. Cc: Stefano Stabellini Cc: Julien Grall Signed-off-by:

Re: [Xen-devel] [PATCH v2 02/52] xen/arch/arm/domain_build.c: let custom parameter parsing routines return errno

2017-08-14 Thread Julien Grall
Hi Juergen, On 14/08/17 08:07, Juergen Gross wrote: Modify the custom parameter parsing routines in: xen/arch/arm/domain_build.c to indicate whether the parameter value was parsed successfully. Cc: Stefano Stabellini Cc: Julien Grall

Re: [Xen-devel] [PATCH v2 01/52] xen/arch/arm/acpi/boot.c: let custom parameter parsing routines return errno

2017-08-14 Thread Julien Grall
Hi Juergen, On 14/08/17 08:07, Juergen Gross wrote: Modify the custom parameter parsing routines in: xen/arch/arm/acpi/boot.c to indicate whether the parameter value was parsed successfully. Cc: Stefano Stabellini Cc: Julien Grall

Re: [Xen-devel] [PATCH v2 19/52] xen/arch/x86/setup.c: let custom parameter parsing routines return errno

2017-08-14 Thread Juergen Gross
On 14/08/17 15:37, Jan Beulich wrote: On 14.08.17 at 09:08, wrote: >> bool __read_mostly acpi_disabled; >> bool __initdata acpi_force; >> static char __initdata acpi_param[10] = ""; >> -static void __init parse_acpi_param(char *s) >> +static int __init

Re: [Xen-devel] [PATCH v2 18/52] xen/arch/x86/psr.c: let custom parameter parsing routines return errno

2017-08-14 Thread Juergen Gross
On 14/08/17 15:35, Jan Beulich wrote: On 14.08.17 at 09:08, wrote: >> --- a/xen/arch/x86/psr.c >> +++ b/xen/arch/x86/psr.c >> @@ -420,7 +420,7 @@ static const struct feat_props l2_cat_props = { >> }; >> >> static void __init parse_psr_bool(char *s, char *value, char

[Xen-devel] [PATCH 27/27] xen/arm: mm: Use memory flags for modify_xen_mappings rather than custom one

2017-08-14 Thread Julien Grall
This will help to consolidate the page-table code and avoid different path depending on the action to perform. Signed-off-by: Julien Grall --- Cc: Konrad Rzeszutek Wilk Cc: Ross Lagerwall arch_livepatch_secure is

[Xen-devel] [PATCH 23/27] xen/arm: mm: Rename 'ai' into 'flags' in create_xen_entries

2017-08-14 Thread Julien Grall
The parameter 'ai' is used either for attribute index or for permissions. Follow-up patch will rework that parameters to carry more information. So rename the parameter to 'flags'. Signed-off-by: Julien Grall --- xen/arch/arm/mm.c | 8 1 file changed, 4

[Xen-devel] [PATCH 26/27] xen/arm: mm: Handling permission flags when adding a new mapping

2017-08-14 Thread Julien Grall
Currently, all the new mappings will be read-write non-executable. Allow the caller to use other permissions. Signed-off-by: Julien Grall --- xen/arch/arm/mm.c | 8 1 file changed, 8 insertions(+) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index

[Xen-devel] [PATCH 14/27] xen/arm: traps: Improve logging for data/prefetch abort fault

2017-08-14 Thread Julien Grall
Walk the hypervisor page table for data/prefetch abort fault to help diagnostics error in the page tables. Signed-off-by: Julien Grall --- xen/arch/arm/traps.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/xen/arch/arm/traps.c

[Xen-devel] [PATCH 21/27] xen/arm: mm: Rename and clarify AP[1] in the stage-1 page table

2017-08-14 Thread Julien Grall
The description of AP[1] in Xen is based on testing rather than the ARM ARM. Per the ARM ARM, on EL2 stage-1 page table, AP[1] is RES1 as the translation regime applies to only one exception level (see D4.4.4 and G4.6.1 in ARM DDI 0487B.a). Update the comment and also rename the field to match

[Xen-devel] [PATCH 22/27] xen/arm: Switch to SYS_STATE_boot just after end_boot_allocator()

2017-08-14 Thread Julien Grall
We should consider the early boot period to end when we stop using the boot allocator. This is inline with x86 and will be helpful to know whether we should allocate memory from the boot allocator or xenheap. Signed-off-by: Julien Grall --- xen/arch/arm/setup.c | 8

[Xen-devel] [PATCH 25/27] xen/arm: mm: Embed permission in the flags

2017-08-14 Thread Julien Grall
Currently, it is not possible to specify the permission of a new mapping. It would be necessary to use the function modify_xen_mappings with a different set of flags. Add introduce a couple of new flags for the permissions (Non-eXecutable, Read-Only) and also provides define that combine the

[Xen-devel] [PATCH 06/27] xen/mm: Use __virt_to_mfn in map_domain_page instead of virt_to_mfn

2017-08-14 Thread Julien Grall
virt_to_mfn may by overridden by the source files, for improving locally typesafe. Therefore map_domain_page has to use __virt_to_mfn to prevent any compilation issue in sources files that override the helper. Signed-off-by: Julien Grall --- Cc: Stefano Stabellini

[Xen-devel] [PATCH 20/27] xen/arm: page: Use ARMv8 naming to improve readability

2017-08-14 Thread Julien Grall
This is based on the Linux ARMv8 naming scheme (see arch/arm64/mm/proc.S). Each type will contain "NORMAL" or "DEVICE" to make clear whether each attribute targets device or normal memory. Signed-off-by: Julien Grall --- xen/arch/arm/kernel.c | 2 +-

[Xen-devel] [PATCH 19/27] xen/arm: page: Clean-up the definition of MAIRVAL

2017-08-14 Thread Julien Grall
Currently MAIRVAL is defined in term of MAIR0VAL and MAIR1VAL which are both hardcoded value. This makes quite difficult to understand the value written in both registers. Rework the definition by using value of each attribute shifted by their associated index. Signed-off-by: Julien Grall

[Xen-devel] [PATCH 24/27] xen/arm: page: Describe the layout of flags used to update page tables

2017-08-14 Thread Julien Grall
Currently, the flags used to update page tables (i.e PAGE_HYPERVISOR_*) only contains the memory attribute index. Follow-up patches will add more information in it. At the same time introduce PAGE_AI_MASK to get the memory attribute index easily. Signed-off-by: Julien Grall

[Xen-devel] [PATCH 16/27] xen/arm: page: Remove unused attributes DEV_NONSHARED and DEV_CACHED

2017-08-14 Thread Julien Grall
They were imported from non-LPAE Linux, but Xen is LPAE only. It is time to do some clean-up in the memory attribute and keep only what make sense for Xen. Follow-up patch will do more clean-up. Also, update the comment saying our attribute matches Linux. Signed-off-by: Julien Grall

[Xen-devel] [PATCH 18/27] xen/arm: page: Prefix memory types with MT_

2017-08-14 Thread Julien Grall
This will avoid confusion in the code when using them. Signed-off-by: Julien Grall --- xen/arch/arm/kernel.c | 2 +- xen/arch/arm/mm.c | 28 +-- xen/arch/arm/platforms/vexpress.c | 2 +- xen/drivers/video/arm_hdlcd.c

[Xen-devel] [PATCH 04/27] xen/mm: Move {G, M]FN <-> {G, M}ADDR helpers to common code

2017-08-14 Thread Julien Grall
Helpers to convert {G,M}FN to {G,M}ADDR and vice-versa were recently introduced on ARM. However, they could be used in common code to simplify a bit the code when using typesafes. Signed-off-by: Julien Grall --- Cc: Stefano Stabellini Cc: Andrew

[Xen-devel] [PATCH 17/27] xen/arm: page: Use directly BUFFERABLE and drop DEV_WC

2017-08-14 Thread Julien Grall
DEV_WC is only used for PAGE_HYPERVISOR_WC and does not bring much improvement. Signed-off-by: Julien Grall --- xen/include/asm-arm/page.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h index

[Xen-devel] [PATCH 02/27] xen/x86: srat: Don't check alloc_boot_pages return

2017-08-14 Thread Julien Grall
alloc_boot_pages will panic if it is not possible to allocate. So the check in the caller is pointless. Signed-off-by: Julien Grall --- Cc: Jan Beulich Cc: Andrew Cooper --- xen/arch/x86/srat.c | 5 - 1 file changed, 5

[Xen-devel] [PATCH 10/27] xen/arm: arm32: Don't define FAR_EL1

2017-08-14 Thread Julien Grall
Aliasing FAR_EL1 to IFAR is wrong because on ARMv8 FAR_EL1[31:0] is architecturally mapped to DFAR and FAR_EL1[63:32] to DFAR. As FAR_EL1 is not currently used in ARM32 code, remove it. Signed-off-by: Julien Grall --- xen/include/asm-arm/cpregs.h | 1 - 1 file changed, 1

[Xen-devel] [PATCH 00/27] xen/arm: Memory subsystem clean-up

2017-08-14 Thread Julien Grall
Hi all, This patch series contains clean-up for the ARM Memory subsystem in preparation of reworking the page tables handling. A branch with the patches can be found on xenbits: https://xenbits.xen.org/git-http/people/julieng/xen-unstable.git branch mm-cleanup-v1 Cheers, Cc: Andrew Cooper

[Xen-devel] [PATCH 09/27] xen/arm: traps: Don't define FAR_EL2 for ARM32

2017-08-14 Thread Julien Grall
Aliasing FAR_EL2 to HIFAR makes the code confusing because on ARMv8 FAR_EL2[31:0] is architecturally mapped to HDFAR and FAR_EL2[63:32] to FAR_EL2. See D7.2.30 in ARM DDI 0487B.a. Open-code the alias instead. Signed-off-by: Julien Grall --- xen/arch/arm/traps.c | 8

[Xen-devel] [PATCH 12/27] xen/arm: Introduce hsr_xabt to gather common bits between hsr_dabt and

2017-08-14 Thread Julien Grall
This will allow to consolidate some part of the data abort and prefetch abort handling in a single function later on. Signed-off-by: Julien Grall --- xen/include/asm-arm/processor.h | 13 + 1 file changed, 13 insertions(+) diff --git

[Xen-devel] [PATCH 11/27] xen/arm: Add FnV field in hsr_*abt

2017-08-14 Thread Julien Grall
FnV (FAR not Valid) bit was introduced by ARMv8 in both AArch32 and AArch64 (See D7-2275, D7-2277, G6-4958, G6-4962 in ARM DDI 0487B.a). Signed-off-by: Julien Grall --- xen/include/asm-arm/processor.h | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff

[Xen-devel] [PATCH 07/27] xen/arm: mm: Redefine mfn_to_virt to use typesafe

2017-08-14 Thread Julien Grall
This add a bit more safety in the memory subsystem code. Signed-off-by: Julien Grall --- xen/arch/arm/mm.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index b3def63ed7..349ac58ffe 100644 ---

[Xen-devel] [PATCH 13/27] xen/arm: traps: Introduce a helper to read the hypersivor fault register

2017-08-14 Thread Julien Grall
While ARM32 has 2 distinct registers for the hypervisor fault register (one for prefetch abort, the other for data abort), AArch64 has only one. Currently, the logic is open-code but a follow-up patch will require to read it too. So move the logic in a separate helper and use it instead of

[Xen-devel] [PATCH 08/27] xen/arm: hsr_iabt: Document RES0 field

2017-08-14 Thread Julien Grall
Signed-off-by: Julien Grall --- xen/include/asm-arm/processor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h index ab5225fa6c..51645f08c0 100644 ---

[Xen-devel] [PATCH 15/27] xen/arm: Replace ioremap_attr(PAGE_HYPERVISOR_NOCACHE) call by ioremap_nocache

2017-08-14 Thread Julien Grall
ioremap_cache is a wrapper of ioremap_attr(...). Signed-off-by: Julien Grall --- xen/arch/arm/platforms/exynos5.c | 2 +- xen/arch/arm/platforms/omap5.c | 6 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/platforms/exynos5.c

[Xen-devel] [PATCH 05/27] xen/mm: Use typesafe MFN for alloc_boot_pages return

2017-08-14 Thread Julien Grall
At the moment, most of the callers will have to use mfn_x. However follow-up patches will remove some of them by propagating the typesafe a bit further. Signed-off-by: Julien Grall --- Cc: Stefano Stabellini Cc: Andrew Cooper

[Xen-devel] [PATCH 01/27] xen/x86: numa: Don't check alloc_boot_pages return

2017-08-14 Thread Julien Grall
alloc_boot_pages will panic if it is not possible to allocate. So the check in the caller is pointless. Signed-off-by: Julien Grall --- Cc: Jan Beulich Cc: Andrew Cooper --- xen/arch/x86/numa.c | 8 1 file changed,

[Xen-devel] [PATCH 03/27] xen/x86: mm: Don't check alloc_boot_pages return

2017-08-14 Thread Julien Grall
The only way alloc_boot_pages will return 0 is during the error case. Although, Xen will panic in the error path. So the check in the caller is pointless. Looking at the loop, my understanding is it will try to allocate in smaller chunk if a bigger chunk fail. Given that alloc_boot_pages can

Re: [Xen-devel] [PATCH] include/public: add new elf note for support of huge physical addresses

2017-08-14 Thread Juergen Gross
On 14/08/17 15:18, Jan Beulich wrote: On 14.08.17 at 14:21, wrote: >> On 14/08/17 13:40, Jan Beulich wrote: >> On 14.08.17 at 13:05, wrote: On 14/08/17 12:48, Jan Beulich wrote: On 14.08.17 at 12:35, wrote: >> On

Re: [Xen-devel] [PATCH v2 43/52] xen/arch/x86/io_apic.c: remove custom_param() error messages

2017-08-14 Thread Jan Beulich
>>> On 14.08.17 at 09:08, wrote: > With _cmdline_parse() now issuing error messages in case of illegal > parameters signalled by parsing functions specified in custom_param() > the message issued by setup_ioapic_ack() can be removed. > > Cc: Jan Beulich > Cc:

Re: [Xen-devel] [PATCH v2 41/52] xen/arch/x86/cpu/mcheck/mce.c: remove custom_param() error messages

2017-08-14 Thread Jan Beulich
>>> On 14.08.17 at 09:08, wrote: > With _cmdline_parse() now issuing error messages in case of illegal > parameters signalled by parsing functions specified in custom_param() > the message issued by mce_set_verbosity() can be removed. > > Cc: Jan Beulich >

Re: [Xen-devel] [PATCH v2 40/52] xen/arch/x86/apic.c: remove custom_param() error messages

2017-08-14 Thread Jan Beulich
>>> On 14.08.17 at 09:08, wrote: > With _cmdline_parse() now issuing error messages in case of illegal > parameters signalled by parsing functions specified in custom_param() > the message issued by apic_set_verbosity() can be removed. > > Cc: Jan Beulich >

  1   2   3   >