From: Sean Christopherson Date: Mon, 21 Oct 2024 11:08:49 -0700 Subject: [PATCH v13 19/85] KVM: Introduce kvm_follow_pfn() to eventually replace "gfn_to_pfn" APIs In-Reply-To: References: <20241010182427.1434605-1-seanjc@google.com> <20241010182427.1434605-20-seanjc@google.com> Message-ID: List-Id: To: kvm-riscv@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Mon, Oct 21, 2024, Yan Zhao wrote: > On Thu, Oct 10, 2024 at 11:23:21AM -0700, Sean Christopherson wrote: > > --- a/virt/kvm/pfncache.c > > +++ b/virt/kvm/pfncache.c > > @@ -159,6 +159,12 @@ static kvm_pfn_t hva_to_pfn_retry(struct gfn_to_pfn_cache *gpc) > > kvm_pfn_t new_pfn = KVM_PFN_ERR_FAULT; > > void *new_khva = NULL; > > unsigned long mmu_seq; > > + struct kvm_follow_pfn kfp = { > > + .slot = gpc->memslot, > > + .gfn = gpa_to_gfn(gpc->gpa), > > + .flags = FOLL_WRITE, > > + .hva = gpc->uhva, > > + }; > Is .map_writable uninitialized? Nope, per C99, "subobjects without explicit initializers are initialized to zero", i.e. map_writable is initialized to "false".