From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5ED3C433B4 for ; Wed, 12 May 2021 03:20:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86B62610A1 for ; Wed, 12 May 2021 03:20:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230160AbhELDVZ (ORCPT ); Tue, 11 May 2021 23:21:25 -0400 Received: from ozlabs.org ([203.11.71.1]:51885 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230115AbhELDVZ (ORCPT ); Tue, 11 May 2021 23:21:25 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Fg0R41KWyz9sSs; Wed, 12 May 2021 13:20:16 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1620789616; bh=B7bwN8TGq/XZZxAawjw/TbSLhlFTW9dhi19LbHpXU+I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=JKjxrgHjtGz8SZ8PBhyqW7xbbXsyEQYnLz0GshsaBHyP0OESW3EzsnTzoZfzvT/NG quJ37NmTwLbKzIO0VDVtvSbky+i44eNlIq0Fmsk87gduhFreQjvUOAFk+/qSSKTiMM B4b6CcSx13IoZXyp8IwI/ZHRdaTt6i46S/qFF5oSNYAk9sVkWRCfNJ5shupPG2B7sR 3+bA4VB6uqgLzPJcgO7okXeOmoWwhMZE/kFRbXmTt5FT4kR/9JNDkai78WZ/pO0FMt 6LrSK0YL4SmA8CrMWLSCwWjRIWYk68YJK3NknUyTNfCThEeLg2KIr45e2Lfd0f5gYi wiLHK2jSmU1Mg== From: Michael Ellerman To: Sean Christopherson Cc: linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, pbonzini@redhat.com Subject: Re: [PATCH] KVM: PPC: Book3S HV: Fix kvm_unmap_gfn_range_hv() for Hash MMU In-Reply-To: References: <20210511105459.800788-1-mpe@ellerman.id.au> Date: Wed, 12 May 2021 13:20:15 +1000 Message-ID: <87lf8ky6xc.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Sean Christopherson writes: > On Tue, May 11, 2021, Michael Ellerman wrote: >> Commit 32b48bf8514c ("KVM: PPC: Book3S HV: Fix conversion to gfn-based >> MMU notifier callbacks") fixed kvm_unmap_gfn_range_hv() by adding a for >> loop over each gfn in the range. >> >> But for the Hash MMU it repeatedly calls kvm_unmap_rmapp() with the >> first gfn of the range, rather than iterating through the range. >> >> This exhibits as strange guest behaviour, sometimes crashing in firmare, >> or booting and then guest userspace crashing unexpectedly. >> >> Fix it by passing the iterator, gfn, to kvm_unmap_rmapp(). >> >> Fixes: 32b48bf8514c ("KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU notifier callbacks") >> Signed-off-by: Michael Ellerman >> --- >> arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> I plan to take this via the powerpc fixes branch. > > FWIW, > > Reviewed-by: Sean Christopherson Thanks. cheers From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D355C433B4 for ; Wed, 12 May 2021 03:20:53 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A4B4961352 for ; Wed, 12 May 2021 03:20:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4B4961352 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Fg0Rl12VVz30DB for ; Wed, 12 May 2021 13:20:51 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=JKjxrgHj; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ellerman.id.au (client-ip=2401:3900:2:1::2; helo=ozlabs.org; envelope-from=mpe@ellerman.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=JKjxrgHj; dkim-atps=neutral Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Fg0RC6nLjz2xZR for ; Wed, 12 May 2021 13:20:23 +1000 (AEST) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Fg0R41KWyz9sSs; Wed, 12 May 2021 13:20:16 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1620789616; bh=B7bwN8TGq/XZZxAawjw/TbSLhlFTW9dhi19LbHpXU+I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=JKjxrgHjtGz8SZ8PBhyqW7xbbXsyEQYnLz0GshsaBHyP0OESW3EzsnTzoZfzvT/NG quJ37NmTwLbKzIO0VDVtvSbky+i44eNlIq0Fmsk87gduhFreQjvUOAFk+/qSSKTiMM B4b6CcSx13IoZXyp8IwI/ZHRdaTt6i46S/qFF5oSNYAk9sVkWRCfNJ5shupPG2B7sR 3+bA4VB6uqgLzPJcgO7okXeOmoWwhMZE/kFRbXmTt5FT4kR/9JNDkai78WZ/pO0FMt 6LrSK0YL4SmA8CrMWLSCwWjRIWYk68YJK3NknUyTNfCThEeLg2KIr45e2Lfd0f5gYi wiLHK2jSmU1Mg== From: Michael Ellerman To: Sean Christopherson Subject: Re: [PATCH] KVM: PPC: Book3S HV: Fix kvm_unmap_gfn_range_hv() for Hash MMU In-Reply-To: References: <20210511105459.800788-1-mpe@ellerman.id.au> Date: Wed, 12 May 2021 13:20:15 +1000 Message-ID: <87lf8ky6xc.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm-ppc@vger.kernel.org, pbonzini@redhat.com, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, npiggin@gmail.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Sean Christopherson writes: > On Tue, May 11, 2021, Michael Ellerman wrote: >> Commit 32b48bf8514c ("KVM: PPC: Book3S HV: Fix conversion to gfn-based >> MMU notifier callbacks") fixed kvm_unmap_gfn_range_hv() by adding a for >> loop over each gfn in the range. >> >> But for the Hash MMU it repeatedly calls kvm_unmap_rmapp() with the >> first gfn of the range, rather than iterating through the range. >> >> This exhibits as strange guest behaviour, sometimes crashing in firmare, >> or booting and then guest userspace crashing unexpectedly. >> >> Fix it by passing the iterator, gfn, to kvm_unmap_rmapp(). >> >> Fixes: 32b48bf8514c ("KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU notifier callbacks") >> Signed-off-by: Michael Ellerman >> --- >> arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> I plan to take this via the powerpc fixes branch. > > FWIW, > > Reviewed-by: Sean Christopherson Thanks. cheers From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Ellerman Date: Wed, 12 May 2021 03:20:15 +0000 Subject: Re: [PATCH] KVM: PPC: Book3S HV: Fix kvm_unmap_gfn_range_hv() for Hash MMU Message-Id: <87lf8ky6xc.fsf@mpe.ellerman.id.au> List-Id: References: <20210511105459.800788-1-mpe@ellerman.id.au> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Sean Christopherson Cc: linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, pbonzini@redhat.com Sean Christopherson writes: > On Tue, May 11, 2021, Michael Ellerman wrote: >> Commit 32b48bf8514c ("KVM: PPC: Book3S HV: Fix conversion to gfn-based >> MMU notifier callbacks") fixed kvm_unmap_gfn_range_hv() by adding a for >> loop over each gfn in the range. >> >> But for the Hash MMU it repeatedly calls kvm_unmap_rmapp() with the >> first gfn of the range, rather than iterating through the range. >> >> This exhibits as strange guest behaviour, sometimes crashing in firmare, >> or booting and then guest userspace crashing unexpectedly. >> >> Fix it by passing the iterator, gfn, to kvm_unmap_rmapp(). >> >> Fixes: 32b48bf8514c ("KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU notifier callbacks") >> Signed-off-by: Michael Ellerman >> --- >> arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> I plan to take this via the powerpc fixes branch. > > FWIW, > > Reviewed-by: Sean Christopherson Thanks. cheers