Re: [Xen-devel] [PATCH v2 00/23] Make ACPI builder available to components other than hvmloader

2016-08-14 Thread Shannon Zhao
On 2016/8/5 5:06, Boris Ostrovsky wrote: > The goal here is to build ACPI tables for PVHv2/HVMlite guests while reusing > existing > hvmloader's ACPI builder code. The builder is provided as a library in > tools/libacpi. > > This version is built on top of Anthony's > git://xenbits.xen.org/pe

Re: [Xen-devel] [PATCH] xl cpupool-numa-split: don't try to bring any dom0 vCPUs online

2016-08-14 Thread Juergen Gross
On 12/08/16 15:11, Jonathan Davies wrote: > Since commit a9dd01431a799b6743193a75f4f1ce2fdfdb7296, main_cpupoolnumasplit > wants to ensure that dom0 doesn't have more online vCPUs than the number of > pCPUs in a NUMA node. > > However, if dom0 already has fewer online vCPUs than the number of pCPU

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

2016-08-14 Thread osstest service owner
flight 100487 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/100487/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf adb6ac256338329883e4d8fafaa8c753dba707c9 baseline version: ovmf 62b8b5be713dd1f801cd4

Re: [Xen-devel] [PATCH 2/2] x86/EFI: use less crude way of generating the build ID

2016-08-14 Thread Konrad Rzeszutek Wilk
> --- a/xen/arch/x86/Makefile > +++ b/xen/arch/x86/Makefile > @@ -158,24 +158,30 @@ $(TARGET).efi: VIRT_BASE = 0x$(shell $(N > $(TARGET).efi: ALT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A > ALT_START$$,,p') > # Don't use $(wildcard ...) here - at least make 3.80 expands this too e

[Xen-devel] [PATCH v1 9/9] livepatch: tests: Make them compile under ARM64

2016-08-14 Thread Konrad Rzeszutek Wilk
We need to two things: 1) Wrap the platform-specific objcopy paramters in defines The input and output parmeters for $(OBJCOPY) are different based on the platforms. As such provide them in the OBJCOPY_MAGIC define and use that. 2) The alternative is a bit different and there are no ex

[Xen-devel] [PATCH v1] Livepatch ARM 64 implementation

2016-08-14 Thread Konrad Rzeszutek Wilk
Hey! This is the first (non RFC) posting of the enablement of Livepatch under ARM64. The patches are based on: [PATCH v3] Livepatch fixes and features for v4.8. (https://lists.xen.org/archives/html/xen-devel/2016-08/msg01825.html) And the git tree is: git://xenbits.xen.org/people/konradwilk/xen

[Xen-devel] [PATCH v1 1/9] livepatch: Bubble up sanity checks on Elf relocs

2016-08-14 Thread Konrad Rzeszutek Wilk
The checks for RELA 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 the duplicate checks don't have to be in the platform specific files. Signed-off-by: Konrad Rzeszutek Wilk

[Xen-devel] [PATCH v1 5/9] arm64/insn: introduce aarch64_insn_gen_{nop|branch_imm}() helper functions

2016-08-14 Thread Konrad Rzeszutek Wilk
This is copied from Linux 4.7, and the initial commit that put this in is 5c5bf25d4f7a950382f94fc120a5818197b48fe9 "arm64: introduce aarch64_insn_gen_{nop|branch_imm}() helper functions" This lays the groundwork for Livepatch to generate the trampoline to jump to the new replacement function. Also

[Xen-devel] [PATCH v1 8/9] livepatch: Move test-cases to common

2016-08-14 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 submi

[Xen-devel] [PATCH v1 4/9] arm/mm: Introduce modify_xen_mappings

2016-08-14 Thread Konrad Rzeszutek Wilk
Which is only used by Livepatch code. The purpose behind this call is to modify the page table entries flags. Specifically the .ro and .nx flags. The current mechanism puts cache attributes in the flags and the .ro and .nx are locked down and assumed to be .ro=0, nx=1. Livepatch needs .nx=0 and a

[Xen-devel] [PATCH v1 7/9] livepatch: ARM64: Ignore mapping symbols: $[a, d, x, p]

2016-08-14 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 v1 6/9] livepatch: Initial ARM64 support.

2016-08-14 Thread Konrad Rzeszutek Wilk
As compared to x86 the va of the hypervisor .text is locked down - we cannot modify the running pagetables to have the .ro flag unset. We borrow the same idea that alternative patching has - which is to vmap the entire .text region and use the alternative virtual address for patching. Since we are

[Xen-devel] [PATCH v1 3/9] x86/arm64: Move the ALT_[ORIG|REPL]_PTR macros to header files.

2016-08-14 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. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Jan Beulich Cc: Andrew Cooper v1: First submissi

[Xen-devel] [PATCH v1 2/9] x86/arm: Make 'make debug' work properly.

2016-08-14 Thread Konrad Rzeszutek Wilk
On x86 it works great but on ARM 32,64 not so much. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Stefano Stabellini Cc: Julien Grall v1: First submission --- xen/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/Makefile b/xe

[Xen-devel] [PATCH v3 8/9] symbols: Generate an xen-sym.map

2016-08-14 Thread Konrad Rzeszutek Wilk
You could construct _most_ of the names of the functions by doing 'nm --defined' but unfortunatly you do not get the prefix that is added on in Xen . For example: $ cat xen-syms.symbols |grep do_domain_pause 0x82d080104920 t domain.c#do_domain_pause $ nm --defined xen-syms|grep do_domain_paus

[Xen-devel] [PATCH v3 5/9] livepatch: Move code from prepare_payload to own routine

2016-08-14 Thread Konrad Rzeszutek Wilk
Specifically the code that is looking up f->old_addr - which can be in its own routine instead of having it part of prepare_payload. No functional change. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Ross Lagerwall v3: First submission. --- xen/common/livepatch.c | 43 +++

[Xen-devel] [PATCH v3 3/9] version/livepatch: Move xen_build_id_check to version.h

2016-08-14 Thread Konrad Rzeszutek Wilk
It makes more sense for it to be there. However that means the version.h has now a dependency on as the Elf_Note is a macro. The elfstructs.h has a dependency on types.h as well so we need that. We cannot put that #include in elfstructs.h as that file is used by tools and they do not have such f

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

2016-08-14 Thread Konrad Rzeszutek Wilk
The NOP functionality will NOP any of the code at the 'old_addr' or at 'name' if the 'new_addr' and 'new_size' are both zero. The purpose of this is to NOP out calls, such as: e9 <4-bytes-offset> (5 byte insn), or on ARM a 4 byte insn for branching. We need the EIP of where we need to the NOP,

[Xen-devel] [PATCH v3] Livepatch fixes and features for v4.8.

2016-08-14 Thread Konrad Rzeszutek Wilk
Hey! This the posting of fixes and various left-overs that didn't get quite done in 4.7 is marked as v3. It should have been v2, but I messed up the emails previously (cover letter said v1, patches said v2), so I figured we can start at v3. Included are: - Bug-fixes - Parsing of symbol names

[Xen-devel] [PATCH v3 2/9] livepatch: Deal with payloads without any .text

2016-08-14 Thread Konrad Rzeszutek Wilk
It is possible. Especially if the only thing they do is NOP functions - in which case there is only .livepatch.funcs sections. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Konrad Rzeszutek Wilk Cc: Ross Lagerwall Cc: Jan Beulich Cc: Andrew Cooper v3: First submission. --- xen/common/livepa

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

2016-08-14 Thread Konrad Rzeszutek Wilk
So that when we apply the patch again the .bss is cleared. Otherwise we may find some variables containing old values. Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Ross Lagerwall Cc: Jan Beulich v3: Initial submission --- xen/common/livepatch.c | 18 +- 1 file changed, 17 ins

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

2016-08-14 Thread Konrad Rzeszutek Wilk
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 use case is the XSA91. As Martin mentions it: "If we have shadow variables, we also need an unload hook to

[Xen-devel] [PATCH v3 4/9] livepatch: Sync cache of build-id before using it first time.

2016-08-14 Thread Konrad Rzeszutek Wilk
We don't print at bootup time the build-id. The reason is that xen_build_init and livepatch_init are both __initcall type routines. This meant that when livepatch_init called xen_build_id, it would return -ENODATA as build_id_len was not setup yet (b/c xen_build_init would be called later). We fix

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

2016-08-14 Thread Konrad Rzeszutek Wilk
in case we want to patch at specific offsets inside a function. (for example if we want to do NOP patching). We also assume that the 'len' is only the size of an isns that would be for a call opcode (so 5 bytes on x86, and 4 on ARM 32/64). Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Konrad Rzes

[Xen-devel] [ovmf test] 100484: regressions - FAIL

2016-08-14 Thread osstest service owner
flight 100484 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/100484/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64-xsm 5 xen-buildfail REGR. vs. 100452 version targeted for testi

[Xen-devel] [PATCH 4.6 23/56] x86/mm/pat: Add support of non-default PAT MSR setting

2016-08-14 Thread Greg Kroah-Hartman
4.6-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit 02f037d641dc6672be5cfe7875a48ab99b95b154 upstream. In preparation for fixing a regression caused by: 9cd25aac1f44 ("x86/mm/pat: Emulate PAT when it is disabled")' ... PAT

[Xen-devel] [PATCH 4.6 28/56] x86/xen, pat: Remove PAT table init code from Xen

2016-08-14 Thread Greg Kroah-Hartman
4.6-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit 88ba281108ed0c25c9d292b48bd3f272fcb90dd0 upstream. Xen supports PAT without MTRRs for its guests. In order to enable WC attribute, it was necessary for xen_start_kernel() to

[Xen-devel] [PATCH 4.6 26/56] x86/mtrr: Fix Xorg crashes in Qemu sessions

2016-08-14 Thread Greg Kroah-Hartman
4.6-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit edfe63ec97ed8d4496225f7ba54c9ce4207c5431 upstream. A Xorg failure on qemu32 was reported as a regression [1] caused by commit 9cd25aac1f44 ("x86/mm/pat: Emulate PAT when it is

[Xen-devel] [PATCH 4.6 30/56] x86/mm/pat: Fix BUG_ON() in mmap_mem() on QEMU/i386

2016-08-14 Thread Greg Kroah-Hartman
4.6-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit 1886297ce0c8d563a08c8a8c4c0b97743e06cd37 upstream. The following BUG_ON() crash was reported on QEMU/i386: kernel BUG at arch/x86/mm/physaddr.c:79! Call Trace: phys_mem

[Xen-devel] [PATCH 4.6 29/56] x86/pat: Document the PAT initialization sequence

2016-08-14 Thread Greg Kroah-Hartman
4.6-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit b6350c21cfe8aa9d65e189509a23c0ea4b8362c2 upstream. Update PAT documentation to describe how PAT is initialized under various configurations. Signed-off-by: Toshi Kani Review

[Xen-devel] [PATCH 4.6 27/56] x86/mtrr: Fix PAT init handling when MTRR is disabled

2016-08-14 Thread Greg Kroah-Hartman
4.6-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit ad025a73f0e9344ac73ffe1b74c184033e08e7d5 upstream. get_mtrr_state() calls pat_init() on BSP even if MTRR is disabled. This results in calling pat_init() on BSP only since APs

[Xen-devel] [PATCH 4.6 24/56] x86/mm/pat: Add pat_disable() interface

2016-08-14 Thread Greg Kroah-Hartman
4.6-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit 224bb1e5d67ba0f2872c98002d6a6f991ac6fd4a upstream. In preparation for fixing a regression caused by: 9cd25aac1f44 ("x86/mm/pat: Emulate PAT when it is disabled") ... PAT n

[Xen-devel] [PATCH 4.6 25/56] x86/mm/pat: Replace cpu_has_pat with boot_cpu_has()

2016-08-14 Thread Greg Kroah-Hartman
4.6-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit d63dcf49cf5ae5605f4d14229e3888e104f294b1 upstream. Borislav Petkov suggested: > Please use on init paths boot_cpu_has(X86_FEATURE_PAT) and on fast > paths static_cpu_has(X8

[Xen-devel] [PATCH 4.4 24/49] x86/mm/pat: Add pat_disable() interface

2016-08-14 Thread Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit 224bb1e5d67ba0f2872c98002d6a6f991ac6fd4a upstream. In preparation for fixing a regression caused by: 9cd25aac1f44 ("x86/mm/pat: Emulate PAT when it is disabled") ... PAT n

[Xen-devel] [PATCH 4.4 30/49] x86/mm/pat: Fix BUG_ON() in mmap_mem() on QEMU/i386

2016-08-14 Thread Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit 1886297ce0c8d563a08c8a8c4c0b97743e06cd37 upstream. The following BUG_ON() crash was reported on QEMU/i386: kernel BUG at arch/x86/mm/physaddr.c:79! Call Trace: phys_mem

[Xen-devel] [PATCH 4.4 27/49] x86/mtrr: Fix PAT init handling when MTRR is disabled

2016-08-14 Thread Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit ad025a73f0e9344ac73ffe1b74c184033e08e7d5 upstream. get_mtrr_state() calls pat_init() on BSP even if MTRR is disabled. This results in calling pat_init() on BSP only since APs

[Xen-devel] [PATCH 4.4 29/49] x86/pat: Document the PAT initialization sequence

2016-08-14 Thread Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit b6350c21cfe8aa9d65e189509a23c0ea4b8362c2 upstream. Update PAT documentation to describe how PAT is initialized under various configurations. Signed-off-by: Toshi Kani Review

[Xen-devel] [PATCH 4.4 28/49] x86/xen, pat: Remove PAT table init code from Xen

2016-08-14 Thread Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit 88ba281108ed0c25c9d292b48bd3f272fcb90dd0 upstream. Xen supports PAT without MTRRs for its guests. In order to enable WC attribute, it was necessary for xen_start_kernel() to

[Xen-devel] [PATCH 4.4 26/49] x86/mtrr: Fix Xorg crashes in Qemu sessions

2016-08-14 Thread Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit edfe63ec97ed8d4496225f7ba54c9ce4207c5431 upstream. A Xorg failure on qemu32 was reported as a regression [1] caused by commit 9cd25aac1f44 ("x86/mm/pat: Emulate PAT when it is

[Xen-devel] [PATCH 4.4 25/49] x86/mm/pat: Replace cpu_has_pat with boot_cpu_has()

2016-08-14 Thread Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit d63dcf49cf5ae5605f4d14229e3888e104f294b1 upstream. Borislav Petkov suggested: > Please use on init paths boot_cpu_has(X86_FEATURE_PAT) and on fast > paths static_cpu_has(X8

[Xen-devel] [PATCH 4.4 23/49] x86/mm/pat: Add support of non-default PAT MSR setting

2016-08-14 Thread Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know. -- From: Toshi Kani commit 02f037d641dc6672be5cfe7875a48ab99b95b154 upstream. In preparation for fixing a regression caused by: 9cd25aac1f44 ("x86/mm/pat: Emulate PAT when it is disabled")' ... PAT

Re: [Xen-devel] x86 PAT fixes for stable

2016-08-14 Thread Greg KH
On Wed, May 25, 2016 at 08:29:39AM +0200, Ingo Molnar wrote: > > * Kani, Toshimitsu wrote: > > > Hello, > > > > The following patches fix two x86 PAT issues reported in 4.4 [1][2]. Can > > you please backport them up to 4.4?  > > Do they apply, build and boot cleanly in that order on top of v4

[Xen-devel] [xen-unstable-coverity test] 100483: regressions - ALL FAIL

2016-08-14 Thread osstest service owner
flight 100483 xen-unstable-coverity real [real] http://logs.test-lab.xenproject.org/osstest/logs/100483/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: coverity-amd646 coverity-upload fail REGR. vs. 100390 version t

[Xen-devel] [xen-unstable test] 100481: tolerable FAIL

2016-08-14 Thread osstest service owner
flight 100481 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/100481/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-armhf-armhf-xl-multivcpu 4 host-ping-check-nativefail pass in 100476 test-armhf-armhf-xl-rtds 11

[Xen-devel] [libvirt test] 100482: tolerable FAIL - PUSHED

2016-08-14 Thread osstest service owner
flight 100482 libvirt real [real] http://logs.test-lab.xenproject.org/osstest/logs/100482/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 12 migrate-support-checkfail never pass test-amd64-amd64-libvirt-xsm 12 migrate-s