From: Greg Kurz Date: Fri, 22 Dec 2017 12:18:59 +0000 Subject: Re: [PATCH] KVM: PPC: Book3S: fix XIVE migration of pending interrupts Message-Id: <20171222131859.5dff1697@bahia.lan> List-Id: References: <20171212120204.6799-1-clg@kaod.org> <4be897d4-2d54-305b-8416-b32384de73a9@redhat.com> <878tdvpeib.fsf@concordia.ellerman.id.au> <20171222075430.GB6945@fergus.ozlabs.ibm.com> <87wp1fnh27.fsf@concordia.ellerman.id.au> <20171222125847.1e5a4f5f@bahia.lan> In-Reply-To: <20171222125847.1e5a4f5f@bahia.lan> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michael Ellerman Cc: Paul Mackerras , Laurent Vivier , =?UTF-8?B?Q8OpZHJpYw==?= Le Goater , kvm-ppc@vger.kernel.org, Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org On Fri, 22 Dec 2017 12:58:47 +0100 Greg Kurz wrote: > On Fri, 22 Dec 2017 22:22:08 +1100 > Michael Ellerman wrote: > > > Paul Mackerras writes: [...] > > > > > > Thanks for doing that. > > > > > > If you felt like merging Alexey's patch "KVM: PPC: Book3S PR: Fix WIMG > > > handling under pHyp" with my acked-by, that would be fine too. The > > > commit message needs a little work - the reason for using HPTE_R_M is > > > not just because it seems to work, but because current POWER > > > processors require M set on mappings for normal pages, and pHyp > > > enforces that. > > > > OK. I saw this too late, but I'll pick that one up next week. If someone > > sends me an updated change log I will merge all of their patches for > > ever. > > > > Really ? Opportunity makes the thief, so here's my take :P > > 8<---------------------------------------------------------------------->8 > KVM: PPC: Book3S: fix XIVE migration of pending interrupts Oops! Paste error... Title should be: KVM: PPC: Book3S PR: Fix WIMG handling under pHyp > > 96df226 "KVM: PPC: Book3S PR: Preserve storage control bits" added WIMG > bits preserving but it missed 2 special cases: > - a magic page in kvmppc_mmu_book3s_64_xlate() and > - guest real mode in kvmppc_handle_pagefault(). > > For these ptes WIMG were 0 and pHyp failed on these causing a guest to > stop in the very beginning at NIP=0x100 (due to bd9166ffe > "KVM: PPC: Book3S PR: Exit KVM on failed mapping"). > > According to LoPAPR v1.1 14.5.4.1.2 H_ENTER: > > The hypervisor checks that the WIMG bits within the PTE are appropriate > for the physical page number else H_Parameter return. (For System Memory > pages WIMG10, or, 1110 if the SAO option is enabled, and for IO pages > WIMG**.) > > This hence initializes WIMG to non-zero value HPTE_R_M (0x10), as expected > by pHyp. > > Fixes: 96df226 "KVM: PPC: Book3S PR: Preserve storage control bits" > Signed-off-by: Alexey Kardashevskiy > 8<---------------------------------------------------------------------->8 > > Cheers, > > -- > Greg > > > cheers > > -- > > 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 >