From patchwork Tue Oct 5 09:01:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 12535995 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58EB8C433F5 for ; Tue, 5 Oct 2021 09:04:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 19A636137C for ; Tue, 5 Oct 2021 09:04:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 19A636137C Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Mime-Version: Message-Id:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=DSVtoF99iBudbMsgPgfJaUoUmzB8+Fi8Mz6BP6KKm8U=; b=U8p FKhnBE2+1/D3f1MFoQr4OaUsaXg6EMcCaGQDgUiq5RokBGCbo61QiZyh4rTGCNjOywZVLyw/hjguz w0xiCmsDBYU29ot3gyCSsvZi0ViXH5+zuHau7HAPzFsapSDHtj+fA6IgwC8EbEBTyGadDVnVlkoLC S6ZJnkZTk2/eY9M3905p3fxPU/rY/iFl0yjXxlFpAJuJs8Qgzs0rIPFE4bnftl27qrOF+2bS/PoRD 3gq0sfn20n/cxjmnncWDt1iPREUSifo2Vlx5R21hWpIL7P6yyTb4+HVeg9VLpCT5mVnelE9cC8Vf9 tSkF/BQdcF/HXzkchC57/miFZS7u+sA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXgKu-009dFR-QN; Tue, 05 Oct 2021 09:02:09 +0000 Received: from mail-qv1-xf49.google.com ([2607:f8b0:4864:20::f49]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXgKr-009dE2-0e for linux-arm-kernel@lists.infradead.org; Tue, 05 Oct 2021 09:02:06 +0000 Received: by mail-qv1-xf49.google.com with SMTP id kc13-20020a056214410d00b00382bc805781so8632069qvb.12 for ; Tue, 05 Oct 2021 02:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=YjTsD/0+blx8dzSzzvYPEmIwxWymL2rSsPmT9WrblMQ=; b=Oni8vTpzdoAguLL9g/0bTNlxG6eqPKNXR7hlH2QVhmPG/MSICPVMmjIkLRMVoFZsak qu7HwsUXwfWdDGja/pJ6rr0gubuHFEcEDOhT1sEUrKFT0YEeebrwEK01Eukybn0GEJ7t Un/N37PDtmLGAevXkQx9RIeDEMjoS/Rb6BKBU4YVPFU/ad/YLq/KXkFDoCP+IObdA6h4 kfqOcbJ1Axh78XlOffdWVzqd2+p5AV42WHmazyMlMQLbiNF3gOWDEbO9ZaI5Y5tsmZct qU/XyCEcLAj+ar44gtcChNSpXGDU2wR5b0HWyYCQDMIYY+/le0bK+7smskmSqoCjAFra 8DDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=YjTsD/0+blx8dzSzzvYPEmIwxWymL2rSsPmT9WrblMQ=; b=SZLy6ktJbb+58cEvEV9KAPzqy/qhCjxzYYob7DQcBbQSg5zUlvPKWN3A5Lv5LGyd0K yLvadujcO7DYgl02wI4XfWFOX9fcn+A9C2kDuoQ5MrI8QbiveoTcMPKnXfpQwDv527AV sIKsJvnVJbDq0IGLUwzHHuEfnzqhmOrbMvnqCMG1ns4jWfqZN2vDw6WazGFF6L7HX3Kn FobW3F7QNAcuNWnAFsXqhOaOV1Ddvq33Kvk/ym/A3eHTezjoB5TUbOqxwjOEIU3p8Deb K0hXZBRDD5upoCo4fX0cHfixIngIiRk0/lBaR8u3sKLJM8tciGO+rJDdCgsR/UEDvkSo YWaw== X-Gm-Message-State: AOAM533Yfe3+C5mPhvaADlyP3RVUDHBt0Ejq42Ny7Movm9p+U5zlhmGy 767SIEu+QBLnMexg4rfUfGmAWFJxJEZY X-Google-Smtp-Source: ABdhPJzdJwotAoaBB3EtyGIAZNxFrytEsAJXsOE9DPlOSjQixLdLb9VSyUZ6rGK2FOH7gAKnzLzBgNvtbGus X-Received: from luke.lon.corp.google.com ([2a00:79e0:d:210:5700:9128:3106:b389]) (user=qperret job=sendgmr) by 2002:ad4:4629:: with SMTP id x9mr26087544qvv.58.1633424522389; Tue, 05 Oct 2021 02:02:02 -0700 (PDT) Date: Tue, 5 Oct 2021 10:01:37 +0100 Message-Id: <20211005090155.734578-1-qperret@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.33.0.800.g4c38ced690-goog Subject: [PATCH 0/2] A couple of EL2 refcounts fixes From: Quentin Perret To: Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , Quentin Perret , Fuad Tabba , David Brazdil , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Cc: kernel-team@android.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211005_020205_097556_BB65DB7D X-CRM114-Status: UNSURE ( 9.45 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi all, This addresses a couple of issues Will has found with the refcounting of page-tables at EL2. Patch 01 fixes a nasty bug, and probably wants to go in -stable. Patch 02 fixes a small inconsistency which made it harder to find refcount-related bugs at EL2. Feedback welcome ! Thanks, Quentin Quentin Perret (2): KVM: arm64: Fix host stage-2 PGD refcount KVM: arm64: Report corrupted refcount at EL2 arch/arm64/kvm/hyp/include/nvhe/gfp.h | 1 + arch/arm64/kvm/hyp/nvhe/mem_protect.c | 6 +++++- arch/arm64/kvm/hyp/nvhe/page_alloc.c | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-)