[09/11] Kernel: Enable SVA support for both Intel and AMD CPUs

Message ID 4e8085be-1959-60f6-eec5-0c30826a70ae@ipfire.org
State Accepted
Commit 11925d6f9fd5ba260819826ba7df24e2244ff7e6
Headers
Series Kernel: Improve hardening |

Commit Message

Peter Müller March 19, 2022, 9:10 p.m. UTC
  Since running virtual machines is one of our legitimate use cases, it
makes sense to provide Qemu with the ability of taking advantage of
IOMMU support for safer virtuall memory allocation, if available.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 config/kernel/kernel.config.x86_64-ipfire | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Michael Tremer March 23, 2022, 5:54 p.m. UTC | #1
Acked-by: Michael Tremer <michael.tremer@ipfire.org>

> On 19 Mar 2022, at 21:10, Peter Müller <peter.mueller@ipfire.org> wrote:
> 
> Since running virtual machines is one of our legitimate use cases, it
> makes sense to provide Qemu with the ability of taking advantage of
> IOMMU support for safer virtuall memory allocation, if available.
> 
> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
> ---
> config/kernel/kernel.config.x86_64-ipfire | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/config/kernel/kernel.config.x86_64-ipfire b/config/kernel/kernel.config.x86_64-ipfire
> index 0b9c79209..42275d26f 100644
> --- a/config/kernel/kernel.config.x86_64-ipfire
> +++ b/config/kernel/kernel.config.x86_64-ipfire
> @@ -6179,6 +6179,7 @@ CONFIG_INTEL_IDMA64=m
> CONFIG_INTEL_IDXD_BUS=m
> CONFIG_INTEL_IDXD=m
> # CONFIG_INTEL_IDXD_COMPAT is not set
> +# CONFIG_INTEL_IDXD_SVM is not set
> # CONFIG_INTEL_IDXD_PERFMON is not set
> CONFIG_INTEL_IOATDMA=m
> CONFIG_PLX_DMA=m
> @@ -6476,11 +6477,12 @@ CONFIG_IOMMU_DEFAULT_DMA_STRICT=y
> # CONFIG_IOMMU_DEFAULT_DMA_LAZY is not set
> # CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
> CONFIG_IOMMU_DMA=y
> +CONFIG_IOMMU_SVA_LIB=y
> CONFIG_AMD_IOMMU=y
> -# CONFIG_AMD_IOMMU_V2 is not set
> +CONFIG_AMD_IOMMU_V2=y
> CONFIG_DMAR_TABLE=y
> CONFIG_INTEL_IOMMU=y
> -# CONFIG_INTEL_IOMMU_SVM is not set
> +CONFIG_INTEL_IOMMU_SVM=y
> # CONFIG_INTEL_IOMMU_DEFAULT_ON is not set
> CONFIG_INTEL_IOMMU_FLOPPY_WA=y
> # CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set
> -- 
> 2.34.1
  

Patch

diff --git a/config/kernel/kernel.config.x86_64-ipfire b/config/kernel/kernel.config.x86_64-ipfire
index 0b9c79209..42275d26f 100644
--- a/config/kernel/kernel.config.x86_64-ipfire
+++ b/config/kernel/kernel.config.x86_64-ipfire
@@ -6179,6 +6179,7 @@  CONFIG_INTEL_IDMA64=m
 CONFIG_INTEL_IDXD_BUS=m
 CONFIG_INTEL_IDXD=m
 # CONFIG_INTEL_IDXD_COMPAT is not set
+# CONFIG_INTEL_IDXD_SVM is not set
 # CONFIG_INTEL_IDXD_PERFMON is not set
 CONFIG_INTEL_IOATDMA=m
 CONFIG_PLX_DMA=m
@@ -6476,11 +6477,12 @@  CONFIG_IOMMU_DEFAULT_DMA_STRICT=y
 # CONFIG_IOMMU_DEFAULT_DMA_LAZY is not set
 # CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
 CONFIG_IOMMU_DMA=y
+CONFIG_IOMMU_SVA_LIB=y
 CONFIG_AMD_IOMMU=y
-# CONFIG_AMD_IOMMU_V2 is not set
+CONFIG_AMD_IOMMU_V2=y
 CONFIG_DMAR_TABLE=y
 CONFIG_INTEL_IOMMU=y
-# CONFIG_INTEL_IOMMU_SVM is not set
+CONFIG_INTEL_IOMMU_SVM=y
 # CONFIG_INTEL_IOMMU_DEFAULT_ON is not set
 CONFIG_INTEL_IOMMU_FLOPPY_WA=y
 # CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON is not set