Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3533728ybz; Mon, 27 Apr 2020 17:58:22 -0700 (PDT) X-Google-Smtp-Source: APiQypKzrXavKX1qVMWdVi9WbUelscl8NsCbKgV+VVVNTt/dcDv5+byLFRdXMI3XjtESAglT2BNd X-Received: by 2002:aa7:c312:: with SMTP id l18mr21747307edq.161.1588035502226; Mon, 27 Apr 2020 17:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588035502; cv=none; d=google.com; s=arc-20160816; b=BDal0vZg8kzFXXfu8j3HcffUgCw7DkwoS8+gWedmmj8gz5bLUWBbwbFi0TBZD0i/YR PIGLcTusqurUK1XWc1rwp6H7mS24Zl3M3W75FhCuYZZzOVA1xdhTMrnhI5nXj+gsfLVa ZBvwZ4nk9LHsTYJ07FmhunR2yFpGnA74EQOFuwoA5Sau+euQf7ZVfFVedASoTyWdFdQ7 N5bqMlaFdkdH5HKi6Or2QAB4RgQzzXvPdslBtSoSb2ORqR/eJCTX45sxXvUnkV0Gj+yg hnc0W4dBP2UhCpG1qi4xS/0SqGWwpGrocv3N9J2AzG5DM7E2se+g4pqCpczAZh7yC0yH keWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=3b2elzWYsDk4enUBhbMT7mQ08oMzesj15Gdisxi0Ddo=; b=NLHMtY9ZjpTNwQUDvMWYLoiICCxzhKpLBtCn4bbShGaRb2ZBVridvMHRRWbglwAFPW mI3l7eE36hPKm9YkRv7S8imbWWimM3WYlQyeG1gNdkGqzgYziBuvaa/s9lWZMSSt+e8J BLFxTr+E2yHYvrQYg22fSVRtapWM+V6x5FhTgMs4cGJmPyxeDGnDwtrX1IhB6kNXOAEO /wmiSWZbM+THkR88Ai7FFkAHrBvieMV6hfiJr3dHlXiFJcXBswK67k/hI5jpffQww/vg aHRRQglJH+uODFAvSzY+NEOIqyiQZ05dr0h9B+D8QtQGQycX5leNmsoeTSqvUjVm8n8Q /TUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s4si783368ejx.332.2020.04.27.17.57.57; Mon, 27 Apr 2020 17:58:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726338AbgD1AyX (ORCPT + 99 others); Mon, 27 Apr 2020 20:54:23 -0400 Received: from mga05.intel.com ([192.55.52.43]:42479 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726263AbgD1AyX (ORCPT ); Mon, 27 Apr 2020 20:54:23 -0400 IronPort-SDR: gsMD55yMjEWbZ8fYZbBny4aLLBGzT+ECLwt+Q4tuuWvovupcIPNPYHUr98ZLlq6lBxgS+66gs5 PdYXVFRWiZEQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2020 17:54:23 -0700 IronPort-SDR: JQc3L9gG3VS4FzygtcdMVJkwfH3re0P7lqJ0dd+sbvkg+lU+h6U12rlxgp/ISB1DbRQuLCenlT w1W8bT4J7AFA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,325,1583222400"; d="scan'208";a="260920803" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.202]) by orsmga006.jf.intel.com with ESMTP; 27 Apr 2020 17:54:23 -0700 From: Sean Christopherson To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Barret Rhoden Subject: [PATCH 0/3] KVM: x86/mmu: Use kernel's PG_LEVEL_* enums Date: Mon, 27 Apr 2020 17:54:19 -0700 Message-Id: <20200428005422.4235-1-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop KVM's PT_{PAGE_TABLE,DIRECTORY,PDPE}_LEVEL KVM enums in favor of the kernel's PG_LEVEL_{4K,2M,1G} enums, which have far more user friendly names. The KVM names were presumably intended to abstract away the page size. In practice, the abstraction is only useful for a single line of code, a PSE paging related large page check. For everything else, the abstract names do nothing but obfuscate the code. Boot tested a PSE kernel under 32-bit KVM and 64-bit KVM, with and without EPT enabled. Patches 2 and 3 generate no binary difference relative to patch 1 when compared via "objdump -d". Sean Christopherson (3): KVM: x86/mmu: Tweak PSE hugepage handling to avoid 2M vs 4M conundrum KVM: x86/mmu: Move max hugepage level to a separate #define KVM: x86/mmu: Drop KVM's hugepage enums in favor of the kernel's enums arch/x86/include/asm/kvm_host.h | 13 +--- arch/x86/kvm/mmu/mmu.c | 118 +++++++++++++++----------------- arch/x86/kvm/mmu/page_track.c | 4 +- arch/x86/kvm/mmu/paging_tmpl.h | 18 ++--- arch/x86/kvm/mmu_audit.c | 6 +- arch/x86/kvm/svm/svm.c | 2 +- arch/x86/kvm/vmx/vmx.c | 6 +- arch/x86/kvm/x86.c | 4 +- 8 files changed, 79 insertions(+), 92 deletions(-) -- 2.26.0