Re: [Xen-devel] [PATCH v8.1 13/27] x86/xen_hello_world.xsplice: Test payload for patching 'xen_extra_version'.

2016-04-20 Thread Konrad Rzeszutek Wilk
> >+.PHONY: xsplice > >+xsplice: config.h > >+# Need to have these done in sequential order > >+$(MAKE) -f $(BASEDIR)/Rules.mk xen_hello_world_func.o > >+$(MAKE) -f $(BASEDIR)/Rules.mk xen_hello_world.o > > Why do these two need doing in order? And why can't $(XSPLICE) not just depend

Re: [Xen-devel] [PATCH v8.1 11/27] xsplice: Implement payload loading

2016-04-20 Thread Konrad Rzeszutek Wilk
On Apr 20, 2016 6:05 PM, "Jan Beulich" wrote: > > >>> Konrad Rzeszutek Wilk 04/20/16 6:00 PM >>> > >> >+ size_t pages; /* Total pages for [text,rw,ro]_addr */ > >> > >> Why size_t and not just unsigned int? > > > >Oh. I

Re: [Xen-devel] [PATCH v8.1 14/27] xsplice, symbols: Implement symbol name resolution on address.

2016-04-20 Thread Konrad Rzeszutek Wilk
> >+unsigned long xsplice_symbols_lookup_by_name(const char *symname) > >+{ > >+struct payload *data; > > Do you need symbols other than those marked "new_symbol" past the loading > of the module? If not, wouldn't it be worthwhile to shrink the symbol table > to just > those, likely speeding

Re: [Xen-devel] [PATCH v8.1 12/27] xsplice: Implement support for applying/reverting/replacing patches.

2016-04-20 Thread Konrad Rzeszutek Wilk
> >+static int prepare_payload(struct payload *payload, > >+ struct xsplice_elf *elf) > >+{ > >+const struct xsplice_elf_sec *sec; > >+unsigned int i; > >+struct xsplice_patch_func_internal *f; > > Why is there a second ("internal") variant of this structure n

Re: [Xen-devel] [PATCH v8.1 19/27] xsplice: Add support for alternatives

2016-04-20 Thread Konrad Rzeszutek Wilk
On Wed, Apr 20, 2016 at 12:28:02AM -0600, Jan Beulich wrote: > >>> Konrad Rzeszutek Wilk 04/14/16 12:02 AM >>> > >--- a/xen/arch/x86/Makefile > >+++ b/xen/arch/x86/Makefile > >@@ -6,7 +6,11 @@ subdir-y += mm > >subdir-$(CONFIG_XENOPROF) += o

Re: [Xen-devel] [PATCH v8.1 17/27] xsplice: Add support for bug frames.

2016-04-20 Thread Konrad Rzeszutek Wilk
On Tue, Apr 19, 2016 at 02:17:35PM -0600, Jan Beulich wrote: > >>> Konrad Rzeszutek Wilk 04/14/16 12:02 AM >>> > >+bool_t is_patch(const void *ptr) > >+{ > >+struct payload *data; > > You guess it: const. > > >+/* > >+ *

Re: [Xen-devel] [PATCH v8.1 19/27] xsplice: Add support for alternatives

2016-04-20 Thread Konrad Rzeszutek Wilk
> >--- a/xen/common/xsplice.c > >+++ b/xen/common/xsplice.c > >@@ -533,6 +533,39 @@ static int prepare_payload(struct payload *payload, > >} > > > >#ifndef CONFIG_ARM > >+sec = xsplice_elf_sec_by_name(elf, ".altinstructions"); > >+if ( sec ) > >+{ > >+struct alt_instr *a,

Re: [Xen-devel] [PATCH v8.1 20/27] build_id: Provide ld-embedded build-ids

2016-04-20 Thread Konrad Rzeszutek Wilk
On Wed, Apr 20, 2016 at 01:14:17AM -0600, Jan Beulich wrote: > >>> Konrad Rzeszutek Wilk 04/14/16 12:03 AM >>> > >--- a/Config.mk > >+++ b/Config.mk > >@@ -126,6 +126,17 @@ endef > >check-$(gcc) = $(call cc-ver-check,CC,0x040100,"Xen r

Re: [Xen-devel] [PATCH v8.1 14/27] xsplice, symbols: Implement symbol name resolution on address.

2016-04-21 Thread Konrad Rzeszutek Wilk
> > So I did try that and it all worked nicely on x86. However on ARM32: > > > > arm make -j8 1>1 > > symbols.c: In function 'symbols_lookup_by_name': > > symbols.c:287:20: error: cast to pointer from integer of different size > > [-Werror=int-to-pointer-cast] > > > > 275 uint64_t addr = 0; /*

Re: [Xen-devel] [PATCH v8.1 11/27] xsplice: Implement payload loading

2016-04-21 Thread Konrad Rzeszutek Wilk
On Wed, Apr 20, 2016 at 11:59:34AM -0400, Konrad Rzeszutek Wilk wrote: > > >+void arch_xsplice_free_payload(void *va) > > >+{ > > >+vfree_xen(va); > > >+} > > > > What is the idea behind having this hook (instead of generic code just &

Re: [Xen-devel] [PATCH v8.1 11/27] xsplice: Implement payload loading

2016-04-21 Thread Konrad Rzeszutek Wilk
On April 21, 2016 11:36:24 AM EDT, Jan Beulich wrote: >>>> On 21.04.16 at 17:15, wrote: >> On Wed, Apr 20, 2016 at 11:59:34AM -0400, Konrad Rzeszutek Wilk >wrote: >>> > >@@ -29,6 +30,13 @@ struct payload { >>> > >uint32_t state;

Re: [Xen-devel] [PATCH v8.1 12/27] xsplice: Implement support for applying/reverting/replacing patches.

2016-04-21 Thread Konrad Rzeszutek Wilk
On Thu, Apr 21, 2016 at 12:44:41AM -0600, Jan Beulich wrote: > >>> On 21.04.16 at 02:28, wrote: > >> >+ASSERT(sec); > >> >+if ( sec->sec->sh_size % sizeof(*payload->funcs) ) > >> >+{ > >> >+dprintk(XENLOG_ERR, XSPLICE "%s: Wrong size of > >> >.xsplice.funcs!\n", > >> >+

Re: [Xen-devel] [PATCH v8.1 20/27] build_id: Provide ld-embedded build-ids

2016-04-21 Thread Konrad Rzeszutek Wilk
On Thu, Apr 21, 2016 at 12:59:00AM -0600, Jan Beulich wrote: > >>> On 21.04.16 at 02:33, wrote: > > On Wed, Apr 20, 2016 at 01:14:17AM -0600, Jan Beulich wrote: > >> >>> Konrad Rzeszutek Wilk 04/14/16 12:03 AM >>> > >> >--- a/Config.

Re: [Xen-devel] [PATCH v8.1 17/27] xsplice: Add support for bug frames.

2016-04-22 Thread Konrad Rzeszutek Wilk
On Thu, Apr 21, 2016 at 12:49:09AM -0600, Jan Beulich wrote: > >>> On 21.04.16 at 02:29, wrote: > > On Tue, Apr 19, 2016 at 02:17:35PM -0600, Jan Beulich wrote: > >> >>> Konrad Rzeszutek Wilk 04/14/16 12:02 AM >>> > >> >+bool_t is_patch(

Re: [Xen-devel] [PATCH] committers to be REST maintainers

2016-04-22 Thread Konrad Rzeszutek Wilk
On Thu, Apr 21, 2016 at 01:31:15AM -0600, Jan Beulich wrote: > As proposed on the hackathon. > > Signed-off-by: Jan Beulich > Acked-by: Ian Jackson Acked-by: Konrad Rzeszutek Wilk ___ Xen-devel mailing list Xen-devel@lists.

Re: [Xen-devel] [PATCH v8.1 14/27] xsplice, symbols: Implement symbol name resolution on address.

2016-04-22 Thread Konrad Rzeszutek Wilk
On Fri, Apr 22, 2016 at 04:08:10AM -0600, Jan Beulich wrote: > >>> On 22.04.16 at 10:45, wrote: > > On 04/22/2016 08:51 AM, Jan Beulich wrote: > >>>>> On 22.04.16 at 09:17, wrote: > >>> On 04/21/2016 01:26 AM, Konrad Rzeszutek Wilk wrote: snip &

Re: [Xen-devel] [PATCH v8.1 24/27] xsplice: Stacking build-id dependency checking.

2016-04-22 Thread Konrad Rzeszutek Wilk
On Wed, Apr 20, 2016 at 01:49:41AM -0600, Jan Beulich wrote: > >>> Konrad Rzeszutek Wilk 04/14/16 12:03 AM >>> > >+.PHONY: note.o > >+note.o: > >+$(OBJCOPY) -O binary --only-section=.note.gnu.build-id > >$(BASEDIR)/xen-syms $@.bin > >+

Re: [Xen-devel] [PATCH v8.1 12/27] xsplice: Implement support for applying/reverting/replacing patches.

2016-04-22 Thread Konrad Rzeszutek Wilk
> > Ideas? > > Well, this presumably being a redundant .section directive > somewhere it would require seeing the full .c together with the > intermediate .s in order to tell. But I guess to avoid you spending > more time on this secondary aspect, let's just drop this for now > and just put it on

Re: [Xen-devel] [PATCH v8.1 17/27] xsplice: Add support for bug frames.

2016-04-22 Thread Konrad Rzeszutek Wilk
On Fri, Apr 22, 2016 at 04:28:42AM -0600, Jan Beulich wrote: > >>> On 22.04.16 at 12:10, wrote: > > On Thu, Apr 21, 2016 at 12:49:09AM -0600, Jan Beulich wrote: > >> >>> On 21.04.16 at 02:29, wrote: > >> > On Tue, Apr 19, 2016 at 02:17:35PM -0600,

Re: [Xen-devel] [PATCH v8.1 14/27] xsplice, symbols: Implement symbol name resolution on address.

2016-04-22 Thread Konrad Rzeszutek Wilk
h wrote: > >> >>>>> On 22.04.16 at 09:17, wrote: > >> >>> On 04/21/2016 01:26 AM, Konrad Rzeszutek Wilk wrote: snip > >> >>>>> > >> >>>>>> +static bool_t is_payload_symbol(const struct xsplice_elf > >>

Re: [Xen-devel] [PATCH v8.1 17/27] xsplice: Add support for bug frames.

2016-04-22 Thread Konrad Rzeszutek Wilk
On Fri, Apr 22, 2016 at 04:58:19AM -0600, Jan Beulich wrote: > >>> On 22.04.16 at 12:54, wrote: > > The thing that makes it "safe" (in lieu of your comment about > > re-ordering) is that the trap code does: > > > > 1289 /* WARN, BUG or ASSERT: decode the filename pointer and line > > number.

Re: [Xen-devel] [PATCH v8.1 14/27] xsplice, symbols: Implement symbol name resolution on address.

2016-04-22 Thread Konrad Rzeszutek Wilk
On Fri, Apr 22, 2016 at 12:13:02PM +0100, Ross Lagerwall wrote: > On 04/22/2016 11:08 AM, Jan Beulich wrote: > >>>>On 22.04.16 at 10:45, wrote: > >>On 04/22/2016 08:51 AM, Jan Beulich wrote: > >>>>>>On 22.04.16 at 09:17, wrote: > >>&g

Re: [Xen-devel] [PATCH v8.1 15/27] xsplice, symbols: Implement fast symbol names -> virtual addresses lookup

2016-04-22 Thread Konrad Rzeszutek Wilk
On Tue, Apr 19, 2016 at 01:52:33PM -0600, Jan Beulich wrote: > >>> Konrad Rzeszutek Wilk 04/14/16 12:02 AM >>> > >NEW CODE: > > > >To make that work we add three tables: > > Why three? Two (or a single one with element pairs) ought to be sufficient:

Re: [Xen-devel] [PATCH v8.1 19/27] xsplice: Add support for alternatives

2016-04-22 Thread Konrad Rzeszutek Wilk
> >+return -EINVAL; > >+} > >+ > >+start = sec->load_addr; > >+end = sec->load_addr + sec->sec->sh_size; > >+ > >+for ( a = start; a < end; a++ ) > >+{ > >+unsigned long instr = (unsigned long)(&a->instr_offset + > >a->instr_offset);

Re: [Xen-devel] [PATCH v8.1 20/27] build_id: Provide ld-embedded build-ids

2016-04-22 Thread Konrad Rzeszutek Wilk
On Thu, Apr 21, 2016 at 12:59:00AM -0600, Jan Beulich wrote: > >>> On 21.04.16 at 02:33, wrote: > > On Wed, Apr 20, 2016 at 01:14:17AM -0600, Jan Beulich wrote: > >> >>> Konrad Rzeszutek Wilk 04/14/16 12:03 AM >>> > >> >--- a/Config.

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

2016-04-22 Thread Konrad Rzeszutek Wilk
> Overall I think that all of the cited examples are such which already > don't really lend themselves to live patching. Hence I think we're > going to be fine without these extra two pieces for the initial round, /me nods. > taking into consideration just those cases where live patching is > reas

Re: [Xen-devel] [PATCH v8.1 12/27] xsplice: Implement support for applying/reverting/replacing patches.

2016-04-22 Thread Konrad Rzeszutek Wilk
> >+/* Defines an outstanding patching action. */ > >+struct xsplice_work > >+{ > >+atomic_t semaphore; /* Used for rendezvous. */ > >+atomic_t irq_semaphore; /* Used to signal all IRQs disabled. */ > > Why do you, btw, need two of them? I would seem to me that having just on

Re: [Xen-devel] [PATCH v3] docs/arm64: update the documention for loading XSM support

2016-04-22 Thread Konrad Rzeszutek Wilk
means if the ramdisk module is present and does not have the > + compatible string "multiboot,ramdisk", then it must always be the > + second module. > + > + Note: This XSM Magic detection behavior was introduced by Xen 4.7. in Xen 4.7? Either way - those are re

Re: [Xen-devel] [PATCH v8 02/25] xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op

2016-04-22 Thread Konrad Rzeszutek Wilk
On Wed, Apr 20, 2016 at 02:18:48PM +0100, Ross Lagerwall wrote: > On 04/13/2016 10:09 PM, Konrad Rzeszutek Wilk wrote: > snip > >+static int xsplice_action(xen_sysctl_xsplice_action_t *action) > >+{ > >+struct payload *data; > >+char n[XEN_XSPL

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

2016-04-22 Thread Konrad Rzeszutek Wilk
> > void libxl_bitmap_set(libxl_bitmap *bitmap, int bit) > > { > > if (bit >= bitmap->size * 8) > > return; > > bitmap->map[bit / 8] |= 1 << (bit & 7); > > } > > > > I referenced above code. It just ignore t

Re: [Xen-devel] [PATCH v8.1 14/27] xsplice, symbols: Implement symbol name resolution on address.

2016-04-22 Thread Konrad Rzeszutek Wilk
> As per my earlier reply to Konrad, there must be more to this. I.e. > "normal" local symbols won't get dropped together with relocations > referencing them getting resolved. Correct. These .LCx symbols only cover .rodata.* sections. Any other local symbols: [konrad@x230 x86]$ readelf --symbols

Re: [Xen-devel] [PATCH v8.1 14/27] xsplice, symbols: Implement symbol name resolution on address.

2016-04-24 Thread Konrad Rzeszutek Wilk
On Fri, Apr 22, 2016 at 05:18:16AM -0600, Jan Beulich wrote: > >>> On 22.04.16 at 13:08, wrote: > > On Fri, Apr 22, 2016 at 04:50:34AM -0600, Jan Beulich wrote: > >> >>> On 22.04.16 at 12:28, wrote: > >> > On Fri, Apr 22, 2016 at 04:08:10AM -0600, Jan Beulich wrote: > >> >> >>> On 22.04.16 at 10:

Re: [Xen-devel] [PATCH v8.1 15/27] xsplice, symbols: Implement fast symbol names -> virtual addresses lookup

2016-04-25 Thread Konrad Rzeszutek Wilk
On Mon, Apr 25, 2016 at 02:38:57AM -0600, Jan Beulich wrote: > >>> On 22.04.16 at 17:21, wrote: > > Here is what I came up using your idea. Do you want me to add > > 'Suggested-by' > > Jan on it? > > I'll leave that up to you; it was really just a vague idea that I gave... > > > --- a/xen/arch

[Xen-devel] [PATCH v9 22/27] XENVER_build_id/libxc: Provide ld-embedded build-id

2016-04-25 Thread Konrad Rzeszutek Wilk
If the hypervisor was built with build-ids we can expose the build-id value to the toolstack (if it is not built with it will just return -ENODATA). This is a priviligied operation so only the controlling stack is able to request this. Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Wei Liu

[Xen-devel] [PATCH v9 06/27] xen-xsplice: Tool to manipulate xsplice payloads

2016-04-25 Thread Konrad Rzeszutek Wilk
(load). Also will use the name of the file as the Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Ross Lagerwall Acked-by: Wei Liu --- Cc: Ian Jackson Cc: Stefano Stabellini Cc: Wei Liu v2: - Removed REVERTED state. - Fixed bugs handling XSPLICE_STATUS_PROGRESS. - Split status

[Xen-devel] [PATCH v9 01/27] Revert "libxc/libxl/python/xenstat/ocaml: Use new XEN_VERSION hypercall"

2016-04-25 Thread Konrad Rzeszutek Wilk
This reverts commit d275ec9ca8a86f7c9c213f3551194d471ce90fbd. As we prefer to still utilize the old XENVER_ hypercall. Signed-off-by: Konrad Rzeszutek Wilk Requested-and-acked-by: Jan Beulich --- tools/libxc/include/xenctrl.h | 32 +- tools/libxc/xc_core.c

[Xen-devel] [PATCH v9 20/27] build_id: Provide ld-embedded build-ids

2016-04-25 Thread Konrad Rzeszutek Wilk
incorrect - some of the values it contains would be offset by the size of the included build id. This obviously causes problems when resolving symbols. We also define the NT_GNU_BUILD_ID in the elfstructs.h as we need to use it in various places. Suggested-by: Andrew Cooper Signed-off-by: Marti

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

2016-04-25 Thread Konrad Rzeszutek Wilk
flask/hooks.c| 40 +- xen/xsm/flask/policy/access_vectors | 25 +- 90 files changed, 6399 insertions(+), 718 deletions(-) Andrew Cooper (1): x86/mm: Introduce modify_xen_mappings() Konrad Rzeszutek Wilk (17): Revert "libxc/libxl/python/xe

[Xen-devel] [PATCH v9 10/27] xsplice: Add helper elf routines

2016-04-25 Thread Konrad Rzeszutek Wilk
Rzeszutek Wilk Acked-by: Ian Jackson Reviewed-by: Andrew Cooper --- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan v2: - With the #define ELFSIZE in the ARM file we can use the common #defines instead of using #ifdef CONFIG_ARM_32. Moved to another patch. - Add

[Xen-devel] [PATCH v9 12/27] xsplice: Implement support for applying/reverting/replacing patches.

2016-04-25 Thread Konrad Rzeszutek Wilk
. To prevent a deadlock with any other barrier in the system, the master will wait for up to 30ms before timing out. Measurements found that the patch application to take about 100 μs on a 72 CPU system, whether idle or fully loaded. Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk

[Xen-devel] [PATCH v9 19/27] xsplice: Add support for alternatives

2016-04-25 Thread Konrad Rzeszutek Wilk
. Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper --- Cc: Keir Fraser Cc: Jan Beulich Cc: Andrew Cooper v2: Make a new alternative function that does not ASSERT on IRQs and don't disable IRQs in the code when loading payload. v4: Include test

[Xen-devel] [PATCH v9 23/27] libxl: info: Display build_id of the hypervisor.

2016-04-25 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: 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 instead of the XENVER_

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

2016-04-25 Thread Konrad Rzeszutek Wilk
search has to only use two public APIs: - register_virtual_region - unregister_virtual_region to let the core code know. If the ->lookup_symbol is not then the default internal symbol lookup mechanism is used. Suggested-by: Andrew Cooper Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: An

[Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-25 Thread Konrad Rzeszutek Wilk
EN_VIRT_END] for the code. We also use the "x86/mm: Introduce modify_xen_mappings()" to change the virtual address page-table permissions. Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper Acked-by: Julien Grall --- Cc: Stefano Stabelli

[Xen-devel] [PATCH v9 03/27] xsplice: Design document

2016-04-25 Thread Konrad Rzeszutek Wilk
: Martin Pohlack Jan Beulich Thank you! Input-from: Martin Pohlack Input-from: Jan Beulich Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Ross Lagerwall Acked-by: Ian Jackson --- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan v1-2: review v3: Split document in

[Xen-devel] [PATCH v9 05/27] libxc: Implementation of XEN_XSPLICE_op in libxc

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

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

2016-04-25 Thread Konrad Rzeszutek Wilk
. We also print the dependency and payloads build_in the keyhandler. Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper --- Cc: Keir Fraser Cc: Jan Beulich Cc: Andrew Cooper v3: First time included. v4: Andrew fix against the build_id.o mutilations. Andrew fix to not include

[Xen-devel] [PATCH v9 15/27] xsplice, symbols: Implement fast symbol names -> virtual addresses lookup

2016-04-25 Thread Konrad Rzeszutek Wilk
bols is simplified as we can do a binary search on symbols_sorted_offsets. Since the symbols are sorted it takes on average 13 calls to symbols_expand_symbol. Signed-off-by: Konrad Rzeszutek Wilk --- CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper v8: New - Remove the debug code - Return

[Xen-devel] [PATCH v9 08/27] arm/x86/vmap: Add v[z|m]alloc_xen and vm_init_type

2016-04-25 Thread Konrad Rzeszutek Wilk
e - we will have to expose and vm_alloc_xen variant. Signed-off-by: Konrad Rzeszutek Wilk Suggested-by: Jan Beulich Acked-by: Julien Grall [ARM] Reviewed-by: Andrew Cooper Acked-by: Jan Beulich --- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan Cc: Stefano Stabellini Cc: Ju

[Xen-devel] [PATCH v9 17/27] xsplice: Add support for bug frames.

2016-04-25 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 Review

[Xen-devel] [PATCH v9 13/27] x86/xen_hello_world.xsplice: Test payload for patching 'xen_extra_version'.

2016-04-25 Thread Konrad Rzeszutek Wilk
tra xen_extra : Hello World $xen-xsplice revert xen_hello_world Performing revert: completed $xen-xsplice unload xen_hello_world Performing unload: completed $xl info | grep extra xen_extra : -unstable Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper Acked

[Xen-devel] [PATCH v9 16/27] x86, xsplice: Print payload's symbol name and payload name in backtraces

2016-04-25 Thread Konrad Rzeszutek Wilk
Lagerwall Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper --- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan v2: Add missing full stop. v3: s/module/payload/ v4: Expand comment and include registration of 'virtual_region' Redo the vsprintf handling of

[Xen-devel] [PATCH v9 26/27] xsplice: Prevent duplicate payloads from being loaded.

2016-04-25 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 v9 14/27] xsplice, symbols: Implement symbol name resolution on address.

2016-04-25 Thread Konrad Rzeszutek Wilk
rules for that and for local symbols do what bintutils ld does. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Ross Lagerwall Reviewed-by: Andrew Cooper --- Cc: Keir Fraser Cc: Jan Beulich Cc: Andrew Cooper v1: Ross original version. v2: Include test-case and document update. v2: s/size_t

[Xen-devel] [PATCH v9 04/27] xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op

2016-04-25 Thread Konrad Rzeszutek Wilk
'non-lock' variant. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Ross Lagerwall Reviewed-by: Andrew Cooper Acked-by: Daniel De Graaf --- Cc: Daniel De Graaf Cc: Ian Jackson Cc: Stefano Stabellini Cc: Wei Liu v2: Rebased on keyhandler: rework keyhandler infrastructure v3: F

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

2016-04-25 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 Review

[Xen-devel] [PATCH v9 21/27] xsplice: Print build_id in keyhandler and on bootup.

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

[Xen-devel] [PATCH v9 18/27] xsplice: Add support for exception tables.

2016-04-25 Thread Konrad Rzeszutek Wilk
ve an exception that is handled. To not grow the code-base if xSplice is not compiled in we add certain #define to help in determining if code needs to be __init or not. Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper --- Cc: Keir Fraser Cc: Jan Beulic

[Xen-devel] [PATCH v9 09/27] x86/mm: Introduce modify_xen_mappings()

2016-04-25 Thread Konrad Rzeszutek Wilk
cleanup (and an ideal functional test), the boot logic which remaps Xen's code and data with reduced permissions is altered to use modify_xen_mappings(), rather than map_pages_to_xen() passing the same mfn's back in. Signed-off-by: Andrew Cooper Signed-off-by: Konrad Rzeszutek Wilk R

[Xen-devel] [PATCH v9 02/27] Revert "HYPERCALL_version_op. New hypercall mirroring XENVER_ but sane."

2016-04-25 Thread Konrad Rzeszutek Wilk
This reverts commit 2716d875379d538c1dfccad78a99ca7db2e09f90. As it was decided that the existing XENVER hypercall - while having grown organically over the years can still be expanded. Signed-off-by: Konrad Rzeszutek Wilk --- tools/flask/policy/policy/modules/xen/xen.te | 7 +- xen/arch/arm

[Xen-devel] [PATCH v9 25/27] xsplice/xen_replace_world: Test-case for XSPLICE_ACTION_REPLACE

2016-04-25 Thread Konrad Rzeszutek Wilk
as .xsplice.depends. We also make .old_addr be zero, forcing the hypervisor to lookup the xen_extra_version. Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper --- Cc: Keir Fraser Cc: Jan Beulich Cc: Andrew Cooper v4: New. Make the objcopy use -S to strip the name. v7: Added

Re: [Xen-devel] [PATCH 9] xSplice v1 design and implementation.

2016-04-25 Thread Konrad Rzeszutek Wilk
On Mon, Apr 25, 2016 at 11:41 AM, Jan Beulich wrote: On 25.04.16 at 17:34, wrote: >> Hey! >> >> Changelog: >> v8.1: http://lists.xen.org/archives/html/xen-devel/2016-04/msg01903.html > > Old changelog? > It should have said: "Since v8.1:": Worked on Jan's comments. I could enumerate _all_

Re: [Xen-devel] [for-4.7] xen/arm: Force broadcast of TLB and instruction cache maintenance instructions

2016-04-25 Thread Konrad Rzeszutek Wilk
On Mon, Apr 18, 2016 at 10:29:51AM +0100, Julien Grall wrote: > UP guest usually uses TLB instruction to flush only on the local CPU. The > TLB flush won't be broadcasted across all the CPUs within the same > innershareable domain. > > When the vCPU is migrated between different CPUs, it may be re

Re: [Xen-devel] [Hackathon 16] Notes from Security Session

2016-04-25 Thread Konrad Rzeszutek Wilk
On Tue, Apr 19, 2016 at 10:11:28AM +0100, Andrew Cooper wrote: > On 19/04/16 10:02, Doug Goldstein wrote: > >On 4/18/16 12:20 PM, Lars Kurth wrote: > >>Hi all, CC-ing XSM maintainer :-) > >> > >>I took notes as much as I could. CC'ed the people who participated most. If > >>I missed/misrepresente

Re: [Xen-devel] Outreachy bite-sized tasks

2016-04-25 Thread Konrad Rzeszutek Wilk
On Wed, Apr 20, 2016 at 12:06:48PM +0200, Paulina Szubarczyk wrote: > On Fri, 2016-04-01 at 15:35 +0200, Roger Pau Monné wrote: > > Please don't top post, it breaks the flow of the conversation. > > > > I'm also adding Anthony (one of the QEMU/Xen maintainers). > > On Fri, 1 Apr 2016, Paulina Szub

Re: [Xen-devel] [PATCH] altp2m: Allow the hostp2m to be shared

2016-04-25 Thread Konrad Rzeszutek Wilk
Sadly I only have little nitpicks. Feel free to ignore them. > diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c > index a522423..d5b4b2d 100644 > --- a/xen/arch/x86/mm/mem_sharing.c > +++ b/xen/arch/x86/mm/mem_sharing.c > @@ -35,6 +35,7 @@ > #include > #include > #i

Re: [Xen-devel] [PATCH v9 04/27] xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op

2016-04-26 Thread Konrad Rzeszutek Wilk
> > components are implemented. > > > > Also by default it is disabled until the implementation > > is in place. > > > > We also use recursive spinlocks to so that the find_payload > > function does not need to have a 'lock' and 'non-lock&#

Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-26 Thread Konrad Rzeszutek Wilk
> > +static int move_payload(struct payload *payload, struct xsplice_elf *elf) > > +{ .. snip.. > > +/* Compute size of different regions. */ > > +for ( i = 1; i < elf->hdr->e_shnum; i++ ) > > +{ > > +if ( (elf->sec[i].sec->sh_flags & (SHF_ALLOC|SHF_EXECINSTR)) == > > +

Re: [Xen-devel] [PATCH v9 10/27] xsplice: Add helper elf routines

2016-04-26 Thread Konrad Rzeszutek Wilk
> > +static int xsplice_header_check(const struct xsplice_elf *elf) > > +{ > > +const Elf_Ehdr *hdr = elf->hdr; > > + > > +if ( sizeof(*elf->hdr) > elf->len ) > > +{ > > +dprintk(XENLOG_ERR, XSPLICE "%s: Section header is bigger than > > payload!\n", > > +elf->n

Re: [Xen-devel] [PATCH v9 08/27] arm/x86/vmap: Add v[z|m]alloc_xen and vm_init_type

2016-04-26 Thread Konrad Rzeszutek Wilk
e one: From 1c133365d98a02c8f5131cdcde11960623fa247a Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Tue, 26 Apr 2016 14:03:06 -0400 Subject: [PATCH] arm/x86/vmap: Add v[z|m]alloc_xen and vm_init_type For those users who want to use the virtual addresses that are in the hypervisor's code/data region address sp

Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-26 Thread Konrad Rzeszutek Wilk
o use the "x86/mm: Introduce modify_xen_mappings()" to change the virtual address page-table permissions. Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Keir Fraser Cc: Jan Beulich Cc: An

Re: [Xen-devel] [PATCH v9 16/27] x86, xsplice: Print payload's symbol name and payload name in backtraces

2016-04-26 Thread Konrad Rzeszutek Wilk
ent. This gets us: Xen call trace: [] revert_hook+0x31/0x35 [xen_hello_world] [] xsplice.c#revert_payload+0x86/0xc6 [] check_for_xsplice_work+0x233/0x3cd [] domain.c#continue_idle_domain+0x9/0x1f Which is great if payloads have similar or same symbol names. Signed-off-by: Ross Lagerwall

Re: [Xen-devel] [PATCH v9 12/27] xsplice: Implement support for applying/reverting/replacing patches.

2016-04-26 Thread Konrad Rzeszutek Wilk
e first arch-specific number of bytes of the old function (again, 5 bytes on x86). - REPLACE: Revert each applied module and then apply the new module. To prevent a deadlock with any other barrier in the system, the master will wait for up to 30ms before timing out. Measurements found that the

Re: [Xen-devel] [PATCH v9 10/27] xsplice: Add helper elf routines

2016-04-26 Thread Konrad Rzeszutek Wilk
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 right now this suffices. Also we a whole lot of checks to make

Re: [Xen-devel] How to install Xen on Fedora 23?

2016-04-26 Thread Konrad Rzeszutek Wilk
On Tue, Apr 26, 2016 at 03:00:21PM +, Jason Long wrote: > Hello. > I installed Fedora 23 x64 on my PC and id below command for installing Xen : > > # cd /etc/yum.repos.d/ > # wget http://fedorapeople.org/groups/virt/...t-preview.repo Why? No need for that. > # yum update > # yum -y install xe

Re: [Xen-devel] [PATCH v9 08/27] arm/x86/vmap: Add v[z|m]alloc_xen and vm_init_type

2016-04-27 Thread Konrad Rzeszutek Wilk
VMAP_DEFAULT); > > +} > > + > > +void *vzalloc_xen(size_t size) > > +{ > > +return vzalloc_type(size, VMAP_XEN); > > +} > > I didn't look at your replies to the later patches yet, but considering > my reply to the one using vzalloc_xen() I wo

Re: [Xen-devel] [PATCH v9 04/27] xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op

2016-04-27 Thread Konrad Rzeszutek Wilk
>> > Also by default it is disabled until the implementation > >> > is in place. > >> > > >> > We also use recursive spinlocks to so that the find_payload > >> > function does not need to have a 'lock' and 'non-lock' vari

Re: [Xen-devel] [PATCH v9 10/27] xsplice: Add helper elf routines

2016-04-27 Thread Konrad Rzeszutek Wilk
On Wed, Apr 27, 2016 at 01:27:05AM -0600, Jan Beulich wrote: > >>> On 27.04.16 at 03:59, wrote: > >> > +static int xsplice_header_check(const struct xsplice_elf *elf) > >> > +{ > >> > +const Elf_Ehdr *hdr = elf->hdr; > >> > + > >> > +if ( sizeof(*elf->hdr) > elf->len ) > >> > +{ > >> >

Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-27 Thread Konrad Rzeszutek Wilk
pe == SHT_NOBITS) ) > > +{ > > +dprintk(XENLOG_DEBUG, XSPLICE "%s: Not supporting %s > > section!\n", > > +elf->name, elf->sec[i].name); > > +rc = -EOPNOTSUPP; > > +goto out; >

Re: [Xen-devel] [PATCH v9 24/27] xsplice: Stacking build-id dependency checking.

2016-04-27 Thread Konrad Rzeszutek Wilk
turn -ENODATA;; > > > > -/* Check if we really have a build-id. */ > > -if ( NT_GNU_BUILD_ID != n->type ) > > -return -ENODATA; > > +sz = (size_t)__note_gnu_build_id_end - (size_t)n; > > So let's hope sizeof(void *) == sizeof(size_t) (or else this would yield &g

Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-27 Thread Konrad Rzeszutek Wilk
irt_end, XEN_VIRT_END] for the code. We also use the "x86/mm: Introduce modify_xen_mappings()" to change the virtual address page-table permissions. Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc: Julien Grall Cc:

Re: [Xen-devel] [PATCH v9 10/27] xsplice: Add helper elf routines

2016-04-27 Thread Konrad Rzeszutek Wilk
but for right now this suffices. Also we a whole lot of checks to make sure that the ELF payload file is not corrupted nor that the offsets point past the file. For most of the checks we print an message if the hypervisor is built with debug enabled. Signed-off-by: Ross Lagerwall Signed-off-by:

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

2016-04-27 Thread Konrad Rzeszutek Wilk
search has to only use two public APIs: - register_virtual_region - unregister_virtual_region to let the core code know. If the ->lookup_symbol is not then the default internal symbol lookup mechanism is used. Suggested-by: Andrew Cooper Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: An

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

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

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

2016-04-27 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 Review

[Xen-devel] [PATCH v10 20/24] libxl: info: Display build_id of the hypervisor.

2016-04-27 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: 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 instead of the XENVER_

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

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

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

2016-04-27 Thread Konrad Rzeszutek Wilk
: Martin Pohlack Jan Beulich Thank you! Input-from: Martin Pohlack Input-from: Jan Beulich Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Ross Lagerwall Acked-by: Ian Jackson --- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan v1-2: review v3: Split document in

[Xen-devel] [PATCH v10 07/24] xsplice: Add helper elf routines

2016-04-27 Thread Konrad Rzeszutek Wilk
Rzeszutek Wilk Acked-by: Ian Jackson --- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan v2: - With the #define ELFSIZE in the ARM file we can use the common #defines instead of using #ifdef CONFIG_ARM_32. Moved to another patch. - Add checks for ELF file

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

2016-04-27 Thread Konrad Rzeszutek Wilk
Lagerwall Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper Reviewed-by: Jan Beulich --- Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan v2: Add missing full stop. v3: s/module/payload/ v4: Expand comment and include registration of 'virtual_region'

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

2016-04-27 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 Review

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

2016-04-27 Thread Konrad Rzeszutek Wilk
. We also print the dependency and payloads build_in the keyhandler. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Keir Fraser Cc: Jan Beulich Cc: Andrew Cooper v3: First time included. v4: Andrew fix against the build_id.o mutilations. Andrew fix to not include extra symbols in binary.id

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

2016-04-27 Thread Konrad Rzeszutek Wilk
ve an exception that is handled. To not grow the code-base if xSplice is not compiled in we add certain #define to help in determining if code needs to be __init or not. Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper Reviewed-by: Jan Beulich --- Cc:

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

2016-04-27 Thread Konrad Rzeszutek Wilk
as .xsplice.depends. We also make .old_addr be zero, forcing the hypervisor to lookup the xen_extra_version. Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper --- Cc: Keir Fraser Cc: Jan Beulich Cc: Andrew Cooper v4: New. Make the objcopy use -S to strip the name. v7: Added

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

2016-04-27 Thread Konrad Rzeszutek Wilk
2-bits - which means that ELF relocations would truncate the 34 and 33th bit. Hence this alternate API. We also add add extra checks in case the b) range has not been initialized. Part of this patch also removes 'vm_alloc' and 'vm_free' decleration as we do not have any users

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

2016-04-27 Thread Konrad Rzeszutek Wilk
From: Ross Lagerwall Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper Reviewed-by: Jan Beulich --- 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

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

2016-04-27 Thread Konrad Rzeszutek Wilk
. Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Andrew Cooper Reviewed-by: Jan Beulich --- Cc: Keir Fraser Cc: Jan Beulich Cc: Andrew Cooper v2: Make a new alternative function that does not ASSERT on IRQs and don't disable IRQs in the code when lo

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

2016-04-27 Thread Konrad Rzeszutek Wilk
. To prevent a deadlock with any other barrier in the system, the master will wait for up to 30ms before timing out. Measurements found that the patch application to take about 100 μs on a 72 CPU system, whether idle or fully loaded. Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk

[Xen-devel] [PATCH v10 19/24] XENVER_build_id/libxc: Provide ld-embedded build-id

2016-04-27 Thread Konrad Rzeszutek Wilk
If the hypervisor was built with build-ids we can expose the build-id value to the toolstack (if it is not built with it will just return -ENODATA). This is a priviligied operation so only the controlling stack is able to request this. Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Wei Liu

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

2016-04-27 Thread Konrad Rzeszutek Wilk
incorrect - some of the values it contains would be offset by the size of the included build id. This obviously causes problems when resolving symbols. We also define the NT_GNU_BUILD_ID in the elfstructs.h as we need to use it in various places. Suggested-by: Andrew Cooper Signed-off-by: Marti

<    1   2   3   4   5   6   7   8   9   10   >