Re: [PATCH v5 1/8] s390/mm: force swiotlb for protected virtualization

Thiago Jung Bauermann
2019-07-11T21:49:05Z

Hello Halil,

Halil Pasic <pasic@linux.ibm.com> writes:

> On s390, protected virtualization guests have to use bounced I/O
> buffers. That requires some plumbing.
>
> Let us make sure, any device that uses DMA API with direct ops correctly
> is spared from the problems, that a hypervisor attempting I/O to a
> non-shared page would bring.
>
> Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> ---
> arch/s390/Kconfig | 4 +++
> arch/s390/include/asm/mem_encrypt.h | 18 +++++++++++
> arch/s390/mm/init.c | 47 +++++++++++++++++++++++++++++
> 3 files changed, 69 insertions(+)
> create mode 100644 arch/s390/include/asm/mem_encrypt.h
>
> diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
> index 109243fdb6ec..88d8355b7bf7 100644
> --- a/arch/s390/Kconfig
> +++ b/arch/s390/Kconfig
> @@ -1,4 +1,7 @@
> # SPDX-License-Identifier: GPL-2.0
> +config ARCH_HAS_MEM_ENCRYPT
> + def_bool y
> +
> config MMU
> def_bool y
>

ARCH_HAS_MEM_ENCRYPT is already defined in arch/Kconfig, so I think you
can just select it in config S390 like you do with SWIOTLB.

> @@ -187,6 +190,7 @@ config S390
> select VIRT_CPU_ACCOUNTING
> select ARCH_HAS_SCALED_CPUTIME
> select HAVE_NMI
> + select SWIOTLB
>
>
> config SCHED_OMIT_FRAME_POINTER

--
Thiago Jung Bauermann
IBM Linux Technology Center