Re: [PATCH v3 0/4] x86/spec-ctrl: IPBP improvements

2023-01-25 Thread Jan Beulich
On 25.01.2023 18:49, Andrew Cooper wrote: > On 25/01/2023 3:24 pm, Jan Beulich wrote: >> Versions of the two final patches were submitted standalone earlier >> on. The series here tries to carry out a suggestion from Andrew, >> which the two of us have been discussing. Then said previously posted

Re: [PATCH v4 04/11] xen: extend domctl interface for cache coloring

2023-01-25 Thread Jan Beulich
On 24.01.2023 17:29, Jan Beulich wrote: > On 23.01.2023 16:47, Carlo Nonato wrote: >> @@ -92,6 +92,10 @@ struct xen_domctl_createdomain { >> /* CPU pool to use; specify 0 or a specific existing pool */ >> uint32_t cpupool_id; >> >> +/* IN LLC coloring parameters */ >> +uint32_t

Re: [QEMU][PATCH v4 07/10] hw/xen/xen-hvm-common: Use g_new and error_setg_errno

2023-01-25 Thread Frediano Ziglio
Il giorno mer 25 gen 2023 alle ore 22:07 Stefano Stabellini ha scritto: > > On Wed, 25 Jan 2023, Vikram Garhwal wrote: > > Replace g_malloc with g_new and perror with error_setg_errno. > > error_setg_errno -> error_report ? Also in the title > > Signed-off-by: Vikram Garhwal Frediano

[PATCH v5 4/4] hw: replace most qemu_bh_new calls with qemu_bh_new_guarded

2023-01-25 Thread Alexander Bulekov
This protects devices from bh->mmio reentrancy issues. Reviewed-by: Stefan Hajnoczi Signed-off-by: Alexander Bulekov --- hw/9pfs/xen-9p-backend.c| 4 +++- hw/block/dataplane/virtio-blk.c | 3 ++- hw/block/dataplane/xen-block.c | 5 +++-- hw/block/virtio-blk.c | 5 +++--

[xen-unstable test] 176132: regressions - FAIL

2023-01-25 Thread osstest service owner
flight 176132 xen-unstable real [real] flight 176138 xen-unstable real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/176132/ http://logs.test-lab.xenproject.org/osstest/logs/176138/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be

[PATCH] tools/python: change 's#' size type for Python >= 3.10

2023-01-25 Thread Marek Marczykowski-Górecki
Python < 3.10 by default uses 'int' type for data+size string types (s#), unless PY_SSIZE_T_CLEAN is defined - in which case it uses Py_ssize_t. The former behavior was removed in Python 3.10 and now it's required to define PY_SSIZE_T_CLEAN before including Python.h, and using Py_ssize_t for the

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Matthew Wilcox
On Wed, Jan 25, 2023 at 08:49:50AM -0800, Suren Baghdasaryan wrote: > On Wed, Jan 25, 2023 at 1:10 AM Peter Zijlstra wrote: > > > + /* > > > + * Flags, see mm.h. > > > + * WARNING! Do not modify directly. > > > + * Use {init|reset|set|clear|mod}_vm_flags() functions instead. >

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Suren Baghdasaryan
On Wed, Jan 25, 2023 at 10:33 AM Matthew Wilcox wrote: > > On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote: > > +/* Use when VMA is not part of the VMA tree and needs no locking */ > > +static inline void init_vm_flags(struct vm_area_struct *vma, > > +

Re: [PATCH v2 5/6] mm: introduce mod_vm_flags_nolock and use it in untrack_pfn

2023-01-25 Thread Suren Baghdasaryan
On Wed, Jan 25, 2023 at 1:42 AM Michal Hocko wrote: > > On Wed 25-01-23 00:38:50, Suren Baghdasaryan wrote: > > In cases when VMA flags are modified after VMA was isolated and mmap_lock > > was downgraded, flags modifications would result in an assertion because > > mmap write lock is not held. >

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Matthew Wilcox
On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote: > +/* Use when VMA is not part of the VMA tree and needs no locking */ > +static inline void init_vm_flags(struct vm_area_struct *vma, > + unsigned long flags) > +{ > + vma->vm_flags = flags;

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Suren Baghdasaryan
On Wed, Jan 25, 2023 at 1:10 AM Peter Zijlstra wrote: > > On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote: > > > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > > index 2d6d790d9bed..6c7c70bf50dd 100644 > > --- a/include/linux/mm_types.h > > +++

Re: [PATCH v2 3/6] mm: replace vma->vm_flags direct modifications with modifier calls

2023-01-25 Thread Suren Baghdasaryan
On Wed, Jan 25, 2023 at 1:30 AM 'Michal Hocko' via kernel-team wrote: > > On Wed 25-01-23 00:38:48, Suren Baghdasaryan wrote: > > Replace direct modifications to vma->vm_flags with calls to modifier > > functions to be able to track flag changes and to keep vma locking > > correctness. > > Is

Re: [PATCH v2 4/6] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-25 Thread Suren Baghdasaryan
On Wed, Jan 25, 2023 at 9:08 AM Michal Hocko wrote: > > On Wed 25-01-23 08:57:48, Suren Baghdasaryan wrote: > > On Wed, Jan 25, 2023 at 1:38 AM 'Michal Hocko' via kernel-team > > wrote: > > > > > > On Wed 25-01-23 00:38:49, Suren Baghdasaryan wrote: > > > > Replace indirect modifications to

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Suren Baghdasaryan
On Wed, Jan 25, 2023 at 10:37 AM Matthew Wilcox wrote: > > On Wed, Jan 25, 2023 at 08:49:50AM -0800, Suren Baghdasaryan wrote: > > On Wed, Jan 25, 2023 at 1:10 AM Peter Zijlstra wrote: > > > > + /* > > > > + * Flags, see mm.h. > > > > + * WARNING! Do not modify directly. > > > > +

Re: [PATCH v2 4/6] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-25 Thread Suren Baghdasaryan
On Wed, Jan 25, 2023 at 1:38 AM 'Michal Hocko' via kernel-team wrote: > > On Wed 25-01-23 00:38:49, Suren Baghdasaryan wrote: > > Replace indirect modifications to vma->vm_flags with calls to modifier > > functions to be able to track flag changes and to keep vma locking > > correctness. Add a

Re: [PATCH v2 4/6] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-25 Thread Michal Hocko
On Wed 25-01-23 08:57:48, Suren Baghdasaryan wrote: > On Wed, Jan 25, 2023 at 1:38 AM 'Michal Hocko' via kernel-team > wrote: > > > > On Wed 25-01-23 00:38:49, Suren Baghdasaryan wrote: > > > Replace indirect modifications to vma->vm_flags with calls to modifier > > > functions to be able to

[RFC PATCH 7/7] xen/blkback: Inform userspace that device has been opened

2023-01-25 Thread Demi Marie Obenour
This allows userspace to use block devices with delete-on-close behavior, which is necessary to ensure virtual devices (such as loop or device-mapper devices) are cleaned up automatically. Protocol details are included in comments. Signed-off-by: Demi Marie Obenour ---

[RFC PATCH 6/7] Minor blkback cleanups

2023-01-25 Thread Demi Marie Obenour
No functional change intended. Signed-off-by: Demi Marie Obenour --- drivers/block/xen-blkback/blkback.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index

[RFC PATCH 0/7] Allow race-free block device handling

2023-01-25 Thread Demi Marie Obenour
This work aims to allow userspace to create and destroy block devices in a race-free and leak-free way, and to allow them to be exposed to other Xen VMs via blkback without leaks or races. It’s marked as RFC for a few reasons: - The code has been only lightly tested. It might be unstable or

[RFC PATCH 3/7] Implement diskseq checks in blkback

2023-01-25 Thread Demi Marie Obenour
From: Demi Marie Obenour This allows specifying a disk sequence number in XenStore. If it does not match the disk sequence number of the underlying device, the device will not be exported and a warning will be logged. Userspace can use this to eliminate race conditions due to major/minor

Re: [QEMU][PATCH v4 09/10] hw/arm: introduce xenpvh machine

2023-01-25 Thread Vikram Garhwal
Hi Stefano, On 1/25/23 2:20 PM, Stefano Stabellini wrote: On Wed, 25 Jan 2023, Vikram Garhwal wrote: Add a new machine xenpvh which creates a IOREQ server to register/connect with Xen Hypervisor. Optional: When CONFIG_TPM is enabled, it also creates a tpm-tis-device, adds a TPM emulator and

Re: [QEMU][PATCH v4 01/10] hw/i386/xen/: move xen-mapcache.c to hw/xen/

2023-01-25 Thread Vikram Garhwal
Hi Philippe, On 1/25/23 2:59 PM, Philippe Mathieu-Daudé wrote: On 25/1/23 09:53, Vikram Garhwal wrote: xen-mapcache.c contains common functions which can be used for enabling Xen on aarch64 with IOREQ handling. Moving it out from hw/i386/xen to hw/xen to make it accessible for both aarch64

Re: [PATCH v2] x86/hotplug: Do not put offline vCPUs in mwait idle state

2023-01-25 Thread Srivatsa S. Bhat
Hi Igor and Sean, On 1/20/23 10:35 AM, Sean Christopherson wrote: > On Fri, Jan 20, 2023, Igor Mammedov wrote: >> On Fri, 20 Jan 2023 05:55:11 -0800 >> "Srivatsa S. Bhat" wrote: >> >>> Hi Igor and Thomas, >>> >>> Thank you for your review! >>> >>> On 1/19/23 1:12 PM, Thomas Gleixner wrote:

[linux-linus test] 176125: regressions - FAIL

2023-01-25 Thread osstest service owner
flight 176125 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/176125/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-arm64-arm64-examine 8 reboot fail REGR. vs. 173462

Re: [XEN PATCH v2 0/3] Configure qemu upstream correctly by default for igd-passthru

2023-01-25 Thread Chuck Zmudzinski
On 1/25/2023 6:37 AM, Anthony PERARD wrote: > On Tue, Jan 10, 2023 at 02:32:01AM -0500, Chuck Zmudzinski wrote: > > I call attention to the commit message of the first patch which points > > out that using the "pc" machine and adding the xen platform device on > > the qemu upstream command line is

Re: [QEMU][PATCH v4 01/10] hw/i386/xen/: move xen-mapcache.c to hw/xen/

2023-01-25 Thread Philippe Mathieu-Daudé
On 25/1/23 09:53, Vikram Garhwal wrote: xen-mapcache.c contains common functions which can be used for enabling Xen on aarch64 with IOREQ handling. Moving it out from hw/i386/xen to hw/xen to make it accessible for both aarch64 and x86. Signed-off-by: Vikram Garhwal Signed-off-by: Stefano

Re: [QEMU][PATCH v4 04/10] xen-hvm: reorganize xen-hvm and move common function to xen-hvm-common

2023-01-25 Thread Vikram Garhwal
Hi Stefano, On 1/25/23 1:55 PM, Stefano Stabellini wrote: On Wed, 25 Jan 2023, Vikram Garhwal wrote: From: Stefano Stabellini This patch does following: 1. creates arch_handle_ioreq() and arch_xen_set_memory(). This is done in preparation for moving most of xen-hvm code to an

Re: [QEMU][PATCH v4 09/10] hw/arm: introduce xenpvh machine

2023-01-25 Thread Stefano Stabellini
On Wed, 25 Jan 2023, Vikram Garhwal wrote: > Add a new machine xenpvh which creates a IOREQ server to register/connect with > Xen Hypervisor. > > Optional: When CONFIG_TPM is enabled, it also creates a tpm-tis-device, adds a > TPM emulator and connects to swtpm running on host machine via chardev

Re: [PATCH v4 3/3] hw: replace most qemu_bh_new calls with qemu_bh_new_guarded

2023-01-25 Thread Stefan Hajnoczi
On Thu, Jan 19, 2023 at 02:03:08AM -0500, Alexander Bulekov wrote: > This protects devices from bh->mmio reentrancy issues. > > Signed-off-by: Alexander Bulekov > --- > hw/9pfs/xen-9p-backend.c| 4 +++- > hw/block/dataplane/virtio-blk.c | 3 ++- > hw/block/dataplane/xen-block.c | 5

Re: [PATCH v4 3/3] hw: replace most qemu_bh_new calls with qemu_bh_new_guarded

2023-01-25 Thread Stefan Hajnoczi
On Thu, Jan 19, 2023 at 02:03:08AM -0500, Alexander Bulekov wrote: > This protects devices from bh->mmio reentrancy issues. > > Signed-off-by: Alexander Bulekov > --- > hw/9pfs/xen-9p-backend.c| 4 +++- > hw/block/dataplane/virtio-blk.c | 3 ++- > hw/block/dataplane/xen-block.c | 5

Re: [QEMU][PATCH v4 07/10] hw/xen/xen-hvm-common: Use g_new and error_setg_errno

2023-01-25 Thread Stefano Stabellini
On Wed, 25 Jan 2023, Vikram Garhwal wrote: > Replace g_malloc with g_new and perror with error_setg_errno. > > Signed-off-by: Vikram Garhwal > --- > hw/xen/xen-hvm-common.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/hw/xen/xen-hvm-common.c

Re: [QEMU][PATCH v4 06/10] hw/xen/xen-hvm-common: skip ioreq creation on ioreq registration failure

2023-01-25 Thread Stefano Stabellini
On Wed, 25 Jan 2023, Vikram Garhwal wrote: > From: Stefano Stabellini > > On ARM it is possible to have a functioning xenpv machine with only the > PV backends and no IOREQ server. If the IOREQ server creation fails continue > to the PV backends initialization. > > Also, moved the IOREQ

Re: [QEMU][PATCH v4 05/10] include/hw/xen/xen_common: return error from xen_create_ioreq_server

2023-01-25 Thread Stefano Stabellini
On Wed, 25 Jan 2023, Vikram Garhwal wrote: > From: Stefano Stabellini > > This is done to prepare for enabling xenpv support for ARM architecture. > On ARM it is possible to have a functioning xenpv machine with only the > PV backends and no IOREQ server. If the IOREQ server creation fails, >

Re: [QEMU][PATCH v4 04/10] xen-hvm: reorganize xen-hvm and move common function to xen-hvm-common

2023-01-25 Thread Stefano Stabellini
On Wed, 25 Jan 2023, Vikram Garhwal wrote: > From: Stefano Stabellini > > This patch does following: > 1. creates arch_handle_ioreq() and arch_xen_set_memory(). This is done in > preparation for moving most of xen-hvm code to an arch-neutral location, > move the x86-specific portion of

[xen-unstable bisection] complete test-amd64-i386-pair

2023-01-25 Thread osstest service owner
branch xen-unstable xenbranch xen-unstable job test-amd64-i386-pair testid guest-migrate/src_host/dst_host Tree: linux git://xenbits.xen.org/linux-pvops.git Tree: linuxfirmware git://xenbits.xen.org/osstest/linux-firmware.git Tree: qemu git://xenbits.xen.org/qemu-xen-traditional.git Tree: qemuu

[xen-unstable test] 176121: regressions - FAIL

2023-01-25 Thread osstest service owner
flight 176121 xen-unstable real [real] flight 176129 xen-unstable real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/176121/ http://logs.test-lab.xenproject.org/osstest/logs/176129/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be

Re: [PATCH v3 1/4] x86/spec-ctrl: add logic to issue IBPB on exit to guest

2023-01-25 Thread Andrew Cooper
On 25/01/2023 3:25 pm, Jan Beulich wrote: > In order to be able to defer the context switch IBPB to the last > possible point, add logic to the exit-to-guest paths to issue the > barrier there, including the "IBPB doesn't flush the RSB/RAS" > workaround. Since alternatives, for now at least, can't

Re: [XEN v5] xen/arm: Use the correct format specifier

2023-01-25 Thread Stefano Stabellini
On Wed, 25 Jan 2023, Ayan Kumar Halder wrote: > 1. One should use 'PRIpaddr' to display 'paddr_t' variables. However, > while creating nodes in fdt, the address (if present in the node name) > should be represented using 'PRIx64'. This is to be in conformance > with the following rule present in

Re: [XEN v6] xen/arm: Probe the load/entry point address of an uImage correctly

2023-01-25 Thread Stefano Stabellini
On Wed, 25 Jan 2023, Ayan Kumar Halder wrote: > Currently, kernel_uimage_probe() does not read the load/entry point address > set in the uImge header. Thus, info->zimage.start is 0 (default value). This > causes, kernel_zimage_place() to treat the binary (contained within uImage) > as position

[PATCH] Add more rules to docs/misra/rules.rst

2023-01-25 Thread Stefano Stabellini
From: Stefano Stabellini As agreed during the last MISRA C discussion, I am adding the following MISRA C rules: 7.1, 7.3, 18.3. I am also adding 13.1 and 18.2 that were "agreed pending an analysis on the amount of violations". In the case of 13.1 there are zero violations reported by cppcheck.

Re: [XEN PATCH v2 0/3] Configure qemu upstream correctly by default for igd-passthru

2023-01-25 Thread Chuck Zmudzinski
On 1/25/2023 6:37 AM, Anthony PERARD wrote: > On Tue, Jan 10, 2023 at 02:32:01AM -0500, Chuck Zmudzinski wrote: > > I call attention to the commit message of the first patch which points > > out that using the "pc" machine and adding the xen platform device on > > the qemu upstream command line is

[PATCH v2] xen/x86: public: add TSC defines for cpuid leaf 4

2023-01-25 Thread Krister Johansen
Cpuid leaf 4 contains information about how the state of the tsc, its mode, and some additional information. A commit that is queued for linux would like to use this to determine whether the tsc mode has been set to 'no emulation' in order to make some decisions about which clocksource is more

[PATCH v2] xen/x86: public: add TSC defines for cpuid leaf 4

2023-01-25 Thread Krister Johansen
Cpuid leaf 4 contains information about how the state of the tsc, its mode, and some additional information. A commit that is queued for linux would like to use this to determine whether the tsc mode has been set to 'no emulation' in order to make some decisions about which clocksource is more

Re: [PATCH] xen/x86: public: add TSC defines for cpuid leaf 4

2023-01-25 Thread Krister Johansen
On Wed, Jan 25, 2023 at 07:57:16AM +0100, Jan Beulich wrote: > On 24.01.2023 23:35, Krister Johansen wrote: > > --- a/xen/include/public/arch-x86/cpuid.h > > +++ b/xen/include/public/arch-x86/cpuid.h > > @@ -71,6 +71,12 @@ > > * EDX: shift amount for tsc->ns conversion > > *

[XEN PATCH v2] Create a Kconfig option to set preferred reboot method

2023-01-25 Thread Per Bilse
Provide a user-friendly option to specify preferred reboot details at compile time. It uses the same internals as the command line 'reboot' parameter, and will be overridden by a choice on the command line. Signed-off-by: Per Bilse --- v2: Incorporate feedback from initial patch. Separating

Re: [PATCH v3 0/4] x86/spec-ctrl: IPBP improvements

2023-01-25 Thread Andrew Cooper
On 25/01/2023 3:24 pm, Jan Beulich wrote: > Versions of the two final patches were submitted standalone earlier > on. The series here tries to carry out a suggestion from Andrew, > which the two of us have been discussing. Then said previously posted > patches are re-based on top, utilizing the

Re: [PATCH v1 09/14] xen/riscv: introduce do_unexpected_trap()

2023-01-25 Thread Andrew Cooper
On 25/01/2023 5:01 pm, Oleksii wrote: > On Mon, 2023-01-23 at 09:39 +1000, Alistair Francis wrote: >> On Sat, Jan 21, 2023 at 1:00 AM Oleksii Kurochko >> wrote: >>> The patch introduces the function the purpose of which is to print >>> a cause of an exception and call "wfi" instruction. >>> >>>

Re: [PATCH v1 09/14] xen/riscv: introduce do_unexpected_trap()

2023-01-25 Thread Julien Grall
Hi, On 25/01/2023 17:01, Oleksii wrote: On Mon, 2023-01-23 at 09:39 +1000, Alistair Francis wrote: On Sat, Jan 21, 2023 at 1:00 AM Oleksii Kurochko wrote: The patch introduces the function the purpose of which is to print a cause of an exception and call "wfi" instruction. Signed-off-by:

Re: [PATCH v1 09/14] xen/riscv: introduce do_unexpected_trap()

2023-01-25 Thread Oleksii
On Mon, 2023-01-23 at 09:39 +1000, Alistair Francis wrote: > On Sat, Jan 21, 2023 at 1:00 AM Oleksii Kurochko > wrote: > > > > The patch introduces the function the purpose of which is to print > > a cause of an exception and call "wfi" instruction. > > > > Signed-off-by: Oleksii Kurochko > >

[PATCH] x86/shadow: Fix PV32 shadowing in !HVM builds

2023-01-25 Thread Andrew Cooper
The OSSTest bisector identified an issue with c/s 1894049fa283 ("x86/shadow: L2H shadow type is PV32-only") in !HVM builds. The bug is ultimately caused by sh_type_to_size[] not actually being specific to HVM guests, and it's position in shadow/hvm.c mislead the reasoning. To fix the issue that

Re: [PATCH v4 04/11] xen: extend domctl interface for cache coloring

2023-01-25 Thread Carlo Nonato
Hi Jan, On Tue, Jan 24, 2023 at 5:29 PM Jan Beulich wrote: > > On 23.01.2023 16:47, Carlo Nonato wrote: > > @@ -275,6 +276,19 @@ unsigned int *dom0_llc_colors(unsigned int *num_colors) > > return colors; > > } > > > > +unsigned int *llc_colors_from_guest(struct xen_domctl_createdomain

Re: [PATCH v4 01/11] xen/common: add cache coloring common code

2023-01-25 Thread Carlo Nonato
On Wed, Jan 25, 2023 at 2:10 PM Jan Beulich wrote: > > On 25.01.2023 12:18, Carlo Nonato wrote: > > On Tue, Jan 24, 2023 at 5:37 PM Jan Beulich wrote: > >> On 23.01.2023 16:47, Carlo Nonato wrote: > >>> --- /dev/null > >>> +++ b/xen/include/xen/llc_coloring.h > >>> @@ -0,0 +1,54 @@ > >>> +/*

Re: [PATCH v2 1/2] libxl: Fix guest kexec - skip cpuid policy

2023-01-25 Thread Anthony PERARD
On Mon, Jan 23, 2023 at 09:59:38PM -0500, Jason Andryuk wrote: > When a domain performs a kexec (soft reset), libxl__build_pre() is > called with the existing domid. Calling libxl__cpuid_legacy() on the > existing domain fails since the cpuid policy has already been set, and > the guest isn't

Re: [PATCH v2 4/8] x86/mem-sharing: copy GADDR based shared guest areas

2023-01-25 Thread Tamas K Lengyel
On Tue, Jan 24, 2023 at 6:19 AM Jan Beulich wrote: > > On 23.01.2023 19:32, Tamas K Lengyel wrote: > > On Mon, Jan 23, 2023 at 11:24 AM Jan Beulich wrote: > >> On 23.01.2023 17:09, Tamas K Lengyel wrote: > >>> On Mon, Jan 23, 2023 at 9:55 AM Jan Beulich wrote: > ---

[PATCH v3 4/4] x86/PV: issue branch prediction barrier when switching 64-bit guest to kernel mode

2023-01-25 Thread Jan Beulich
Since both kernel and user mode run in ring 3, they run in the same "predictor mode". While the kernel could take care of this itself, doing so would be yet another item distinguishing PV from native. Additionally we're in a much better position to issue the barrier command, and we can save a #GP

[PATCH v3 3/4] x86: limit issuing of IBPB during context switch

2023-01-25 Thread Jan Beulich
When the outgoing vCPU had IBPB issued upon entering Xen there's no need for a 2nd barrier during context switch. Signed-off-by: Jan Beulich --- v3: Fold into series. --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -2015,7 +2015,8 @@ void context_switch(struct vcpu *prev, s

[PATCH v3 2/4] x86/spec-ctrl: defer context-switch IBPB until guest entry

2023-01-25 Thread Jan Beulich
In order to avoid clobbering Xen's own predictions, defer the barrier as much as possible. Merely mark the CPU as needing a barrier issued the next time we're exiting to guest context. Suggested-by: Andrew Cooper Signed-off-by: Jan Beulich --- I couldn't find any sensible (central/unique) place

[PATCH v3 1/4] x86/spec-ctrl: add logic to issue IBPB on exit to guest

2023-01-25 Thread Jan Beulich
In order to be able to defer the context switch IBPB to the last possible point, add logic to the exit-to-guest paths to issue the barrier there, including the "IBPB doesn't flush the RSB/RAS" workaround. Since alternatives, for now at least, can't nest, emit JMP to skip past both constructs where

[PATCH v3 0/4] x86/spec-ctrl: IPBP improvements

2023-01-25 Thread Jan Beulich
Versions of the two final patches were submitted standalone earlier on. The series here tries to carry out a suggestion from Andrew, which the two of us have been discussing. Then said previously posted patches are re-based on top, utilizing the new functionality. 1: spec-ctrl: add logic to issue

Xen Security Advisory 425 v1 (CVE-2022-42330) - Guests can cause Xenstore crash via soft reset

2023-01-25 Thread Xen . org security team
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Xen Security Advisory CVE-2022-42330 / XSA-425 Guests can cause Xenstore crash via soft reset ISSUE DESCRIPTION = When a guest issues a "Soft Reset" (e.g. for performing a kexec) the libxl based Xen

Re: [PATCH v1 07/14] xen/riscv: introduce exception handlers implementation

2023-01-25 Thread Oleksii
On Mon, 2023-01-23 at 11:50 +, Andrew Cooper wrote: > > > > +    /* Save context to stack */ > > +    REG_S   sp, (RISCV_CPU_USER_REGS_OFFSET(sp) - > > RISCV_CPU_USER_REGS_SIZE) (sp) > > +    addi    sp, sp, -RISCV_CPU_USER_REGS_SIZE > > +    REG_S   t0,

[linux-linus test] 176115: regressions - FAIL

2023-01-25 Thread osstest service owner
flight 176115 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/176115/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-arm64-arm64-examine 8 reboot fail REGR. vs. 173462

Re: [RFC PATCH 0/8] SVE feature for arm guests

2023-01-25 Thread Julien Grall
Hi Bertrand, On 25/01/2023 13:21, Bertrand Marquis wrote: On 13 Jan 2023, at 09:44, Julien Grall wrote: Hi Luca, On 12/01/2023 11:58, Luca Fancellu wrote: On 11 Jan 2023, at 16:59, Julien Grall wrote: On 11/01/2023 14:38, Luca Fancellu wrote: This serie is introducing the possibility for

[libvirt test] 176116: tolerable FAIL - PUSHED

2023-01-25 Thread osstest service owner
flight 176116 libvirt real [real] http://logs.test-lab.xenproject.org/osstest/logs/176116/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-i386-libvirt-raw 7 xen-install fail like 176085 test-armhf-armhf-libvirt 16

Re: [RFC PATCH 0/8] SVE feature for arm guests

2023-01-25 Thread Bertrand Marquis
Hi Julien, > On 13 Jan 2023, at 09:44, Julien Grall wrote: > > Hi Luca, > > On 12/01/2023 11:58, Luca Fancellu wrote: >>> On 11 Jan 2023, at 16:59, Julien Grall wrote: >>> On 11/01/2023 14:38, Luca Fancellu wrote: This serie is introducing the possibility for Dom0 and DomU guests to use

Re: [PATCH v4 01/11] xen/common: add cache coloring common code

2023-01-25 Thread Jan Beulich
On 25.01.2023 12:18, Carlo Nonato wrote: > On Tue, Jan 24, 2023 at 5:37 PM Jan Beulich wrote: >> On 23.01.2023 16:47, Carlo Nonato wrote: >>> --- /dev/null >>> +++ b/xen/include/xen/llc_coloring.h >>> @@ -0,0 +1,54 @@ >>> +/* SPDX-License-Identifier: GPL-2.0 */ >>> +/* >>> + * Last Level Cache

Re: [XEN PATCH v2 0/3] Configure qemu upstream correctly by default for igd-passthru

2023-01-25 Thread Anthony PERARD
On Tue, Jan 10, 2023 at 02:32:01AM -0500, Chuck Zmudzinski wrote: > I call attention to the commit message of the first patch which points > out that using the "pc" machine and adding the xen platform device on > the qemu upstream command line is not functionally equivalent to using > the "xenfv"

Re: [PATCH v2 1/3] xen/arm: Add memory overlap check for bootinfo.reserved_mem

2023-01-25 Thread Julien Grall
On 14/12/2022 03:16, Henry Wang wrote: As we are having more and more types of static region, and all of these static regions are defined in bootinfo.reserved_mem, it is necessary to add the overlap check of reserved memory regions in Xen, because such check will help user to identify the

Re: Usage of Xen Security Data in VulnerableCode

2023-01-25 Thread George Dunlap
On Thu, Jan 19, 2023 at 1:10 PM Tushar Goel wrote: > Hi Andrew, > > > Maybe we want to make it CC-BY-4 to require people to reference back to > > the canonical upstream ? > Thanks for your response, can we have a more declarative statement on > the license from your end > and also can you please

Re: [PATCH v2 1/3] xen/arm: Add memory overlap check for bootinfo.reserved_mem

2023-01-25 Thread Julien Grall
Hi Henry, On 14/12/2022 03:16, Henry Wang wrote: As we are having more and more types of static region, and all of these static regions are defined in bootinfo.reserved_mem, it is necessary to add the overlap check of reserved memory regions in Xen, because such check will help user to identify

Re: [XEN v5] xen/arm: Probe the load/entry point address of an uImage correctly

2023-01-25 Thread Ayan Kumar Halder
Hi Stefano, On 20/01/2023 22:28, Stefano Stabellini wrote: On Fri, 13 Jan 2023, Ayan Kumar Halder wrote: Currently, kernel_uimage_probe() does not read the load/entry point address set in the uImge header. Thus, info->zimage.start is 0 (default value). This causes, kernel_zimage_place() to

[XEN v6] xen/arm: Probe the load/entry point address of an uImage correctly

2023-01-25 Thread Ayan Kumar Halder
Currently, kernel_uimage_probe() does not read the load/entry point address set in the uImge header. Thus, info->zimage.start is 0 (default value). This causes, kernel_zimage_place() to treat the binary (contained within uImage) as position independent executable. Thus, it loads it at an incorrect

Re: [PATCH v4 01/11] xen/common: add cache coloring common code

2023-01-25 Thread Carlo Nonato
Hi Jan, Julien On Tue, Jan 24, 2023 at 5:37 PM Jan Beulich wrote: > > On 23.01.2023 16:47, Carlo Nonato wrote: > > @@ -769,6 +776,13 @@ struct domain *domain_create(domid_t domid, > > return ERR_PTR(err); > > } > > > > +struct domain *domain_create(domid_t domid, > > +

[xen-unstable test] 176110: regressions - FAIL

2023-01-25 Thread osstest service owner
flight 176110 xen-unstable real [real] flight 176119 xen-unstable real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/176110/ http://logs.test-lab.xenproject.org/osstest/logs/176119/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be

[XEN v5] xen/arm: Use the correct format specifier

2023-01-25 Thread Ayan Kumar Halder
1. One should use 'PRIpaddr' to display 'paddr_t' variables. However, while creating nodes in fdt, the address (if present in the node name) should be represented using 'PRIx64'. This is to be in conformance with the following rule present in https://elinux.org/Device_Tree_Linux . node names

Re: [PATCH v2 6/6] mm: export dump_mm()

2023-01-25 Thread Michal Hocko
On Wed 25-01-23 00:38:51, Suren Baghdasaryan wrote: > mmap_assert_write_locked() is used in vm_flags modifiers. Because > mmap_assert_write_locked() uses dump_mm() and vm_flags are sometimes > modified from from inside a module, it's necessary to export > dump_mm() function. > > Signed-off-by:

Re: [PATCH v2 5/6] mm: introduce mod_vm_flags_nolock and use it in untrack_pfn

2023-01-25 Thread Michal Hocko
On Wed 25-01-23 00:38:50, Suren Baghdasaryan wrote: > In cases when VMA flags are modified after VMA was isolated and mmap_lock > was downgraded, flags modifications would result in an assertion because > mmap write lock is not held. > Introduce mod_vm_flags_nolock to be used in such situation. >

Re: [PATCH v2 4/6] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-25 Thread Michal Hocko
On Wed 25-01-23 00:38:49, Suren Baghdasaryan wrote: > Replace indirect modifications to vma->vm_flags with calls to modifier > functions to be able to track flag changes and to keep vma locking > correctness. Add a BUG_ON check in ksm_madvise() to catch indirect > vm_flags modification attempts.

Re: [PATCH v2 3/6] mm: replace vma->vm_flags direct modifications with modifier calls

2023-01-25 Thread Michal Hocko
On Wed 25-01-23 00:38:48, Suren Baghdasaryan wrote: > Replace direct modifications to vma->vm_flags with calls to modifier > functions to be able to track flag changes and to keep vma locking > correctness. Is this a manual (git grep) based work or have you used Coccinele for the patch

[PATCH v2 5/6] mm: introduce mod_vm_flags_nolock and use it in untrack_pfn

2023-01-25 Thread Suren Baghdasaryan
In cases when VMA flags are modified after VMA was isolated and mmap_lock was downgraded, flags modifications would result in an assertion because mmap write lock is not held. Introduce mod_vm_flags_nolock to be used in such situation. Pass a hint to untrack_pfn to conditionally use

[PATCH v2 4/6] mm: replace vma->vm_flags indirect modification in ksm_madvise

2023-01-25 Thread Suren Baghdasaryan
Replace indirect modifications to vma->vm_flags with calls to modifier functions to be able to track flag changes and to keep vma locking correctness. Add a BUG_ON check in ksm_madvise() to catch indirect vm_flags modification attempts. Signed-off-by: Suren Baghdasaryan ---

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Peter Zijlstra
On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote: > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 2d6d790d9bed..6c7c70bf50dd 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -491,7 +491,13 @@ struct vm_area_struct { >

Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Michal Hocko
On Wed 25-01-23 00:38:46, Suren Baghdasaryan wrote: > vm_flags are among VMA attributes which affect decisions like VMA merging > and splitting. Therefore all vm_flags modifications are performed after > taking exclusive mmap_lock to prevent vm_flags updates racing with such > operations.

[PATCH v2 3/6] mm: replace vma->vm_flags direct modifications with modifier calls

2023-01-25 Thread Suren Baghdasaryan
Replace direct modifications to vma->vm_flags with calls to modifier functions to be able to track flag changes and to keep vma locking correctness. Signed-off-by: Suren Baghdasaryan --- arch/arm/kernel/process.c | 2 +- arch/ia64/mm/init.c

[PATCH v2 6/6] mm: export dump_mm()

2023-01-25 Thread Suren Baghdasaryan
mmap_assert_write_locked() is used in vm_flags modifiers. Because mmap_assert_write_locked() uses dump_mm() and vm_flags are sometimes modified from from inside a module, it's necessary to export dump_mm() function. Signed-off-by: Suren Baghdasaryan --- mm/debug.c | 1 + 1 file changed, 1

[PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions

2023-01-25 Thread Suren Baghdasaryan
vm_flags are among VMA attributes which affect decisions like VMA merging and splitting. Therefore all vm_flags modifications are performed after taking exclusive mmap_lock to prevent vm_flags updates racing with such operations. Introduce modifier functions for vm_flags to be used whenever flags

Re: [PATCH v2 2/6] mm: replace VM_LOCKED_CLEAR_MASK with VM_LOCKED_MASK

2023-01-25 Thread Michal Hocko
On Wed 25-01-23 00:38:47, Suren Baghdasaryan wrote: > To simplify the usage of VM_LOCKED_CLEAR_MASK in clear_vm_flags(), > replace it with VM_LOCKED_MASK bitmask and convert all users. > > Signed-off-by: Suren Baghdasaryan Acked-by: Michal Hocko > --- > include/linux/mm.h | 4 ++-- >

[PATCH v2 0/6] introduce vm_flags modifier functions

2023-01-25 Thread Suren Baghdasaryan
This patchset was originally published as a part of per-VMA locking [1] and was split after suggestion that it's viable on its own and to facilitate the review process. It is now a preprequisite for the next version of per-VMA lock patchset, which reuses vm_flags modifier functions to lock the VMA

[PATCH v2 2/6] mm: replace VM_LOCKED_CLEAR_MASK with VM_LOCKED_MASK

2023-01-25 Thread Suren Baghdasaryan
To simplify the usage of VM_LOCKED_CLEAR_MASK in clear_vm_flags(), replace it with VM_LOCKED_MASK bitmask and convert all users. Signed-off-by: Suren Baghdasaryan --- include/linux/mm.h | 4 ++-- kernel/fork.c | 2 +- mm/hugetlb.c | 4 ++-- mm/mlock.c | 6 +++--- mm/mmap.c

[QEMU][PATCH v4 08/10] meson.build: do not set have_xen_pci_passthrough for aarch64 targets

2023-01-25 Thread Vikram Garhwal
From: Stefano Stabellini have_xen_pci_passthrough is only used for Xen x86 VMs. Signed-off-by: Stefano Stabellini Reviewed-by: Alex Bennée --- meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meson.build b/meson.build index 6d3b665629..693802adb2 100644 --- a/meson.build +++

[QEMU][PATCH v4 04/10] xen-hvm: reorganize xen-hvm and move common function to xen-hvm-common

2023-01-25 Thread Vikram Garhwal
From: Stefano Stabellini This patch does following: 1. creates arch_handle_ioreq() and arch_xen_set_memory(). This is done in preparation for moving most of xen-hvm code to an arch-neutral location, move the x86-specific portion of xen_set_memory to arch_xen_set_memory. Also, move

[QEMU][PATCH v4 05/10] include/hw/xen/xen_common: return error from xen_create_ioreq_server

2023-01-25 Thread Vikram Garhwal
From: Stefano Stabellini This is done to prepare for enabling xenpv support for ARM architecture. On ARM it is possible to have a functioning xenpv machine with only the PV backends and no IOREQ server. If the IOREQ server creation fails, continue to the PV backends initialization.

[QEMU][PATCH v4 10/10] meson.build: enable xenpv machine build for ARM

2023-01-25 Thread Vikram Garhwal
Add CONFIG_XEN for aarch64 device to support build for ARM targets. Signed-off-by: Vikram Garhwal Signed-off-by: Stefano Stabellini Reviewed-by: Alex Bennée --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index

[QEMU][PATCH v4 09/10] hw/arm: introduce xenpvh machine

2023-01-25 Thread Vikram Garhwal
Add a new machine xenpvh which creates a IOREQ server to register/connect with Xen Hypervisor. Optional: When CONFIG_TPM is enabled, it also creates a tpm-tis-device, adds a TPM emulator and connects to swtpm running on host machine via chardev socket and support TPM functionalities for a guest

[QEMU][PATCH v4 02/10] hw/i386/xen: rearrange xen_hvm_init_pc

2023-01-25 Thread Vikram Garhwal
In preparation to moving most of xen-hvm code to an arch-neutral location, move non IOREQ references to: - xen_get_vmport_regs_pfn - xen_suspend_notifier - xen_wakeup_notifier - xen_ram_init towards the end of the xen_hvm_init_pc() function. This is done to keep the common ioreq functions in one

[QEMU][PATCH v4 07/10] hw/xen/xen-hvm-common: Use g_new and error_setg_errno

2023-01-25 Thread Vikram Garhwal
Replace g_malloc with g_new and perror with error_setg_errno. Signed-off-by: Vikram Garhwal --- hw/xen/xen-hvm-common.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index 94dbbe97ed..01c8ec1956 100644 ---

[QEMU][PATCH v4 00/10] Introduce xenpvh machine for arm architecture

2023-01-25 Thread Vikram Garhwal
MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi, This series add xenpvh machine for aarch64. Motivation behind creating xenpvh machine with IOREQ and TPM was to enable each guest on Xen aarch64 to have it's own unique and emulated TPM. This series

[QEMU][PATCH v4 06/10] hw/xen/xen-hvm-common: skip ioreq creation on ioreq registration failure

2023-01-25 Thread Vikram Garhwal
From: Stefano Stabellini On ARM it is possible to have a functioning xenpv machine with only the PV backends and no IOREQ server. If the IOREQ server creation fails continue to the PV backends initialization. Also, moved the IOREQ registration and mapping subroutine to new function

[QEMU][PATCH v4 03/10] hw/i386/xen/xen-hvm: move x86-specific fields out of XenIOState

2023-01-25 Thread Vikram Garhwal
From: Stefano Stabellini In preparation to moving most of xen-hvm code to an arch-neutral location, move: - shared_vmport_page - log_for_dirtybit - dirty_bitmap - suspend - wakeup out of XenIOState struct as these are only used on x86, especially the ones related to dirty logging. Updated

[QEMU][PATCH v4 01/10] hw/i386/xen/: move xen-mapcache.c to hw/xen/

2023-01-25 Thread Vikram Garhwal
xen-mapcache.c contains common functions which can be used for enabling Xen on aarch64 with IOREQ handling. Moving it out from hw/i386/xen to hw/xen to make it accessible for both aarch64 and x86. Signed-off-by: Vikram Garhwal Signed-off-by: Stefano Stabellini --- hw/i386/meson.build

  1   2   >