From patchwork Thu May 11 09:58:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wanpeng Li X-Patchwork-Id: 9721145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BF0EF601E7 for ; Thu, 11 May 2017 09:59:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE32228665 for ; Thu, 11 May 2017 09:59:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B320A28667; Thu, 11 May 2017 09:59:27 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C77D28665 for ; Thu, 11 May 2017 09:59:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755298AbdEKJ7J (ORCPT ); Thu, 11 May 2017 05:59:09 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35587 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755029AbdEKJ7H (ORCPT ); Thu, 11 May 2017 05:59:07 -0400 Received: by mail-pf0-f193.google.com with SMTP id u26so2675802pfd.2; Thu, 11 May 2017 02:59:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CIs3nt8muuFe7RUHlS7PHOGpxNnID/Q40Vm7S2VcwC0=; b=Cg6W426z6a2QKRUdIDRJ9UAA6gY+qK6W6EBlfFpMXu65WTbq2PxM2IM7WiZDrjHRxv XtDMfz4Y4G5mIHxZozutlPC947Vb04lcH1rjzMcAWs4n4/0ml2zf3lhgitBMwU0YeA7s V6Z+gJWRAPJtifWemqUzJzw4rBFUFyx94LzVBST//Eum50cFnKuVFxsfJJ4It27OAGW2 RIb70e2FguFHUZe8UeS8TnJ0kMV3pTlJ9OXHM80tTYtPYoiMrklC+FWlRbR52AjqW70s nlDWkP0UHmGIu/isyTcI/5LDoiDq99Gj9MMiRhWqYTxTPFCkpe/xsHnFVzDEtl8/2YAn iWnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CIs3nt8muuFe7RUHlS7PHOGpxNnID/Q40Vm7S2VcwC0=; b=bfWkjlXjgovtuA4IP1QYKUvZaMZ+dP+mUX9NPOxTLdDdk0vjGvyzpXm8CePAtUP7xc V9fqV4Xbwcc4euaeoh9AbVkL1Pvz/lmgp+u/y6A96C7P2YgDFIuZ4lIZXTp/Q/9MrqFb c368C5vyBNQaqIpCV+nEYVRod1KDOJc0DuwB6G2OfB8TUCcyfQ37X2kR40//9/i0hkLK gwgh4M+nnRsnwwBCLfk1Nttfr1gD+n2WLpkec2NifTePKibgurhtp9NeSoFWQJyb/AQ6 fI0hT/w1XZJIaiWUTb8xAD3d7IJamgnSq9uJf4/RUjiYb9lCusk4rKTieeXKke+H3lJ7 /4Sw== X-Gm-Message-State: AODbwcBYAK8oT6O7tJd9atdHDpq5wFdf89IowY9FDpcN1ZPDG2ve00jC 7/38w8gDeFQePQ== X-Received: by 10.98.130.201 with SMTP id w192mr11683799pfd.34.1494496746339; Thu, 11 May 2017 02:59:06 -0700 (PDT) Received: from localhost ([203.205.141.123]) by smtp.gmail.com with ESMTPSA id e16sm2976129pfk.100.2017.05.11.02.59.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 02:59:05 -0700 (PDT) From: Wanpeng Li X-Google-Original-From: Wanpeng Li To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Wanpeng Li Subject: [PATCH v2 2/2] KVM: VMX: Don't enable EPT A/D feature if EPT feature is disabled Date: Thu, 11 May 2017 02:58:56 -0700 Message-Id: <1494496736-9178-2-git-send-email-wanpeng.li@hotmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494496736-9178-1-git-send-email-wanpeng.li@hotmail.com> References: <1494496736-9178-1-git-send-email-wanpeng.li@hotmail.com> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wanpeng Li We can observe eptad kvm_intel module parameter is still Y even if ept is disabled which is weird. This patch will not enable EPT A/D feature if EPT feature is disabled. Cc: Paolo Bonzini Cc: Radim Krčmář Signed-off-by: Wanpeng Li --- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index c6f4ad4..04c16ea 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -6504,7 +6504,7 @@ static __init int hardware_setup(void) enable_ept_ad_bits = 0; } - if (!cpu_has_vmx_ept_ad_bits()) + if (!cpu_has_vmx_ept_ad_bits() || !enable_ept) enable_ept_ad_bits = 0; if (!cpu_has_vmx_unrestricted_guest())