From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junaid Shahid Subject: Re: [PATCH v3 7/8] kvm: x86: mmu: Lockless access tracking for Intel CPUs without EPT A bits. Date: Fri, 16 Dec 2016 16:01:02 -0800 Message-ID: <1518872.OXBznDnly6@js-desktop.mtv.corp.google.com> References: <93b5692a-0f76-a31d-46f3-b85d19298d92@linux.intel.com> <736ae8e7-271a-d4d0-5535-5899f64d2b93@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Cc: Xiao Guangrong , kvm@vger.kernel.org, andreslc@google.com, pfeiner@google.com To: Paolo Bonzini Return-path: Received: from mail-pg0-f50.google.com ([74.125.83.50]:33850 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756570AbcLQABE (ORCPT ); Fri, 16 Dec 2016 19:01:04 -0500 Received: by mail-pg0-f50.google.com with SMTP id a1so14305566pgf.1 for ; Fri, 16 Dec 2016 16:01:04 -0800 (PST) In-Reply-To: <736ae8e7-271a-d4d0-5535-5899f64d2b93@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Friday, December 16, 2016 04:23:21 PM Paolo Bonzini wrote: > Junaid, of all comments from Guangrong I'm mostly interested in > kvm_mmu_clear_all_pte_masks. What was the intended purpose? This was needed in the original version of this patch where the shadow_= acc_track_mask was set via the separate kvm_mmu_set_access_track_masks(= ) call rather than as part of kvm_mmu_set_mask_ptes(). In that case, wi= thout the clearing during init, we could end up with both shadow_acc_tr= ack_mask and shadow_accessed_mask being set if the kvm_intel module was= reloaded with different EPT parameters e.g. modprobe kvm_intel ept_ad=3D0=20 rmmod kvm_intel =20 modprobe kvm_intel ept_ad=3D1 =20 Now that we are setting both masks together through kvm_mmu_set_mask_pt= es(), this problem doesn=E2=80=99t exist and the kvm_mmu_clear_all_pte_= masks() isn=E2=80=99t strictly needed. However, I think it might still = be a good idea to keep it because the basic issue is that these masks a= re expected to be set by the kvm_(intel|amd) modules but they are actua= lly a part of the kvm module and hence they are initialized to 0 only o= n the (re)loading of the kvm module, but not of the kvm_(intel|amd) mod= ules. Thanks, Junaid