From: Alexander Graf Date: Mon, 02 Nov 2009 09:26:30 +0000 Subject: Re: [PATCH 11/27] Add book3s_64 Host MMU handling Message-Id: <463AF0FC-6573-445F-89C5-F5C21D2332AB@suse.de> List-Id: References: <1256917647-6200-1-git-send-email-agraf@suse.de> <1256917647-6200-12-git-send-email-agraf@suse.de> <7786.1257118763@neuling.org> In-Reply-To: <7786.1257118763@neuling.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michael Neuling Cc: "kvm@vger.kernel.org" , Kevin Wolf , Arnd Bergmann , Hollis Blanchard , Marcelo Tosatti , kvm-ppc , "linuxppc-dev@ozlabs.org" , Avi Kivity , "bphilips@suse.de" , Olof Johansson Am 02.11.2009 um 00:39 schrieb Michael Neuling : > >> +static void invalidate_pte(struct hpte_cache *pte) >> +{ >> + dprintk_mmu("KVM: Flushing SPT %d: 0x%llx (0x%llx) -> 0x%llx\n", >> + i, pte->pte.eaddr, pte->pte.vpage, pte->host_va); >> + >> + ppc_md.hpte_invalidate(pte->slot, pte->host_va, >> + MMU_PAGE_4K, MMU_SEGSIZE_256M, >> + false); > > Are we assuming 256M segments here (and elsewhere)? Yes, on the host we only create 256MB segments. What the guest uses is a different question. > > >> +static int kvmppc_mmu_next_segment(struct kvm_vcpu *vcpu, ulong >> esid) >> +{ >> + int i; >> + int max_slb_size = 64; >> + int found_inval = -1; >> + int r; >> + >> + if (!get_paca()->kvm_slb_max) >> + get_paca()->kvm_slb_max = 1; >> + >> + /* Are we overwriting? */ >> + for (i = 1; i < get_paca()->kvm_slb_max; i++) { >> + if (!(get_paca()->kvm_slb[i].esid & SLB_ESID_V)) >> + found_inval = i; >> + else if ((get_paca()->kvm_slb[i].esid & ESID_MASK) = esid) >> + return i; >> + } >> + >> + /* Found a spare entry that was invalidated before */ >> + if (found_inval > 0) >> + return found_inval; >> + >> + /* No spare invalid entry, so create one */ >> + >> + if (mmu_slb_size < 64) >> + max_slb_size = mmu_slb_size; > > Can we just use the global mmu_slb_size eliminate max_slb_size? Hm, for a strange reason I wanted to have at most 64 slb entries. Maybe the struct can't hold more? I'll check again as soon as I'm on a notebook again. Alex > > > > Mikey > -- > To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html