From patchwork Sat Sep 1 11:28:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 10584941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7762D5A4 for ; Sun, 2 Sep 2018 02:21:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6652C29FC7 for ; Sun, 2 Sep 2018 02:21:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59D8E29FCA; Sun, 2 Sep 2018 02:21:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DATE_IN_PAST_12_24, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F07CE29FC7 for ; Sun, 2 Sep 2018 02:21:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B52E6B5FD9; Sat, 1 Sep 2018 22:21:11 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 913466B5FDB; Sat, 1 Sep 2018 22:21:11 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78D906B5FDA; Sat, 1 Sep 2018 22:21:11 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by kanga.kvack.org (Postfix) with ESMTP id 193846B5FDB for ; Sat, 1 Sep 2018 22:21:11 -0400 (EDT) Received: by mail-pf1-f198.google.com with SMTP id t23-v6so9165353pfe.20 for ; Sat, 01 Sep 2018 19:21:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:message-id :user-agent:date:from:to:cc:cc:cc:cc:cc:cc:cc:cc:cc:subject :references:mime-version:content-disposition:lines; bh=U0AlHIzYWwWdibjBNKZjKcnKPmcDOWtACPflAPhiSpA=; b=ovUk06zrjACOEdUuHBZ+VBYZxuD3OHhqRZG2Rw/nWQowCFhi26pJKpUlO2pFT4cpxZ bKm4JYTE7KsApLq8jH7fNy9vVpxqTRzvwciDDED/lYw9bEwiRu1EKCgqw/pTpKEvZJNJ Jp9++ey/hNNSdHvHJXXFZdlypBjVBr23eEMRpsu3Lk2MMNEX54Clptd+J8AHL4fXwjS0 5kINkbm3tJbORorq6Qaac0W2tzSZ8wQmS8TWFy+YK25+Po9NFcKLrlS9PbB/D4YQ/h35 4uP4WBQQFcWxXyAbP1KTtCJDPt2RhjlR6QEkWIL830M6hk8jRKQAYp0CdZSYHz/UPGj5 Yccw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of fengguang.wu@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=fengguang.wu@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: APzg51CWSdDWR5yU7Nmi7AvBK9/tmTsbYoizZDQoVPkeNueZzoVJ2zZ6 hSJfUZNPzT5Iwz4ZySTVLCxQO/OSPGdHqUg+TZxmTBcraL3uO4qPz07tvv+L2nmijsk721k9K7M XTzDm1DjmMTv0g3DaN3CzwvzqEgG1jSIIoJXKNtd1G7GQ/27c7Cv+JyGvKIP90ei05Q== X-Received: by 2002:a63:550b:: with SMTP id j11-v6mr19660708pgb.167.1535854870818; Sat, 01 Sep 2018 19:21:10 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbv9AQqWqxBwsBTUPomJ/lDqKiSUTIdDOwjsxV2SuvJgFUUxXkZljNNuPiRI51E9DdD0yvj X-Received: by 2002:a63:550b:: with SMTP id j11-v6mr19660690pgb.167.1535854870245; Sat, 01 Sep 2018 19:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535854870; cv=none; d=google.com; s=arc-20160816; b=rKMxw2slFCMXeOJwz/M8vbrqLzoPHxbExULOReXdI/WxUDe98b2Ubs4YDCXIeZjKbp QnG0cf2op9YDoY+LF9YRRde2EUBlh9DsicwcP+Chek1Rv3gCDzBgNvqUn6VJjK4MQimW 7NfuLLhRZQcwVeAmeknDm0Zv5p1hkPaOuHNhgnwkaJzDQo1j7eW/yr2NIypTuMN0W4d6 WCKXqvH5Svj0LxyLxWdYBR5BAjZqGi1/pOK2irWchq1pS4U734/I6GZSbQNr+/tdQgVo DZJ+0SABSHYI81VxjKn4lpnS1rzstp9uQO5PWlzcb+451qUcFRylE9H6Jqd+SPfYQA9n splA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=lines:content-disposition:mime-version:references:subject:cc:cc:cc :cc:cc:cc:cc:cc:cc:to:from:date:user-agent:message-id :arc-authentication-results; bh=U0AlHIzYWwWdibjBNKZjKcnKPmcDOWtACPflAPhiSpA=; b=FtVqxqrSnIpDn/2hg86swMcGkZr7cogUbjuftmmJprON+QFAcfpyu9cGfzw0mr7HlI rclmVEaSB0jzyoiNb+wcrRrqufEHZXO+Yoex76yUfbFvO4oHh2+tb80QCN10QByf8Ul1 7oR64PRPb1bloLfnJkHzbz87QeQOBHvnYbKF0Puskcyp8RochH+lZhVLk98lFtBtjapU yEf0mAeYFxTVtl+uS6cb8KeylIInSr+Y0jPrybhSsEVG3eq2Z2H1l/ksPfTOpss1GRHe U0lj5iSd8q7XYEeHNcc5yxVtx80KfwULotsAg+2G9Cy+GY0TV9/N5WoL9m8jc9cVMF/Q RAyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of fengguang.wu@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=fengguang.wu@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga04.intel.com (mga04.intel.com. [192.55.52.120]) by mx.google.com with ESMTPS id d32-v6si13682201pla.93.2018.09.01.19.21.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Sep 2018 19:21:10 -0700 (PDT) Received-SPF: pass (google.com: domain of fengguang.wu@intel.com designates 192.55.52.120 as permitted sender) client-ip=192.55.52.120; Authentication-Results: mx.google.com; spf=pass (google.com: domain of fengguang.wu@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=fengguang.wu@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Sep 2018 19:21:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,318,1531810800"; d="scan'208";a="80211548" Received: from dbxu-mobl.ccr.corp.intel.com (HELO wfg-t570.sh.intel.com) ([10.254.212.218]) by orsmga003.jf.intel.com with ESMTP; 01 Sep 2018 19:20:58 -0700 Received: from wfg by wfg-t570.sh.intel.com with local (Exim 4.89) (envelope-from ) id 1fwI0X-0003Zq-7h; Sun, 02 Sep 2018 10:20:57 +0800 Message-Id: <20180901124811.703808090@intel.com> User-Agent: quilt/0.63-1 Date: Sat, 01 Sep 2018 19:28:23 +0800 From: Fengguang Wu To: Andrew Morton cc: Linux Memory Management List , Fengguang Wu cc: Peng DongX cc: Liu Jingqi cc: Dong Eddie CC: Dave Hansen cc: Huang Ying CC: Brendan Gregg cc: kvm@vger.kernel.org Cc: LKML Subject: [RFC][PATCH 5/5] [PATCH 5/5] kvm-ept-idle: enable module References: <20180901112818.126790961@intel.com> MIME-Version: 1.0 Content-Disposition: inline; filename=0005-kvm-ept-idle-enable-module.patch Lines: 47 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000303, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Fengguang Wu --- arch/x86/kvm/Kconfig | 11 +++++++++++ arch/x86/kvm/Makefile | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 1bbec387d289..4c6dec47fac6 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -96,6 +96,17 @@ config KVM_MMU_AUDIT This option adds a R/W kVM module parameter 'mmu_audit', which allows auditing of KVM MMU events at runtime. +config KVM_EPT_IDLE + tristate "KVM EPT idle page tracking" + depends on KVM_INTEL + depends on PROC_PAGE_MONITOR + ---help--- + Provides support for walking EPT to get the A bits on Intel + processors equipped with the VT extensions. + + To compile this as a module, choose M here: the module + will be called kvm-ept-idle. + # OK, it's a little counter-intuitive to do this, but it puts it neatly under # the virtualization menu. source drivers/vhost/Kconfig diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile index dc4f2fdf5e57..5cad0590205d 100644 --- a/arch/x86/kvm/Makefile +++ b/arch/x86/kvm/Makefile @@ -19,6 +19,10 @@ kvm-y += x86.o mmu.o emulate.o i8259.o irq.o lapic.o \ kvm-intel-y += vmx.o pmu_intel.o kvm-amd-y += svm.o pmu_amd.o +kvm-ept-idle-y += ept_idle.o + obj-$(CONFIG_KVM) += kvm.o obj-$(CONFIG_KVM_INTEL) += kvm-intel.o obj-$(CONFIG_KVM_AMD) += kvm-amd.o + +obj-$(CONFIG_KVM_EPT_IDLE) += kvm-ept-idle.o