Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp98837iof; Sun, 5 Jun 2022 22:19:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynkOVCWnaBt3GWNVWrsMWW09jDSlbiO8SkcaM/4vfx5+6aGb7urPFX3dGPjHm2K2/t3CS3 X-Received: by 2002:a63:6b82:0:b0:3fd:1865:a783 with SMTP id g124-20020a636b82000000b003fd1865a783mr14226148pgc.500.1654492764070; Sun, 05 Jun 2022 22:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654492764; cv=none; d=google.com; s=arc-20160816; b=wp/1EsUVGHMGHutuiPZtFblLc+mpEmHaKPxo0sHXPDgH+LQef2pETPxcgp7e0sBHIT GNfObp9o+z74FEBu1+smz09l1NgiP4ApBXIHmmBnqI+MGRCOU+vLiqDBMNtHnS1BOu8R Z1IxPY6jGOai7aoNJhko8U6DrEdNzjDkA4KVcRoZ1rUKhE8y/6lmEqFvwxN9fH0LGQ+U gFoYfKvGKR4tA0J3BC0J+K5iTNnCUErc84/r/Wyfaou+mDdgkzFl3mnik4ThcSzOeGDe JDF1ouHwa5ZAWQb5c9y3n6becPfT2SshQbFREalV0u/IF40Aio2cgIVq2EPJ5W0EcxBj aMIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OlGYpcHVQA/YlW9Cm4xx1uTyQMaz0Myd/TiCIy2nB3o=; b=fF4MXPFYIJ3kffiBxLTYdbXTcW4vwjQIftQrC9FfR3RilDijNrfLXWJLd2r6jziUXd RTqjczNvZa+wl058WLDu6QGjcNDxMMEOMX1sZ3j1QYhDdYHbo4sFLds2nlhmeFTukI4i fUipuRNhtXFlP58TMLWCkW+pLO3LCuABa1GaX561gDg7MmF8UYctZYRt6N96TORYonLA d76jAzk/NHky+Xa1eDbxBb57VNImLz+m1kzne5KLPUMC+idcBpxX8gKT4JhCoHTowUGE Fhgv++u/dBkAHjxsX7TRKUPhOPqdg/q7z/YJZg6Gc3nQRy4gFOQ6g3wkxKM7yyVhkyO7 du9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Zu/NphAd"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h2-20020a056a00170200b0051bceab9ecdsi14152420pfc.208.2022.06.05.22.19.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:19:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Zu/NphAd"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F27B818F2DB; Sun, 5 Jun 2022 21:24:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349688AbiFEGdg (ORCPT + 99 others); Sun, 5 Jun 2022 02:33:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349634AbiFEGdd (ORCPT ); Sun, 5 Jun 2022 02:33:33 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B443937BF6; Sat, 4 Jun 2022 23:33:31 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id s12so9887536plp.0; Sat, 04 Jun 2022 23:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OlGYpcHVQA/YlW9Cm4xx1uTyQMaz0Myd/TiCIy2nB3o=; b=Zu/NphAdZBNIcPKZDnWHx5b7dDhCuefgQIOMBrqvWI+2e7pvQNAsguZF7ApPtV2+dW B1EmZX7/ZoyDKyG+G5nQEHSJGsScNOGHnzJ0gduKci63yRKSdEyYS5oE2m79fznuxXMp J5mn9qvVAgsVq9fG3uSxZPwIjnIk1tIjrVWiajKs6hf4oWT4jOdJ6dcsNqwB6tp2iPA+ GbSEdnuec6TBrK+k+EQfzdZiopbltqzld49NqzpTX0UwVz+qASp7YwgsHHKTlvdoH78Z 62uxaD6a1kPxy9Fi+t+S7tYurElMTU1mtowAscHtHsxr5S+Ws+dOVHekVYtreNTL6tSR aRIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OlGYpcHVQA/YlW9Cm4xx1uTyQMaz0Myd/TiCIy2nB3o=; b=sZsX41+YZ6V5Lz2B+4Pnf259BJETb4V1vSkiFhHUTtefZwyC0OygBuCkAuoEnUEzh2 J+Nqm9WDva9larg756ynm5lytspr/LQrq37abMdKrtST2MXLvtgiQ0uDmdPuTc1YShQp RBOryQnEWzOzFEW9U1/gFJZtqaBqwez28MvjkJupKpRzl1iijdX8NbCQXPwqiU7UBP8s INxAv+xKuIYgTTRSuSpOWksg7uMNvvYz+Meq72fopq3hHqdcTgUBt7csbISwZwcBiA0M LAA8bWug18e6X7ifI+qkiYZIms7/De3qjTRwVf/0Zxh3c+BvQYUFddXXFNQ0D/5p/AGl EvOw== X-Gm-Message-State: AOAM533f9+Gir59oflAYOA1clGRW9o11m63td8ZSVc+X6mmNh+zungAp IWA9qqNy0/dwrMwd7WUnp/9LYtbDayA= X-Received: by 2002:a17:90a:c981:b0:1e6:75f0:d4ea with SMTP id w1-20020a17090ac98100b001e675f0d4eamr21018524pjt.37.1654410810897; Sat, 04 Jun 2022 23:33:30 -0700 (PDT) Received: from localhost ([198.11.178.15]) by smtp.gmail.com with ESMTPSA id u128-20020a626086000000b005184d1e838dsm8530423pfb.12.2022.06.04.23.33.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Jun 2022 23:33:30 -0700 (PDT) From: Lai Jiangshan To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Maxim Levitsky , Lai Jiangshan Subject: [PATCH 1/6] KVM: X86/MMU: Remove unused macros from paging_tmpl.h Date: Sun, 5 Jun 2022 14:34:12 +0800 Message-Id: <20220605063417.308311-2-jiangshanlai@gmail.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20220605063417.308311-1-jiangshanlai@gmail.com> References: <20220605063417.308311-1-jiangshanlai@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Lai Jiangshan Remove unused PT_BASE_ADDR_MASK, PT_LEVEL_BITS, and CMPXCHG. Signed-off-by: Lai Jiangshan --- arch/x86/kvm/mmu/paging_tmpl.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h index db80f7ccaa4e..2375bd5fd9f4 100644 --- a/arch/x86/kvm/mmu/paging_tmpl.h +++ b/arch/x86/kvm/mmu/paging_tmpl.h @@ -24,17 +24,14 @@ #define pt_element_t u64 #define guest_walker guest_walker64 #define FNAME(name) paging##64_##name - #define PT_BASE_ADDR_MASK GUEST_PT64_BASE_ADDR_MASK #define PT_LVL_ADDR_MASK(lvl) PT64_LVL_ADDR_MASK(lvl) #define PT_LVL_OFFSET_MASK(lvl) PT64_LVL_OFFSET_MASK(lvl) #define PT_INDEX(addr, level) PT64_INDEX(addr, level) - #define PT_LEVEL_BITS PT64_LEVEL_BITS #define PT_GUEST_DIRTY_SHIFT PT_DIRTY_SHIFT #define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT #define PT_HAVE_ACCESSED_DIRTY(mmu) true #ifdef CONFIG_X86_64 #define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL - #define CMPXCHG "cmpxchgq" #else #define PT_MAX_FULL_LEVELS 2 #endif @@ -42,30 +39,24 @@ #define pt_element_t u32 #define guest_walker guest_walker32 #define FNAME(name) paging##32_##name - #define PT_BASE_ADDR_MASK PT32_BASE_ADDR_MASK #define PT_LVL_ADDR_MASK(lvl) PT32_LVL_ADDR_MASK(lvl) #define PT_LVL_OFFSET_MASK(lvl) PT32_LVL_OFFSET_MASK(lvl) #define PT_INDEX(addr, level) PT32_INDEX(addr, level) - #define PT_LEVEL_BITS PT32_LEVEL_BITS #define PT_MAX_FULL_LEVELS 2 #define PT_GUEST_DIRTY_SHIFT PT_DIRTY_SHIFT #define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT #define PT_HAVE_ACCESSED_DIRTY(mmu) true - #define CMPXCHG "cmpxchgl" #elif PTTYPE == PTTYPE_EPT #define pt_element_t u64 #define guest_walker guest_walkerEPT #define FNAME(name) ept_##name - #define PT_BASE_ADDR_MASK GUEST_PT64_BASE_ADDR_MASK #define PT_LVL_ADDR_MASK(lvl) PT64_LVL_ADDR_MASK(lvl) #define PT_LVL_OFFSET_MASK(lvl) PT64_LVL_OFFSET_MASK(lvl) #define PT_INDEX(addr, level) PT64_INDEX(addr, level) - #define PT_LEVEL_BITS PT64_LEVEL_BITS #define PT_GUEST_DIRTY_SHIFT 9 #define PT_GUEST_ACCESSED_SHIFT 8 #define PT_HAVE_ACCESSED_DIRTY(mmu) (!(mmu)->cpu_role.base.ad_disabled) #ifdef CONFIG_X86_64 - #define CMPXCHG "cmpxchgq" #endif #define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL #else @@ -1076,15 +1067,12 @@ static int FNAME(sync_page)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp) #undef pt_element_t #undef guest_walker #undef FNAME -#undef PT_BASE_ADDR_MASK #undef PT_INDEX #undef PT_LVL_ADDR_MASK #undef PT_LVL_OFFSET_MASK -#undef PT_LEVEL_BITS #undef PT_MAX_FULL_LEVELS #undef gpte_to_gfn #undef gpte_to_gfn_lvl -#undef CMPXCHG #undef PT_GUEST_ACCESSED_MASK #undef PT_GUEST_DIRTY_MASK #undef PT_GUEST_DIRTY_SHIFT -- 2.19.1.6.gb485710b