Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1306378lqd; Thu, 25 Apr 2024 11:18:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXRnVZj2ZEwGC4WW8B9N4xulaabJCC39Vc/xKjQplbYC7yUdUWasZ2ue6nq5mgtOzRUksEJS3JOI0jfrVgL8997KOgBMwSPnRILaHcr2A== X-Google-Smtp-Source: AGHT+IHNtbBL849MfKopZ49clu+37+VkwqgjtG3FFi0SBD5ZeEF2rcm5ZFxtu7AR5DLX+4KzQSer X-Received: by 2002:a05:6a00:1907:b0:6f3:876a:c029 with SMTP id y7-20020a056a00190700b006f3876ac029mr765742pfi.10.1714069125884; Thu, 25 Apr 2024 11:18:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714069125; cv=pass; d=google.com; s=arc-20160816; b=L88tIVSmLf/oac5H+uFls/cRA4Nhv9814RorYHSuMJtS7hLYGVBMkNUuGeo9rhJCHf y+qyD6k4N6uYDJ1JgII5kUH0h8PlH/OF1fjp6TolL/GJW9vC3HRICRBNXN7NmJUgpuWZ yckE73dSncCxwMUi4kB+LnH7q9XyJ+1Bso/U6V1hNd7ZlPzcUgPx4dHcWq2umLH9Czcx 9Bk6PsPBkPpw8s3tHLRDUKac1wfxnm1LWciS33f2YJfTQ9o6TaYUGH+dso438yzDf1Rc +6gbOqyECBFfQaplkybsqaE9sYY0XdJwXf0V09oPDcMdfT6qGKgDjlLrQpqZJv7actux szmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=xsQmB/ujrLz5bVmiqNIM4xqekUXoYgiO5185Qrw1mQI=; fh=eYnsx0Z+WlTyELSzFzbD+r+VsYulrBAJl2jmOkw3hvo=; b=00Qn/HQUcIxG+5tdLmSZEdASkW5aLA7LgFdgUHILphTocVGVshjGI2zhpMXtUgtkOq E85JSwf5gxqru3Bab5WdGcoV9kXUQRF0K7S2Q3mtulRrQHnfZtXsPg5rPhPtt3erbpEU e4okfFWqKByj/XC77wpyxic3VsRrWYL/6cOS59rVdq4SjHy9INAvyrg05668edSjF7YJ jBvrXyZY7xU/Vlz3mIvU7wru1aof2yEbqnewW+Xgp8eMBfxNnJ5/FYmuutnOKVLihm1j 3hVjl1bGK4vYTcjyfAwLZs/pl4G6tntFeooBl4lJ7BaGK/AzO14XvP1VGoTI3USWRwWV nepQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-159011-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159011-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i20-20020a63d454000000b005ff7d19d2b9si7635949pgj.714.2024.04.25.11.18.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 11:18:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159011-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-159011-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159011-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 831D9283E1A for ; Thu, 25 Apr 2024 18:18:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43AED15252C; Thu, 25 Apr 2024 18:16:41 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EF821482EF; 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=1714069000; cv=none; b=AIHf9bS3JtJS5/BRUbAD3Ktoz/gcZvKxsEKJSYv5dMFD2LgeUJuvn+YVrie2XvdKjWp2IRx2/tMtgYhsOFgnrJ8LaIYfkdRI7a3nk+zT2qAiKvm9VJY+6lwqvNkrdAr97SGpNsypzMVT2UYjxzjpaDEicER1DT0+eq+hcsb4hlg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714069000; c=relaxed/simple; bh=osvQDcfth2oHBETtvgsqxTXc9soDQsyNFetTLK7ImU8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XiVus0btIHkrkT33QLOFkrA/yGpSnFIz3GEHQ08BbmPzIlz2xH1Zs6XmWgJAmrHrlFxoI4VRp9FXH41vRZLlX5cub+8jtW8QlcKvDP5gFaDOhwX5TVFkNWa83vSERMdzTqKuYL/Zq1u73RdswmDUU/k6mPffYKKQmSm5CCBGkL0= 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-kernel@vger.kernel.org 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)