From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EFC614B077; Thu, 25 Apr 2024 18:16:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714068999; cv=none; b=QuKy9+Xjpn49IJSliX3pHhvUrTCl6N9t6AneO9YnxCtLdz1WIHo4KFLJjZOKCPSx5Xt31RDp/m9mqTn479W5+yYZQd78QFCk8doqLvnGeUZg7JBaV1tMaZC2uDj+IhY5AsHKLfOXKQQ8f+hRpy5atTZ5G3UBFcEIeMEYmw1TtfY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714068999; c=relaxed/simple; bh=osvQDcfth2oHBETtvgsqxTXc9soDQsyNFetTLK7ImU8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Cy7ywjmE0hG0diZeEiyD9gaEx//+N6b2v+4yVi+CyOeuHzMAsh8gxpNms4e/1jAZ/dwD+XRmm6pe6eAgZ6JkkTfRJsDyU8baX/bX08A9fQv+NbPoufcmr8BjZi90SevX+apijqu58mF4SqM25LPhqWY9QsJLUIuQ4dVzOXJVTlY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 41D731007; Thu, 25 Apr 2024 11:17:04 -0700 (PDT) Received: from NH27D9T0LF (unknown [10.57.56.86]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 336303F793; Thu, 25 Apr 2024 11:16:32 -0700 (PDT) Date: Thu, 25 Apr 2024 20:16:28 +0200 From: Emanuele Rocca To: Suzuki K Poulose Cc: kernel test robot , Steven Price , kvm@vger.kernel.org, kvmarm@lists.linux.dev, llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Catalin Marinas , Marc Zyngier , Will Deacon , James Morse , Oliver Upton , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni Subject: Re: [PATCH v2 09/14] arm64: Enable memory encrypt for Realms Message-ID: References: <20240412084213.1733764-10-steven.price@arm.com> <202404151003.vkNApJiS-lkp@intel.com> <5bba262f-6d30-417b-8a6f-fc03b86c47bd@arm.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5bba262f-6d30-417b-8a6f-fc03b86c47bd@arm.com> Hi, On 2024-04-25 05:29, Suzuki K Poulose wrote: > Emmanuele reports that these need to be exported as well, something > like: > > > diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c > index 229b6d9990f5..de3843ce2aea 100644 > --- a/arch/arm64/mm/pageattr.c > +++ b/arch/arm64/mm/pageattr.c > @@ -228,11 +228,13 @@ int set_memory_encrypted(unsigned long addr, int > numpages) > { > return __set_memory_encrypted(addr, numpages, true); > } > +EXPORT_SYMBOL_GPL(set_memory_encrypted); > > int set_memory_decrypted(unsigned long addr, int numpages) > { > return __set_memory_encrypted(addr, numpages, false); > } > +EXPORT_SYMBOL_GPL(set_memory_decrypted); > > #ifdef CONFIG_DEBUG_PAGEALLOC > void __kernel_map_pages(struct page *page, int numpages, int enable Indeed, without exporting the symbols I was getting this build failure: ERROR: modpost: "set_memory_encrypted" [drivers/hv/hv_vmbus.ko] undefined! ERROR: modpost: "set_memory_decrypted" [drivers/hv/hv_vmbus.ko] undefined! I can now build 6.9-rc1 w/ CCA guest patches if I apply Suzuki's changes: 1) move set_memory_encrypted/decrypted from asm/mem_encrypt.h to asm/set_memory.h 2) export both symbols in mm/pageattr.c See diff below. Thanks, Emanuele diff --git a/arch/arm64/include/asm/mem_encrypt.h b/arch/arm64/include/asm/mem_encrypt.h index 7381f9585321..e47265cd180a 100644 --- a/arch/arm64/include/asm/mem_encrypt.h +++ b/arch/arm64/include/asm/mem_encrypt.h @@ -14,6 +14,4 @@ static inline bool force_dma_unencrypted(struct device *dev) return is_realm_world(); } -int set_memory_encrypted(unsigned long addr, int numpages); -int set_memory_decrypted(unsigned long addr, int numpages); #endif diff --git a/arch/arm64/include/asm/set_memory.h b/arch/arm64/include/asm/set_memory.h index 0f740b781187..9561b90fb43c 100644 --- a/arch/arm64/include/asm/set_memory.h +++ b/arch/arm64/include/asm/set_memory.h @@ -14,4 +14,6 @@ int set_direct_map_invalid_noflush(struct page *page); int set_direct_map_default_noflush(struct page *page); bool kernel_page_present(struct page *page); +int set_memory_encrypted(unsigned long addr, int numpages); +int set_memory_decrypted(unsigned long addr, int numpages); #endif /* _ASM_ARM64_SET_MEMORY_H */ diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c index 229b6d9990f5..de3843ce2aea 100644 --- a/arch/arm64/mm/pageattr.c +++ b/arch/arm64/mm/pageattr.c @@ -228,11 +228,13 @@ int set_memory_encrypted(unsigned long addr, int numpages) { return __set_memory_encrypted(addr, numpages, true); } +EXPORT_SYMBOL_GPL(set_memory_encrypted); int set_memory_decrypted(unsigned long addr, int numpages) { return __set_memory_encrypted(addr, numpages, false); } +EXPORT_SYMBOL_GPL(set_memory_decrypted); #ifdef CONFIG_DEBUG_PAGEALLOC void __kernel_map_pages(struct page *page, int numpages, int enable)