From patchwork Thu Dec 5 15:41:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 11275013 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BED4F138C for ; Thu, 5 Dec 2019 15:42:23 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A4F89206DB for ; Thu, 5 Dec 2019 15:42:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4F89206DB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ictFk-00009Y-Rn; Thu, 05 Dec 2019 15:41:16 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ictFj-00009T-Bz for xen-devel@lists.xenproject.org; Thu, 05 Dec 2019 15:41:15 +0000 X-Inumbo-ID: aab0e21e-1775-11ea-822e-12813bfff9fa Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id aab0e21e-1775-11ea-822e-12813bfff9fa; Thu, 05 Dec 2019 15:41:14 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B0292B11E; Thu, 5 Dec 2019 15:41:13 +0000 (UTC) To: "xen-devel@lists.xenproject.org" From: Jan Beulich Message-ID: Date: Thu, 5 Dec 2019 16:41:28 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 Content-Language: en-US Subject: [Xen-devel] [PATCH] x86/nEPT: ditch nept_sp_entry() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: George Dunlap , Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" It's bogusly non-static. It making the call sites actually less easy to read, and there being another open-coded use in the file - let's just get rid of it. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper Acked-by: George Dunlap --- a/xen/arch/x86/mm/hap/nested_ept.c +++ b/xen/arch/x86/mm/hap/nested_ept.c @@ -54,11 +54,6 @@ #define NEPT_2M_ENTRY_FLAG (1 << 10) #define NEPT_4K_ENTRY_FLAG (1 << 9) -bool_t nept_sp_entry(ept_entry_t e) -{ - return !!(e.sp); -} - static bool_t nept_rsv_bits_check(ept_entry_t e, uint32_t level) { uint64_t rsv_bits = EPT_MUST_RSV_BITS; @@ -68,7 +63,7 @@ static bool_t nept_rsv_bits_check(ept_en case 1: break; case 2 ... 3: - if ( nept_sp_entry(e) ) + if ( e.sp ) rsv_bits |= ((1ull << (9 * (level - 1))) - 1) << PAGE_SHIFT; else rsv_bits |= EPTE_EMT_MASK | EPTE_IGMT_MASK; @@ -181,7 +176,7 @@ nept_walk_tables(struct vcpu *v, unsigne if ( nept_misconfiguration_check(gw->lxe[lvl], lvl) ) goto misconfig_err; - if ( (lvl == 2 || lvl == 3) && nept_sp_entry(gw->lxe[lvl]) ) + if ( (lvl == 2 || lvl == 3) && gw->lxe[lvl].sp ) { /* Generate a fake l1 table entry so callers don't all * have to understand superpages. */