Re: [Xen-devel] [PATCH] tools: xentoolcore_restrict_all: Do deregistration before close

2017-11-14 Thread Ross Lagerwall
->watch_pipe[1]); } -close(h->fd); xentoolcore__deregister_active_handle(>tc_ah); +close(h->fd); Since the rest of this file uses tabs, you may as well use tabs for this line as well. Reviewed-by: Ross Lagerwall <ross.lagerw...@citrix.com> ___

Re: [Xen-devel] [PATCH for-4.10] libs/evtchn: Remove active handler on clean-up or failure

2017-11-14 Thread Ross Lagerwall
On 11/14/2017 11:51 AM, Ian Jackson wrote: Ross Lagerwall writes ("Re: [PATCH for-4.10] libs/evtchn: Remove active handler on clean-up or failure"): On 11/10/2017 05:10 PM, Julien Grall wrote: Commit 89d55473ed16543044a31d1e0d4660cf5a3f49df "xentoolcore_restrict

Re: [Xen-devel] [PATCH for-4.10] libs/evtchn: Remove active handler on clean-up or failure

2017-11-13 Thread Ross Lagerwall
er, I think it should call xentoolcore__deregister_active_handle() _before_ calling osdep_evtchn_close() to avoid trying to restrict a closed fd or some other fd that happens to have the same number. I think all the other libs need to be fixed as well, unless there was a reason it was done thi

Re: [Xen-devel] [PATCH v1 4/5] tools: libxendevicemodel: Provide xendevicemodel_add_to_physmap

2017-10-27 Thread Ross Lagerwall
. -- Ross Lagerwall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v2 2/5] xen: Provide XEN_DMOP_add_to_physmap

2017-10-23 Thread Ross Lagerwall
e size rather than below (since IIRC we only need pad up to the next 4 byte boundary). Nope, the build fails unless I pad it to an 8 byte boundary. This is also why I added padding to struct xen_dm_op_pin_memory_cacheattr... -- Ross Lagerwall ___ Xen

[Xen-devel] [PATCH v2 0/5] Add dmops to allow use of VGA with restricted QEMU

2017-10-23 Thread Ross Lagerwall
on a range. Ross Lagerwall (5): xen/mm: Make xenmem_add_to_physmap global xen: Provide XEN_DMOP_add_to_physmap xen: Provide XEN_DMOP_pin_memory_cacheattr tools: libxendevicemodel: Provide xendevicemodel_add_to_physmap tools: libxendevicemodel: Provide xendevicemodel_pin_memory_cacheattr

[Xen-devel] [PATCH v2 1/5] xen/mm: Make xenmem_add_to_physmap global

2017-10-23 Thread Ross Lagerwall
Make it global in preparation to be called by a new dmop. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- Reviewed-by: Paul Durrant <paul.durr...@citrix.com> --- xen/common/memory.c | 5 ++--- xen/include/xen/mm.h | 3 +++ 2 files changed, 5 insertions(+), 3 deleti

[Xen-devel] [PATCH v2 5/5] tools: libxendevicemodel: Provide xendevicemodel_pin_memory_cacheattr

2017-10-23 Thread Ross Lagerwall
Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- Acked-by: Ian Jackson <ian.jack...@eu.citrix.com> Reviewed-by: Paul Durrant <paul.durr...@citrix.com> --- tools/libs/devicemodel/core.c | 19 +++ tools/libs/devicemodel/include/xen

[Xen-devel] [PATCH v2 4/5] tools: libxendevicemodel: Provide xendevicemodel_add_to_physmap

2017-10-23 Thread Ross Lagerwall
Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- Changed in v2: * Make it operate on a range. tools/libs/devicemodel/Makefile | 2 +- tools/libs/devicemodel/core.c | 21 + tools/libs/devicemodel/include/xendevicemodel.

[Xen-devel] [PATCH v2 3/5] xen: Provide XEN_DMOP_pin_memory_cacheattr

2017-10-23 Thread Ross Lagerwall
Provide XEN_DMOP_pin_memory_cacheattr to allow a deprivileged QEMU to pin the caching type of RAM after moving the VRAM. It is equivalent to XEN_DOMCTL_pin_memory_cacheattr. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- Changed in v2: * Check pad is 0. xen/arch/x86/hv

[Xen-devel] [PATCH v2 2/5] xen: Provide XEN_DMOP_add_to_physmap

2017-10-23 Thread Ross Lagerwall
Provide XEN_DMOP_add_to_physmap, a limited version of XENMEM_add_to_physmap to allow a deprivileged QEMU to move VRAM when a guest programs its BAR. It is equivalent to XENMEM_add_to_physmap with space == XENMAPSPACE_gmfn_range. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.

Re: [Xen-devel] [PATCH v1 2/5] xen: Provide XEN_DMOP_add_to_physmap

2017-10-20 Thread Ross Lagerwall
other comments, would it make sense to instead use XENMAPSPACE_gmfn_range and have the caller set the size? As it is currently, QEMU does only populate VRAM one page at a time (using xen_xc_domain_add_to_physmap) so it is already slow but it could be improved. --

[Xen-devel] [PATCH v1 0/5] Add dmops to allow use of VGA with restricted QEMU

2017-10-18 Thread Ross Lagerwall
The recently added support for restricting QEMU prevents use of the VGA console. This series addresses that by adding a couple of new dmops. A corresponding patch for QEMU is needed to make use of the new dmops. Ross Lagerwall (5): xen/mm: Make xenmem_add_to_physmap public xen: Provide

[Xen-devel] [PATCH v1 1/5] xen/mm: Make xenmem_add_to_physmap global

2017-10-18 Thread Ross Lagerwall
Make it global in preparation to be called by a new dmop. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- xen/common/memory.c | 5 ++--- xen/include/xen/mm.h | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xen/common/memory.c b/xen/common/memory.c

[Xen-devel] [PATCH v1 4/5] tools: libxendevicemodel: Provide xendevicemodel_add_to_physmap

2017-10-18 Thread Ross Lagerwall
Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- tools/libs/devicemodel/Makefile | 2 +- tools/libs/devicemodel/core.c | 17 + tools/libs/devicemodel/include/xendevicemodel.h | 13 + tools/libs/devic

[Xen-devel] [PATCH v1 5/5] tools: libxendevicemodel: Provide xendevicemodel_pin_memory_cacheattr

2017-10-18 Thread Ross Lagerwall
Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- tools/libs/devicemodel/core.c | 19 +++ tools/libs/devicemodel/include/xendevicemodel.h | 14 ++ tools/libs/devicemodel/libxendevicemodel.map| 1 + 3 files changed, 34 inse

[Xen-devel] [PATCH v1 2/5] xen: Provide XEN_DMOP_add_to_physmap

2017-10-18 Thread Ross Lagerwall
Provide XEN_DMOP_add_to_physmap, a limited version of XENMEM_add_to_physmap to allow a deprivileged QEMU to move VRAM when a guest programs its BAR. It is equivalent to XENMEM_add_to_physmap with space == XENMAPSPACE_gmfn. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- xe

[Xen-devel] [PATCH v1 3/5] xen: Provide XEN_DMOP_pin_memory_cacheattr

2017-10-18 Thread Ross Lagerwall
Provide XEN_DMOP_pin_memory_cacheattr to allow a deprivileged QEMU to pin the caching type of RAM after moving the VRAM. It is equivalent to XEN_DOMCTL_pin_memory_cacheattr. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- xen/arch/x86/hvm/dm.c | 12 +++

[Xen-devel] [PATCH v2 for-4.10 2/2] xentoolcore_restrict_all: Implement for libxenevtchn

2017-10-18 Thread Ross Lagerwall
Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- Changed in v2: * Keep warning about DoS and resource exhaustion being a possibility. (Note that v1 of this patch was incorrectly titled v2.) tools/Rules.mk| 2 +- tools/libs/evtchn/Ma

[Xen-devel] [PATCH v2 for-4.10 1/2] tools/libs/evtchn: Add support for restricting a handle

2017-10-18 Thread Ross Lagerwall
Implement support for restricting evtchn handles to a particular domain on Linux by calling the IOCTL_EVTCHN_RESTRICT_DOMID ioctl (support added in Linux v4.8). Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> Acked-by: Ian Jackson <ian.jack...@eu.citrix.com> Release-acke

Re: [Xen-devel] [PATCH] tools: libxendevicemodel: Restore symbol versions for 1.0

2017-10-18 Thread Ross Lagerwall
map alone and added a new version which simply adds the new symbol. Fix this. Reported-by: Ross Lagerwall <ross.lagerw...@citrix.com> CC: Stefano Stabellini <sstabell...@kernel.org> Signed-off-by: Ian Jackson <ian.jack...@eu.citrix.com> --- Reviewed-by: Ross Lagerwal

Re: [Xen-devel] [PATCH 03/26] tools: libxendevicemodel: Provide xendevicemodel_shutdown

2017-10-17 Thread Ross Lagerwall
local: *; /* Do not expose anything by default */ Why did all the symbols get moved to VERS_1.1 rather than adding only the new one to VERS_1.1 and keeping the rest at VERS_1.0 (like has been done with libxenforeignmemory)? -- Ross Lagerwall _

Re: [Xen-devel] [PATCH v2 2/2] xentoolcore_restrict_all: Implement for libxenevtchn

2017-10-17 Thread Ross Lagerwall
On 10/16/2017 11:55 AM, Ian Jackson wrote: Ross Lagerwall writes ("[PATCH v2 2/2] xentoolcore_restrict_all: Implement for libxenevtchn"): Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> ... int osdep_evtchn_open(xenevtchn_handle *xce); diff --git a/tools/libs/

Re: [Xen-devel] [PATCH v1 1/2] tools/libs/evtchn: Add support for restricting a handle

2017-10-16 Thread Ross Lagerwall
On 10/16/2017 12:29 PM, Ian Jackson wrote: Ross Lagerwall writes ("Re: [PATCH v1 1/2] tools/libs/evtchn: Add support for restricting a handle"): No. As far as I can see, it can only be used to bind new interdomain events, not other events. OK, good, thanks. This entire file

Re: [Xen-devel] [PATCH v1 1/2] tools/libs/evtchn: Add support for restricting a handle

2017-10-16 Thread Ross Lagerwall
On 10/16/2017 11:53 AM, Ian Jackson wrote: Ross Lagerwall writes ("[PATCH v1 1/2] tools/libs/evtchn: Add support for restricting a handle"): +/* + * Restrict this file descriptor so that it can only be used to bind + * new interdomain events from one domain. Can it be used to

[Xen-devel] [PATCH v1 1/2] tools/libs/evtchn: Add support for restricting a handle

2017-10-13 Thread Ross Lagerwall
Implement support for restricting evtchn handles to a particular domain on Linux by calling the IOCTL_EVTCHN_RESTRICT_DOMID ioctl (support added in Linux v4.8). Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- tools/include/xen-sys/Linux/evtchn.h | 15 +++ tool

[Xen-devel] [PATCH v2 2/2] xentoolcore_restrict_all: Implement for libxenevtchn

2017-10-13 Thread Ross Lagerwall
Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- tools/Rules.mk| 2 +- tools/libs/evtchn/Makefile| 4 ++-- tools/libs/evtchn/core.c | 13 + tools/libs/evtchn/private.h | 3 +++ tool

Re: [Xen-devel] [PATCH 3/8] xen: defer call to xen_restrict until just before os_setup_post

2017-10-13 Thread Ross Lagerwall
has a /dev/null). -- Ross Lagerwall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

[Xen-devel] [PATCH for-4.10] xen: Fix XEN_DMOP_remote_shutdown return value

2017-10-11 Thread Ross Lagerwall
Return 0 to indicate success rather than whatever rc was previously set to (-EINVAL). Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- xen/arch/x86/hvm/dm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c index 82addea..3

Re: [Xen-devel] [PATCH v2 0/*] xen: xen-domid-restrict improvements

2017-10-10 Thread Ross Lagerwall
On 10/06/2017 02:19 PM, Paul Durrant wrote: -Original Message- From: Xen-devel [mailto:xen-devel-boun...@lists.xen.org] On Behalf Of Ross Lagerwall Sent: 06 October 2017 13:58 To: Ian Jackson <ian.jack...@citrix.com>; qemu-de...@nongnu.org Cc: Anthony Perard <anthony.per...@c

Re: [Xen-devel] [PATCH v4 04/11] livepatch/arm[32, 64]: Don't load and crash on livepatches loaded with wrong text alignment.

2017-10-09 Thread Ross Lagerwall
be split into two patches? Is the latter check not needed for ARM64? -- Ross Lagerwall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 04/24] xentoolcore, _restrict_all: Introduce new library and implementation

2017-10-06 Thread Ross Lagerwall
hardcoded rules fixes the problem (although presumably there's a better way): handlereg.o: $(AUTOINCS) handlereg.opic: $(AUTOINCS) -- Ross Lagerwall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v2 25/24] xl: Document VGA problems arising from lack of physmap dmop

2017-10-06 Thread Ross Lagerwall
dmop to fix this properly. For now, document the problem. Signed-off-by: Ian Jackson <ian.jack...@eu.citrix.com> Reported-by: Ross Lagerwall <ross.lagerw...@citrix.com> CC: Ross Lagerwall <ross.lagerw...@citrix.com> CC: Wei Liu <wei.l...@citrix.com> CC: Paul Durrant

Re: [Xen-devel] [PATCH v2 0/*] xen: xen-domid-restrict improvements

2017-10-06 Thread Ross Lagerwall
to contain a valid /dev/null. This is a bit annoying and prevents the chroot being on a "nodev" mount. Regards, -- Ross Lagerwall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 7/8] os-posix: Provide new -runasid option

2017-10-06 Thread Ross Lagerwall
er_pwd->pw_uid : user_gid) < 0) { fprintf(stderr, "Failed to setuid(%d)\n", user_pwd->pw_uid); exit(1); } This last one should be user_uid, not user_gid. -- Ross Lagerwall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v4 07/11] livepatch/x86/arm[32, 64]: Force .livepatch.depends section to be uint32_t aligned.

2017-10-05 Thread Ross Lagerwall
mbol from test-cases." which fixes this. Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> --- Cc: Jan Beulich <jbeul...@suse.com> Cc: Andrew Cooper <andrew.coop...@citrix.com> Cc: Ian Jackson <ian.jack...@eu.citrix.com> Cc: Wei Liu <wei.l..

Re: [Xen-devel] [PATCH v4 01/11] livepatch: Expand check for safe_for_reapply if livepatch has only .rodata.

2017-10-05 Thread Ross Lagerwall
On 10/05/2017 02:51 PM, Konrad Rzeszutek Wilk wrote: On Thu, Oct 05, 2017 at 02:47:30PM +0100, Ross Lagerwall wrote: On 09/20/2017 11:31 PM, Konrad Rzeszutek Wilk wrote: If the livepatch has only .rodata sections then it is OK to also apply/revert/apply the livepatch without having to worry

Re: [Xen-devel] [PATCH v4 03/11] livepatch: Include sizes when an mismatch occurs

2017-10-05 Thread Ross Lagerwall
iples" in the warning. Also fix one case where we would fail if the size of the .ex_table was being zero - but that is OK. Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> --- Cc: Ross Lagerwall <ross.lagerw...@citrix.com> Reviewed-by: Ross Lagerwall <

Re: [Xen-devel] [PATCH v4 01/11] livepatch: Expand check for safe_for_reapply if livepatch has only .rodata.

2017-10-05 Thread Ross Lagerwall
lying after an revert" for details. Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> --- Cc: Ross Lagerwall <ross.lagerw...@citrix.com> The patch looks OK, but what is the use case for a live patch with only .rodata? Rega

[Xen-devel] [PATCH v2] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq

2017-08-23 Thread Ross Lagerwall
the RTC. This patch by itself doesn't affect any of the toolstacks that I checked; the libxl toolstack doesn't currently handle this event nor does the XAPI toolstack. If nothing handles the event, it is simply ignored. We plan on modifying XAPI to handle it. Signed-off-by: Ross Lagerwall

Re: [Xen-devel] [PATCH] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq

2017-08-22 Thread Ross Lagerwall
On 08/21/2017 11:30 PM, Stefano Stabellini wrote: On Mon, 21 Aug 2017, Ross Lagerwall wrote: When the guest writes to the RTC, Xen emulates it and broadcasts a TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP message when this happens rather than ignoring it so that something useful can be done

[Xen-devel] [PATCH] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq

2017-08-21 Thread Ross Lagerwall
When the guest writes to the RTC, Xen emulates it and broadcasts a TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP message when this happens rather than ignoring it so that something useful can be done with the information. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- hw/i386/x

Re: [Xen-devel] PVH VCPU hotplug support v7?

2017-07-31 Thread Ross Lagerwall
On 07/31/2017 03:29 PM, Boris Ostrovsky wrote: On 07/31/2017 10:12 AM, Andrew Cooper wrote: On 31/07/17 14:55, Boris Ostrovsky wrote: On 07/31/2017 09:20 AM, Ross Lagerwall wrote: Hi Boris, I've modified your PVH VCPU hotplug support v6 patch series [1] to support HVM guests running _with_

Re: [Xen-devel] [PATCH v6 05/12] x86/domctl: Handle ACPI access from domctl

2017-07-31 Thread Ross Lagerwall
While I'm looking at this code... This doesn't work if access->width > sizeof(val) (4 bytes). The same value (access->address) is always passed into acpi_cpumap_access_common for 'port' and this is used as an offset into the avail_cpus array. So the

[Xen-devel] PVH VCPU hotplug support v7?

2017-07-31 Thread Ross Lagerwall
is.ostrov...@oracle.com> Reviewed-by: Juergen Gross <jgr...@suse.com> Thanks, -- Ross Lagerwall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

[Xen-devel] [PATCH v3] livepatch: Declare live patching as a supported feature

2017-07-03 Thread Ross Lagerwall
See docs/features/livepatch.pandoc for the details. Turn live patching on by default on supported platforms (x86). Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> --- Changed in v3: Default to on for supported pl

Re: [Xen-devel] [PATCH for-4.9] livepatch: Declare live patching as a supported feature

2017-07-03 Thread Ross Lagerwall
On 06/30/2017 02:42 PM, George Dunlap wrote: On 06/28/2017 05:18 PM, Ross Lagerwall wrote: On 06/27/2017 10:17 AM, George Dunlap wrote: On 26/06/17 18:30, Andrew Cooper wrote: On 26/06/17 18:00, George Dunlap wrote: On 26/06/17 16:36, Ross Lagerwall wrote: ... We absolutely cannot

Re: [Xen-devel] [PATCH v3 07/16] xen/arm: livepatch: Redefine virt_to_mfn to support typesafe

2017-07-03 Thread Ross Lagerwall
-by: Julien Grall <julien.gr...@arm.com> Reviewed-by: Stefano Stabellini <sstabell...@kernel..org> Acked-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> --- Cc: Ross Lagerwall <ross.lagerw...@citrix.com> Acked-by: Ross Lagerwall &l

Re: [Xen-devel] [PATCH for-4.9] livepatch: Declare live patching as a supported feature

2017-06-28 Thread Ross Lagerwall
On 06/27/2017 10:17 AM, George Dunlap wrote: On 26/06/17 18:30, Andrew Cooper wrote: On 26/06/17 18:00, George Dunlap wrote: On 26/06/17 16:36, Ross Lagerwall wrote: ... We absolutely cannot be in the position of issuing XSAs for situations like this, because there are too many ways where

[Xen-devel] [PATCH for-4.9 v2] livepatch: Declare live patching as a supported feature

2017-06-28 Thread Ross Lagerwall
See docs/features/livepatch.pandoc for the details. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- Moved it into a feature document. Clarified a few bits and pieces based on feedback. docs/features/livepatch.pandoc | 103 + xen/

Re: [Xen-devel] [PATCH for-4.9] livepatch: Declare live patching as a supported feature

2017-06-26 Thread Ross Lagerwall
On 06/26/2017 05:39 PM, Andrew Cooper wrote: On 26/06/17 16:36, Ross Lagerwall wrote: snip * Unprivileged access to live patching operations: Live patching operations should only be accessible to privileged guests and it shall be treated as a security issue

[Xen-devel] [PATCH for-4.9] livepatch: Declare live patching as a supported feature

2017-06-26 Thread Ross Lagerwall
t live patch can introduce an arbitrary denial of service. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- xen/common/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/Kconfig b/xen/common/Kconfig index dc8e876..876086c 100644 --- a/xen/common

Re: [Xen-devel] [PATCH for-4.9 v3 3/3] xen/livepatch: Don't crash on encountering STN_UNDEF relocations

2017-06-23 Thread Ross Lagerwall
. Additionally, fix an off-by-one error while range checking symndx, and perform a safety check on elf->sym[symndx].sym before derefencing it, to avoid tripping over a NULL pointer when calculating val. Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> Reviewed-by: Ross Lagerwall <

Re: [Xen-devel] [PATCH for-4.9 v3 2/3] xen/livepatch: Use zeroed memory allocations for arrays

2017-06-23 Thread Ross Lagerwall
On 06/22/2017 07:15 PM, Andrew Cooper wrote: Each of these arrays is sparse. Use zeroed allocations to cause uninitialised array elements to contain deterministic values, most importantly for the embedded pointers. Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> Reviewed-by

Re: [Xen-devel] [PATCH for-4.9 v2] xen/livepatch: Don't crash on encountering STN_UNDEF relocations

2017-06-22 Thread Ross Lagerwall
. Additionally, perform a safety check on elf->sym[symndx].sym before derefencing it, to avoid tripping over a NULL pointer when calculating val. Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> Reviewed-by: Ross Lagerwall <ross.lagerw..

[Xen-devel] [PATCH] rombios/ata: Wait for BSY to clear after write

2017-06-13 Thread Ross Lagerwall
are probably rarely used these days, but they are used by GRUB 2 to write to its environment file which happens by default on Ubuntu. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- tools/firmware/rombios/rombios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

Re: [Xen-devel] [PATCH LIVEPATCH-BUILD-TOOLS 2/2] Remove section alignment requirement

2017-06-12 Thread Ross Lagerwall
On 06/09/2017 06:08 PM, Konrad Rzeszutek Wilk wrote: On Fri, Jun 09, 2017 at 06:00:35PM +0100, Andrew Cooper wrote: On 09/06/17 17:38, Konrad Rzeszutek Wilk wrote: On Fri, Jun 09, 2017 at 05:03:36PM +0100, Ross Lagerwall wrote: Remove the requirement that section twins have the same alignment

Re: [Xen-devel] xsa213 and live patching

2017-06-09 Thread Ross Lagerwall
had previously fixed this but hadn't yet sent out that patch. I've now sent this fix along with another to xen-devel. Regards, -- Ross Lagerwall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

[Xen-devel] [PATCH LIVEPATCH-BUILD-TOOLS 2/2] Remove section alignment requirement

2017-06-09 Thread Ross Lagerwall
Remove the requirement that section twins have the same alignment. The section alignment of the patched section is respected by the loader in Xen so it shouldn't matter if the original section alignment was different. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- creat

[Xen-devel] [PATCH LIVEPATCH-BUILD-TOOLS 1/2] Ignore .discard sections

2017-06-09 Thread Ross Lagerwall
Ignore differences in discard sections. They are not included in the final xen binary so there is no need to include them in the live patch. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- create-diff-object.c | 8 1 file changed, 8 insertions(+) diff --git a/creat

Re: [Xen-devel] [PATCH for v4.9] livepatch: Wrong usage of spinlock on debug console.

2017-06-09 Thread Ross Lagerwall
softirqs(); if ( spin_trylock(_lock) ) return The effect is that we have just effectively taken the lock and returned without unlocking! CC: Ross Lagerwall <ross.lagerw...@citrix.com> CC: Boris Ostrovsky <boris.ostrov...@oracle.com> CC: Jan Beulich <jbeul...@suse

[Xen-devel] [PATCH v2] x86/vmx: Fix vmentry failure because of invalid LER on Broadwell

2017-05-30 Thread Ross Lagerwall
. This is assumed to be erratum BDF14. Workaround the issue by sign-extending into bits 48:63 for MSR_IA32_LASTINT{FROM,TO}IP. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- Changes in v2: - Use a single check if fixup is needed. - Rename to include the erratum name/number. - Sign

[Xen-devel] [PATCH] x86/vmx: Fix vmentry failure because of invalid LER on Broadwell

2017-05-25 Thread Ross Lagerwall
Occasionally, the top three bits of MSR_IA32_LASTINTTOIP (MSR_LER_TO_LIP) may be incorrect, as though the MSR is using the LBR_FORMAT_EIP_FLAGS_TSX format. The MSR should contain an offset into the current code segment according to the Intel documentation. It is not clear why this happens. It may

Re: [Xen-devel] [PATCH] x86/efi: Reserve EFI properties table

2017-05-17 Thread Ross Lagerwall
On 05/15/2017 02:52 PM, Julien Grall wrote: Hi Andrew, On 08/05/17 17:29, Andrew Cooper wrote: On 08/05/17 17:17, Ross Lagerwall wrote: Some EFI firmware implementations may place the EFI properties table in RAM marked as BootServicesData, which Xen does not consider as reserved. When dom0

[Xen-devel] [PATCH] x86/efi: Reserve EFI properties table

2017-05-08 Thread Ross Lagerwall
EFI properties table as reserved in the E820, much like is done with the dmi regions. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- xen/arch/x86/efi/efi-boot.h | 8 xen/common/efi/boot.c | 20 xen/common/efi/efi.h| 4 3 file

[Xen-devel] [PATCH] x86/microcode: Use the return value from early_microcode_update_cpu

2017-04-20 Thread Ross Lagerwall
Use the return value from early_microcode_update_cpu rather than ignoring it. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- xen/arch/x86/microcode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/microcode.c b/xen/arch/x86/microcode.c

[Xen-devel] [PATCH] x86: Move microcode loading earlier

2017-04-18 Thread Ross Lagerwall
t. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- xen/arch/x86/cpu/common.c | 2 + xen/arch/x86/microcode.c| 131 +--- xen/arch/x86/microcode_amd.c| 3 +- xen/arch/x86/microcode_intel.c | 3 +- xen/arch/x86/setup.c

Re: [Xen-devel] [PATCH v2] x86: suppress duplicate symbol warnings for CONFIG_GCOV

2017-03-31 Thread Ross Lagerwall
eul...@suse.com> Reviewed-by: Ross Lagerwall <ross.lagerw...@citrix.com> ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH] x86: suppress duplicate symbol warnings for CONFIG_GCOV

2017-03-23 Thread Ross Lagerwall
On 03/23/2017 02:57 PM, Jan Beulich wrote: There are quite a few of these, and as the option is a development one only, duplicate symbol names should not be an issue there. Signed-off-by: Jan Beulich <jbeul...@suse.com> Acked-by: Ross Lagerwall <ross.lagerw...@citrix.com>

Re: [Xen-devel] [PATCH v2 0/6] Remove dependency on __LINE__

2017-03-17 Thread Ross Lagerwall
patching. Does that seem reasonable? -- Ross Lagerwall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v2 0/6] Remove dependency on __LINE__

2017-03-10 Thread Ross Lagerwall
bers. They would be removed only for "release" builds in which it is likely that the source code & debuginfo is archived somewhere such that looking up a line number requires several steps anyway. I could suggest making it a separate config option but IIRC you prefer to limit the number

[Xen-devel] [PATCH v2 0/6] Remove dependency on __LINE__

2017-03-08 Thread Ross Lagerwall
f __LINE__ that have been introduced since the last version of this series. See the patches for further changes on each patch. Ross Lagerwall (6): lib: Add a generic implementation of current_text_addr() sched: Remove dependency on __LINE__ for release builds mm: Use statically defined locking ord

[Xen-devel] [PATCH v2 5/6] x86_emulate: Remove dependency on __LINE__ for release builds

2017-03-08 Thread Ross Lagerwall
When using LivePatch, use of __LINE__ can generate spurious changes in functions due to embedded line numbers. For release builds with LivePatch enabled, remove the use of these line numbers and print the current text address instead. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.

[Xen-devel] [PATCH v2 2/6] sched: Remove dependency on __LINE__ for release builds

2017-03-08 Thread Ross Lagerwall
When using LivePatch, use of __LINE__ can generate spurious changes in functions due to embedded line numbers. For release builds with LivePatch enabled, remove the use of these line numbers in domain_crash*() and print the current text address instead. Signed-off-by: Ross Lagerwall <ross.lag

[Xen-devel] [PATCH v2 1/6] lib: Add a generic implementation of current_text_addr()

2017-03-08 Thread Ross Lagerwall
Remove the unused x86 implementation. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- Changes in v2: * Include Clang in the comment. xen/common/lib.c| 12 xen/include/asm-x86/processor.h | 10 -- xen/include/xen/lib.h | 2

[Xen-devel] [PATCH v2 3/6] mm: Use statically defined locking order

2017-03-08 Thread Ross Lagerwall
Instead of using a locking order based on line numbers which interacts poorly with trying to create a live patch, statically define the locking order. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> Reviewed-by: Dario Faggioli <dario.faggi...@citrix.com> --- Changes in v2:

[Xen-devel] [PATCH v2 4/6] iommu: Remove dependency on __LINE__ for release builds

2017-03-08 Thread Ross Lagerwall
When using LivePatch, use of __LINE__ can generate spurious changes in functions due to embedded line numbers. For release builds with LivePatch enabled, remove the use of these line numbers in IOMMU_WAIT_OP() and print the current text address instead. Signed-off-by: Ross Lagerwall <ross.lag

[Xen-devel] [PATCH v2 6/6] xen/arm: Remove dependency on __LINE__ for release builds

2017-03-08 Thread Ross Lagerwall
When using LivePatch, use of __LINE__ can generate spurious changes in functions due to embedded line numbers. For release builds with LivePatch enabled, remove the use of these line numbers and print the current text address instead. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.

[Xen-devel] [PATCH v3] xen-netfront: Improve error handling during initialization

2017-02-08 Thread Ross Lagerwall
api context. * If any fatal error occurs, unregister and destroy the netdev to avoid leaving around a half setup network device. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- Changed in V3: * If xennet_create_queues returns < 0, it will not have created any queues so the

Re: [Xen-devel] [PATCH v2] xen-netfront: Improve error handling during initialization

2017-02-08 Thread Ross Lagerwall
On 02/07/2017 11:33 PM, Boris Ostrovsky wrote: On 02/07/2017 09:55 AM, Ross Lagerwall wrote: This fixes a crash when running out of grant refs when creating many queues across many netdevs. * If creating queues fails (i.e. there are no grant refs available), call xenbus_dev_fatal() to ensure

[Xen-devel] [PATCH v2] xen-netfront: Improve error handling during initialization

2017-02-07 Thread Ross Lagerwall
api context. * If any fatal error occurs, unregister and destroy the netdev to avoid leaving around a half setup network device. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- Changed in V2: * Retested on top of v4.10-rc7 + "xen-netfront: Delete r

Re: [Xen-devel] [PATCH] xen-netfront: Improve error handling during initialization

2017-02-02 Thread Ross Lagerwall
On 02/01/2017 06:54 PM, Boris Ostrovsky wrote: On 02/01/2017 10:50 AM, Ross Lagerwall wrote: Improve error handling during initialization. This fixes a crash when running out of grant refs when creating many queues across many netdevs. * Delay timer creation so that if initializing a queue

[Xen-devel] [PATCH] xen-netfront: Improve error handling during initialization

2017-02-01 Thread Ross Lagerwall
off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- drivers/net/xen-netfront.c | 39 ++- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 8315fe7..8ca85af 100644 --- a/driver

Re: [Xen-devel] [PATCH v1 0/7] Make building xSplice patches easier

2017-01-31 Thread Ross Lagerwall
On 01/31/2017 03:05 AM, Doug Goldstein wrote: On 5/6/16 10:48 AM, Ross Lagerwall wrote: Here is a set of changes to make building xSplice patches easier. Tested to boot on x86. Compile-tested on arm. This is probably too late to make it into 4.7, but hey, if someone wants to put it in I've

[Xen-devel] [PATCH] x86: Use ACPI reboot method for Dell OptiPlex 9020

2016-12-14 Thread Ross Lagerwall
Manufacturer: Dell Inc. Product Name: OptiPlex 9020 Version: 00 Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- xen/arch/x86/shutdown.c | 13 + 1 file changed, 13 insertions(+) diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c index 55f6840..3d669d1

[Xen-devel] [PATCH v2 6/8] tools/livepatch: Remove unused struct member

2016-12-13 Thread Ross Lagerwall
Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> Acked-by: Wei Liu <wei.l...@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> --- tools/misc/xen-livepatch.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/misc/xen-livepatch.c b/tools/mi

[Xen-devel] [PATCH v2 8/8] tools/livepatch: Exit with 2 if a timeout occurs

2016-12-13 Thread Ross Lagerwall
the output. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- tools/misc/xen-livepatch.c | 37 ++--- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/tools/misc/xen-livepatch.c b/tools/misc/xen-livepatch.c index 140445d..af9fcd6

[Xen-devel] [PATCH v2 0/8] xen-livepatch misc fixes/changes

2016-12-13 Thread Ross Lagerwall
Hi all, This series contains a few fixes to the xen-livepatch tool. It also contains a few changes to make the output more readable. Changed in v2: * Fix minor comments. * Split the last patch into two. Ross Lagerwall (8): tools/livepatch: Show the correct expected state before action tools

[Xen-devel] [PATCH v2 2/8] tools/livepatch: Set stdout and stderr unbuffered

2016-12-13 Thread Ross Lagerwall
Using both stdout and stderr interleaved without newlines can result in strange output when using line buffered mode (e.g. a terminal) or when fully buffered (e.g. redirected to a file). Set stdout to unbuffered mode to fix this (stderr is always unbuffered by default). Signed-off-by: Ross

[Xen-devel] [PATCH v2 3/8] tools/livepatch: Improve output

2016-12-13 Thread Ross Lagerwall
-livepatch apply test2 test2 failed with 22(Invalid argument) Performing apply: (no newline) After: $ xen-livepatch apply test2 Applying test2: failed Error 22: Invalid argument Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> Acked-by: Wei Liu <wei.l...@c

[Xen-devel] [PATCH v2 4/8] livepatch: Fix documentation of timeout

2016-12-13 Thread Ross Lagerwall
The hypervisor expects the timeout from the hypercall to be in nanoseconds, so document this correctly. Also correctly document what happens when timeout is set to zero. Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- docs/misc/livepatch.markdown | 13 +++-- tools

[Xen-devel] [PATCH v2 5/8] tools/livepatch: Remove pointless retry loop

2016-12-13 Thread Ross Lagerwall
to actually start the operation. Furthermore, have xen-livepatch set the hypervisor timeout rather than relying on the hypervisor default since the tool doesn't know how long it will be. Use nanosleep rather than usleep since usleep has been removed from POSIX.1-2008. Signed-off-by: Ross Lagerwall

[Xen-devel] [PATCH v2 1/8] tools/livepatch: Show the correct expected state before action

2016-12-13 Thread Ross Lagerwall
xen-livepatch unload test test: in wrong state (APPLIED), expected (unknown) After: $ xen-livepatch unload test test: in wrong state (APPLIED), expected (CHECKED) Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> Acked-by: Wei Liu <wei.l...@citrix.com> --- tools/mis

[Xen-devel] [PATCH v2 7/8] tools/livepatch: Save errno where needed

2016-12-13 Thread Ross Lagerwall
Fix a number of incorrect uses of errno after an operation that could set it (e.g. fprintf, close). Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- tools/misc/xen-livepatch.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a

Re: [Xen-devel] [PATCH v1 2/7] tools/livepatch: Set stdout and stderr unbuffered

2016-12-13 Thread Ross Lagerwall
On 12/12/2016 05:02 PM, Wei Liu wrote: On Mon, Dec 12, 2016 at 04:18:05PM +, Ross Lagerwall wrote: Using both stdout and stderr interleaved without newlines can result in strange output when using line buffered mode (e.g. a terminal) or when fully buffered (e.g. redirected to a file). Set

[Xen-devel] [PATCH v1 0/7] xen-livepatch misc fixes/changes

2016-12-12 Thread Ross Lagerwall
Hi all, This series contains a few fixes to the xen-livepatch tool. It also contains a few changes to make the output more readable. Ross Lagerwall (7): tools/livepatch: Show the correct expected state before action tools/livepatch: Set stdout and stderr unbuffered tools/livepatch: Improve

[Xen-devel] [PATCH v1 6/7] tools/livepatch: Remove unused struct member

2016-12-12 Thread Ross Lagerwall
Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- tools/misc/xen-livepatch.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/misc/xen-livepatch.c b/tools/misc/xen-livepatch.c index d683860..9633c4a 100644 --- a/tools/misc/xen-livepatch.c +++ b/tools/misc/xen-livep

[Xen-devel] [PATCH v1 1/7] tools/livepatch: Show the correct expected state before action

2016-12-12 Thread Ross Lagerwall
xen-livepatch unload test test: in wrong state (APPLIED), expected (unknown) After: $ xen-livepatch unload test test: in wrong state (APPLIED), expected (CHECKED) Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- tools/misc/xen-livepatch.c | 2 +- 1 file changed,

[Xen-devel] [PATCH v1 7/7] tools/livepatch: Exit with 2 if a timeout occurs

2016-12-12 Thread Ross Lagerwall
the output. Fix a number of incorrect uses of errno after an operation that could set it (e.g. fprintf, close). Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- tools/misc/xen-livepatch.c | 60 +++--- 1 file changed, 41 insertions(+), 19 del

[Xen-devel] [PATCH v1 3/7] tools/livepatch: Improve output

2016-12-12 Thread Ross Lagerwall
-livepatch apply test2 test2 failed with 22(Invalid argument) Performing apply: (no newline) After: $ xen-livepatch apply test2 Applying test2: failed Error 22: Invalid argument Signed-off-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- tools/misc/xen-livepatch.

  1   2   3   4   >