[PATCH v2 3/3] VMCI: Enforce queuepair max size for IOCTL_VMCI_QUEUEPAIR_ALLOC

2021-01-20 Thread Jorgen Hansen
When create the VMCI queue pair tracking data structures on the host side, the IOCTL for creating the VMCI queue pair didn't validate the queue pair size parameters. This change adds checks for this. This avoids a memory allocation issue in qp_host_alloc_queue, as reported by nslusa...@gmx.net.

[PATCH v2 2/3] VMCI: Use set_page_dirty_lock() when unregistering guest memory

2021-01-20 Thread Jorgen Hansen
When the VMCI host support releases guest memory in the case where the VM was killed, the pinned guest pages aren't locked. Use set_page_dirty_lock() instead of set_page_dirty(). Testing done: Killed VM while having an active VMCI based vSocket connection and observed warning from ext4. With this

Re: [PATCH v5 05/16] clocksource/hyperv: use MSR-based access if running as root

2021-01-20 Thread Pavel Tatashin
On Wed, Jan 20, 2021 at 7:01 AM Wei Liu wrote: > > When Linux runs as the root partition, the setup required for TSC page > is different. Why would we need a TSC page as a clock source for root partition at all? I think the above can be removed. Luckily Linux also has access to the MSR based >

Re: [PATCH v5 04/16] iommu/hyperv: don't setup IRQ remapping when running as root

2021-01-20 Thread Pavel Tatashin
On Wed, Jan 20, 2021 at 7:01 AM Wei Liu wrote: > > The IOMMU code needs more work. We're sure for now the IRQ remapping > hooks are not applicable when Linux is the root partition. > > Signed-off-by: Wei Liu > Acked-by: Joerg Roedel > Reviewed-by: Vitaly Kuznetsov > --- >

Re: [PATCH v5 01/16] asm-generic/hyperv: change HV_CPU_POWER_MANAGEMENT to HV_CPU_MANAGEMENT

2021-01-20 Thread Pavel Tatashin
On Wed, Jan 20, 2021 at 7:01 AM Wei Liu wrote: > > This makes the name match Hyper-V TLFS. > > Signed-off-by: Wei Liu > Reviewed-by: Vitaly Kuznetsov > --- > include/asm-generic/hyperv-tlfs.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [RFC PATCH 3/7] tun: allow use of BPF_PROG_TYPE_SCHED_CLS program type

2021-01-20 Thread Alexei Starovoitov
On Tue, Jan 12, 2021 at 12:55 PM Yuri Benditovich wrote: > > On Tue, Jan 12, 2021 at 10:40 PM Yuri Benditovich > wrote: > > > > On Tue, Jan 12, 2021 at 9:42 PM Yuri Benditovich > > wrote: > > > > > > This program type can set skb hash value. It will be useful > > > when the tun will support

Re: [PATCH v5 03/16] Drivers: hv: vmbus: skip VMBus initialization if Linux is root

2021-01-20 Thread Pavel Tatashin
On Wed, Jan 20, 2021 at 7:01 AM Wei Liu wrote: > > There is no VMBus and the other infrastructures initialized in > hv_acpi_init when Linux is running as the root partition. > > Signed-off-by: Wei Liu > --- > v3: Return 0 instead of -ENODEV. > --- > drivers/hv/vmbus_drv.c | 3 +++ > 1 file

Re: [PATCH v5 02/16] x86/hyperv: detect if Linux is the root partition

2021-01-20 Thread Pavel Tatashin
On Wed, Jan 20, 2021 at 7:01 AM Wei Liu wrote: > > For now we can use the privilege flag to check. Stash the value to be > used later. > > Put in a bunch of defines for future use when we want to have more > fine-grained detection. > > Signed-off-by: Wei Liu > --- > v3: move hv_root_partition to

[PATCH v2 1/3] VMCI: Stop log spew when qp allocation isn't possible

2021-01-20 Thread Jorgen Hansen
VMCI queue pair allocation is disabled, if a VM is in FT mode. In these cases, VMware Tools may still once in a while attempt to create a vSocket stream connection, resulting in multiple warnings in the kernel logs. Therefore downgrade the error log to a debug log. Reviewed-by: Vishnu Dasa

[PATCH v2 0/3] VMCI: Queue pair bug fixes

2021-01-20 Thread Jorgen Hansen
This series contains three bug fixes for the queue pair implementation in the VMCI driver. v1 -> v2: - format patches as a series - use min_t instead of min to ensure size_t comparison (issue pointed out by kernel test robot ) Jorgen Hansen (3): VMCI: Stop log spew when qp allocation

Re: [PATCH v5 06/16] x86/hyperv: allocate output arg pages if required

2021-01-20 Thread Pavel Tatashin
On Wed, Jan 20, 2021 at 7:01 AM Wei Liu wrote: > > When Linux runs as the root partition, it will need to make hypercalls > which return data from the hypervisor. > > Allocate pages for storing results when Linux runs as the root > partition. > > Signed-off-by: Lillian Grassin-Drake >

[PATCH 1/1] vhost scsi: allocate vhost_scsi with GFP_NOWAIT to avoid delay

2021-01-20 Thread Dongli Zhang
The size of 'struct vhost_scsi' is order-10 (~2.3MB). It may take long time delay by kzalloc() to compact memory pages when there is a lack of high-order pages. As a result, there is latency to create a VM (with vhost-scsi) or to hotadd vhost-scsi-based storage. The prior commit 595cb754983d

RE: [RFC 3/3] vfio: Share the KVM instance with Vdmabuf

2021-01-20 Thread Kasireddy, Vivek
Hi Alex, > -Original Message- > From: Alex Williamson > Sent: Tuesday, January 19, 2021 7:37 PM > To: Tian, Kevin > Cc: Kasireddy, Vivek ; Kim, Dongwon > ; virtualization@lists.linux-foundation.org; Zhao, Yan > Y > > Subject: Re: [RFC 3/3] vfio: Share the KVM instance with Vdmabuf >

Re: [PATCH v2] vdpa_sim: use iova module to allocate IOVA addresses

2021-01-20 Thread Stefano Garzarella
Hi Michael, I'm restarting the work on vdpa-blk simulator, and this patch is needed to have it working properly. Do you plan to queue this patch or would you prefer that I include it in my next vdpa-blk-sim series? Thanks, Stefano On Wed, Dec 23, 2020 at 10:06:08AM +0100, Stefano

Re: [PATCH v5 06/16] x86/hyperv: allocate output arg pages if required

2021-01-20 Thread kernel test robot
Hi Wei, I love your patch! Perhaps something to improve: [auto build test WARNING on e71ba9452f0b5b2e8dc8aa5445198cd9214a6a62] url: https://github.com/0day-ci/linux/commits/Wei-Liu/Introducing-Linux-root-partition-support-for-Microsoft-Hypervisor/20210120-215640 base

Re: [PATCH net-next v2 3/3] xsk: build skb by page

2021-01-20 Thread Michael S. Tsirkin
On Wed, Jan 20, 2021 at 03:11:04AM -0500, Michael S. Tsirkin wrote: > On Wed, Jan 20, 2021 at 03:50:01PM +0800, Xuan Zhuo wrote: > > This patch is used to construct skb based on page to save memory copy > > overhead. > > > > This function is implemented based on IFF_TX_SKB_NO_LINEAR. Only the > >

Re: [PATCH 2/7] uapi: virtio_snd: add the sound device header file

2021-01-20 Thread Michael S. Tsirkin
On Wed, Jan 20, 2021 at 01:36:30AM +0100, Anton Yakovlev wrote: > The file contains the definitions for the sound device from the OASIS > virtio spec. > > Signed-off-by: Anton Yakovlev > --- > MAINTAINERS | 6 + > include/uapi/linux/virtio_snd.h | 361

Re: [PATCH 3/7] ALSA: virtio: add virtio sound driver

2021-01-20 Thread Michael S. Tsirkin
On Wed, Jan 20, 2021 at 01:36:31AM +0100, Anton Yakovlev wrote: > Introduce skeleton of the virtio sound driver. The driver implements > the virtio sound device specification, which has become part of the > virtio standard. > > Initial initialization of the device, virtqueues and creation of an >

Re: [PATCH net-next v2 3/3] xsk: build skb by page

2021-01-20 Thread Michael S. Tsirkin
On Wed, Jan 20, 2021 at 03:50:01PM +0800, Xuan Zhuo wrote: > This patch is used to construct skb based on page to save memory copy > overhead. > > This function is implemented based on IFF_TX_SKB_NO_LINEAR. Only the > network card priv_flags supports IFF_TX_SKB_NO_LINEAR will use page to >

Re: [PATCH 4/7] ALSA: virtio: handling control and I/O messages for the PCM device

2021-01-20 Thread Michael S. Tsirkin
On Wed, Jan 20, 2021 at 01:36:32AM +0100, Anton Yakovlev wrote: > The driver implements a message-based transport for I/O substream > operations. Before the start of the substream, the hardware buffer is > sliced into I/O messages, the number of which is equal to the current > number of periods.

Re: [PATCH 5/7] ALSA: virtio: PCM substream operators

2021-01-20 Thread Michael S. Tsirkin
On Wed, Jan 20, 2021 at 01:36:33AM +0100, Anton Yakovlev wrote: > Introduce the operators required for the operation of substreams. > > Signed-off-by: Anton Yakovlev > --- > sound/virtio/Makefile | 3 +- > sound/virtio/virtio_pcm.c | 5 +- > sound/virtio/virtio_pcm.h | 2 +

Re: [PATCH v2] drm/virtio: Track total GPU memory for virtio driver

2021-01-20 Thread Daniel Vetter
On Tue, Jan 19, 2021 at 11:08:12AM -0800, Yiwei Zhang wrote: > On Mon, Jan 18, 2021 at 11:03 PM Daniel Vetter wrote: > > > > On Tue, Jan 19, 2021 at 12:41 AM Yiwei Zhang wrote: > > > > > > On the success of virtio_gpu_object_create, add size of newly allocated > > > bo to the tracled total_mem.

Re: [PATCH 2/7] uapi: virtio_snd: add the sound device header file

2021-01-20 Thread Michael S. Tsirkin
On Wed, Jan 20, 2021 at 03:19:55AM -0500, Michael S. Tsirkin wrote: > On Wed, Jan 20, 2021 at 01:36:30AM +0100, Anton Yakovlev wrote: > > The file contains the definitions for the sound device from the OASIS > > virtio spec. > > > > Signed-off-by: Anton Yakovlev > > --- > > MAINTAINERS

Re: [PATCH] virtio-mem: Assign boolean values to a bool variable

2021-01-20 Thread David Hildenbrand
On 20.01.21 10:57, Michael S. Tsirkin wrote: > On Wed, Jan 20, 2021 at 10:40:37AM +0100, David Hildenbrand wrote: >> On 20.01.21 08:50, Jiapeng Zhong wrote: >>> Fix the following coccicheck warnings: >>> >>> ./drivers/virtio/virtio_mem.c:2580:2-25: WARNING: Assignment >>> of 0/1 to bool variable.

Re: [PATCH] virtio-mem: Assign boolean values to a bool variable

2021-01-20 Thread David Hildenbrand
On 20.01.21 08:50, Jiapeng Zhong wrote: > Fix the following coccicheck warnings: > > ./drivers/virtio/virtio_mem.c:2580:2-25: WARNING: Assignment > of 0/1 to bool variable. > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Zhong > --- > drivers/virtio/virtio_mem.c | 2 +- > 1 file

Re: [PATCH] virtio-mem: Assign boolean values to a bool variable

2021-01-20 Thread Michael S. Tsirkin
On Wed, Jan 20, 2021 at 10:40:37AM +0100, David Hildenbrand wrote: > On 20.01.21 08:50, Jiapeng Zhong wrote: > > Fix the following coccicheck warnings: > > > > ./drivers/virtio/virtio_mem.c:2580:2-25: WARNING: Assignment > > of 0/1 to bool variable. > > > > Reported-by: Abaci Robot > >

Re: [PATCH 2/7] uapi: virtio_snd: add the sound device header file

2021-01-20 Thread Michael S. Tsirkin
On Wed, Jan 20, 2021 at 01:36:30AM +0100, Anton Yakovlev wrote: > The file contains the definitions for the sound device from the OASIS > virtio spec. > > Signed-off-by: Anton Yakovlev > --- > MAINTAINERS | 6 + > include/uapi/linux/virtio_snd.h | 361

Re: [PATCH v1] vdpa/mlx5: Fix memory key MTT population

2021-01-20 Thread Michael S. Tsirkin
On Wed, Jan 20, 2021 at 10:11:54AM +0200, Eli Cohen wrote: > On Wed, Jan 20, 2021 at 02:57:05AM -0500, Michael S. Tsirkin wrote: > > On Wed, Jan 20, 2021 at 07:36:19AM +0200, Eli Cohen wrote: > > > On Fri, Jan 08, 2021 at 04:38:55PM +0800, Jason Wang wrote: > > > > > > Hi Michael, > > > this

[PATCH v3 3/4] drm/qxl: release shadow on shutdown

2021-01-20 Thread Gerd Hoffmann
In case we have a shadow surface on shutdown release it so it doesn't leak. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index

[PATCH v3 1/4] drm/qxl: use drmm_mode_config_init

2021-01-20 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/qxl/qxl_display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 012bce0cdb65..38d6b596094d 100644 ---

[PATCH v3 2/4] drm/qxl: unpin release objects

2021-01-20 Thread Gerd Hoffmann
Balances the qxl_create_bo(..., pinned=true, ...); call in qxl_release_bo_alloc(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_release.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c index

[PATCH v3 4/4] drm/qxl: handle shadow in primary destroy

2021-01-20 Thread Gerd Hoffmann
qxl_primary_atomic_disable must check whenever the framebuffer bo has a shadow surface and in case it has check the shadow primary status. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c

Re: [PATCH] virtio-mem: Assign boolean values to a bool variable

2021-01-20 Thread David Hildenbrand
On 20.01.21 12:03, Michael S. Tsirkin wrote: > On Wed, Jan 20, 2021 at 11:04:18AM +0100, David Hildenbrand wrote: >> On 20.01.21 10:57, Michael S. Tsirkin wrote: >>> On Wed, Jan 20, 2021 at 10:40:37AM +0100, David Hildenbrand wrote: On 20.01.21 08:50, Jiapeng Zhong wrote: > Fix the

Re: [PATCH v2] drm/virtio: Track total GPU memory for virtio driver

2021-01-20 Thread Daniel Vetter
On Wed, Jan 20, 2021 at 10:51 AM Yiwei Zhang‎ wrote: > > On Wed, Jan 20, 2021 at 1:11 AM Daniel Vetter wrote: > > > > On Tue, Jan 19, 2021 at 11:08:12AM -0800, Yiwei Zhang wrote: > > > On Mon, Jan 18, 2021 at 11:03 PM Daniel Vetter wrote: > > > > > > > > On Tue, Jan 19, 2021 at 12:41 AM Yiwei

Doctoral Symposium - CISTI 2021, Chaves, Portugal

2021-01-20 Thread ML
---- ---- Doctoral Symposium CISTI 2021 - 16th Iberian Conference on Information Systems and Technologies, Chaves, Portugal, 23 - 26 June 2021 http://www.cisti.eu/

Re: [RFC v3 03/11] vdpa: Remove the restriction that only supports virtio-net devices

2021-01-20 Thread Stefano Garzarella
On Wed, Jan 20, 2021 at 11:46:38AM +0800, Jason Wang wrote: On 2021/1/19 下午12:59, Xie Yongji wrote: With VDUSE, we should be able to support all kinds of virtio devices. Signed-off-by: Xie Yongji --- drivers/vhost/vdpa.c | 29 +++-- 1 file changed, 3 insertions(+),

Re: [PATCH] virtio-mem: Assign boolean values to a bool variable

2021-01-20 Thread Michael S. Tsirkin
On Wed, Jan 20, 2021 at 11:04:18AM +0100, David Hildenbrand wrote: > On 20.01.21 10:57, Michael S. Tsirkin wrote: > > On Wed, Jan 20, 2021 at 10:40:37AM +0100, David Hildenbrand wrote: > >> On 20.01.21 08:50, Jiapeng Zhong wrote: > >>> Fix the following coccicheck warnings: > >>> > >>>

Re: [PATCH] virtio-mem: Assign boolean values to a bool variable

2021-01-20 Thread Michael S. Tsirkin
On Wed, Jan 20, 2021 at 12:14:14PM +0100, David Hildenbrand wrote: > On 20.01.21 12:03, Michael S. Tsirkin wrote: > > On Wed, Jan 20, 2021 at 11:04:18AM +0100, David Hildenbrand wrote: > >> On 20.01.21 10:57, Michael S. Tsirkin wrote: > >>> On Wed, Jan 20, 2021 at 10:40:37AM +0100, David

Re: [PATCH] virtio-mem: Assign boolean values to a bool variable

2021-01-20 Thread David Hildenbrand
>>> Want to send your ack on this one? >> >> Sure >> >> Acked-by: David Hildenbrand > > > Added yours and the original Signed-off-by. > > Thanks! Thanks Michael! -- Thanks, David / dhildenb ___ Virtualization mailing list

[PATCH v4 06/15] x86: rework arch_local_irq_restore() to not use popf

2021-01-20 Thread Juergen Gross via Virtualization
"popf" is a rather expensive operation, so don't use it for restoring irq flags. Instead test whether interrupts are enabled in the flags parameter and enable interrupts via "sti" in that case. This results in the restore_fl paravirt op to be no longer needed. Suggested-by: Andy Lutomirski

[PATCH v4 05/15] x86/xen: drop USERGS_SYSRET64 paravirt call

2021-01-20 Thread Juergen Gross via Virtualization
USERGS_SYSRET64 is used to return from a syscall via sysret, but a Xen PV guest will nevertheless use the iret hypercall, as there is no sysret PV hypercall defined. So instead of testing all the prerequisites for doing a sysret and then mangling the stack for Xen PV again for doing an iret just

[PATCH v4 11/15] x86/paravirt: simplify paravirt macros

2021-01-20 Thread Juergen Gross via Virtualization
The central pvops call macros PVOP_CALL() and PVOP_VCALL() are looking very similar now. The main differences are using PVOP_VCALL_ARGS or PVOP_CALL_ARGS, which are identical, and the return value handling. So drop PVOP_VCALL_ARGS and instead of PVOP_VCALL() just use

[PATCH v4 07/15] x86/paravirt: switch time pvops functions to use static_call()

2021-01-20 Thread Juergen Gross via Virtualization
The time pvops functions are the only ones left which might be used in 32-bit mode and which return a 64-bit value. Switch them to use the static_call() mechanism instead of pvops, as this allows quite some simplification of the pvops implementation. Signed-off-by: Juergen Gross --- V4: - drop

[PATCH v4 12/15] x86/paravirt: switch iret pvops to ALTERNATIVE

2021-01-20 Thread Juergen Gross via Virtualization
The iret paravirt op is rather special as it is using a jmp instead of a call instruction. Switch it to ALTERNATIVE. Signed-off-by: Juergen Gross --- V3: - use ALTERNATIVE_TERNARY --- arch/x86/include/asm/paravirt.h | 6 +++--- arch/x86/include/asm/paravirt_types.h | 5 +

[PATCH v4 09/15] x86: add new features for paravirt patching

2021-01-20 Thread Juergen Gross via Virtualization
For being able to switch paravirt patching from special cased custom code sequences to ALTERNATIVE handling some X86_FEATURE_* are needed as new features. This enables to have the standard indirect pv call as the default code and to patch that with the non-Xen custom code sequence via ALTERNATIVE

[PATCH v4 13/15] x86/paravirt: add new macros PVOP_ALT* supporting pvops in ALTERNATIVEs

2021-01-20 Thread Juergen Gross via Virtualization
Instead of using paravirt patching for custom code sequences add support for using ALTERNATIVE handling combined with paravirt call patching. Signed-off-by: Juergen Gross --- V3: - drop PVOP_ALT_VCALL() macro --- arch/x86/include/asm/paravirt_types.h | 49 ++- 1 file

[PATCH v4 14/15] x86/paravirt: switch functions with custom code to ALTERNATIVE

2021-01-20 Thread Juergen Gross via Virtualization
Instead of using paravirt patching for custom code sequences use ALTERNATIVE for the functions with custom code replacements. Instead of patching an ud2 instruction for unpopulated vector entries into the caller site, use a simple function just calling BUG() as a replacement. Simplify the

[PATCH v4 15/15] x86/paravirt: have only one paravirt patch function

2021-01-20 Thread Juergen Gross via Virtualization
There is no need any longer to have different paravirt patch functions for native and Xen. Eliminate native_patch() and rename paravirt_patch_default() to paravirt_patch(). Signed-off-by: Juergen Gross --- V3: - remove paravirt_patch_insns() (kernel test robot) ---

[PATCH v4 04/15] x86/pv: switch SWAPGS to ALTERNATIVE

2021-01-20 Thread Juergen Gross via Virtualization
SWAPGS is used only for interrupts coming from user mode or for returning to user mode. So there is no reason to use the PARAVIRT framework, as it can easily be replaced by an ALTERNATIVE depending on X86_FEATURE_XENPV. There are several instances using the PV-aware SWAPGS macro in paths which

[PATCH v4 10/15] x86/paravirt: remove no longer needed 32-bit pvops cruft

2021-01-20 Thread Juergen Gross via Virtualization
PVOP_VCALL4() is only used for Xen PV, while PVOP_CALL4() isn't used at all. Keep PVOP_CALL4() for 64 bits due to symmetry reasons. This allows to remove the 32-bit definitions of those macros leading to a substantial simplification of the paravirt macros, as those were the only ones needing

[PATCH v4 00/15] x86: major paravirt cleanup

2021-01-20 Thread Juergen Gross via Virtualization
This is a major cleanup of the paravirt infrastructure aiming at eliminating all custom code patching via paravirt patching. This is achieved by using ALTERNATIVE instead, leading to the ability to give objtool access to the patched in instructions. In order to remove most of the 32-bit special

Re: [PATCH v2] drm/virtio: Track total GPU memory for virtio driver

2021-01-20 Thread Gerd Hoffmann
Hi, > > > > > + select TRACE_GPU_MEM > > > > > +#ifdef CONFIG_TRACE_GPU_MEM That doesn't make sense btw. > > > > > +#ifdef CONFIG_TRACE_GPU_MEM > > > > > +static inline void virtio_gpu_trace_total_mem(struct > > > > > virtio_gpu_device *vgdev, > > > > > +

[PATCH v4 07/15] x86/paravirt: switch time pvops functions to use static_call()

2021-01-20 Thread Juergen Gross via Virtualization
The time pvops functions are the only ones left which might be used in 32-bit mode and which return a 64-bit value. Switch them to use the static_call() mechanism instead of pvops, as this allows quite some simplification of the pvops implementation. Signed-off-by: Juergen Gross --- V4: - drop

[PATCH v4 10/15] x86/paravirt: remove no longer needed 32-bit pvops cruft

2021-01-20 Thread Juergen Gross via Virtualization
PVOP_VCALL4() is only used for Xen PV, while PVOP_CALL4() isn't used at all. Keep PVOP_CALL4() for 64 bits due to symmetry reasons. This allows to remove the 32-bit definitions of those macros leading to a substantial simplification of the paravirt macros, as those were the only ones needing

[PATCH v4 15/15] x86/paravirt: have only one paravirt patch function

2021-01-20 Thread Juergen Gross via Virtualization
There is no need any longer to have different paravirt patch functions for native and Xen. Eliminate native_patch() and rename paravirt_patch_default() to paravirt_patch(). Signed-off-by: Juergen Gross --- V3: - remove paravirt_patch_insns() (kernel test robot) ---

[PATCH v4 14/15] x86/paravirt: switch functions with custom code to ALTERNATIVE

2021-01-20 Thread Juergen Gross via Virtualization
Instead of using paravirt patching for custom code sequences use ALTERNATIVE for the functions with custom code replacements. Instead of patching an ud2 instruction for unpopulated vector entries into the caller site, use a simple function just calling BUG() as a replacement. Simplify the

[PATCH v4 12/15] x86/paravirt: switch iret pvops to ALTERNATIVE

2021-01-20 Thread Juergen Gross via Virtualization
The iret paravirt op is rather special as it is using a jmp instead of a call instruction. Switch it to ALTERNATIVE. Signed-off-by: Juergen Gross --- V3: - use ALTERNATIVE_TERNARY --- arch/x86/include/asm/paravirt.h | 6 +++--- arch/x86/include/asm/paravirt_types.h | 5 +

[PATCH v4 00/15] x86: major paravirt cleanup

2021-01-20 Thread Juergen Gross via Virtualization
[Resend due to all the Cc:'s missing] This is a major cleanup of the paravirt infrastructure aiming at eliminating all custom code patching via paravirt patching. This is achieved by using ALTERNATIVE instead, leading to the ability to give objtool access to the patched in instructions. In

[PATCH v4 05/15] x86/xen: drop USERGS_SYSRET64 paravirt call

2021-01-20 Thread Juergen Gross via Virtualization
USERGS_SYSRET64 is used to return from a syscall via sysret, but a Xen PV guest will nevertheless use the iret hypercall, as there is no sysret PV hypercall defined. So instead of testing all the prerequisites for doing a sysret and then mangling the stack for Xen PV again for doing an iret just

[PATCH v4 11/15] x86/paravirt: simplify paravirt macros

2021-01-20 Thread Juergen Gross via Virtualization
The central pvops call macros PVOP_CALL() and PVOP_VCALL() are looking very similar now. The main differences are using PVOP_VCALL_ARGS or PVOP_CALL_ARGS, which are identical, and the return value handling. So drop PVOP_VCALL_ARGS and instead of PVOP_VCALL() just use

[PATCH v4 06/15] x86: rework arch_local_irq_restore() to not use popf

2021-01-20 Thread Juergen Gross via Virtualization
"popf" is a rather expensive operation, so don't use it for restoring irq flags. Instead test whether interrupts are enabled in the flags parameter and enable interrupts via "sti" in that case. This results in the restore_fl paravirt op to be no longer needed. Suggested-by: Andy Lutomirski

[PATCH v4 04/15] x86/pv: switch SWAPGS to ALTERNATIVE

2021-01-20 Thread Juergen Gross via Virtualization
SWAPGS is used only for interrupts coming from user mode or for returning to user mode. So there is no reason to use the PARAVIRT framework, as it can easily be replaced by an ALTERNATIVE depending on X86_FEATURE_XENPV. There are several instances using the PV-aware SWAPGS macro in paths which

[PATCH v4 13/15] x86/paravirt: add new macros PVOP_ALT* supporting pvops in ALTERNATIVEs

2021-01-20 Thread Juergen Gross via Virtualization
Instead of using paravirt patching for custom code sequences add support for using ALTERNATIVE handling combined with paravirt call patching. Signed-off-by: Juergen Gross --- V3: - drop PVOP_ALT_VCALL() macro --- arch/x86/include/asm/paravirt_types.h | 49 ++- 1 file

[PATCH v4 09/15] x86: add new features for paravirt patching

2021-01-20 Thread Juergen Gross via Virtualization
For being able to switch paravirt patching from special cased custom code sequences to ALTERNATIVE handling some X86_FEATURE_* are needed as new features. This enables to have the standard indirect pv call as the default code and to patch that with the non-Xen custom code sequence via ALTERNATIVE