From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CBCAC433E0 for ; Mon, 11 Jan 2021 22:39:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C03322B37 for ; Mon, 11 Jan 2021 22:39:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729941AbhAKWjZ (ORCPT ); Mon, 11 Jan 2021 17:39:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:57356 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727019AbhAKWjZ (ORCPT ); Mon, 11 Jan 2021 17:39:25 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B207B22288; Mon, 11 Jan 2021 22:38:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610404725; bh=0lwuzx6//6aWaeU/bHiIYY0N6Mk6I3xVSjTVmPofC00=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=o0LWWgA6IhXv79v5uKIpX/wKBsn2OHYLJzfD5gPUs+ODAG42mImSMrSddnlAVoLWY B3oNcimJbSOIvz6IiHSdaseGT2MV9FLBuaCJ+4+IMocOsQRtQPsWdVUOqBVd2H9/da J+lrAT46QqKdhFg2pNVse9izRaTT3dTw5l78/TkCcEzXaY8MuUjJCt6iflKFWMYBg5 0gZj0NvNMlAJu6lUzvo4nyP09X8Ko/7V2eqwojAn2HQ8J8RY7g7VZPcH8UhZt0wwet Aiaz4t+K/euP0+7lqgdM8POWK/LFBU6d6oupfUTnzdaVaRefgDUGG7icoMEh1mBnqx aaelhsSsgu0EA== Message-ID: <31681b840aac59a8d8dcb05f2356d25cf09e1f11.camel@kernel.org> Subject: Re: [RFC PATCH 01/23] x86/sgx: Split out adding EPC page to free list to separate helper From: Jarkko Sakkinen To: Kai Huang , linux-sgx@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org Cc: seanjc@google.com, luto@kernel.org, dave.hansen@intel.com, haitao.huang@intel.com, pbonzini@redhat.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com Date: Tue, 12 Jan 2021 00:38:40 +0200 In-Reply-To: <3d50c2614ff8a46b44062a398fd8644bcda92132.1609890536.git.kai.huang@intel.com> References: <3d50c2614ff8a46b44062a398fd8644bcda92132.1609890536.git.kai.huang@intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3 (by Flathub.org) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-sgx@vger.kernel.org On Wed, 2021-01-06 at 14:55 +1300, Kai Huang wrote: > From: Sean Christopherson > > SGX virtualization requires to allocate "raw" EPC and use it as virtual > EPC for SGX guest.  Unlike EPC used by SGX driver, virtual EPC doesn't > track how EPC pages are used in VM, e.g. (de)construction of enclaves, > so it cannot guarantee EREMOVE success, e.g. it doesn't have a priori > knowledge of which pages are SECS with non-zero child counts. > > Split sgx_free_page() into two parts so that the "add to free list" > part can be used by virtual EPC without having to modify the EREMOVE > logic in sgx_free_page(). > > Signed-off-by: Sean Christopherson > Signed-off-by: Kai Huang I have a better idea with the same outcome for KVM. https://lore.kernel.org/linux-sgx/20210111223610.62261-1-jarkko@kernel.org/T/#t /Jarkko