Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp4027545pxm; Tue, 1 Mar 2022 09:46:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLUsL1ZYxsV02oWntk6DaA/10OfC4Lb/YRw8cb710Ji9+vdek4KlZQ/9/UNqD1DKfbNsm4 X-Received: by 2002:a05:6402:34c1:b0:412:d12c:e713 with SMTP id w1-20020a05640234c100b00412d12ce713mr25283413edc.312.1646156764937; Tue, 01 Mar 2022 09:46:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646156764; cv=none; d=google.com; s=arc-20160816; b=wb7ljt0QVUuwWGkGaYPLf+4V2pgMNF7qO64GqkbORfJp82uQhVWkOkXrSzSrlgLYGt lYtqI6MEaOsRJAbejJ+Q8ytS381SqSyULiXZsUOMxCNrbwCrNvCo5cqUz8rDJj0VkV0l Zn6NIX50OHWEqDi32J9s4EiToBHE2kWIs/LpEKXUj6qmVCzhxs2IQ3EXmsGH0k/4u9d6 6UfBkL2rwHTmSSkd5cekky6HtX47fh/q1DeVeOmnCZK+blsOQFO13XXk5G028ufqRlgY kCUw0LD/oOqAL42bWInU8oIf44S5qEFy3QWqfzOgfelGVMNXe31EKPpZ76ShCcZxb7MA HWow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=04zKmsGn4psUjRv1dS7gu5PasTnRzH4PNqqLkeEeb5s=; b=GtOzdKCe2Wmscff6jKDj3xDrshKaeLR25e+aJPL8PO4EfvdPWboDPE7//SuS9cQFrv n8/3jMSFmm0BRGp1EmokdWXnaUfBZrbGimSDZ43Ldlp8ymKsB+/HaOKOFHhku6PVpopQ QA70I1B+FPeRWaU6JOugwccvzmPCLD0ncAj/cMuMV2+UGiO0SikCVyDJF65dsrmvidaa WzP2HtchBlKw7WYUw1oLZHDNMNu564JEKpjUDF3TxnHbQGWibcpqhitTIFMNfHvZQvby Of+EDGIOZCOgjlM29SoSFhV8v+zUMmya8oyJwdF6j5tCNbHAfEh2kaKUqXHraNe0J6FM q9JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VILTBHfH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p19-20020a170906b21300b006d6dfbfeab6si2467951ejz.357.2022.03.01.09.45.40; Tue, 01 Mar 2022 09:46:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VILTBHfH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235589AbiCAPNP (ORCPT + 99 others); Tue, 1 Mar 2022 10:13:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232130AbiCAPNN (ORCPT ); Tue, 1 Mar 2022 10:13:13 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1625AA66EC; Tue, 1 Mar 2022 07:12:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A5B9061635; Tue, 1 Mar 2022 15:12:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39B47C340EE; Tue, 1 Mar 2022 15:12:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646147551; bh=nhjoO2U16ehs9nVncYaKUrXUw/1VXcwyAGAuJhstjd0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VILTBHfHCFmcMOBwjJrG0uAZPIXDz1NSseZXGwyBJSppITz8cgwiso19pp6rZYSnw XSbXGsRRwRDluwzgoqyVq6SY2YISDFqPKupEDIcTE5bBFhfYVTNMXl/tTP3iYvWbCW /iPZUdsqx2pGrUeR73Io0FiGhyLw5hACQt7a0WUS8eMi8hL+3G+nffAd0S1q73P4Qd 8GSnHyKpS75DYTb+hSQbwANc+/VhNeWdpHfIBpEycve6VwVoc3dP6y/9l/t2Jkwdtu nvgC1czza6ZhCoZLvWka/ER4dPNVqz5m7pO9VEShZAqqyAdXRUREUzqrp2HUdG8D55 Ym6poS0GlpPtQ== Date: Tue, 1 Mar 2022 16:13:13 +0100 From: Jarkko Sakkinen To: Reinette Chatre Cc: dave.hansen@linux.intel.com, tglx@linutronix.de, bp@alien8.de, luto@kernel.org, mingo@redhat.com, linux-sgx@vger.kernel.org, x86@kernel.org, seanjc@google.com, kai.huang@intel.com, cathy.zhang@intel.com, cedric.xing@intel.com, haitao.huang@intel.com, mark.shanahan@intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 13/25] x86/sgx: Support adding of pages to initialized enclave Message-ID: References: <9ab661a845d242cb10a90ade997f8ebda33cc7c9.1638381245.git.reinette.chatre@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9ab661a845d242cb10a90ade997f8ebda33cc7c9.1638381245.git.reinette.chatre@intel.com> X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 01, 2021 at 11:23:11AM -0800, Reinette Chatre wrote: > diff --git a/arch/x86/kernel/cpu/sgx/encl.h b/arch/x86/kernel/cpu/sgx/encl.h > index 848a28d28d3d..1b6ce1da7c92 100644 > --- a/arch/x86/kernel/cpu/sgx/encl.h > +++ b/arch/x86/kernel/cpu/sgx/encl.h > @@ -123,4 +123,6 @@ void sgx_encl_free_epc_page(struct sgx_epc_page *page); > struct sgx_encl_page *sgx_encl_load_page(struct sgx_encl *encl, > unsigned long addr); > > +struct sgx_va_page *sgx_encl_grow(struct sgx_encl *encl); > +void sgx_encl_shrink(struct sgx_encl *encl, struct sgx_va_page *va_page); > #endif /* _X86_ENCL_H */ > diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c > index 5dddb3c9f742..de0bf68ee842 100644 > --- a/arch/x86/kernel/cpu/sgx/ioctl.c > +++ b/arch/x86/kernel/cpu/sgx/ioctl.c > @@ -17,7 +17,7 @@ > #include "encl.h" > #include "encls.h" > > -static struct sgx_va_page *sgx_encl_grow(struct sgx_encl *encl) > +struct sgx_va_page *sgx_encl_grow(struct sgx_encl *encl) > { > struct sgx_va_page *va_page = NULL; > void *err; > @@ -43,7 +43,7 @@ static struct sgx_va_page *sgx_encl_grow(struct sgx_encl *encl) > return va_page; > } > > -static void sgx_encl_shrink(struct sgx_encl *encl, struct sgx_va_page *va_page) > +void sgx_encl_shrink(struct sgx_encl *encl, struct sgx_va_page *va_page) > { > encl->page_cnt--; Nit: this should be a separate patch, e.g. x86/sgx: Export sgx_encl_{grow,shrink}() In order to use sgx_encl_{grow,shrink}() in the page augementation code located in encl.c, export these functions. BR, Jarkko