[Xen-devel] OSStest commits and Xen releases

2019-01-28 Thread Juergen Gross
I have found an alarming tendency regarding changes in the OSStest repository: over the last 2 years (or 3 Xen versions) there has been a pattern of OSStest commits being more frequent during the RC phase of a Xen release. On average there were about 4 commits to osstest.git per week. The numbers

[Xen-devel] [linux-4.9 test] 132521: tolerable FAIL - PUSHED

2019-01-28 Thread osstest service owner
flight 132521 linux-4.9 real [real] http://logs.test-lab.xenproject.org/osstest/logs/132521/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-xl-qemut-win7-amd64 17 guest-stopfail like 132421 test-amd64-i386-xl-qemut-win7-amd64 17

Re: [Xen-devel] RT Xen on ARM - R-Car series

2019-01-28 Thread LOPEZ, FUENTES NACARINO Jairo Eduardo
Andrii, YEY! I have finally got an error message! The rest of the mail is inline. 2019年1月28日(月) 17:25 Andrii Anisov : > Hello Jairo, > > On 28.01.19 19:20, LOPEZ, FUENTES NACARINO Jairo Eduardo wrote: > > > I was able to compile the Xen image with earlyprintk without issue. > > Cool. > > > It

Re: [Xen-devel] [PATCH 0/3] gcc-plugins: Introduce stackinit plugin

2019-01-28 Thread Alexander Popov
On 23.01.2019 14:03, Kees Cook wrote: > This adds a new plugin "stackinit" that attempts to perform unconditional > initialization of all stack variables Hello Kees! Hello everyone! I was curious about the performance impact of the initialization of all stack variables. So I did a very brief

Re: [Xen-devel] [PATCH v5 3/8] microcode: introduce the global microcode cache

2019-01-28 Thread Chao Gao
On Mon, Jan 28, 2019 at 06:39:43PM +0100, Roger Pau Monné wrote: >On Mon, Jan 28, 2019 at 03:06:45PM +0800, Chao Gao wrote: >> to replace the current per-cpu cache 'uci->mc'. >> >> Compared to the current per-cpu cache, the benefits of the global >> microcode cache are: >> 1. It reduces the work

[Xen-devel] [xen-unstable-smoke test] 132550: tolerable all pass - PUSHED

2019-01-28 Thread osstest service owner
flight 132550 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/132550/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 13 migrate-support-checkfail never pass test-armhf-armhf-xl

[Xen-devel] [qemu-mainline test] 132514: regressions - FAIL

2019-01-28 Thread osstest service owner
flight 132514 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/132514/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-xl-qemuu-dmrestrict-amd64-dmrestrict 12 guest-start/debianhvm.repeat fail REGR.

Re: [Xen-devel] [PATCH] tools/libxl: Fix leaking ssid_label in libxl_name_to_domid

2019-01-28 Thread Tamas K Lengyel
On Mon, Jan 28, 2019 at 5:16 AM Wei Liu wrote: > > On Sat, Jan 26, 2019 at 10:45:07PM -0700, Tamas K Lengyel wrote: > > On systems with XSM enabled libxl_name_to_domid leaks memory > > allocated for ssid_label: > > > > ==2693== 53 bytes in 2 blocks are definitely lost in loss record 4 of 8 > >

Re: [Xen-devel] [PATCH for-4.12 6/8] xen/arm: Implement workaround for Cortex-A76 erratum 1165522

2019-01-28 Thread Stefano Stabellini
On Mon, 28 Jan 2019, Julien Grall wrote: > On 1/27/19 9:55 AM, Julien Grall wrote: > > Hi, > > > > On 1/25/19 9:36 PM, Stefano Stabellini wrote: > > > On Thu, 24 Jan 2019, Julien Grall wrote: > > > > @James, please correct me if I am wrong below :). > > > > > > > > On 24/01/2019 00:52, Stefano

Re: [Xen-devel] [PATCH for-4.12 v2 5/7] xen/arm: p2m: Only use isb() when it is necessary

2019-01-28 Thread Stefano Stabellini
On Mon, 28 Jan 2019, Julien Grall wrote: > The EL1 translation regime is out-of-context when running at EL2. This > means the processor cannot speculate memory accesses using the registers > associated to that regime. > > An isb() is only needed if Xen is going to use the translation regime >

Re: [Xen-devel] Backport candidate for Arm

2019-01-28 Thread Stefano Stabellini
On Mon, 28 Jan 2019, Julien Grall wrote: > Hi, > > On 1/26/19 1:30 AM, Stefano Stabellini wrote: > > On Mon, 21 Jan 2019, Julien Grall wrote: > > > Hi, > > > > > > Ping? > > > > > > Cheers, > > > > > > On 30/11/2018 17:25, Julien Grall wrote: > > > > Hi, > > > > > > > > Below a list of

Re: [Xen-devel] [PATCH] arch/arm/xen: Remove duplicate header

2019-01-28 Thread Stefano Stabellini
On Mon, 28 Jan 2019, Boris Ostrovsky wrote: > On 1/28/19 3:29 AM, Oleksandr Andrushchenko wrote: > > +Boris and Juergen who can also help getting it in > > I can put this in but I'd like to have Stefano's ack, this being ARM. The patch is OK. Sorry for not replying earlier, this thread fell off

[Xen-devel] [PATCH v3 17/17] libxl: require qemu in dom0 even if stubdomain is in use

2019-01-28 Thread Marek Marczykowski-Górecki
Until xenconsoled learns how to handle multiple consoles, this is needed for save/restore support (qemu state is transferred over secondary consoles). Additionally, Linux-based stubdomain waits for all the backends to initialize during boot. Lack of some console backends results in stubdomain

[Xen-devel] [PATCH v3 04/17] libxl: Allow running qemu-xen in stubdomain

2019-01-28 Thread Marek Marczykowski-Górecki
Do not prohibit anymore using stubdomain with qemu-xen. To help distingushing MiniOS and Linux stubdomain, add helper inline functions libxl__stubdomain_is_linux() and libxl__stubdomain_is_linux_running(). Those should be used where really the difference is about MiniOS/Linux, not

[Xen-devel] [PATCH v3 01/17] Document ioemu MiniOS stubdomain protocol

2019-01-28 Thread Marek Marczykowski-Górecki
Add documentation based on reverse-engineered toolstack-ioemu stubdomain protocol. Signed-off-by: Marek Marczykowski-Górecki --- docs/misc/stubdom.txt | 53 - 1 file changed, 53 insertions(+) diff --git a/docs/misc/stubdom.txt b/docs/misc/stubdom.txt

[Xen-devel] [PATCH v3 06/17] libxl: write qemu arguments into separate xenstore keys

2019-01-28 Thread Marek Marczykowski-Górecki
This allows using arguments with spaces, like -append, without nominating any special "separator" character. Signed-off-by: Marek Marczykowski-Górecki --- Changes in v3: - previous version of this patch "libxl: use \x1b to separate qemu arguments for linux stubdomain" used specific

[Xen-devel] [PATCH v3 12/17] libxl: use vchan for QMP access with Linux stubdomain, libxl__ev_qmp_* version

2019-01-28 Thread Marek Marczykowski-Górecki
Access to QMP of QEMU in Linux stubdomain is possible over vchan connection. Add appropriate handling in libxl__ev_qmp_* API, keeping all the asynchronous properties. Since only one client can be connected to vchan server at the same time and it is not enforced by the libxenvchan itself,

[Xen-devel] [PATCH v3 16/17] libxl: add locking for libvchan QMP connection

2019-01-28 Thread Marek Marczykowski-Górecki
It is not safe for multiple clients to (even try to) connect to the same vchan server at the same time. Contrary to QMP over local socket, connection over vchan needs external locking. For now use flock() for this. This is not ideal for async QMP API, as flock() will block the whole thread while

[Xen-devel] [PATCH v3 07/17] libxl: create vkb device only for guests with graphics output

2019-01-28 Thread Marek Marczykowski-Górecki
The forced vkb device is meant for better performance of qemu access (at least according to ebbd2561b4cefb299f0f68a88b2788504223de18 "libxl: Add a vkbd frontend/backend pair for HVM guests"), which isn't used if there is no configured channel to actually access that keyboard. One can still add

[Xen-devel] [PATCH v3 10/17] libxl: typo fix in comment

2019-01-28 Thread Marek Marczykowski-Górecki
Signed-off-by: Marek Marczykowski-Górecki --- tools/libxl/libxl_qmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c index 42c8ab8..a235095 100644 --- a/tools/libxl/libxl_qmp.c +++ b/tools/libxl/libxl_qmp.c @@ -1452,7 +1452,7

[Xen-devel] [PATCH v3 03/17] libxl: fix qemu-trad cmdline for no sdl/vnc case

2019-01-28 Thread Marek Marczykowski-Górecki
When qemu is running in stubdomain, any attempt to initialize vnc/sdl there will crash it (on failed attempt to load a keymap from a file). If vfb is present, all those cases are skipped. But since b053f0c4c9e533f3d97837cf897eb920b8355ed3 "libxl: do not start dom0 qemu for stubdomain when not

[Xen-devel] [PATCH v3 02/17] Document ioemu Linux stubdomain protocol

2019-01-28 Thread Marek Marczykowski-Górecki
Add documentation for upcoming Linux stubdomain for qemu-upstream. Signed-off-by: Marek Marczykowski-Górecki --- docs/misc/stubdom.txt | 50 - 1 file changed, 50 insertions(+) diff --git a/docs/misc/stubdom.txt b/docs/misc/stubdom.txt index

[Xen-devel] [PATCH v3 00/17] Add support for qemu-xen runnning in a Linux-based stubdomain.

2019-01-28 Thread Marek Marczykowski-Górecki
General idea is to allow freely set device_model_version and device_model_stubdomain_override and choose the right options based on this choice. Also, allow to specific path to stubdomain kernel/ramdisk, for greater flexibility. First two patches add documentation about expected

[Xen-devel] [PATCH v3 15/17] tools: add missing libxenvchan cflags

2019-01-28 Thread Marek Marczykowski-Górecki
libxenvchan.h include xenevtchn.h and xengnttab.h, so applications built with it needs applicable -I in CFLAGS too. Signed-off-by: Marek Marczykowski-Górecki --- tools/Rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Rules.mk b/tools/Rules.mk index

[Xen-devel] [PATCH v3 14/17] libxl: add save/restore support for qemu-xen in stubdomain

2019-01-28 Thread Marek Marczykowski-Górecki
Rely on a wrapper script in stubdomain to attach FD 3/4 of qemu to relevant consoles. Signed-off-by: Marek Marczykowski-Górecki --- Changes in v3: - adjust for qmp_ev* - assume specific fdset id in qemu set in stubdomain --- tools/libxl/libxl_dm.c | 23 +++

[Xen-devel] [PATCH v3 09/17] tools/libvchan: notify server when client is connected

2019-01-28 Thread Marek Marczykowski-Górecki
Let the server know when the client is connected. Otherwise server will notice only when client send some data. This change does not break existing clients, as libvchan user should handle spurious notifications anyway (for example acknowledge of remote side reading the data). Signed-off-by: Marek

[Xen-devel] [PATCH v3 08/17] xl: add stubdomain related options to xl config parser

2019-01-28 Thread Marek Marczykowski-Górecki
Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Jason Andryuk --- docs/man/xl.cfg.5.pod.in | 23 +++ tools/xl/xl_parse.c | 7 +++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in index

[Xen-devel] [PATCH v3 05/17] libxl: Handle Linux stubdomain specific QEMU options.

2019-01-28 Thread Marek Marczykowski-Górecki
From: Eric Shelton This patch creates an appropriate command line for the QEMU instance running in a Linux-based stubdomain. NOTE: a number of items are not currently implemented for Linux-based stubdomains, such as: - save/restore - QMP socket - graphics output (e.g., VNC) Signed-off-by: Eric

[Xen-devel] [PATCH v3 13/17] libxl: use vchan for QMP access with Linux stubdomain, non-async version

2019-01-28 Thread Marek Marczykowski-Górecki
Access to QMP of QEMU in Linux stubdomain is possible over vchan connection. Add appropriate handling to synchronous API. Since only one client can be connected to vchan server at the same time and it is not enforced by the libxenvchan itself, additional client-side locking is needed. Note that

[Xen-devel] [xen-unstable test] 132504: regressions - FAIL

2019-01-28 Thread osstest service owner
flight 132504 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/132504/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 16 guest-localmigrate/x10 fail REGR. vs.

Re: [Xen-devel] [PATCH] arch/arm/xen: Remove duplicate header

2019-01-28 Thread Boris Ostrovsky
On 1/28/19 3:29 AM, Oleksandr Andrushchenko wrote: > +Boris and Juergen who can also help getting it in I can put this in but I'd like to have Stefano's ack, this being ARM. -boris > > On 1/28/19 8:34 AM, Souptick Joarder wrote: >> On Mon, Jan 14, 2019 at 4:08 PM Oleksandr Andrushchenko >>

Re: [Xen-devel] [PATCH v3 3/6] libxl: don't try to manipulate json config for stubdomain

2019-01-28 Thread Marek Marczykowski-Górecki
On Mon, Jan 28, 2019 at 02:41:15PM +, Wei Liu wrote: > On Sat, Jan 26, 2019 at 03:31:14AM +0100, Marek Marczykowski-Górecki wrote: > > Stubdomain do not have it's own config file - its configuration is > > derived from target domains. Do not try to manipulate it when attaching > > PCI device.

[Xen-devel] [freebsd-master test] 132527: trouble: blocked/broken

2019-01-28 Thread osstest service owner
flight 132527 freebsd-master real [real] http://logs.test-lab.xenproject.org/osstest/logs/132527/ Failures and problems with tests :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64-freebsd broken

Re: [Xen-devel] [PATCH v3 4/6] xen/x86: Allow stubdom access to irq created for msi.

2019-01-28 Thread Marek Marczykowski-Górecki
On Mon, Jan 28, 2019 at 02:50:00PM +, Wei Liu wrote: > On Sat, Jan 26, 2019 at 03:31:15AM +0100, Marek Marczykowski-Górecki wrote: > > From: Simon Gaiser > > > > Stubdomains need to be given sufficient privilege over the guest which it > > provides emulation for in order for PCI passthrough

[Xen-devel] [libvirt test] 132511: tolerable all pass - PUSHED

2019-01-28 Thread osstest service owner
flight 132511 libvirt real [real] http://logs.test-lab.xenproject.org/osstest/logs/132511/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 14 saverestore-support-checkfail like 132469 test-armhf-armhf-libvirt-raw 13

[Xen-devel] [xen-unstable-smoke test] 132538: tolerable all pass - PUSHED

2019-01-28 Thread osstest service owner
flight 132538 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/132538/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 13 migrate-support-checkfail never pass test-armhf-armhf-xl

Re: [Xen-devel] xen-4.12~rc1 in ub1804: no vfb objects in pv domU, bug or feature?

2019-01-28 Thread Anthony PERARD
On Sun, Jan 27, 2019 at 02:15:52PM -0800, Pry Mar wrote: > qemu build config: > http://paste.debian.net/plain/1062777/ > > domU startup trace: > http://paste.debian.net/plain/1062768/ > > This release uses qemu-3.0.0 which has a depends on libxentoolcore. > > In xen-4.11.1 with qemu-2.11.2 vfb

Re: [Xen-devel] [PATCH v5 3/8] microcode: introduce the global microcode cache

2019-01-28 Thread Roger Pau Monné
On Mon, Jan 28, 2019 at 03:06:45PM +0800, Chao Gao wrote: > to replace the current per-cpu cache 'uci->mc'. > > Compared to the current per-cpu cache, the benefits of the global > microcode cache are: > 1. It reduces the work that need to be done on each CPU. Parsing ucode > file can be done once

Re: [Xen-devel] [PATCH v5 2/8] microcode/intel: extend microcode_update_match()

2019-01-28 Thread Jan Beulich
>>> On 28.01.19 at 17:55, wrote: > On Mon, Jan 28, 2019 at 03:06:44PM +0800, Chao Gao wrote: >> to a more generic function. Then, this function can compare two given >> microcodes' signature/revision as well. Comparing two microcodes is >> used to update the global microcode cache (introduced by

Re: [Xen-devel] [PATCH for-4.12] arm/p2m: do not invalidate p2m root if it is shared with IOMMU

2019-01-28 Thread Andrii Anisov
On 28.01.19 18:54, Julien Grall wrote: On 1/28/19 4:40 PM, Andrii Anisov wrote: On 28.01.19 18:36, Julien Grall wrote: Hold on, CA57 and CA53 are ARMv8 cores. So are you using 32-bit or 64-bit guests? 64-bit guests. 64-bit guest should not have any Set/Way operations unless you are

Re: [Xen-devel] [PATCH v5 2/8] microcode/intel: extend microcode_update_match()

2019-01-28 Thread Roger Pau Monné
On Mon, Jan 28, 2019 at 03:06:44PM +0800, Chao Gao wrote: > to a more generic function. Then, this function can compare two given > microcodes' signature/revision as well. Comparing two microcodes is > used to update the global microcode cache (introduced by the later > patches in this series)

Re: [Xen-devel] [PATCH for-4.12] arm/p2m: do not invalidate p2m root if it is shared with IOMMU

2019-01-28 Thread Julien Grall
On 1/28/19 4:40 PM, Andrii Anisov wrote: On 28.01.19 18:36, Julien Grall wrote: Hold on, CA57 and CA53 are ARMv8 cores. So are you using 32-bit or 64-bit guests? 64-bit guests. 64-bit guest should not have any Set/Way operations unless you are using a very very old Linux. So what is the

Re: [Xen-devel] [PATCH v2 for-4.12] x86/hvm: Fix bit checking for CR4 and MSR_EFER

2019-01-28 Thread Wei Liu
On Mon, Jan 28, 2019 at 04:40:59PM +, Andrew Cooper wrote: > Before the cpuid_policy logic came along, %cr4/EFER auditing on migrate-in was > complicated, because at that point no CPUID information had been set for the > guest. Auditing against the host CPUID was better than nothing, but not

Re: [Xen-devel] [PATCH v2 for-4.12] x86/hvm: Fix bit checking for CR4 and MSR_EFER

2019-01-28 Thread Jan Beulich
>>> On 28.01.19 at 17:40, wrote: > Before the cpuid_policy logic came along, %cr4/EFER auditing on migrate-in was > complicated, because at that point no CPUID information had been set for the > guest. Auditing against the host CPUID was better than nothing, but not > ideal. > > Similarly at

[Xen-devel] [PATCH v2 for-4.12] x86/hvm: Fix bit checking for CR4 and MSR_EFER

2019-01-28 Thread Andrew Cooper
Before the cpuid_policy logic came along, %cr4/EFER auditing on migrate-in was complicated, because at that point no CPUID information had been set for the guest. Auditing against the host CPUID was better than nothing, but not ideal. Similarly at the time, PVHv1 lacked the "CPUID passed through

Re: [Xen-devel] [PATCH v5 1/8] microcode/intel: remove redundent check against ucode size

2019-01-28 Thread Roger Pau Monné
On Mon, Jan 28, 2019 at 03:06:43PM +0800, Chao Gao wrote: > This check has been done in microcode_sanity_check(). Needn't do it > again in get_matching_microcode(). > > Signed-off-by: Chao Gao Reviewed-by: Roger Pau Monné Thanks, Roger. ___

Re: [Xen-devel] [PATCH for-4.12] arm/p2m: do not invalidate p2m root if it is shared with IOMMU

2019-01-28 Thread Andrii Anisov
On 28.01.19 18:36, Julien Grall wrote: Hold on, CA57 and CA53 are ARMv8 cores. So are you using 32-bit or 64-bit guests? 64-bit guests. 64-bit guest should not have any Set/Way operations unless you are using a very very old Linux. So what is the version of each guest? All of them

Re: [Xen-devel] [PATCH for-4.12] arm/p2m: do not invalidate p2m root if it is shared with IOMMU

2019-01-28 Thread Julien Grall
On 1/28/19 4:32 PM, Andrii Anisov wrote: Hello Julien, Actually I was going to send this patch as RFC, but dropped it at the last moment. On 28.01.19 17:55, Julien Grall wrote: This was missed on purpose. Let me explain why. The call to p2m_invalidate_root() arch_domain_creation_finished

Re: [Xen-devel] [PATCH for-4.12] arm/p2m: do not invalidate p2m root if it is shared with IOMMU

2019-01-28 Thread Andrii Anisov
Hello Julien, Actually I was going to send this patch as RFC, but dropped it at the last moment. On 28.01.19 17:55, Julien Grall wrote: This was missed on purpose. Let me explain why. The call to p2m_invalidate_root() arch_domain_creation_finished is called by *all* the domain at boot to

Re: [Xen-devel] [PATCH for-4.12] pvh/dom0: fix deadlock in GSI mapping

2019-01-28 Thread Jan Beulich
>>> On 28.01.19 at 16:52, wrote: > On Mon, Jan 28, 2019 at 08:30:02AM -0700, Jan Beulich wrote: >> >>> On 28.01.19 at 15:22, wrote: >> > In order to solve it move the vioapic_hwdom_map_gsi outside of the >> > locked region in vioapic_write_redirent. vioapic_hwdom_map_gsi will >> > not access any

[Xen-devel] [PATCH for-4.12] xen/arm: irq: End cleanly spurious interrupt

2019-01-28 Thread Julien Grall
no_irq_type handlers are used when an IRQ does not have action attached. This is useful to detect misconfiguration between the interrupt controller and the software. Currently, all the handlers will do nothing on spurious interrupt. This means if such interrupt is received, the priority of the

[Xen-devel] [PATCH for-next] xen/arm: irq: Don't use _IRQ_PENDING when handling host interrupt

2019-01-28 Thread Julien Grall
While SPIs are shared between CPU, it is not possible to receive the same interrupts on a different CPU while the interrupt is in active state. The deactivation of the interrupt is done at the end of the handling. This means the _IRQ_PENDING logic is unecessary on Arm as a same interrupt can

[Xen-devel] [linux-linus test] 132499: regressions - FAIL

2019-01-28 Thread osstest service owner
flight 132499 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/132499/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-examine 4 memdisk-try-append fail REGR. vs. 132451 Tests which did

Re: [Xen-devel] [PATCH for-4.12] arm/p2m: do not invalidate p2m root if it is shared with IOMMU

2019-01-28 Thread Julien Grall
Hi, On 1/28/19 3:34 PM, Andrii Anisov wrote: From: Andrii Anisov In case if the p2m table is shared to IOMMU, invalidating it turns IOMMU to translation faults that could be not repaired. Fixed patch check for the corresponded condition and has a comment for one introduced

Re: [Xen-devel] [PATCH for-4.12] x86/hvm: Fix hvm_cr4_guest_valid_bits() for PVH dom0

2019-01-28 Thread Andrew Cooper
On 28/01/2019 15:50, Jan Beulich wrote: On 28.01.19 at 16:36, wrote: >> On 28/01/2019 15:22, Jan Beulich wrote: >> On 28.01.19 at 14:56, wrote: Before the cpuid_policy logic came along, %cr4 auditing on migrate-in was complicated, because at that point no CPUID information had

Re: [Xen-devel] [PATCH for-4.12] pvh/dom0: fix deadlock in GSI mapping

2019-01-28 Thread Roger Pau Monné
On Mon, Jan 28, 2019 at 08:30:02AM -0700, Jan Beulich wrote: > >>> On 28.01.19 at 15:22, wrote: > > In order to solve it move the vioapic_hwdom_map_gsi outside of the > > locked region in vioapic_write_redirent. vioapic_hwdom_map_gsi will > > not access any of the vioapic fields, so there's no

Re: [Xen-devel] [PATCH v3] x86/AMD: flush TLB after ucode update

2019-01-28 Thread Woods, Brian
On 1/28/19 8:25 AM, Andrew Cooper wrote: > On 28/01/2019 14:19, Jan Beulich wrote: --- a/xen/arch/x86/microcode_amd.c +++ b/xen/arch/x86/microcode_amd.c @@ -218,6 +218,12 @@ static int apply_microcode(unsigned int spin_unlock_irqrestore(_update_lock, flags);

Re: [Xen-devel] [PATCH for-4.12] x86/hvm: Fix hvm_cr4_guest_valid_bits() for PVH dom0

2019-01-28 Thread Jan Beulich
>>> On 28.01.19 at 16:36, wrote: > On 28/01/2019 15:22, Jan Beulich wrote: > On 28.01.19 at 14:56, wrote: >>> Before the cpuid_policy logic came along, %cr4 auditing on migrate-in was >>> complicated, because at that point no CPUID information had been set for the >>> guest. Auditing

Re: [Xen-devel] [PATCH for-4.12] x86/hvm: Fix hvm_cr4_guest_valid_bits() for PVH dom0

2019-01-28 Thread Andrew Cooper
On 28/01/2019 15:22, Jan Beulich wrote: On 28.01.19 at 14:56, wrote: >> Before the cpuid_policy logic came along, %cr4 auditing on migrate-in was >> complicated, because at that point no CPUID information had been set for the >> guest. Auditing against the host CPUID was better than

[Xen-devel] [PATCH for-4.12] arm/p2m: do not invalidate p2m root if it is shared with IOMMU

2019-01-28 Thread Andrii Anisov
From: Andrii Anisov In case if the p2m table is shared to IOMMU, invalidating it turns IOMMU to translation faults that could be not repaired. Fixed patch check for the corresponded condition and has a comment for one introduced p2m_invalidate_root() call, but miss them for another. So put the

Re: [Xen-devel] [PATCH for-4.12] x86/hvm: Fix hvm_cr4_guest_valid_bits() for PVH dom0

2019-01-28 Thread Andrew Cooper
On 28/01/2019 15:22, Wei Liu wrote: > On Mon, Jan 28, 2019 at 01:56:29PM +, Andrew Cooper wrote: >> Before the cpuid_policy logic came along, %cr4 auditing on migrate-in was >> complicated, because at that point no CPUID information had been set for the >> guest. Auditing against the host

Re: [Xen-devel] [PATCH for-4.12] pvh/dom0: fix deadlock in GSI mapping

2019-01-28 Thread Jan Beulich
>>> On 28.01.19 at 15:22, wrote: > In order to solve it move the vioapic_hwdom_map_gsi outside of the > locked region in vioapic_write_redirent. vioapic_hwdom_map_gsi will > not access any of the vioapic fields, so there's no need to call the > function holding the hvm.irq_lock. True, but you

Re: [Xen-devel] [PATCH for-4.12] x86/hvm: Fix hvm_cr4_guest_valid_bits() for PVH dom0

2019-01-28 Thread Wei Liu
On Mon, Jan 28, 2019 at 01:56:29PM +, Andrew Cooper wrote: > Before the cpuid_policy logic came along, %cr4 auditing on migrate-in was > complicated, because at that point no CPUID information had been set for the > guest. Auditing against the host CPUID was better than nothing, but not >

Re: [Xen-devel] [PATCH for-4.12] pvh/dom0: fix deadlock in GSI mapping

2019-01-28 Thread Wei Liu
On Mon, Jan 28, 2019 at 03:22:45PM +0100, Roger Pau Monne wrote: > The current GSI mapping code can cause the following deadlock: > > (XEN) *** Dumping CPU0 host state: *** > (XEN) [ Xen-4.12.0-rc x86_64 debug=y Tainted: C ] > [...] > (XEN) Xen call trace: > (XEN)[]

Re: [Xen-devel] [PATCH SpectreV1+L1TF v4 05/11] common/grant_table: block speculative out-of-bound accesses

2019-01-28 Thread Jan Beulich
>>> On 28.01.19 at 15:45, wrote: > On 1/23/19 14:37, Jan Beulich wrote: > On 23.01.19 at 12:51, wrote: >>> @@ -2223,7 +2231,8 @@ gnttab_transfer( >>> okay = gnttab_prepare_for_transfer(e, d, gop.ref); >>> spin_lock(>page_alloc_lock); >>> >>> -if ( unlikely(!okay)

Re: [Xen-devel] [PATCH v3 5/6] xen/x86: add PHYSDEVOP_msi_msix_set_enable

2019-01-28 Thread Wei Liu
On Sat, Jan 26, 2019 at 03:31:16AM +0100, Marek Marczykowski-Górecki wrote: > Allow device model running in stubdomain to enable/disable MSI(-X), > bypassing pciback. While pciback is still used to access config space > from within stubdomain, it refuse to write to >

Re: [Xen-devel] [PATCH v3 4/6] xen/x86: Allow stubdom access to irq created for msi.

2019-01-28 Thread Wei Liu
On Sat, Jan 26, 2019 at 03:31:15AM +0100, Marek Marczykowski-Górecki wrote: > From: Simon Gaiser > > Stubdomains need to be given sufficient privilege over the guest which it > provides emulation for in order for PCI passthrough to work correctly. > When a HVM domain try to enable MSI, QEMU in

Re: [Xen-devel] [PATCH SpectreV1+L1TF v4 05/11] common/grant_table: block speculative out-of-bound accesses

2019-01-28 Thread Norbert Manthey
On 1/23/19 14:37, Jan Beulich wrote: On 23.01.19 at 12:51, wrote: >> @@ -1268,7 +1272,8 @@ unmap_common( >> } >> >> smp_rmb(); >> -map = _entry(lgt, op->handle); >> +map = _entry(lgt, array_index_nospec(op->handle, >> +

Re: [Xen-devel] [PATCH v3 6/6] tools/libxc: add wrapper for PHYSDEVOP_msi_msix_set_enable

2019-01-28 Thread Wei Liu
On Sat, Jan 26, 2019 at 03:31:17AM +0100, Marek Marczykowski-Górecki wrote: > Add libxc wrapper for PHYSDEVOP_msi_msix_set_enable introduced in > previous commit. > > Signed-off-by: Marek Marczykowski-Górecki Assuming the addition of physdev ops is accepted: Acked-by: Wei Liu

Re: [Xen-devel] [PATCH v3 3/6] libxl: don't try to manipulate json config for stubdomain

2019-01-28 Thread Wei Liu
On Sat, Jan 26, 2019 at 03:31:14AM +0100, Marek Marczykowski-Górecki wrote: > Stubdomain do not have it's own config file - its configuration is > derived from target domains. Do not try to manipulate it when attaching > PCI device. > So if we add the same configuration to stubdom as well, what

Re: [Xen-devel] [PATCH v3] x86/AMD: flush TLB after ucode update

2019-01-28 Thread Andrew Cooper
On 28/01/2019 14:19, Jan Beulich wrote: >>> --- a/xen/arch/x86/microcode_amd.c >>> +++ b/xen/arch/x86/microcode_amd.c >>> @@ -218,6 +218,12 @@ static int apply_microcode(unsigned int >>> >>> spin_unlock_irqrestore(_update_lock, flags); >>> >>> +/* >>> + * Experimentally this helps

Re: [Xen-devel] [PATCH v3 1/6] libxl: do not attach xen-pciback to HVM domain, if stubdomain is in use

2019-01-28 Thread Wei Liu
On Sat, Jan 26, 2019 at 03:31:12AM +0100, Marek Marczykowski-Górecki wrote: > HVM domains use IOMMU and device model assistance for communicating with > PCI devices, xen-pcifront/pciback isn't directly needed by HVM domain. > But pciback serve also second function - it reset the device when it is

Re: [Xen-devel] [PATCH v3 2/6] libxl: attach PCI device to qemu only after setting pciback/pcifront

2019-01-28 Thread Wei Liu
On Sat, Jan 26, 2019 at 03:31:13AM +0100, Marek Marczykowski-Górecki wrote: > When qemu is running in stubdomain, handling "pci-ins" command will fail > if pcifront is not initialized already. Fix this by sending such command > only after confirming that pciback/front is running. > >

Re: [Xen-devel] [PATCH v3] x86/AMD: flush TLB after ucode update

2019-01-28 Thread Jan Beulich
>>> On 28.01.19 at 12:40, wrote: > On 28/01/2019 09:51, Jan Beulich wrote: >> The increased number of messages (spec_ctrl.c:print_details()) within a >> certain time window made me notice some slowness of boot time screen >> output. Experimentally I've narrowed the time window to be from >>

Re: [Xen-devel] SpectreV1+L1TF Patch Series

2019-01-28 Thread Norbert Manthey
On 1/24/19 22:05, Andrew Cooper wrote: > On 23/01/2019 11:51, Norbert Manthey wrote: >> Dear all, >> >> This patch series attempts to mitigate the issue that have been raised in the >> XSA-289 (https://xenbits.xen.org/xsa/advisory-289.html). To block speculative >> execution on Intel hardware, an

[Xen-devel] [PATCH for-4.12] x86/hvm: Fix hvm_cr4_guest_valid_bits() for PVH dom0

2019-01-28 Thread Andrew Cooper
Before the cpuid_policy logic came along, %cr4 auditing on migrate-in was complicated, because at that point no CPUID information had been set for the guest. Auditing against the host CPUID was better than nothing, but not ideal. Order of information in the migration stream is still an issue

Re: [Xen-devel] [PATCH v2.1 2/2] x86emul: fix test harness and fuzzer build dependencies

2019-01-28 Thread Wei Liu
On Fri, Jan 25, 2019 at 12:34:18AM -0700, Jan Beulich wrote: > Commit fd35f32b4b ("tools/x86emul: Use struct cpuid_policy in the > userspace test harnesses") didn't account for the dependencies of > cpuid-autogen.h to potentially change between incremental builds. > In particular the harness has a

Re: [Xen-devel] [PATCH v2.1 1/2] tools: fix build dependency upon generated header(s)

2019-01-28 Thread Wei Liu
On Fri, Jan 25, 2019 at 12:33:49AM -0700, Jan Beulich wrote: > Commit fd35f32b4b ("tools/x86emul: Use struct cpuid_policy in the > userspace test harnesses") didn't account for the dependencies of > cpuid-autogen.h to potentially change between incremental builds. > Putting the make invocation to

Re: [Xen-devel] [PATCH-for-4.10/4.11] libxl: don't set gnttab limits in soft reset case

2019-01-28 Thread Wei Liu
On Thu, Jan 17, 2019 at 05:40:59PM +0100, Juergen Gross wrote: > In case of soft reset the gnttab limit setting will fail, so omit it. > Setting of max vcpu count is pointless in this case, too, so we can > drop that as well. > > Without this patch soft reset will fail with: > > libxl: error:

[Xen-devel] Patch "x86/entry/64/compat: Fix stack switching for XEN PV" has been added to the 4.19-stable tree

2019-01-28 Thread gregkh
This is a note to let you know that I've just added the patch titled x86/entry/64/compat: Fix stack switching for XEN PV to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is:

[Xen-devel] Patch "x86/entry/64/compat: Fix stack switching for XEN PV" has been added to the 4.20-stable tree

2019-01-28 Thread gregkh
This is a note to let you know that I've just added the patch titled x86/entry/64/compat: Fix stack switching for XEN PV to the 4.20-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is:

Re: [Xen-devel] [PATCH SpectreV1+L1TF v4 09/11] x86/vioapic: block speculative out-of-bound accesses

2019-01-28 Thread Norbert Manthey
On 1/28/19 12:12, Jan Beulich wrote: On 28.01.19 at 12:03, wrote: >> On 1/25/19 17:34, Jan Beulich wrote: >> On 23.01.19 at 12:57, wrote: @@ -212,7 +217,12 @@ static void vioapic_write_redirent( struct hvm_irq *hvm_irq = hvm_domain_irq(d); union

Re: [Xen-devel] [PATCH] tools/libxl: Fix leaking ssid_label in libxl_name_to_domid

2019-01-28 Thread Wei Liu
On Sat, Jan 26, 2019 at 10:45:07PM -0700, Tamas K Lengyel wrote: > On systems with XSM enabled libxl_name_to_domid leaks memory > allocated for ssid_label: > > ==2693== 53 bytes in 2 blocks are definitely lost in loss record 4 of 8 > ==2693==at 0x4C2BE6D: malloc (vg_replace_malloc.c:309) >

Re: [Xen-devel] [PATCH for-4.12] arm: gic: deactivate sgi immediately after eoi

2019-01-28 Thread Juergen Gross
On 24/01/2019 13:43, Peng Fan wrote: > On i.MX8, we implemented partition reboot which means Cortex-A reboot > will not impact M4 cores and System control Unit core. However GICv3 > is not reset because we also need to support A72 Cluster reboot without > affecting A53 Cluster. > > The gic-v3

Re: [Xen-devel] [PATCH for-4.12] libxl: When restricted, start QEMU paused

2019-01-28 Thread Juergen Gross
On 24/01/2019 13:29, Anthony PERARD wrote: > Since libxl later during guest creation run the command "cont", it kind > of expect that QEMU would not do any emulation, use the "-S" command > option to make this effective. Unfortunately, when QEMU is started with > "-S", it won't write QEMU's

Re: [Xen-devel] [PATCH v3] x86/AMD: flush TLB after ucode update

2019-01-28 Thread Juergen Gross
On 28/01/2019 10:51, Jan Beulich wrote: > The increased number of messages (spec_ctrl.c:print_details()) within a > certain time window made me notice some slowness of boot time screen > output. Experimentally I've narrowed the time window to be from > immediately after the early ucode update on

Re: [Xen-devel] [PATCH for-4.12 v2 0/7] xen/arm: Workaround for Cortex-A76 erratum 1165522

2019-01-28 Thread Juergen Gross
On 28/01/2019 12:50, Julien Grall wrote: > Hi all, > > Early version of Cortex-A76 can end-up with corrupt TLBs if they > speculate an AT instruction while the S1/S2 system registers are in an > inconsistent state. > > This can happen during guest context switch and when invalidating the > TLBs

Re: [Xen-devel] [PATCH v2 for-4.12] gic-vgic: fix an assert condition

2019-01-28 Thread Juergen Gross
On 25/01/2019 18:06, Andrii Anisov wrote: > From: Andrii Anisov > > Currently, that assert condition does not correspond to a comment above > and makes assertion failed on HW IRQ disconnection. > Fix the condition so it corresponds to the comment and allows IRQ > disconnection on debug builds. >

Re: [Xen-devel] [PATCH v6 1/3] xen/pt: fix some pass-thru devices don't work across reboot

2019-01-28 Thread Chao Gao
On Fri, Jan 25, 2019 at 09:13:49AM -0700, Jan Beulich wrote: On 25.01.19 at 09:26, wrote: >> --- a/xen/arch/x86/domctl.c >> +++ b/xen/arch/x86/domctl.c >> @@ -732,7 +732,11 @@ long arch_do_domctl( >> break; >> >> ret = -EPERM; >> -if ( irq <= 0 ||

[Xen-devel] [PATCH for-4.12 v2 4/7] xen/arm: domain_build: Don't switch to the guest P2M when copying data

2019-01-28 Thread Julien Grall
Until recently, kernel/initrd/dtb were loaded using guest VA and therefore requiring to restore temporarily the P2M. This was reworked in a series of commits (up to 9292086 "xen/arm: domain_build: Use copy_to_guest_phys_flush_dcache in dtb_load") to use a guest PA. This will also help a follow-up

[Xen-devel] [PATCH for-4.12 v2 6/7] xen/arm: Implement workaround for Cortex-A76 erratum 1165522

2019-01-28 Thread Julien Grall
Early version of Cortex-A76 can end-up with corrupt TLBs if they speculate an AT instruction while the S1/S2 system registers are in an inconsistent state. This can happen during guest context switch and when invalidating the TLBs for other than the current VMID. The workaround implemented in

[Xen-devel] [PATCH for-4.12 v2 0/7] xen/arm: Workaround for Cortex-A76 erratum 1165522

2019-01-28 Thread Julien Grall
Hi all, Early version of Cortex-A76 can end-up with corrupt TLBs if they speculate an AT instruction while the S1/S2 system registers are in an inconsistent state. This can happen during guest context switch and when invalidating the TLBs for other than the current VMID. The workaround

[Xen-devel] [PATCH for-4.12 v2 5/7] xen/arm: p2m: Only use isb() when it is necessary

2019-01-28 Thread Julien Grall
The EL1 translation regime is out-of-context when running at EL2. This means the processor cannot speculate memory accesses using the registers associated to that regime. An isb() is only needed if Xen is going to use the translation regime before returning to the guest (exception returns will

[Xen-devel] [PATCH for-4.12 v2 1/7] xen/arm: Only set necessary flags when initializing HCR_EL2

2019-01-28 Thread Julien Grall
Only {A,F,I}MO are necessary to receive interrupts until a guest vCPU is loaded. The rest have no effect on Xen and it is better to avoid setting them. Signed-off-by: Julien Grall Reviewed-by: Andrii Anisov Reviewed-by: Stefano Stabellini --- Changes in v2: - Fix typo -

[Xen-devel] [PATCH for-4.12 v2 2/7] xen/arm: p2m: Provide an helper to generate the VTTBR

2019-01-28 Thread Julien Grall
A follow-up patch will need to generate the VTTBR in a few places. Signed-off-by: Julien Grall Reviewed-by: Andrii Anisov Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Andrii's and Stefano's reviewed-by --- xen/arch/arm/p2m.c | 7 ++- 1 file changed, 6

[Xen-devel] [PATCH for-4.12 v2 7/7] DO NOT APPLY Allow testing the new AT speculate workaround code

2019-01-28 Thread Julien Grall
Signed-off-by: Julien Grall --- xen/arch/arm/cpuerrata.c | 10 ++ xen/arch/arm/p2m.c | 2 ++ 2 files changed, 12 insertions(+) diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c index 4431b244fd..727c67451d 100644 --- a/xen/arch/arm/cpuerrata.c +++

[Xen-devel] [PATCH for-4.12 v2 3/7] xen/arm: p2m: Introduce an helper to allocate the root page-table

2019-01-28 Thread Julien Grall
A follow-up patch will require to allocate the root page-table without having a domain in hand. Signed-off-by: Julien Grall Reviewed-by: Andrii Anisov Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Andrii's and Stefano's reviewed-by --- xen/arch/arm/p2m.c | 16

Re: [Xen-devel] [PATCH 1/2] xen: add interface for obtaining .config from hypervisor

2019-01-28 Thread Jan Beulich
>>> On 28.01.19 at 12:40, wrote: On 17.01.19 at 15:57, wrote: >> @@ -83,3 +84,9 @@ subdir-$(CONFIG_UBSAN) += ubsan >> >> subdir-$(CONFIG_NEEDS_LIBELF) += libelf >> subdir-$(CONFIG_HAS_DEVICE_TREE) += libfdt >> + >> +config_data.c: ../.config >> +( echo "const char xen_config_data[]

Re: [Xen-devel] [PATCH v3] x86/AMD: flush TLB after ucode update

2019-01-28 Thread Andrew Cooper
On 28/01/2019 09:51, Jan Beulich wrote: > The increased number of messages (spec_ctrl.c:print_details()) within a > certain time window made me notice some slowness of boot time screen > output. Experimentally I've narrowed the time window to be from > immediately after the early ucode update on

Re: [Xen-devel] [PATCH 1/2] xen: add interface for obtaining .config from hypervisor

2019-01-28 Thread Jan Beulich
>>> On 17.01.19 at 15:57, wrote: > @@ -83,3 +84,9 @@ subdir-$(CONFIG_UBSAN) += ubsan > > subdir-$(CONFIG_NEEDS_LIBELF) += libelf > subdir-$(CONFIG_HAS_DEVICE_TREE) += libfdt > + > +config_data.c: ../.config > + ( echo "const char xen_config_data[] ="; \ > + cat $< | gzip |

  1   2   >