From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933357AbdCaQ1D (ORCPT ); Fri, 31 Mar 2017 12:27:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36858 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933106AbdCaQ1C (ORCPT ); Fri, 31 Mar 2017 12:27:02 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E73362E605A Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E73362E605A Subject: Re: [PATCH 4/6] kvm: nVMX: support EPT accessed/dirty bits To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= References: <1490867732-16743-1-git-send-email-pbonzini@redhat.com> <1490867732-16743-5-git-send-email-pbonzini@redhat.com> <20170331162431.GF6019@potion> Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, david@redhat.com From: Paolo Bonzini Message-ID: Date: Fri, 31 Mar 2017 18:26:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170331162431.GF6019@potion> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 31 Mar 2017 16:27:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31/03/2017 18:24, Radim Krčmář wrote: >> + if (is_guest_mode(vcpu) >> + && !(exit_qualification & EPT_VIOLATION_GVA_TRANSLATED)) { >> + /* >> + * Fix up exit_qualification according to whether guest >> + * page table accesses are reads or writes. >> + */ >> + u64 eptp = nested_ept_get_cr3(vcpu); >> + exit_qualification &= ~EPT_VIOLATION_ACC_WRITE; >> + if (eptp & VMX_EPT_AD_ENABLE_BIT) >> + exit_qualification |= EPT_VIOLATION_ACC_WRITE; > I think this would be better without unconditional clearing > > if (!(eptp & VMX_EPT_AD_ENABLE_BIT)) > exit_qualification &= ~EPT_VIOLATION_ACC_WRITE; Yeah, this is a remnant of my (failed) attempt at emulating A/D bits when the processor doesn't support it. Which worked, only it's not compliant enough to include it in the final series. As for the two nits you found, shall I repost or are you okay with fixing it yourself? Paolo