]> git.baikalelectronics.ru Git - kernel.git/commit
virtio: replace restricted mem access flag with callback
authorJuergen Gross <jgross@suse.com>
Wed, 22 Jun 2022 06:38:36 +0000 (08:38 +0200)
committerJuergen Gross <jgross@suse.com>
Mon, 1 Aug 2022 05:42:49 +0000 (07:42 +0200)
commit7aa7b880b96d7d5889e5fb4bc0d73cbe05ed067a
tree5154e240ad4f487a866e74a055671d66b8b12b6d
parentb8da8d03bab5934f096bd1bdb8965fbe9fc39a26
virtio: replace restricted mem access flag with callback

Instead of having a global flag to require restricted memory access
for all virtio devices, introduce a callback which can select that
requirement on a per-device basis.

For convenience add a common function returning always true, which can
be used for use cases like SEV.

Per default use a callback always returning false.

As the callback needs to be set in early init code already, add a
virtio anchor which is builtin in case virtio is enabled.

Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> # Arm64 guest using Xen
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Link: https://lore.kernel.org/r/20220622063838.8854-2-jgross@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
arch/s390/mm/init.c
arch/x86/mm/mem_encrypt_amd.c
drivers/virtio/Kconfig
drivers/virtio/Makefile
drivers/virtio/virtio.c
drivers/virtio/virtio_anchor.c [new file with mode: 0644]
include/linux/platform-feature.h
include/linux/virtio_anchor.h [new file with mode: 0644]
include/xen/xen.h