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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, 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 8B3E8C433F5 for ; Sat, 4 Sep 2021 01:03:42 +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 0623160698 for ; Sat, 4 Sep 2021 01:03:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0623160698 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=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4H1byN59Pxz3cCG for ; Sat, 4 Sep 2021 11:03:40 +1000 (AEST) 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=michael@ellerman.id.au; receiver=) 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)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4H1bx42nkRz2xvP for ; Sat, 4 Sep 2021 11:02:32 +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 4H1bwx2hyGz9sCD; Sat, 4 Sep 2021 11:02:25 +1000 (AEST) From: Michael Ellerman To: linuxppc-dev@lists.ozlabs.org, Alexey Kardashevskiy In-Reply-To: <20210827040706.517652-1-aik@ozlabs.ru> References: <20210827040706.517652-1-aik@ozlabs.ru> Subject: Re: [PATCH kernel] KVM: PPC: Fix clearing never mapped TCEs in realmode Message-Id: <163071729187.1779947.11008244687916528145.b4-ty@ellerman.id.au> Date: Sat, 04 Sep 2021 11:01:31 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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: Leonardo Bras , kvm-ppc@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, 27 Aug 2021 14:07:06 +1000, Alexey Kardashevskiy wrote: > Since e1a1ef84cd07, pages for TCE tables for KVM guests are allocated > only when needed. This allows skipping any update when clearing TCEs. > This works mostly fine as TCE updates are handled when MMU is enabled. > The realmode handlers fail with H_TOO_HARD when pages are not yet > allocated except when clearing a TCE in which case KVM prints a warning > but proceeds to dereference a NULL pointer which crashes the host OS. > > [...] Applied to powerpc/next. [1/1] KVM: PPC: Fix clearing never mapped TCEs in realmode https://git.kernel.org/powerpc/c/1d78dfde33a02da1d816279c2e3452978b7abd39 cheers From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Ellerman Date: Sat, 04 Sep 2021 01:01:31 +0000 Subject: Re: [PATCH kernel] KVM: PPC: Fix clearing never mapped TCEs in realmode Message-Id: <163071729187.1779947.11008244687916528145.b4-ty@ellerman.id.au> List-Id: References: <20210827040706.517652-1-aik@ozlabs.ru> In-Reply-To: <20210827040706.517652-1-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linuxppc-dev@lists.ozlabs.org, Alexey Kardashevskiy Cc: Leonardo Bras , kvm-ppc@vger.kernel.org On Fri, 27 Aug 2021 14:07:06 +1000, Alexey Kardashevskiy wrote: > Since e1a1ef84cd07, pages for TCE tables for KVM guests are allocated > only when needed. This allows skipping any update when clearing TCEs. > This works mostly fine as TCE updates are handled when MMU is enabled. > The realmode handlers fail with H_TOO_HARD when pages are not yet > allocated except when clearing a TCE in which case KVM prints a warning > but proceeds to dereference a NULL pointer which crashes the host OS. > > [...] Applied to powerpc/next. [1/1] KVM: PPC: Fix clearing never mapped TCEs in realmode https://git.kernel.org/powerpc/c/1d78dfde33a02da1d816279c2e3452978b7abd39 cheers