From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.w1.samsung.com ([210.118.77.11]:60492 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751745AbbLCHOQ convert rfc822-to-8bit (ORCPT ); Thu, 3 Dec 2015 02:14:16 -0500 From: Pavel Fedin To: 'Ard Biesheuvel' Cc: kvmarm@lists.cs.columbia.edu, 'KVM devel mailing list' , 'Marc Zyngier' , 'Christoffer Dall' , stable@vger.kernel.org References: <1448975032-7156-1-git-send-email-p.fedin@samsung.com> In-reply-to: Subject: RE: [PATCH] KVM: arm/arm64: Revert to old way of checking for device mapping in stage2_flush_ptes(). Date: Thu, 03 Dec 2015 10:14:12 +0300 Message-id: <007c01d12d9a$36dd6eb0$a4984c10$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 8BIT Content-language: ru Sender: stable-owner@vger.kernel.org List-ID: Hello! > > diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c > > index 7dace90..51ad98f 100644 > > --- a/arch/arm/kvm/mmu.c > > +++ b/arch/arm/kvm/mmu.c > > @@ -310,7 +310,8 @@ static void stage2_flush_ptes(struct kvm *kvm, pmd_t *pmd, > > > > pte = pte_offset_kernel(pmd, addr); > > do { > > - if (!pte_none(*pte) && !kvm_is_device_pfn(__phys_to_pfn(addr))) > > + if (!pte_none(*pte) && > > + (pte_val(*pte) & PAGE_S2_DEVICE) != PAGE_S2_DEVICE) > > I think your analysis is correct, but does that not apply to both instances? No no, another one is correct, since it operates on real PFN (at least looks like so). I have verified my fix against the original problem (crash on Exynos5410 without generic timer), and it still works fine there. > And instead of reverting, could we fix this properly instead? Of course, i'm not against alternate approaches, feel free to. I've just suggested what i could, to fix things quickly. I'm indeed no expert in KVM memory management yet. After all, this is what mailing lists are for. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia