[Xen-devel] [PATCH v5 2/8] docs: add feature document for Xen hypervisor sysfs-like support

2020-02-19 Thread Juergen Gross
On the 2019 Xen developer summit there was agreement that the Xen hypervisor should gain support for a hierarchical name-value store similar to the Linux kernel's sysfs. In the beginning there should only be basic support: entries can be added from the hypervisor itself only, there is a simple hyp

[Xen-devel] [PATCH v5 6/8] xen: provide version information in hypfs

2020-02-19 Thread Juergen Gross
Provide version and compile information in /buildinfo/ node of the Xen hypervisor file system. As this information is accessible by dom0 only no additional security problem arises. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V3: - new patch V4: - add __read_mostly annotations (Jan

[Xen-devel] [PATCH v5 0/8] Add hypervisor sysfs-like support

2020-02-19 Thread Juergen Gross
On the 2019 Xen developer summit there was agreement that the Xen hypervisor should gain support for a hierarchical name-value store similar to the Linux kernel's sysfs. This is a first implementation of that idea adding the basic functionality to hypervisor and tools side. The interface to any us

[Xen-devel] [PATCH v5 5/8] tools: add xenfs tool

2020-02-19 Thread Juergen Gross
Add the xenfs tool for accessing the hypervisor filesystem. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- V1: - rename to xenhypfs - don't use "--" for subcommands - add write support V2: - escape non-printable characters per default with cat subcommand (Ian Jackson) - add -b option to c

[Xen-devel] [PATCH v5 8/8] xen: add runtime parameter access support to hypfs

2020-02-19 Thread Juergen Gross
Add support to read and modify values of hypervisor runtime parameters via the hypervisor file system. As runtime parameters can be modified via a sysctl, too, this path has to take the hypfs rw_lock as writer. For custom runtime parameters the resulting parameter value needs to be stored in a st

[Xen-devel] [PATCH v5 3/8] xen: add basic hypervisor filesystem support

2020-02-19 Thread Juergen Gross
Add the infrastructure for the hypervisor filesystem. This includes the hypercall interface and the base functions for entry creation, deletion and modification. In order not to have to repeat the same pattern multiple times in case adding a new node should BUG_ON() failure, the helpers for addin

[Xen-devel] [PATCH v5 4/8] libs: add libxenhypfs

2020-02-19 Thread Juergen Gross
Add the new library libxenhypfs for access to the hypervisor filesystem. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- V1: - rename to libxenhypfs - add xenhypfs_write() V3: - major rework due to new hypervisor interface - add decompression capability V4: - add dependency to libz in pkgco

[Xen-devel] [PATCH v5 1/8] xen: add a generic way to include binary files as variables

2020-02-19 Thread Juergen Gross
Add a new script xen/tools/binfile for including a binary file at build time being usable via a pointer and a size variable in the hypervisor. Make use of that generic tool in xsm. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V3: - new patch V4: - add alignment parameter (Jan Beul

[Xen-devel] [PATCH v5 7/8] xen: add /buildinfo/config entry to hypervisor filesystem

2020-02-19 Thread Juergen Gross
Add the /buildinfo/config entry to the hypervisor filesystem. This entry contains the .config file used to build the hypervisor. Signed-off-by: Juergen Gross --- V3: - store data in gzip format - use binfile mechanism to create data file - move code to kernel.c --- .gitignore |

[Xen-devel] [PATCH] x86: "spec-ctrl=no-xen" should also disable branch hardening

2020-02-19 Thread Jan Beulich
This is controlling Xen behavior alone, after all. Reported-by: Jin Nan Wang Signed-off-by: Jan Beulich --- a/xen/arch/x86/spec_ctrl.c +++ b/xen/arch/x86/spec_ctrl.c @@ -98,8 +98,6 @@ static int __init parse_spec_ctrl(const if ( opt_pv_l1tf_domu < 0 ) opt_pv_l1tf_d

Re: [Xen-devel] [BUG] panic: "IO-APIC + timer doesn't work" - several people have reproduced

2020-02-19 Thread Jan Beulich
On 18.02.2020 22:45, Andrew Cooper wrote: > On 18/02/2020 18:43, Jason Andryuk wrote: >> On Mon, Feb 17, 2020, 8:22 PM Andrew Cooper >> wrote: >>> On 17/02/2020 20:41, Jason Andryuk wrote: On Mon, Feb 17, 2020 at 2:46 PM Andrew Cooper wrote: > On 17/02/2020 19:19, Jason Andryuk wr

Re: [Xen-devel] [PATCH] x86/ioperm: add new paravirt function update_io_bitmap

2020-02-19 Thread Jan Beulich
On 19.02.2020 06:35, Jürgen Groß wrote: > On 18.02.20 22:03, Thomas Gleixner wrote: >> Juergen Gross writes: >>> Commit 111e7b15cf10f6 ("x86/ioperm: Extend IOPL config to control >>> ioperm() as well") reworked the iopl syscall to use I/O bitmaps. >>> >>> Unfortunately this broke Xen PV domains us

[Xen-devel] [PATCH V3] x86/altp2m: Hypercall to set altp2m view visibility

2020-02-19 Thread Alexandru Stefan ISAILA
At this moment a guest can call vmfunc to change the altp2m view. This should be limited in order to avoid any unwanted view switch. The new xc_altp2m_set_visibility() solves this by making views invisible to vmfunc. This is done by having a separate arch.altp2m_working_eptp that is populated and

Re: [Xen-devel] [PATCH] x86/ioperm: add new paravirt function update_io_bitmap

2020-02-19 Thread Thomas Gleixner
Jürgen Groß writes: > On 18.02.20 22:03, Thomas Gleixner wrote: >> BTW, why isn't stuff like this not catched during next or at least >> before the final release? Is nothing running CI on upstream with all >> that XEN muck active? > > This problem showed up by not being able to start the X server

Re: [Xen-devel] [PATCH] x86/ioperm: add new paravirt function update_io_bitmap

2020-02-19 Thread Jürgen Groß
On 19.02.20 10:22, Thomas Gleixner wrote: Jürgen Groß writes: On 18.02.20 22:03, Thomas Gleixner wrote: BTW, why isn't stuff like this not catched during next or at least before the final release? Is nothing running CI on upstream with all that XEN muck active? This problem showed up by not

[Xen-devel] [PATCH v6 1/6] libxl: add infrastructure to track and query 'recent' domids

2020-02-19 Thread Paul Durrant
A domid is considered recent if the domain it represents was destroyed less than a specified number of seconds ago. For debugging and/or testing purposes the number can be set using the environment variable LIBXL_DOMID_REUSE_TIMEOUT. If the variable does not exist then a default value of 60s is use

[Xen-devel] [PATCH v6 3/6] public/xen.h: add a definition for a 'valid domid' mask

2020-02-19 Thread Paul Durrant
A subsequent patch will modify libxl to allow selection of a random domid value when creating domains. Valid values are limited to a width of 15 bits, so add an appropriate mask definition to the public header. Signed-off-by: Paul Durrant --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson

[Xen-devel] [PATCH v6 2/6] libxl: modify libxl__logv() to only log valid domid values

2020-02-19 Thread Paul Durrant
Some code-paths use values other than INVALID_DOMID to indicate an invalid domain id. Specifically, xl will pass a value of 0 when creating/restoring a domain. Therefore modify libxl__logv() to use libxl_domid_valid_guest() as a validity test. Signed-off-by: Paul Durrant --- Cc: Ian Jackson Cc:

[Xen-devel] [PATCH v6 6/6] xl: allow domid to be preserved on save/restore or migrate

2020-02-19 Thread Paul Durrant
This patch adds a '-D' command line option to save and migrate to allow the domain id to be incorporated into the saved domain configuration and hence be preserved. NOTE: Logically it may seem as though preservation of domid should be dealt with by libxl, but the libxl migration stream has n

[Xen-devel] [PATCH v6 0/6] xl/libxl: domid allocation/preservation changes

2020-02-19 Thread Paul Durrant
Paul Durrant (6): libxl: add infrastructure to track and query 'recent' domids libxl: modify libxl__logv() to only log valid domid values public/xen.h: add a definition for a 'valid domid' mask libxl: allow creation of domains with a specified or random domid xl.conf: introduce 'domid_pol

[Xen-devel] [PATCH v6 4/6] libxl: allow creation of domains with a specified or random domid

2020-02-19 Thread Paul Durrant
This patch adds a 'domid' field to libxl_domain_create_info and then modifies libxl__domain_make() to have Xen use that value if it is valid. If the domid value is invalid then Xen will choose the domid, as before, unless the value is the new special RANDOM_DOMID value added to the API. This value

[Xen-devel] [PATCH v6 5/6] xl.conf: introduce 'domid_policy'

2020-02-19 Thread Paul Durrant
This patch adds a new global 'domid_policy' configuration option to decide how domain id values are allocated for new domains. It may be set to one of two values: "xen", the default value, will cause an invalid domid value to be passed to do_domain_create() preserving the existing behaviour of hav

[Xen-devel] [xen-unstable-coverity test] 147290: all pass - PUSHED

2020-02-19 Thread osstest service owner
flight 147290 xen-unstable-coverity real [real] http://logs.test-lab.xenproject.org/osstest/logs/147290/ Perfect :-) All tests in this flight passed as required version targeted for testing: xen c47984aabead53918e5ba6d43cdb3f1467452739 baseline version: xen 707d

[Xen-devel] [PATCH 04/52] drm: Set final_kfree in drm_dev_alloc

2020-02-19 Thread Daniel Vetter
I also did a full review of all callers, and only the xen driver forgot to call drm_dev_put in the failure path. Fix that up too. v2: I noticed that xen has a drm_driver.release hook, and uses drm_dev_alloc(). We need to remove the kfree from xen_drm_drv_release(). bochs also has a release hook,

[Xen-devel] [PATCH v6 3/3] nvmx: always trap accesses to x2APIC MSRs

2020-02-19 Thread Roger Pau Monne
Nested VMX doesn't expose support for SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE, SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY or SECONDARY_EXEC_APIC_REGISTER_VIRT, and hence the x2APIC MSRs should always be trapped in the nested guest MSR bitmap, or else a nested guest could access the hardware x2APIC MSRs giv

[Xen-devel] [PATCH v6 2/3] bitmap: import bitmap_{set/clear} from Linux 5.5

2020-02-19 Thread Roger Pau Monne
Import the functions and it's dependencies. Based on Linux 5.5, commit id d5226fa6dbae0569ee43ecfc08bdcd6770fc4755. Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich --- Changes since v4: - Introduce BIT_WORD in generic header bitops.h (instead of the x86 one). - Include byteorder.h for

[Xen-devel] [PATCH v6 1/3] arm: rename BIT_{WORD/MASK/PER_WORD) to BITOP_*

2020-02-19 Thread Roger Pau Monne
So BIT_WORD can be imported from Linux. The difference between current Linux implementation of BIT_WORD is that the size of the word unit is a long integer, while the Xen one is hardcoded to 32 bits. Current users of BITOP_WORD on Arm (which considers a word a long integer) are switched to use the

[Xen-devel] [PATCH v6 0/3] nvmx: implement support for MSR bitmaps

2020-02-19 Thread Roger Pau Monne
Hello, Patch #3 makes sure the x2APIC MSR range is always trapped, or else a guest with nested virtualization enabled could manage to access some of the x2APIC MSR registers from the host. Previous patches are preparatory patches in order to import bitmap_{set/clear}. Thanks, Roger. Roger Pau Mo

[Xen-devel] [PATCH] xen: Enable interrupts when calling _cond_resched()

2020-02-19 Thread Thomas Gleixner
xen_maybe_preempt_hcall() is called from the exception entry point xen_do_hypervisor_callback with interrupts disabled. _cond_resched() evades the might_sleep() check in cond_resched() which would have caught that and schedule_debug() unfortunately lacks a check for irqs_disabled(). Enable interr

[Xen-devel] [PATCH] amd/iommu: add missing unlock in iommu_read_log

2020-02-19 Thread Roger Pau Monne
Reported-by: Coverity CID: 1458632 Fixes: 709d3ddea2d5e ('AMD/IOMMU: Common the #732/#733 errata handling in iommu_read_log()') Signed-off-by: Roger Pau Monné --- xen/drivers/passthrough/amd/iommu_init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/drivers/passthrough/amd/iommu_init.c

Re: [Xen-devel] [PATCH] amd/iommu: add missing unlock in iommu_read_log

2020-02-19 Thread Andrew Cooper
On 19/02/2020 11:19, Roger Pau Monne wrote: > Reported-by: Coverity > CID: 1458632 We tend to use just Coverity-ID: 1458632 > Fixes: 709d3ddea2d5e ('AMD/IOMMU: Common the #732/#733 errata handling in > iommu_read_log()') > Signed-off-by: Roger Pau Monné > --- > xen/drivers/passthrough/amd/iomm

Re: [Xen-devel] [PATCH] amd/iommu: add missing unlock in iommu_read_log

2020-02-19 Thread Roger Pau Monné
On Wed, Feb 19, 2020 at 11:23:40AM +, Andrew Cooper wrote: > On 19/02/2020 11:19, Roger Pau Monne wrote: > > Reported-by: Coverity > > CID: 1458632 > > We tend to use just Coverity-ID: 1458632 Oh, I got confused with FreeBSD usage of CID. > > > Fixes: 709d3ddea2d5e ('AMD/IOMMU: Common the #

Re: [Xen-devel] [PATCH v6 1/3] arm: rename BIT_{WORD/MASK/PER_WORD) to BITOP_*

2020-02-19 Thread Julien Grall
Hi Roger, On 19/02/2020 10:22, Roger Pau Monne wrote: So BIT_WORD can be imported from Linux. The difference between current Linux implementation of BIT_WORD is that the size of the word unit is a long integer, while the Xen one is hardcoded to 32 bits. Current users of BITOP_WORD on Arm (which

Re: [Xen-devel] [PATCH v6 1/3] arm: rename BIT_{WORD/MASK/PER_WORD) to BITOP_*

2020-02-19 Thread Roger Pau Monné
On Wed, Feb 19, 2020 at 11:35:16AM +, Julien Grall wrote: > Hi Roger, > > On 19/02/2020 10:22, Roger Pau Monne wrote: > > So BIT_WORD can be imported from Linux. The difference between current > > Linux implementation of BIT_WORD is that the size of the word unit is > > a long integer, while t

[Xen-devel] [PATCH v4 1/3] x86/hypervisor: pass flags to hypervisor_flush_tlb

2020-02-19 Thread Wei Liu
Hyper-V's L0 assisted flush has fine-grained control over what gets flushed. We need all the flags available to make the best decisions possible. No functional change because Xen's implementation doesn't care about what is passed to it. Signed-off-by: Wei Liu Reviewed-by: Roger Pau Monné Review

[Xen-devel] [PATCH v4 2/3] x86/hyperv: skeleton for L0 assisted TLB flush

2020-02-19 Thread Wei Liu
Implement a basic hook for L0 assisted TLB flush. The hook needs to check if prerequisites are met. If they are not met, it returns an error number to fall back to native flushes. Introduce a new variable to indicate if hypercall page is ready. Signed-off-by: Wei Liu Reviewed-by: Roger Pau Monné

[Xen-devel] [PATCH v4 0/3] Xen on Hyper-V: Implement L0 assisted TLB flush

2020-02-19 Thread Wei Liu
Hi all This seris is based on Roger's L0 assisted flush series. I have done some testing against a Linux on Hyper-V in a 32-vcpu VM. All builds were done with -j32. Building Xen on Linux: real0m45.376s user2m28.156s sys 0m51.672s Building Xen on Linux on Xen on Hyper-V, no assiste

[Xen-devel] [PATCH v4 3/3] x86/hyperv: L0 assisted TLB flush

2020-02-19 Thread Wei Liu
Implement L0 assisted TLB flush for Xen on Hyper-V. It takes advantage of several hypercalls: * HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST * HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX * HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE * HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX Pick the most efficient hypercalls available.

Re: [Xen-devel] CPU Lockup bug with the credit2 scheduler

2020-02-19 Thread Dario Faggioli
On Mon, 2020-02-17 at 11:58 -0800, Sarah Newman wrote: > On 1/7/20 6:25 AM, Alastair Browne wrote: > > > > After the tests, we decided to stick with 4.9.0.9 kernel and 4.12 > > Xen > > for production use running credit1 as the default scheduler. > > One person CC'ed appears to be having the same

Re: [Xen-devel] [PATCH] xen: Enable interrupts when calling _cond_resched()

2020-02-19 Thread Jürgen Groß
On 19.02.20 12:01, Thomas Gleixner wrote: xen_maybe_preempt_hcall() is called from the exception entry point xen_do_hypervisor_callback with interrupts disabled. _cond_resched() evades the might_sleep() check in cond_resched() which would have caught that and schedule_debug() unfortunately lacks

Re: [Xen-devel] [PATCH v6 1/3] arm: rename BIT_{WORD/MASK/PER_WORD) to BITOP_*

2020-02-19 Thread Julien Grall
On 19/02/2020 11:41, Roger Pau Monné wrote: On Wed, Feb 19, 2020 at 11:35:16AM +, Julien Grall wrote: Hi Roger, On 19/02/2020 10:22, Roger Pau Monne wrote: So BIT_WORD can be imported from Linux. The difference between current Linux implementation of BIT_WORD is that the size of the word

Re: [Xen-devel] [PATCH v5 1/8] xen: add a generic way to include binary files as variables

2020-02-19 Thread Wei Liu
On Wed, Feb 19, 2020 at 09:11:19AM +0100, Juergen Gross wrote: > Add a new script xen/tools/binfile for including a binary file at build > time being usable via a pointer and a size variable in the hypervisor. > > Make use of that generic tool in xsm. > > Signed-off-by: Juergen Gross > Reviewed-

Re: [Xen-devel] [PATCH 1/2] smp: convert the cpu maps lock into a rw lock

2020-02-19 Thread Julien Grall
Hi Roger, On 13/02/2020 11:32, Roger Pau Monne wrote: Most users of the cpu maps just care about the maps not changing while the lock is being held, but don't actually modify the maps. Convert the lock into a rw lock, and take the lock in read mode in get_cpu_maps and in write mode in cpu_hotpl

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

2020-02-19 Thread osstest service owner
flight 147221 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/147221/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-qemuu-nested-amd 14 xen-boot/l1 fail REGR. vs. 147140 test-armhf-armhf-x

Re: [Xen-devel] [PATCH 0/8] xen: don't let keyhandlers block indefinitely on locks

2020-02-19 Thread Julien Grall
Hi Jan, On 14/02/2020 09:37, Jan Beulich wrote: On 13.02.2020 19:38, Andrew Cooper wrote: On 13/02/2020 12:54, Juergen Gross wrote: Keyhandlers dumping hypervisor information to the console often need to take locks while accessing data. In order to not block in case of system inconsistencies i

Re: [Xen-devel] [PATCH 04/52] drm: Set final_kfree in drm_dev_alloc

2020-02-19 Thread Oleksandr Andrushchenko
On 2/19/20 12:20 PM, Daniel Vetter wrote: > I also did a full review of all callers, and only the xen driver > forgot to call drm_dev_put in the failure path. Fix that up too. > > v2: I noticed that xen has a drm_driver.release hook, and uses > drm_dev_alloc(). We need to remove the kfree from > xe

Re: [Xen-devel] [PATCH 0/2] smp: convert cpu_add_remove_lock int a rw lock

2020-02-19 Thread Andrew Cooper
On 13/02/2020 11:32, Roger Pau Monne wrote: > Hello, > > The main aim of this series is to reduce the pressure around > cpu_add_remove_lock by converting it into a rw lock. Most users of the > lock want to take it in read mode, as they only care about the maps not > changing. > > Patch #2 makes the

Re: [Xen-devel] [PATCH] xen/sched: fix get_cpu_idle_time() with core scheduling

2020-02-19 Thread Dario Faggioli
On Thu, 2020-02-13 at 15:35 +0100, Juergen Gross wrote: > get_cpu_idle_time() is calling vcpu_runstate_get() for an idle vcpu. > With core scheduling active this is fragile, as idle vcpus are > assigned > to other scheduling units temporarily, and that assignment is changed > in some cases without

Re: [Xen-devel] [PATCH 3/8] xen/sched: don't use irqsave locks in dumping functions

2020-02-19 Thread Dario Faggioli
On Thu, 2020-02-13 at 13:54 +0100, Juergen Gross wrote: > All dumping functions invoked by the "runq" keyhandler are called > with > disabled interrupts, so there is no need to use the irqsave variants > of any locks in those functions. > > To me, this patch looks pretty independent from the seri

Re: [Xen-devel] [PATCH] amd/iommu: add missing unlock in iommu_read_log

2020-02-19 Thread Jan Beulich
On 19.02.2020 12:32, Roger Pau Monné wrote: > On Wed, Feb 19, 2020 at 11:23:40AM +, Andrew Cooper wrote: >> On 19/02/2020 11:19, Roger Pau Monne wrote: >>> --- a/xen/drivers/passthrough/amd/iommu_init.c >>> +++ b/xen/drivers/passthrough/amd/iommu_init.c >>> @@ -338,6 +338,7 @@ static int iommu_

Re: [Xen-devel] [PATCH v2] sysctl: use xmalloc_array() for XEN_SYSCTL_page_offline_op

2020-02-19 Thread Jan Beulich
Julien, On 18.02.2020 17:53, Andrew Cooper wrote: > On 18/02/2020 16:52, Jan Beulich wrote: >> This is more robust than the raw xmalloc_bytes(). >> >> Also add a sanity check on the input page range, to avoid returning >> the less applicable -ENOMEM in such cases (and trying the allocation in >> t

Re: [Xen-devel] [PATCH 1/2] smp: convert the cpu maps lock into a rw lock

2020-02-19 Thread Jan Beulich
On 13.02.2020 12:32, Roger Pau Monne wrote: > void __init register_cpu_notifier(struct notifier_block *nb) > { > -if ( !spin_trylock(&cpu_add_remove_lock) ) > +if ( !write_trylock(&cpu_add_remove_lock) ) > BUG(); /* Should never fail as we are called only during boot. */ > n

Re: [Xen-devel] [PATCH 2/2] smp: convert cpu_hotplug_begin into a blocking lock acquisition

2020-02-19 Thread Jan Beulich
On 13.02.2020 12:32, Roger Pau Monne wrote: > Don't allow cpu_hotplug_begin to fail by converting the trylock into a > blocking lock acquisition. Write users of the cpu_add_remove_lock are > limited to CPU plug/unplug operations, and cannot deadlock between > themselves or other users taking the lo

Re: [Xen-devel] [PATCH v2] sysctl: use xmalloc_array() for XEN_SYSCTL_page_offline_op

2020-02-19 Thread Julien Grall
On 19/02/2020 12:49, Jan Beulich wrote: Julien, On 18.02.2020 17:53, Andrew Cooper wrote: On 18/02/2020 16:52, Jan Beulich wrote: This is more robust than the raw xmalloc_bytes(). Also add a sanity check on the input page range, to avoid returning the less applicable -ENOMEM in such cases (

Re: [Xen-devel] [PATCH 1/2] smp: convert the cpu maps lock into a rw lock

2020-02-19 Thread Roger Pau Monné
On Wed, Feb 19, 2020 at 01:56:02PM +0100, Jan Beulich wrote: > On 13.02.2020 12:32, Roger Pau Monne wrote: > > void __init register_cpu_notifier(struct notifier_block *nb) > > { > > -if ( !spin_trylock(&cpu_add_remove_lock) ) > > +if ( !write_trylock(&cpu_add_remove_lock) ) > > B

Re: [Xen-devel] [PATCH 2/2] smp: convert cpu_hotplug_begin into a blocking lock acquisition

2020-02-19 Thread Roger Pau Monné
On Wed, Feb 19, 2020 at 01:59:51PM +0100, Jan Beulich wrote: > On 13.02.2020 12:32, Roger Pau Monne wrote: > > Don't allow cpu_hotplug_begin to fail by converting the trylock into a > > blocking lock acquisition. Write users of the cpu_add_remove_lock are > > limited to CPU plug/unplug operations,

[Xen-devel] [PATCH] AMD/IOMMU: drop unused PCI-generic #define-s

2020-02-19 Thread Jan Beulich
Quite possibly they had been in use when some of the PCI interfacing was done in an ad hoc way rather than using the PCI functions we have. Right now these have no users (left). Signed-off-by: Jan Beulich --- a/xen/drivers/passthrough/amd/iommu-defs.h +++ b/xen/drivers/passthrough/amd/iommu-defs

Re: [Xen-devel] [PATCH 04/52] drm: Set final_kfree in drm_dev_alloc

2020-02-19 Thread Laurent Pinchart
Hi Daniel, Thank you for the patch. On Wed, Feb 19, 2020 at 11:20:34AM +0100, Daniel Vetter wrote: > I also did a full review of all callers, and only the xen driver > forgot to call drm_dev_put in the failure path. Fix that up too. I'd split this patch in two then, with the Xen first coming fir

Re: [Xen-devel] [PATCH 1/2] smp: convert the cpu maps lock into a rw lock

2020-02-19 Thread Jan Beulich
On 19.02.2020 14:19, Roger Pau Monné wrote: > On Wed, Feb 19, 2020 at 01:56:02PM +0100, Jan Beulich wrote: >> On 13.02.2020 12:32, Roger Pau Monne wrote: >>> void __init register_cpu_notifier(struct notifier_block *nb) >>> { >>> -if ( !spin_trylock(&cpu_add_remove_lock) ) >>> +if ( !write

Re: [Xen-devel] [PATCH 2/2] smp: convert cpu_hotplug_begin into a blocking lock acquisition

2020-02-19 Thread Jan Beulich
On 19.02.2020 14:22, Roger Pau Monné wrote: > On Wed, Feb 19, 2020 at 01:59:51PM +0100, Jan Beulich wrote: >> On 13.02.2020 12:32, Roger Pau Monne wrote: >>> Don't allow cpu_hotplug_begin to fail by converting the trylock into a >>> blocking lock acquisition. Write users of the cpu_add_remove_lock

[Xen-devel] Xen mailing lists: dropping Subject line tags, etc.

2020-02-19 Thread Ian Jackson
Hi. This message is being sent once to each mailing list hosted by the Xen Project. Increasingly, mail systems on the public internet are demanding restrictive SPF configurations [1] and DKIM signatures [2]. Currently the Xen Project systems have liberal configurations. Unfortunately this means t

Re: [Xen-devel] [PATCH 3/8] xen/sched: don't use irqsave locks in dumping functions

2020-02-19 Thread Jan Beulich
On 13.02.2020 13:54, Juergen Gross wrote: > All dumping functions invoked by the "runq" keyhandler are called with > disabled interrupts, Is this actually needed for anything? It means not servicing interrupts for perhaps an extended period of time. Debug keys aren't promised to be non-intrusive,

Re: [Xen-devel] [PATCH 5/8] xen/sched: use keyhandler locks when dumping data to console

2020-02-19 Thread Dario Faggioli
On Thu, 2020-02-13 at 13:54 +0100, Juergen Gross wrote: > Instead of using the normal locks use the keyhandler provided > trylocks > with timeouts. This requires a special primitive for the scheduler > lock. > So, FWIW, I tend to agree with Andrew on the general aspects of this. I.e., I personally

Re: [Xen-devel] [PATCH 1/2] smp: convert the cpu maps lock into a rw lock

2020-02-19 Thread Roger Pau Monné
On Wed, Feb 19, 2020 at 02:42:58PM +0100, Jan Beulich wrote: > On 19.02.2020 14:19, Roger Pau Monné wrote: > > On Wed, Feb 19, 2020 at 01:56:02PM +0100, Jan Beulich wrote: > >> On 13.02.2020 12:32, Roger Pau Monne wrote: > >>> void __init register_cpu_notifier(struct notifier_block *nb) > >>> { >

Re: [Xen-devel] [PATCH 04/52] drm: Set final_kfree in drm_dev_alloc

2020-02-19 Thread Daniel Vetter
On Wed, Feb 19, 2020 at 2:39 PM Laurent Pinchart wrote: > > Hi Daniel, > > Thank you for the patch. > > On Wed, Feb 19, 2020 at 11:20:34AM +0100, Daniel Vetter wrote: > > I also did a full review of all callers, and only the xen driver > > forgot to call drm_dev_put in the failure path. Fix that u

Re: [Xen-devel] [PATCH 2/2] smp: convert cpu_hotplug_begin into a blocking lock acquisition

2020-02-19 Thread Roger Pau Monné
On Wed, Feb 19, 2020 at 02:44:12PM +0100, Jan Beulich wrote: > On 19.02.2020 14:22, Roger Pau Monné wrote: > > On Wed, Feb 19, 2020 at 01:59:51PM +0100, Jan Beulich wrote: > >> On 13.02.2020 12:32, Roger Pau Monne wrote: > >>> Don't allow cpu_hotplug_begin to fail by converting the trylock into a >

Re: [Xen-devel] [PATCH] xen: Enable interrupts when calling _cond_resched()

2020-02-19 Thread Thomas Gleixner
Jürgen Groß writes: > On 19.02.20 12:01, Thomas Gleixner wrote: >> xen_maybe_preempt_hcall() is called from the exception entry point >> xen_do_hypervisor_callback with interrupts disabled. >> >> _cond_resched() evades the might_sleep() check in cond_resched() which >> would have caught that and

Re: [Xen-devel] [PATCH 2/2] smp: convert cpu_hotplug_begin into a blocking lock acquisition

2020-02-19 Thread Jan Beulich
On 19.02.2020 15:45, Roger Pau Monné wrote: > On Wed, Feb 19, 2020 at 02:44:12PM +0100, Jan Beulich wrote: >> On 19.02.2020 14:22, Roger Pau Monné wrote: >>> On Wed, Feb 19, 2020 at 01:59:51PM +0100, Jan Beulich wrote: On 13.02.2020 12:32, Roger Pau Monne wrote: > Don't allow cpu_hotplug_b

Re: [Xen-devel] [PATCH 2/2] smp: convert cpu_hotplug_begin into a blocking lock acquisition

2020-02-19 Thread Andrew Cooper
On 19/02/2020 13:44, Jan Beulich wrote: > On 19.02.2020 14:22, Roger Pau Monné wrote: >> On Wed, Feb 19, 2020 at 01:59:51PM +0100, Jan Beulich wrote: >>> On 13.02.2020 12:32, Roger Pau Monne wrote: Don't allow cpu_hotplug_begin to fail by converting the trylock into a blocking lock acquis

Re: [Xen-devel] [PATCH 3/8] xen/sched: don't use irqsave locks in dumping functions

2020-02-19 Thread Jürgen Groß
On 19.02.20 15:27, Jan Beulich wrote: On 13.02.2020 13:54, Juergen Gross wrote: All dumping functions invoked by the "runq" keyhandler are called with disabled interrupts, Is this actually needed for anything? It means not servicing interrupts for perhaps an extended period of time. Debug keys

[Xen-devel] [linux-4.19 test] 147222: regressions - FAIL

2020-02-19 Thread osstest service owner
flight 147222 linux-4.19 real [real] http://logs.test-lab.xenproject.org/osstest/logs/147222/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-qemuu-nested-intel 17 debian-hvm-install/l1/l2 fail REGR. vs. 142932 test-amd64-i

Re: [Xen-devel] [PATCH 2/2] smp: convert cpu_hotplug_begin into a blocking lock acquisition

2020-02-19 Thread Andrew Cooper
On 19/02/2020 14:57, Jan Beulich wrote: > On 19.02.2020 15:45, Roger Pau Monné wrote: >> On Wed, Feb 19, 2020 at 02:44:12PM +0100, Jan Beulich wrote: >>> On 19.02.2020 14:22, Roger Pau Monné wrote: On Wed, Feb 19, 2020 at 01:59:51PM +0100, Jan Beulich wrote: > On 13.02.2020 12:32, Roger Pa

Re: [Xen-devel] [PATCH 5/8] xen/sched: use keyhandler locks when dumping data to console

2020-02-19 Thread Jürgen Groß
On 19.02.20 15:31, Dario Faggioli wrote: On Thu, 2020-02-13 at 13:54 +0100, Juergen Gross wrote: Instead of using the normal locks use the keyhandler provided trylocks with timeouts. This requires a special primitive for the scheduler lock. So, FWIW, I tend to agree with Andrew on the general

Re: [Xen-devel] Xen mailing lists: dropping Subject line tags, etc.

2020-02-19 Thread Marek Marczykowski-Górecki
On Wed, Feb 19, 2020 at 01:48:39PM +, Ian Jackson wrote: > Hi. This message is being sent once to each mailing list hosted by > the Xen Project. > > Increasingly, mail systems on the public internet are demanding > restrictive SPF configurations [1] and DKIM signatures [2]. > > Currently the

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

2020-02-19 Thread osstest service owner
flight 147297 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/147297/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 13 migrate-support-checkfail never pass test-arm64-arm64-xl-xsm 1

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

2020-02-19 Thread osstest service owner
flight 147229 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/147229/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-xl-qemuu-ovmf-amd64 10 debian-hvm-install fail REGR. vs. 145767 test-amd64-i386-xl-qemu

[Xen-devel] [PATCH] xen/sched: don't disable interrupts all the time when dumping run-queues

2020-02-19 Thread Juergen Gross
Having interrupts disabled all the time when running dump_runq() is not necessary. All the called functions are doing proper locking and disable interrupts if needed. Signed-off-by: Juergen Gross --- xen/common/sched/cpupool.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/xen/common/sche

Re: [Xen-devel] [PATCH] AMD/IOMMU: drop unused PCI-generic #define-s

2020-02-19 Thread Andrew Cooper
On 19/02/2020 13:37, Jan Beulich wrote: > Quite possibly they had been in use when some of the PCI interfacing was > done in an ad hoc way rather than using the PCI functions we have. Right > now these have no users (left). > > Signed-off-by: Jan Beulich Acked-by: Andrew Cooper

Re: [Xen-devel] [PATCH 3/8] xen/sched: don't use irqsave locks in dumping functions

2020-02-19 Thread Dario Faggioli
On Wed, 2020-02-19 at 16:02 +0100, Jürgen Groß wrote: > On 19.02.20 15:27, Jan Beulich wrote: > > On 13.02.2020 13:54, Juergen Gross wrote: > > > All dumping functions invoked by the "runq" keyhandler are called > > > with > > > disabled interrupts, > > > > Is this actually needed for anything? It

Re: [Xen-devel] [PATCH v5 3/8] xen: add basic hypervisor filesystem support

2020-02-19 Thread Jan Beulich
On 19.02.2020 09:11, Juergen Gross wrote: > +static int hypfs_get_path_user(char *buf, > + XEN_GUEST_HANDLE_PARAM(const_char) uaddr, > + unsigned long ulen) > +{ > +if ( ulen > XEN_HYPFS_MAX_PATHLEN ) > +return -EINVAL; > + > +

Re: [Xen-devel] [PATCH] xen/arm: Restrict access to most HVM_PARAM's

2020-02-19 Thread Julien Grall
Hi Andrew, Thank you for stepping up and trying to make HVM_PARAM better :). On 10/02/2020 18:45, Andrew Cooper wrote: ARM currently has no restrictions on toolstack and guest access to the entire HVM_PARAM block. As the paging/monitor/sharing features aren't under security support, this doesn

Re: [Xen-devel] [PATCH v5 7/8] xen: add /buildinfo/config entry to hypervisor filesystem

2020-02-19 Thread Jan Beulich
On 19.02.2020 09:11, Juergen Gross wrote: > --- a/xen/common/Makefile > +++ b/xen/common/Makefile > @@ -1,6 +1,7 @@ > obj-$(CONFIG_ARGO) += argo.o > obj-y += bitmap.o > obj-y += bsearch.o > +obj-y += config_data.o In particular with embedded uses in mind, I think this wants to have a Kconfig co

Re: [Xen-devel] [PATCH] xen/sched: don't disable interrupts all the time when dumping run-queues

2020-02-19 Thread Dario Faggioli
On Wed, 2020-02-19 at 16:33 +0100, Juergen Gross wrote: > Having interrupts disabled all the time when running dump_runq() is > not necessary. All the called functions are doing proper locking > and disable interrupts if needed. > > Signed-off-by: Juergen Gross > As said, I'm fine with this other

Re: [Xen-devel] [PATCH 2/2] smp: convert cpu_hotplug_begin into a blocking lock acquisition

2020-02-19 Thread Jan Beulich
On 19.02.2020 16:07, Andrew Cooper wrote: > On 19/02/2020 14:57, Jan Beulich wrote: >> On 19.02.2020 15:45, Roger Pau Monné wrote: >>> On Wed, Feb 19, 2020 at 02:44:12PM +0100, Jan Beulich wrote: On 19.02.2020 14:22, Roger Pau Monné wrote: > On Wed, Feb 19, 2020 at 01:59:51PM +0100, Jan Be

Re: [Xen-devel] [PATCH 2/2] smp: convert cpu_hotplug_begin into a blocking lock acquisition

2020-02-19 Thread Roger Pau Monné
On Wed, Feb 19, 2020 at 03:07:14PM +, Andrew Cooper wrote: > On 19/02/2020 14:57, Jan Beulich wrote: > > On 19.02.2020 15:45, Roger Pau Monné wrote: > >> On Wed, Feb 19, 2020 at 02:44:12PM +0100, Jan Beulich wrote: > >>> On 19.02.2020 14:22, Roger Pau Monné wrote: > On Wed, Feb 19, 2020 at

[Xen-devel] [PATCH v1 03/13] numa: Teach ram block notifiers about resizeable ram blocks

2020-02-19 Thread David Hildenbrand
Ram block notifiers are currently not aware of resizes. Especially to handle resizes during migration, but also to implement actually resizeable ram blocks (make everything between used_length and max_length inaccessible), we want to teach ram block notifiers about resizeable ram. Introduce the ba

Re: [Xen-devel] [PATCH v5 3/8] xen: add basic hypervisor filesystem support

2020-02-19 Thread Julien Grall
Hi, On 19/02/2020 15:49, Jan Beulich wrote: On 19.02.2020 09:11, Juergen Gross wrote: +int hypfs_write_bool(struct hypfs_entry_leaf *leaf, + XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned long ulen) +{ +union { +char buf[8]; +uint8_t u8; +uint16_t u

[Xen-devel] [XEN PATCH] libxl: wait for console path before firing console_available

2020-02-19 Thread Paweł Marczewski
If we skip the bootloader, the TTY path will be set for xenconsoled. However, there is no guarantee that this will happen by the time we want to call the console_available callback, so we have to wait. Signed-off-by: Paweł Marczewski --- tools/libxl/libxl_create.c | 33

Re: [Xen-devel] [PATCH v5 3/8] xen: add basic hypervisor filesystem support

2020-02-19 Thread Julien Grall
On 19/02/2020 08:11, Juergen Gross wrote: +int hypfs_write_bool(struct hypfs_entry_leaf *leaf, + XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned long ulen) +{ +union { +char buf[8]; +uint8_t u8; +uint16_t u16; +uint32_t u32; +uint64_t

Re: [Xen-devel] [PATCH 2/2] smp: convert cpu_hotplug_begin into a blocking lock acquisition

2020-02-19 Thread Roger Pau Monné
On Wed, Feb 19, 2020 at 05:06:20PM +0100, Jan Beulich wrote: > On 19.02.2020 16:07, Andrew Cooper wrote: > > On 19/02/2020 14:57, Jan Beulich wrote: > >> On 19.02.2020 15:45, Roger Pau Monné wrote: > >>> On Wed, Feb 19, 2020 at 02:44:12PM +0100, Jan Beulich wrote: > On 19.02.2020 14:22, Roger

Re: [Xen-devel] [PATCH V3] x86/altp2m: Hypercall to set altp2m view visibility

2020-02-19 Thread Tamas K Lengyel
On Wed, Feb 19, 2020 at 2:19 AM Alexandru Stefan ISAILA wrote: > > At this moment a guest can call vmfunc to change the altp2m view. This > should be limited in order to avoid any unwanted view switch. > > The new xc_altp2m_set_visibility() solves this by making views invisible > to vmfunc. > This

Re: [Xen-devel] [PATCH] x86: "spec-ctrl=no-xen" should also disable branch hardening

2020-02-19 Thread Andrew Cooper
On 19/02/2020 08:12, Jan Beulich wrote: > This is controlling Xen behavior alone, after all. > > Reported-by: Jin Nan Wang > Signed-off-by: Jan Beulich Acked-by: Andrew Cooper ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xe

Re: [Xen-devel] [PATCH] xen/arm: Restrict access to most HVM_PARAM's

2020-02-19 Thread Tamas K Lengyel
On Mon, Feb 10, 2020 at 11:46 AM Andrew Cooper wrote: > > ARM currently has no restrictions on toolstack and guest access to the entire > HVM_PARAM block. As the paging/monitor/sharing features aren't under security > support, this doesn't need an XSA. There is no paging or sharing implementatio

Re: [Xen-devel] [PATCH v5 8/8] xen: add runtime parameter access support to hypfs

2020-02-19 Thread Jan Beulich
On 19.02.2020 09:11, Juergen Gross wrote: > --- a/docs/misc/hypfs-paths.pandoc > +++ b/docs/misc/hypfs-paths.pandoc > @@ -152,3 +152,12 @@ The major version of Xen. > /buildinfo/version/minor = INTEGER > > The minor version of Xen. > + > + /params/ > + > +A directory of runtime paramet

Re: [Xen-devel] [PATCH v5 3/8] xen: add basic hypervisor filesystem support

2020-02-19 Thread Julien Grall
On 19/02/2020 16:26, Julien Grall wrote: On 19/02/2020 08:11, Juergen Gross wrote: +int hypfs_write_bool(struct hypfs_entry_leaf *leaf, + XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned long ulen) +{ +    union { +    char buf[8]; +    uint8_t u8; +    uint16_t

Re: [Xen-devel] [PATCH] xen/sched: rework credit2 run-queue allocation

2020-02-19 Thread Dario Faggioli
On Thu, 2020-01-23 at 09:55 +0100, Juergen Gross wrote: > Currently the memory for each run-queue of the credit2 scheduler is > allocated at the scheduler's init function: for each cpu in the > system > a struct csched2_runqueue_data is being allocated, even if the > current scheduler only handles

Re: [Xen-devel] [PATCH v2 0/4] xen/rcu: let rcu work better with core scheduling

2020-02-19 Thread Igor Druzhinin
On 18/02/2020 13:15, Igor Druzhinin wrote: > On 18/02/2020 12:21, Juergen Gross wrote: >> Today the RCU handling in Xen is affecting scheduling in several ways. >> It is raising sched softirqs without any real need and it requires >> tasklets for rcu_barrier(), which interacts badly with core sched

Re: [Xen-devel] [PATCH] xen/sched: rework credit2 run-queue allocation

2020-02-19 Thread Jan Beulich
On 19.02.2020 17:47, Dario Faggioli wrote: > On Thu, 2020-01-23 at 09:55 +0100, Juergen Gross wrote: >> --- a/xen/common/sched/credit2.c >> +++ b/xen/common/sched/credit2.c >> @@ -849,51 +822,71 @@ static inline bool same_core(unsigned int cpua, >> unsigned int cpub) >> cpu_to_core(cpua

Re: [Xen-devel] [PATCH 2/2] smp: convert cpu_hotplug_begin into a blocking lock acquisition

2020-02-19 Thread Andrew Cooper
On 19/02/2020 16:06, Jan Beulich wrote: > On 19.02.2020 16:07, Andrew Cooper wrote: >> On 19/02/2020 14:57, Jan Beulich wrote: >>> On 19.02.2020 15:45, Roger Pau Monné wrote: On Wed, Feb 19, 2020 at 02:44:12PM +0100, Jan Beulich wrote: > On 19.02.2020 14:22, Roger Pau Monné wrote: >> O

Re: [Xen-devel] [PATCH V3] x86/altp2m: Hypercall to set altp2m view visibility

2020-02-19 Thread Jan Beulich
On 19.02.2020 10:18, Alexandru Stefan ISAILA wrote: > @@ -4835,6 +4836,23 @@ static int do_altp2m_op( > break; > } > > +case HVMOP_altp2m_set_visibility: > +{ > +uint16_t altp2m_idx = a.u.set_visibility.altp2m_idx; > + > +if ( a.u.set_visibility.pad ) > +

  1   2   >