Re: [Xen-devel] [PATCH] x86: drop pointless uses of __func__ / __FUNCTION__

2016-08-24 Thread Konrad Rzeszutek Wilk
On Wed, Aug 24, 2016 at 02:02:51AM -0600, Jan Beulich wrote: > Non-debugging message text should be (and is in the cases here) > distinguishable without also logging function names. Debugging message > text, otoh, already includes file name and line number, so also > logging function names is redun

Re: [Xen-devel] [PATCH] x86/mm: drop pointless use of __FUNCTION__

2016-08-24 Thread Konrad Rzeszutek Wilk
On Wed, Aug 24, 2016 at 02:01:09AM -0600, Jan Beulich wrote: > Non-debugging message text should be (and is here) distinguishable > without also logging function names. Reviewed-by: Konrad Rzeszutek Wilk > > Signed-off-by: Jan Beulich > > --- a/xen/arch/x86/mm/paging.c &g

Re: [Xen-devel] [PATCH] x86: correct PT_NOTE file position

2016-08-24 Thread Konrad Rzeszutek Wilk
> Signed-off-by: Jan Beulich Reviewed-by: Konrad Rzeszutek Wilk > > --- a/xen/arch/x86/boot/mkelf32.c > +++ b/xen/arch/x86/boot/mkelf32.c > @@ -394,7 +394,7 @@ int main(int argc, char **argv) > note_phdr.p_paddr = note_base; > note_phdr.p_filesz = note_s

[Xen-devel] [PATCH v2 14/20] livepatch: ARM 32|64: Ignore mapping symbols: $[d, a, x, t]

2016-08-25 Thread Konrad Rzeszutek Wilk
Those symbols are used to help final linkers to replace insn. The ARM ELF specification mandates that they are present to denote the start of certain CPU features. There are two variants of it - short and long format. Either way - we can ignore these symbols. Signed-off-by: Konrad Rzeszutek Wilk

[Xen-devel] [PATCH v2 03/20] x86/arm64: Expose the ALT_[ORIG|REPL]_PTR macros to header files.

2016-08-25 Thread Konrad Rzeszutek Wilk
That way common code can use the same macro to access the most common attributes without much #ifdef. Take advantage of it right away in the livepatch code. Note: on ARM we use tabs to conform to the style of the file. Acked-by: Jan Beulich Signed-off-by: Konrad Rzeszutek Wilk --- Cc

[Xen-devel] [PATCH v2 15/20] livepatch: Move test-cases to common

2016-08-25 Thread Konrad Rzeszutek Wilk
So they can be shared with ARM64 (but not yet, so they are only built on x86). No functional change. We also need to tweak the MAINTAINERS and .gitignore file Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Jan Beulich Cc: Andrew Cooper v1: First

[Xen-devel] [PATCH v2 04/20] alternatives: x86 rename and change parameters on ARM

2016-08-25 Thread Konrad Rzeszutek Wilk
tr *' instead of void pointer and size length. We also add 'const' and make the arguments be on the proper offset. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Andrew Cooper Cc: Jan Beulich v1: First submission. v2: Squash apply_alterna

[Xen-devel] [PATCH v2 20/20] livepatch: ARM32 support.

2016-08-25 Thread Konrad Rzeszutek Wilk
tests: Make them compile under ARM64" put in the right infrastructure for it and we piggyback on it. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Julien Grall Cc: Stefano Stabellini v2: First submission. --- xen/arch/arm/arm32/livepatch.c | 252 -

[Xen-devel] [PATCH v2 06/20] arm/alternative: Use _start instead of _stext

2016-08-25 Thread Konrad Rzeszutek Wilk
The code uses a mix of _start, _stext, and _etext. Lets unify it and use the same 'style'. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Julien Grall Cc: Stefano Stabellini v2: First submission --- xen/arch/arm/alternative.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[Xen-devel] [PATCH v2 02/20] x86/arm: Make 'make debug' work properly.

2016-08-25 Thread Konrad Rzeszutek Wilk
When doing cross-compilation we should use proper $(OBJDUMP). Otherwise decompiling say ARM 32 code using x86 objdump won't help much. Acked-by: Jan Beulich Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Stefano Stabellini Cc: Julien Grall v1:

[Xen-devel] [PATCH v2 09/20] arm/mm: Introduce modify_xen_mappings

2016-08-25 Thread Konrad Rzeszutek Wilk
also .ro to be set to 1. We introduce a new 'flags' where various bits determine whether .ro and .nx bits are set or cleared. We can't use an enum as the function prototype would diverge from x86. Signed-off-by: Konrad Rzeszutek Wilk -- Cc: Ross Lagerwall Cc: Stefano Stabellini C

[Xen-devel] [PATCH v2 19/20] livepatch/elf: Adjust section aligment to word

2016-08-25 Thread Konrad Rzeszutek Wilk
alignments for .bug.frame, .livepatch.depends, ,.rodata.str1, and .strtab are 1 unless we: - Provide our own linker script file. - Piggyback on Xen's (but that means lots of #ifdefery) - Throw an error and refuse the payload Or just fix it up. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Julien

[Xen-devel] [PATCH v2 11/20] arm/arm64: Update comment about VA layout.

2016-08-25 Thread Konrad Rzeszutek Wilk
It was missing 2MB. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Stefano Stabellini Cc: Julien Grall v2: First submission. Spun of from 'livepatch: Initial ARM64 support." --- xen/include/asm-arm/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/i

[Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-08-25 Thread Konrad Rzeszutek Wilk
d arm32 platform specific livepatch file. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Ross Lagerwall Cc: Stefano Stabellini Cc: Julien Grall Cc Jan Beulich Cc: Andrew Cooper RFC: Wholy cow! It works! v1: Finished the various TODOs and reviews outlined by Julien in RFC. v2: Call che

[Xen-devel] [PATCH v2 16/20] livepatch: tests: Make them compile under ARM64

2016-08-25 Thread Konrad Rzeszutek Wilk
exceptions under ARM (but there are under ARM 64). Also use one of the first config options for the CPU field feature. We are not yet attempting to build them under ARM32 so that is still ifdefed out. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian

[Xen-devel] [PATCH v2 07/20] arm/x86: Add ALTERNATIVE and HAS_EX_TABLE

2016-08-25 Thread Konrad Rzeszutek Wilk
: Konrad Rzeszutek Wilk --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Jan Beulich Cc: Andrew Cooper Cc: Doug Goldstein v2: First submission --- xen/arch/x86/Kconfig | 8 xen/common/livepatch.c | 5 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86

[Xen-devel] [PATCH v2] Livepatch for ARM 64 and 32.

2016-08-25 Thread Konrad Rzeszutek Wilk
.c | 0 .../test => test/livepatch}/xen_hello_world_func.c | 8 +- .../test => test/livepatch}/xen_replace_world.c| 0 .../livepatch}/xen_replace_world_func.c| 0 41 files changed, 1139 insertions(+), 122 deletions(-) Konrad Rzeszutek Wilk (20): livepatch: Bubble up sani

[Xen-devel] [PATCH v2 01/20] livepatch: Bubble up sanity checks on Elf relocs

2016-08-25 Thread Konrad Rzeszutek Wilk
onrad Rzeszutek Wilk --- Cc: Konrad Rzeszutek Wilk Cc: Ross Lagerwall Cc: Andrew Cooper v1: First submission v2: Mirror checks for SHT_REL case. --- xen/arch/x86/livepatch.c | 12 xen/common/livepatch_elf.c | 17 + 2 files changed, 17 insertions(+), 12 deletions(-)

[Xen-devel] [PATCH v2 08/20] x86: change modify_xen_mappings to return error

2016-08-25 Thread Konrad Rzeszutek Wilk
The implementation on x86 always returns zero, but other platforms may return error values. Suggested-by: Julien Grall Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Jan Beulich Cc: Andrew Cooper v2: First submission --- xen/arch/x86/livepatch.c | 4

[Xen-devel] [PATCH v2 10/20] arm64/insn: introduce aarch64_insn_gen_{nop|branch_imm}() helper functions

2016-08-25 Thread Konrad Rzeszutek Wilk
t function. Also allows us to NOP the callsites. This lays the groundwork for Livepatch to generate the trampoline to jump to the new replacement function. And also to NOP insns. Signed-off-by: Konrad Rzeszutek Wilk -- Cc: Ross Lagerwall Cc: Stefano Stabellini Cc: Julien Grall RFC: First submissi

[Xen-devel] [PATCH v2 12/20] x86, arm: Change arch_livepatch_quiesce() decleration.

2016-08-25 Thread Konrad Rzeszutek Wilk
On ARM we need an alternative VA region to poke in the hypervisor .text data. And since this is setup during runtime we may fail (it uses vmap so most likely error is ENOMEM). As such this error needs to be bubbled up and also abort the livepatching if it occurs. Signed-off-by: Konrad Rzeszutek

[Xen-devel] [PATCH v2 05/20] arm64/alternatives: Make it possible to patch outside of hypervisor.

2016-08-25 Thread Konrad Rzeszutek Wilk
With livepatching the alternatives that should be patched are outside the Xen hypervisor _start -> _end. As such having to use an alternative VA is not neccessary. In fact we can use the ones that the caller provided us with. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Stefano Stabellini

[Xen-devel] [PATCH v2 2/5] tasklet: Add cross CPU feeding of per-cpu tasklets.

2016-08-25 Thread Konrad Rzeszutek Wilk
these parts split out. Signed-off-by: Konrad Rzeszutek Wilk --- RFC: First version v1: Posted, folks asked if ticketlocks fixed it. v2: Intel confirmed at XPDS 2016 that the problem is still present with large guests. Cc: Jan Beulich Cc: Andrew Cooper Cc: "Lan, Tianyu" Cc: Ke

[Xen-devel] [PATCH v2 3/5] tasklet: Remove the old-softirq implementation.

2016-08-25 Thread Konrad Rzeszutek Wilk
ld be an easier aid in understanding the code with these parts split out. Signed-off-by: Konrad Rzeszutek Wilk --- RFC: First version v1: Posted, folks asked if ticketlocks fixed it. v2: Intel confirmed at XPDS 2016 that the problem is still present with large guests. Cc: Jan Beulich Cc: Andr

[Xen-devel] [PATCH v2] Convert tasklet to per-cpu tasklet.

2016-08-25 Thread Konrad Rzeszutek Wilk
+- xen/include/xen/tasklet.h | 52 +++- 2 files changed, 271 insertions(+), 86 deletions(-) Konrad Rzeszutek Wilk (5): tasklet: Introduce per-cpu tasklet for softirq. tasklet: Add cross CPU feeding of per-cpu tasklets. tasklet: Remove the old-softirq implementation

[Xen-devel] [PATCH v2 5/5] tasklet: Remove the scaffolding.

2016-08-25 Thread Konrad Rzeszutek Wilk
st of this is code deletion and code motion. No new functionality is added. Signed-off-by: Konrad Rzeszutek Wilk --- RFC: First version v1: Posted, folks asked if ticketlocks fixed it. v2: Intel confirmed at XPDS 2016 that the problem is still present with large guests. Cc: Jan Beulich Cc: And

[Xen-devel] [PATCH v2 4/5] tasklet: Introduce per-cpu tasklet for schedule tasklet.

2016-08-25 Thread Konrad Rzeszutek Wilk
name for its per-cpu list ("tasklet_vec"). It also removes the old implementation in one swoop. Signed-off-by: Konrad Rzeszutek Wilk --- RFC: First version v1: Posted, folks asked if ticketlocks fixed it. v2: Intel confirmed at XPDS 2016 that the problem is still present with larg

[Xen-devel] [PATCH v2 1/5] tasklet: Introduce per-cpu tasklet for softirq.

2016-08-25 Thread Konrad Rzeszutek Wilk
RCPU' which is can co-exist with the TASKLET_SOFTIRQ. It will be replaced in 'tasklet: Remove the old-softirq implementation." Signed-off-by: Konrad Rzeszutek Wilk --- RFC: First version v1: Posted, folks asked if ticketlocks fixed it. v2: Intel confirmed at XPDS 2016 tha

Re: [Xen-devel] linux-4.7.* under xen-4.6.* gives "unhandled page fault (ec=0000)" at boot. -- Root cause found.

2016-08-29 Thread Konrad Rzeszutek Wilk
On Mon, Aug 29, 2016 at 05:04:05AM -0600, Jan Beulich wrote: > >>> On 29.08.16 at 01:14, wrote: > > First of all - please don't cross post. > > > Den 17. aug. 2016 21:56, I wrote (to xen-users, as I am no developer): > >> I'm on gentoo, running gentoo-sources kernel for dom0. > >> > >> I am unab

Re: [Xen-devel] [PATCH] xen/HVM: Add guarding logic for VMX specific code

2016-08-29 Thread Konrad Rzeszutek Wilk
hvm_domain.vmx sturcture. structure. > > Signed-off-by: Suravee Suthikulpanit Reviewed-by: Konrad Rzeszutek Wilk > Cc: Wei Liu > Cc: Jan Beulich > --- > Note: I ran into an issue while working on the upcoming patch series for > AMD Advance Virtual Interrupt Controller p

Re: [Xen-devel] [PATCH 2/4] arm64: use "b" to branch to start_xen

2016-08-30 Thread Konrad Rzeszutek Wilk
xen' defined in > .init.text section in prelink.o > > Use "b" instead. > > Signed-off-by: Wei Liu > --- > Compile test only. Reviewed-by: Konrad Rzeszutek Wilk > > Cc: Stefano Stabellini > Cc: Julien Grall > --- > xen/arch/arm/arm64/head.S | 4

Re: [Xen-devel] Xen 4.8 Development Update

2016-08-31 Thread Konrad Rzeszutek Wilk
> * Per-cpu tasklet > - Konrad Rzeszutek Wilk Waiting for review and hopefully test results from Intel. > === ARM === > > * Livepatching > - Konrad Rzeszutek Wilk Need review from Stefano & Julien. ___ Xen-devel

Re: [Xen-devel] [PATCH v2] Livepatch for ARM 64 and 32.

2016-08-31 Thread Konrad Rzeszutek Wilk
On Wed, Aug 31, 2016 at 03:49:55PM +0100, Julien Grall wrote: > On 25/08/16 14:37, Konrad Rzeszutek Wilk wrote: > > Hey! > > Hi Konrad, > > > Since v1 (and RFC): > > [https://lists.xen.org/archives/html/xen-devel/2016-08/msg01835.html] > > - Acted on m

Re: [Xen-devel] [PATCH 2/2] xen_platform: SUSE xenlinux unplug for emulated PCI

2016-09-01 Thread Konrad Rzeszutek Wilk
On Thu, Sep 01, 2016 at 02:11:31PM +0200, Olaf Hering wrote: > Implement SUSE specific unplug protocol for emulated PCI devices > in PVonHVM guests. Its a simple 'outl(1, (ioaddr + 4));'. > This protocol was implemented and used since Xen 3.0.4. > It is used in all SUSE/SLES/openSUSE releases up to

Re: [Xen-devel] [PATCH] acpi: Re-license ACPI builder files from GPLv2 to LGPLv2.1

2016-09-02 Thread Konrad Rzeszutek Wilk
sources in ACPI > >> > bulder directory to the Lesser GNU Public License (LGPL) > >> > version 2.1 > >> > > >> > Signed-off-by: Boris Ostrovsky > >> > CC: Kouya Shimura > >> > CC: Daniel Kiper > >> > CC: Stefan Ber

Re: [Xen-devel] Xen 4.8 Development Update

2016-09-06 Thread Konrad Rzeszutek Wilk
On Mon, Sep 05, 2016 at 05:47:54PM +0200, Dario Faggioli wrote: > On Wed, 2016-08-31 at 10:21 -0400, Konrad Rzeszutek Wilk wrote: > > > > > > *  Per-cpu tasklet > > >   -  Konrad Rzeszutek Wilk > > Waiting for review and hopefully test results from Intel. >

Re: [Xen-devel] xen/xen vs xen/kvm nesting with pv drivers

2016-09-06 Thread Konrad Rzeszutek Wilk
On Tue, Sep 06, 2016 at 03:36:28PM +0100, Andrew Cooper wrote: > On 06/09/16 14:32, Anthony Wright wrote: > > On 06/09/2016 14:05, Andrew Cooper wrote: > >> On 06/09/16 13:47, Anthony Wright wrote: > >>> I tried to install Xen (4.7.0 with linux 4.7.2 Dom0) on an AWS virtual > >>> machine and it fa

Re: [Xen-devel] [PATCH] docs: document old SUSE/Novell unplug for HVM

2016-09-06 Thread Konrad Rzeszutek Wilk
On Fri, Sep 02, 2016 at 11:32:55AM +0200, Olaf Hering wrote: > Signed-off-by: Olaf Hering Reviewed-by: Konrad Rzeszutek Wilk And if nobody complains I will commit it in 'staging' in a day or so. P.S. I couldn't actually find it - but is there an spec for what the BARs in th

Re: [Xen-devel] [PATCH v4 1/9] livepatch: Clear .bss when payload is reverted

2016-09-06 Thread Konrad Rzeszutek Wilk
On Wed, Aug 24, 2016 at 02:55:21AM -0600, Jan Beulich wrote: > >>> On 24.08.16 at 04:22, wrote: > > --- a/xen/common/livepatch.c > > +++ b/xen/common/livepatch.c > > @@ -70,6 +70,9 @@ struct payload { > > unsigned int nsyms; /* Nr of entries in .strtab and > > symbols. */ >

Re: [Xen-devel] [PATCH v4 1/9] livepatch: Clear .bss when payload is reverted

2016-09-06 Thread Konrad Rzeszutek Wilk
11ff40fa7bb5fdcc69a58d0fec49c904ffca4793 "xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op" caps the size of the binary at 2MB. We follow that in capping the size of the .BSSes to be at maximum 2MB. Signed-off-by: Konrad Rzeszutek Wilk --- xen/common/livepatch_elf.c | 11 +

Re: [Xen-devel] [PATCH v4 4/9] version: Print build-id at bootup.

2016-09-06 Thread Konrad Rzeszutek Wilk
gt; > Therefore this patch moves the logic of printing the build-id > > to version.c. > > > > Signed-off-by: Konrad Rzeszutek Wilk > > Reviewed-by: Jan Beulich Thank you. I had a slight change due to rebasing on "x86/EFI: use less cr

Re: [Xen-devel] [PATCH v2 01/20] livepatch: Bubble up sanity checks on Elf relocs

2016-09-06 Thread Konrad Rzeszutek Wilk
On Thu, Aug 25, 2016 at 09:37:16AM -0400, Konrad Rzeszutek Wilk wrote: > The checks for SHT_REL[,A] ELF sanity checks does not need to > be in the platform specific file and can be bubbled up > in the platform agnostic file. > > This makes the ARM 32/64 implementation easier as

Re: [Xen-devel] [PATCH v2 15/20] livepatch: Move test-cases to common

2016-09-06 Thread Konrad Rzeszutek Wilk
MAINTAINERS and .gitignore file > > > > Signed-off-by: Konrad Rzeszutek Wilk > > for whichever parts it's relevant > Acked-by: Jan Beulich Thank you! > with one adjustment request: > > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @

Re: [Xen-devel] [PATCH v2 15/20] livepatch: Move test-cases to common

2016-09-06 Thread Konrad Rzeszutek Wilk
On Thu, Aug 25, 2016 at 09:37:30AM -0400, Konrad Rzeszutek Wilk wrote: > So they can be shared with ARM64 (but not yet, so they > are only built on x86). > > No functional change. > > We also need to tweak the MAINTAINERS and .gitignore file > > Signed-off-by: Konr

Re: [Xen-devel] [PATCH v4 9/9] livepach: Add .livepatch.hooks functions and test-case

2016-09-06 Thread Konrad Rzeszutek Wilk
On Tue, Aug 23, 2016 at 10:22:12PM -0400, Konrad Rzeszutek Wilk wrote: > From: Ross Lagerwall > > Add hook functions which run during patch apply and patch revert. > Hook functions are used by livepatch payloads to manipulate data > structures during patching, etc. > > One

Re: [Xen-devel] xen/xen vs xen/kvm nesting with pv drivers

2016-09-06 Thread Konrad Rzeszutek Wilk
. snip.. > > >> It would be lovely if someone would work on this, but it is a very large > > >> swamp. > > >> > > >> ~Andrew > > > Does the L1's Dom0 have to issue the hypercalls directly? Would it be > > > possible to get the L1's Dom0 to issue the request to the L1 hypervisor > > > and that to ca

Re: [Xen-devel] [PATCH v2 14/20] livepatch: ARM 32|64: Ignore mapping symbols: $[d, a, x, t]

2016-09-06 Thread Konrad Rzeszutek Wilk
ound within the payload will abort loading of it. Something like this (compile tested on x86 for right now): From e513d9d2e689870ab5b381a7a6d7d3ad24a517e5 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Tue, 6 Sep 2016 14:52:21 -0400 Subject: [PATCH] livepatch/arm/x86: Check payload for for unwelcomed

Re: [Xen-devel] [PATCH] xen/arm: alternative: Make it possible to patch outside of the hypervisor

2016-09-06 Thread Konrad Rzeszutek Wilk
directly the Xen binary is the function > __apply_alternatives_multi_stop. The other caller apply_alternatives > will work on the payload which will still have read-write access at that > time. > > Signed-off-by: Julien Grall > > --- > Cc: Konrad Rzeszutek Wilk > > This is an alter

Re: [Xen-devel] [PATCH v2 18/20] xen/arm32/livepatch: Add BPICALLIS to helper to invalidate all instruction caches

2016-09-06 Thread Konrad Rzeszutek Wilk
On Thu, Sep 01, 2016 at 04:13:30PM +0100, Julien Grall wrote: > Hi Konrad, > > On 25/08/16 14:37, Konrad Rzeszutek Wilk wrote: > > When we are flushing the cache we are most likley also want > > to flush the branch predictor too. Hence add this. > > I think it makes mo

Re: [Xen-devel] [PATCH v4 6/9] livepatch: Add parsing for the symbol+0x

2016-09-06 Thread Konrad Rzeszutek Wilk
On Wed, Aug 24, 2016 at 03:08:01AM -0600, Jan Beulich wrote: > >>> On 24.08.16 at 04:22, wrote: > > --- a/xen/common/livepatch.c > > +++ b/xen/common/livepatch.c > > @@ -237,13 +237,34 @@ static const char *livepatch_symbols_lookup(unsigned > > long addr, > > static int resolve_old_address(struc

Re: [Xen-devel] [PATCH v4 7/9] livepatch: NOP if func->new_[addr] is zero.

2016-09-06 Thread Konrad Rzeszutek Wilk
On Wed, Aug 24, 2016 at 03:13:18AM -0600, Jan Beulich wrote: > >>> On 24.08.16 at 04:22, wrote: > > The NOP functionality will NOP any of the code at > > the 'old_addr' or at 'name' if the 'new_addr' is zero. > > The purpose of this is to NOP out calls, such as: > > > > e8 <4-bytes-offset> > >

Re: [Xen-devel] [PATCH v2 07/20] arm/x86: Add ALTERNATIVE and HAS_EX_TABLE

2016-09-06 Thread Konrad Rzeszutek Wilk
On Thu, Aug 25, 2016 at 08:54:51AM -0600, Jan Beulich wrote: > >>> On 25.08.16 at 15:37, wrote: > > @@ -22,6 +24,12 @@ config X86 > > select NUMA > > select VGA > > > > +config ALTERNATIVE > > + bool > > + > > +config HAS_EX_TABLE > > + bool > > These need to move out of arch/x86/,

Re: [Xen-devel] [PATCH v2 07/20] arm/x86: Add ALTERNATIVE and HAS_EX_TABLE

2016-09-06 Thread Konrad Rzeszutek Wilk
On Thu, Aug 25, 2016 at 08:56:07AM -0600, Jan Beulich wrote: > >>> On 25.08.16 at 15:58, wrote: > > On 25/08/16 14:37, Konrad Rzeszutek Wilk wrote: > > > >> x86 implements all of them by default - and we just > >> add two extra CONFIG_ variables to b

Re: [Xen-devel] [PATCH v2 07/20] arm/x86: Add ALTERNATIVE and HAS_EX_TABLE

2016-09-06 Thread Konrad Rzeszutek Wilk
On Tue, Sep 06, 2016 at 04:36:40PM -0400, Konrad Rzeszutek Wilk wrote: > On Thu, Aug 25, 2016 at 08:56:07AM -0600, Jan Beulich wrote: > > >>> On 25.08.16 at 15:58, wrote: > > > On 25/08/16 14:37, Konrad Rzeszutek Wilk wrote: > > > > > >> x86

Re: [Xen-devel] [PATCH v2 19/20] livepatch/elf: Adjust section aligment to word

2016-09-06 Thread Konrad Rzeszutek Wilk
On Thu, Aug 25, 2016 at 09:11:15AM -0600, Jan Beulich wrote: > >>> On 25.08.16 at 15:37, wrote: > > On most architectures it does not matter what the aligment is. > > > > On ARM32 it is paramount that the aligment is word-size (4) > > otherwise we get a Data Abort when trying to perform ELF > > r

Re: [Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-09-06 Thread Konrad Rzeszutek Wilk
not generate a break fault instruction? In the excitment of getting ARM32 implementation working - forgot to write the code that would have done the check for all the platforms (32MB for ARM, 128MB for ARM64, and 2GB on x86). It will be an followup patch, like so (compile tested): From 508157d81eaa

Re: [Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-09-06 Thread Konrad Rzeszutek Wilk
On Thu, Aug 25, 2016 at 09:02:48AM -0600, Jan Beulich wrote: > >>> On 25.08.16 at 15:37, wrote: > > --- a/xen/include/xen/types.h > > +++ b/xen/include/xen/types.h > > @@ -14,6 +14,12 @@ > > #define NULL ((void*)0) > > #endif > > > > +#define U16_MAX ((u16)~0U) > > +#define S16_MAX

Re: [Xen-devel] [PATCH] xen/arm: alternative: Make it possible to patch outside of the hypervisor

2016-09-06 Thread Konrad Rzeszutek Wilk
> > --- > > xen/arch/arm/alternative.c | 58 > > +- > > 1 file changed, 31 insertions(+), 27 deletions(-) > > > > diff --git a/xen/arch/arm/alternative.c b/xen/arch/arm/alternative.c > > index 8ee5a11..db4bd0f 100644 > > --- a/xen/arch/arm/alternative.

Re: [Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-09-06 Thread Konrad Rzeszutek Wilk
> ...snip.. > > > +case R_AARCH64_ABS32: > > > +ovf = reloc_data(RELOC_OP_ABS, dest, val, 32); > > > +break; > > > > I have noticed that not all the relocations are implemented (e.g > > R_AARCH64_ABS16, R_AARCH64_MOVW_*...). I don't think there is anything > > preve

Re: [Xen-devel] [PATCH v2] Livepatch for ARM 64 and 32.

2016-09-06 Thread Konrad Rzeszutek Wilk
On Wed, Aug 31, 2016 at 09:54:30AM -0600, Jan Beulich wrote: > >>> On 31.08.16 at 17:24, wrote: > > On 31/08/16 16:09, Julien Grall wrote: > >> On 31/08/16 16:06, Konrad Rzeszutek Wilk wrote: > >>> So you are thinking of exposing this 'xen feature bi

Re: [Xen-devel] [PATCH v2 1/2] xen/arm: alternative: Clean-up __apply_alternatives

2016-09-07 Thread Konrad Rzeszutek Wilk
ng the Xen binary, not > only the text section). > - s/text_mfn/xen_mfn/ and s/text_order/xen_order/ to make clear that > we map the Xen binary. > - Mention about inittext as alternative may patch this section. > > Signed-off-by: Konrad Rzeszutek

Re: [Xen-devel] [PATCH v2 2/2] xen/arm: alternative: Make it possible to patch outside of the hypervisor

2016-09-07 Thread Konrad Rzeszutek Wilk
gt; Signed-off-by: Julien Grall > > --- > Cc: Konrad Rzeszutek Wilk Reviewed-by: Konrad Rzeszutek Wilk ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v2 13/20] livepatch: Initial ARM64 support.

2016-09-07 Thread Konrad Rzeszutek Wilk
On Wed, Sep 07, 2016 at 11:43:27AM +0100, Julien Grall wrote: > > > On 07/09/2016 04:33, Konrad Rzeszutek Wilk wrote: > > > ...snip.. > > > > > +case R_AARCH64_ABS32: > > > > > +ovf = reloc_data(RELOC_OP_ABS, dest, val, 32);

Re: [Xen-devel] [PATCH v4 9/9] livepach: Add .livepatch.hooks functions and test-case

2016-09-07 Thread Konrad Rzeszutek Wilk
On Tue, Sep 06, 2016 at 07:25:23PM +0100, Andrew Cooper wrote: > On 06/09/16 18:22, Konrad Rzeszutek Wilk wrote: > > On Tue, Aug 23, 2016 at 10:22:12PM -0400, Konrad Rzeszutek Wilk wrote: > >> From: Ross Lagerwall > >> > >> Add hook functions which run

Re: [Xen-devel] [PATCH v4 6/9] livepatch: Add parsing for the symbol+0x

2016-09-08 Thread Konrad Rzeszutek Wilk
On Wed, Sep 07, 2016 at 02:10:43AM -0600, Jan Beulich wrote: > >>> On 06.09.16 at 21:56, wrote: > > On Wed, Aug 24, 2016 at 03:08:01AM -0600, Jan Beulich wrote: > >> >>> On 24.08.16 at 04:22, wrote: > >> > --- a/xen/common/livepatch.c > >> > +++ b/xen/common/livepatch.c > >> > @@ -237,13 +237,34

Re: [Xen-devel] [PATCH v4 1/9] livepatch: Clear .bss when payload is reverted

2016-09-08 Thread Konrad Rzeszutek Wilk
On Wed, Sep 07, 2016 at 02:02:44AM -0600, Jan Beulich wrote: > >>> On 06.09.16 at 18:47, wrote: > > On Wed, Aug 24, 2016 at 02:55:21AM -0600, Jan Beulich wrote: > >> >>> On 24.08.16 at 04:22, wrote: > >> > --- a/xen/common/livepatch.c > >> > +++ b/xen/common/livepatch.c > >> > @@ -70,6 +70,9 @@ s

Re: [Xen-devel] [PATCH v2 20/20] livepatch: ARM32 support.

2016-09-08 Thread Konrad Rzeszutek Wilk
On Thu, Aug 25, 2016 at 09:37:35AM -0400, Konrad Rzeszutek Wilk wrote: > The patch piggybacks on: livepatch: Initial ARM64 support, which > brings up all of the neccessary livepatch infrastructure pieces in. > > This patch adds three major pieces: > > 1) ELF relocations.

Re: [Xen-devel] [PATCH] fix EFI part of "symbols: Generate an xen-sym.map"

2016-09-08 Thread Konrad Rzeszutek Wilk
Jan Beulich Reviewed-by: Konrad Rzeszutek Wilk > > --- a/xen/Makefile > +++ b/xen/Makefile > @@ -67,7 +67,7 @@ _install: $(TARGET)$(CONFIG_XEN_INSTALL_ > if [ -r $(TARGET).efi -a -n '$(EFI_DIR)' ]; then \ > [ -d $(D)$(EF

Re: [Xen-devel] [PATCH v4 1/9] livepatch: Clear .bss when payload is reverted

2016-09-09 Thread Konrad Rzeszutek Wilk
On Fri, Sep 09, 2016 at 02:33:18PM +0100, Ross Lagerwall wrote: > On 08/24/2016 03:22 AM, Konrad Rzeszutek Wilk wrote: > > So that when we apply the patch again the .bss is cleared. > > Otherwise we may find some variables containing old values. > > > > The payloa

[Xen-devel] [PATCH v5 2/4] livepatch: Add limit of 2MB to payload .bss sections.

2016-09-11 Thread Konrad Rzeszutek Wilk
The initial patch: 11ff40fa7bb5fdcc69a58d0fec49c904ffca4793 "xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op" caps the size of the binary at 2MB. We follow that in capping the size of the .BSSes to be at maximum 2MB. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Ross Lagerwal

[Xen-devel] [PATCH v5 4/4] livepach: Add .livepatch.hooks functions and test-case

2016-09-11 Thread Konrad Rzeszutek Wilk
hooks provide flexibility when having to deal with unforeseen cases, but their application should be rarely required (< 10%)." Furthermore include a test-case for it. Signed-off-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jac

[Xen-devel] [PATCH v5 1/4] livepatch/docs: Document .bss not being cleared, and .data potentially having changed values

2016-09-11 Thread Konrad Rzeszutek Wilk
Lagerwall Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Andrew Cooper Cc: Jan Beulich v5: New submission --- docs/misc/livepatch.markdown | 6 ++ 1 file changed, 6 insertions(+) diff --git a/docs/misc/livepatch.markdown b/docs/misc/livepatch.markdown index 89c1050..07be0af 100644 --- a/docs

[Xen-devel] [PATCH v5] Livepatch fixes and general features for Xen 4.8.

2016-09-11 Thread Konrad Rzeszutek Wilk
bss can have old values) so will need one more review. [PATCH v5 4/4] livepach: Add .livepatch.hooks functions and test-case Thanks! The git tree ` git://xenbits.xen.org/people/konradwilk/xen.git livepatch.v4.8.v5 contains all the following patches (and more): Konrad Rzeszutek Wilk (3

[Xen-devel] [PATCH v5 3/4] livepatch: NOP if func->new_addr is zero.

2016-09-11 Thread Konrad Rzeszutek Wilk
r more 'struct livepatch_func' structures need to be present or we have to implement a variable size buffer. While at it, also unify the code on x86 patching so it is a bit simpler (instead of two seperate writes just make it one memcpy). Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Ko

[Xen-devel] [PATCH v3 08/18] livepatch: ARM 32|64: Ignore mapping symbols: $[d, a, x]

2016-09-11 Thread Konrad Rzeszutek Wilk
bits] Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Konrad Rzeszutek Wilk Cc: Ross Lagerwall Cc: Stefano Stabellini Cc: Julien Grall Cc: Andrew Cooper v1: First submission v2: Update the order of symbols, fix title Add {} in after the first if - per Jan's recommendation. v3: Add And

[Xen-devel] [PATCH v3] Livepatch for ARM 64 and 32.

2016-09-11 Thread Konrad Rzeszutek Wilk
ARM64; and ARM CubieTruck for ARM32). There are also support patches and one general bug-fix ("arm: poison initmem when it is freed.") - which could be ignored. Enjoy! Konrad Rzeszutek Wilk (18): arm/x86: Add HAS_[ALTERNATIVE|EX_TABLE] livepatch: Reject payloads with .alte

[Xen-devel] [PATCH v3 14/18] xen/arm32: Add an helper to invalidate all instruction caches

2016-09-11 Thread Konrad Rzeszutek Wilk
by: Konrad Rzeszutek Wilk --- Cc: Julien Grall Cc: Stefano Stabellini v2: First submission v3: Squashed "xen/arm32/livepatch: Add BPICALLIS to helper to invalidate all instruction caches" in this patch. --- xen/include/asm-arm/arm32/page.h | 13 + 1 file changed, 13

[Xen-devel] [PATCH v3 02/18] livepatch: Reject payloads with .alternative or .ex_table if support is not built-in.

2016-09-11 Thread Konrad Rzeszutek Wilk
If the payload had the sections mentioned but the hypervisor did not support some of them (say on ARM the .ex_table) - instead of ignoring them - it should forbid loading of such payload. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Jan Beulich Cc

[Xen-devel] [PATCH v3 12/18] livepatch: tests: Make them compile under ARM64

2016-09-11 Thread Konrad Rzeszutek Wilk
exceptions under ARM (but there are under ARM 64). Also use one of the first config options for the CPU field feature. We are not yet attempting to build them under ARM32 so that is still ifdefed out. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian

[Xen-devel] [PATCH v3 04/18] arm/mm: Introduce modify_xen_mappings

2016-09-11 Thread Konrad Rzeszutek Wilk
also .ro to be set to 1. We introduce a new 'flags' where various bits determine whether .ro and .nx bits are set or cleared. We can't use an enum as the function prototype would diverge from x86. Reviewed-by: Julien Grall Signed-off-by: Konrad Rzeszutek Wilk -- Cc: Ross Lagerwa

[Xen-devel] [PATCH v3 03/18] arm/x86: change [modify, destroy]_xen_mappings to return error

2016-09-11 Thread Konrad Rzeszutek Wilk
The implementation on x86 always returns zero, but other platforms may return error values. Reviewed-by: Andrew Cooper Suggested-by: Julien Grall Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Jan Beulich Cc: Andrew Cooper v2: First submission v3

[Xen-devel] [PATCH v3 10/18] livepatch: Move test-cases to their own sub-directory in test.

2016-09-11 Thread Konrad Rzeszutek Wilk
cked-by: Jan Beulich [for directory] Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Jan Beulich Cc: Andrew Cooper v1: First submission v2: Move to test/livepatch per Jan's recommendation v3: Sort MAINTAINERS for livepatch. Add Jan's Acke

[Xen-devel] [PATCH v3 01/18] arm/x86: Add HAS_[ALTERNATIVE|EX_TABLE]

2016-09-11 Thread Konrad Rzeszutek Wilk
the ALTERNATIVE is selected. And while at it change the livepatch common code that would benefit from this. Suggested-by: Julien Grall Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Jan Beulich Cc: Andrew Cooper Cc: Doug Goldstein v2: First submission

[Xen-devel] [PATCH v3 05/18] arm: poison initmem when it is freed.

2016-09-11 Thread Konrad Rzeszutek Wilk
ected Trap: Supervisor Call We don't have to worry about Thumb code so this instruction is a safe to execute. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Julien Grall Cc: Stefano Stabellini --- xen/arch/arm/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch

[Xen-devel] [PATCH v3 07/18] livepatch: ARM/x86: Check displacement of old_addr and new_addr

2016-09-11 Thread Konrad Rzeszutek Wilk
displacement). On ARM the conditional branch supports even a smaller displacement but fortunatly we are not using that. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Andrew Cooper Cc: Jan Beulich Cc: Stefano Stabellini Cc: Julien Grall v3: New submission. --- docs/misc/livepatch.markdown

[Xen-devel] [PATCH v3 18/18] livepatch: arm[32, 64], x86: NOP test-case

2016-09-11 Thread Konrad Rzeszutek Wilk
, and 4. Granted this code may be different per compiler! Hence if anybody does run this test-case - they should verify that the assumptions made here are correct. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Julien Grall Cc: Stefano Stabellini Cc: Jan Beulich Cc: Andrew Cooper v3: New s

[Xen-devel] [PATCH v3 06/18] livepatch: Initial ARM64 support.

2016-09-11 Thread Konrad Rzeszutek Wilk
d arm32 platform specific livepatch file. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Ross Lagerwall Cc: Stefano Stabellini Cc: Julien Grall Cc Jan Beulich Cc: Andrew Cooper RFC: Wholy cow! It works! v1: Finished the various TODOs and reviews outlined by Julien in RFC. v2: Call che

[Xen-devel] [PATCH v3 11/18] livepatch: tests: Move the .name value to .rodata

2016-09-11 Thread Konrad Rzeszutek Wilk
Right now the contents of 'name' are all located in the .data section. We want them in the .rodata section so change the type to have const on them. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Andrew Cooper Cc: Jan Beulich v3: First submission. --- xen/test/livepatch/xen_bye_world

[Xen-devel] [PATCH v3 15/18] bug/x86/arm: Align bug_frames sections.

2016-09-11 Thread Konrad Rzeszutek Wilk
t_ref -4164 +4164 do_grant_table_op 98929836 -56 grant_map_exists 300 --300 __gnttab_map_grant_ref 3880 - -3880 Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Julien Gral

[Xen-devel] [PATCH v3 16/18] livepatch: ARM32 support.

2016-09-11 Thread Konrad Rzeszutek Wilk
the test-cases to be built under ARM 32. The "livepatch: tests: Make them compile under ARM64" put in the right infrastructure for it and we piggyback on it. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Julien Grall Cc: Stefano Stabellini v2: First submissio

[Xen-devel] [PATCH v3 13/18] livepatch: x86, ARM, alternative: Expose FEATURE_LIVEPATCH

2016-09-11 Thread Konrad Rzeszutek Wilk
To use as a common way of testing alternative patching for livepatches. Both architectures have this FEATURE and the test-cases can piggyback on that. Suggested-by: Julien Grall Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Julien Grall Cc: Stefano Stabellini Cc: Jan Beulich Cc: Andrew

[Xen-devel] [PATCH v3 17/18] livepatch, arm[32|64]: Share arch_livepatch_revert_jmp

2016-09-11 Thread Konrad Rzeszutek Wilk
It is exactly the same in both platforms. No functional change. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Julien Grall Cc: Stefano Stabellini v3: New submission. --- xen/arch/arm/arm32/livepatch.c | 19 +-- xen/arch/arm/arm64/livepatch.c | 19 +-- xen/arch

[Xen-devel] [PATCH v3 09/18] livepatch/arm/x86: Check payload for for unwelcomed symbols.

2016-09-11 Thread Konrad Rzeszutek Wilk
compile Xen with any Thumb instructions (which are variable length) - and if we find these mapping symbols we should disallow such payload. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Konrad Rzeszutek Wilk Cc: Ross Lagerwall Cc: Stefano Stabellini Cc: Julien Grall Cc: Andrew Cooper v3: New

Re: [Xen-devel] BUG_ON() vs ASSERT()

2016-09-13 Thread Konrad Rzeszutek Wilk
On Mon, Sep 12, 2016 at 09:23:41AM -0600, Jan Beulich wrote: > All, > > in > https://lists.xenproject.org/archives/html/xen-devel/2016-09/msg01201.html > and > https://lists.xenproject.org/archives/html/xen-devel/2016-09/msg01210.html > Andrew basically suggests that we should switch away from usi

Re: [Xen-devel] [PATCH v5 1/4] livepatch/docs: Document .bss not being cleared, and .data potentially having changed values

2016-09-13 Thread Konrad Rzeszutek Wilk
On Mon, Sep 12, 2016 at 01:49:51AM -0600, Jan Beulich wrote: > >>> On 11.09.16 at 17:48, wrote: > > --- a/docs/misc/livepatch.markdown > > +++ b/docs/misc/livepatch.markdown > > @@ -875,6 +875,12 @@ section and the new function will reference the new > > string in the new > > > > This is imple

Re: [Xen-devel] [PATCH v3 01/18] arm/x86: Add HAS_[ALTERNATIVE|EX_TABLE]

2016-09-13 Thread Konrad Rzeszutek Wilk
On Mon, Sep 12, 2016 at 04:31:20PM +0100, Julien Grall wrote: > Hi, > > On 12/09/16 16:28, Jan Beulich wrote: > > > > > On 11.09.16 at 22:35, wrote: > > > x86 implements all of them by default - and we just > > > add two extra HAS_ variables to be declared in autoconf.h. > > > > > > ARM 64 only

Re: [Xen-devel] [PATCH v3 15/18] bug/x86/arm: Align bug_frames sections.

2016-09-13 Thread Konrad Rzeszutek Wilk
On Tue, Sep 13, 2016 at 03:21:04AM -0600, Jan Beulich wrote: > >>> On 11.09.16 at 22:35, wrote: > > Furthermore on x86 the bloat-o-meter detects that with this > > change: > > > > [konrad@char xen]$ ~/linux/scripts/bloat-o-meter xen-syms xen-syms.align4 > > add/remove: 0/0 grow/shrink: 3/14 up/do

Re: [Xen-devel] [RFC] e1000: Don't save writes to ICS/ICR masked by IMS

2016-09-13 Thread Konrad Rzeszutek Wilk
On Thu, Sep 01, 2016 at 10:57:48AM -0700, Ed Swierk wrote: > Windows 8, 10 and Server 2012 guests hang intermittently while booting > on Xen 4.5.3 with 1 vCPU and 4 e1000 vNICs, shortly after the Windows > logo appears and the little dots start spinning. > > Running strace on qemu shows its main t

Re: [Xen-devel] [PATCH RFC 1/6] xen/arm: platforms: Add earlyprintk and serial support for Tegra boards.

2016-09-13 Thread Konrad Rzeszutek Wilk
On Mon, Sep 05, 2016 at 06:13:56AM -0400, Kyle Temkin wrote: > From: "Kyle J. Temkin" > > Tegra boards feature a NS16550-compatible serial mapped into the MMIO > space. Add support for its use both as a full-featured serial port and > as an earlyprintk driver. > > Adds a new "needs_rtoie" (requi

Re: [Xen-devel] [PATCH v3] Livepatch for ARM 64 and 32.

2016-09-16 Thread Konrad Rzeszutek Wilk
On Fri, Sep 16, 2016 at 03:35:21PM +0200, Julien Grall wrote: > Hi Konrad, > > On 11/09/2016 22:35, Konrad Rzeszutek Wilk wrote: > > v2: [http://www.gossamer-threads.com/lists/xen/devel/61?page=last] > > - Addressed the two outstanding concerns: CPU bit feature to

<    5   6   7   8   9   10   11   12   13   14   >