From: Jingxian He hejingxian@huawei.com
virtcca inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IAGYKI
--------------------------------
Modify arm64 defconfig for cvm guest featue.
Signed-off-by: Jingxian He hejingxian@huawei.com --- arch/arm64/Kconfig | 2 +- arch/arm64/configs/openeuler_defconfig | 3 ++- arch/arm64/kernel/virtcca_cvm_guest.c | 2 +- kernel/dma/swiotlb.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index c0fc7b4ca..501ec560a 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -2576,7 +2576,7 @@ config COMPAT def_bool y depends on AARCH32_EL0 || ARM64_ILP32
-config HISI_VIRTCCA_GUEST +config HISI_VIRTCCA_GUEST bool "Enable cvm guest run" depends on DMA_RESTRICTED_POOL help diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index 973e518e6..efb099ff4 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -595,6 +595,7 @@ CONFIG_DMI=y # end of Boot options
CONFIG_COMPAT=y +CONFIG_HISI_VIRTCCA_GUEST=y
# # Power management options @@ -7820,7 +7821,7 @@ CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y CONFIG_SWIOTLB=y # CONFIG_SWIOTLB_DYNAMIC is not set CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC=y -# CONFIG_DMA_RESTRICTED_POOL is not set +CONFIG_DMA_RESTRICTED_POOL=y CONFIG_DMA_NONCOHERENT_MMAP=y CONFIG_DMA_COHERENT_POOL=y CONFIG_DMA_DIRECT_REMAP=y diff --git a/arch/arm64/kernel/virtcca_cvm_guest.c b/arch/arm64/kernel/virtcca_cvm_guest.c index 1ce458959..6c4987546 100644 --- a/arch/arm64/kernel/virtcca_cvm_guest.c +++ b/arch/arm64/kernel/virtcca_cvm_guest.c @@ -75,7 +75,7 @@ static int __set_memory_encrypted(unsigned long addr, int numpages, bool encrypt) { - if (!is_cvm_world()) + if (!is_virtcca_cvm_world()) return 0;
WARN_ON(!__is_lm_address(addr)); diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index ef444544e..5c10d1b7c 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -1741,7 +1741,7 @@ void __init swiotlb_cvm_update_mem_attributes(void) void *vaddr; unsigned long bytes;
- if (!is_cvm_world() || !is_swiotlb_allocated()) + if (!is_virtcca_cvm_world() || !is_swiotlb_allocated()) return; vaddr = phys_to_virt(io_tlb_default_mem.defpool.start); bytes = PAGE_ALIGN(io_tlb_default_mem.defpool.nslabs << IO_TLB_SHIFT);