From patchwork Mon Oct 4 09:03:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 12533523 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 93051C433EF for ; Mon, 4 Oct 2021 09:05:46 +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 5ADF46139F for ; Mon, 4 Oct 2021 09:05:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5ADF46139F 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=eZN TpWDT1FQqaK4U9dhow1lpk6xkwOmH9eQzJR0zb4zi8P6hGST60SZphIxi+Ih8RPyBk3sfWLafJ+gA oO+qvlPl/2n5Qk6ibTMQtKusIuTmmGdP+oZtOGEBJSR/q4pWMn65Bsi5lU+LXmMjosg+4ZYncRw7k aaMY/cLEdgNOThYDUjJ7TxVPVfU6yJ18dzwnTy6gdEpRyqK1sWHYWhX+bPYfGhk4LofN5icrD7fjJ iR5j5LMFALY4kbZlXEw6KJLXqQpxtULKVNbskB8YuZjnIjVls8CRWsI73knvczdZRspNKGdfQB/p3 kMDV2mCjeCiaPEi0Qx361XOIxqlT18g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXJsx-005iCZ-DT; Mon, 04 Oct 2021 09:03:47 +0000 Received: from mail-ed1-x549.google.com ([2a00:1450:4864:20::549]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXJst-005iAu-Bo for linux-arm-kernel@lists.infradead.org; Mon, 04 Oct 2021 09:03:44 +0000 Received: by mail-ed1-x549.google.com with SMTP id k2-20020a50ce42000000b003dadf140b15so4828405edj.19 for ; Mon, 04 Oct 2021 02:03:41 -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=cDeVBbd8fmjR3GX4XwCizTRj0hWM50iHttru8PTyFUbxfI+Srq2N/f14A83cswDquw OE9TAuHD7lC8c+ic+i+yiOl6IQ6FAVHQZxmdzAY67B5j4gFWr8hZMA+WN6zXBqBp6NTN jgffafFQATGQHreUOq5eYQplEJ9eQJEWTkXjY37D/dAoaHfL9y81mvc9j/2KYhMfZYvq RdaZVd1Kr3Cd1Kg1HvlNAfRBfG/lGsC3tDKyTZS9O4kJQFviWp6aWFtCosLSaivreQ82 eKsskutGnKtrjVhwwPVOhTRNgee+YZb0n732fTRei79zPf1IOd2rllBdb10/PIjLrgC6 sr5Q== 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=nSR3NeIhpu39ufOMnjpFGd8ZnLC4VspBc0dRIZJve0/NALJbDExQ+RDwarUBkn6xOA PP2i507wITekLbdO8GWXBJfyQYVGfHaRo+fyM+x2kKCokLQbrZLYMcQhkB7MfZ1Bgcwd g0qYrhpnH7NPNDXmniWd4OkipzB2RdwDZUi5dAZY+3pyIzlsQxMj/qu8B2ZMNEd8C1JM RZ027tcaQknvzhiLwMwqsPLb+ZXokhVGajbJDjKMrQIMT/keXuDftKsvdS0EIPjt/VyE BnZ1qJWS4iwLiTv1UgpFqdC2VJz45553hdhTN3++MyDxNu2vXj4Z62g0O03/3/LWVLaJ paVQ== X-Gm-Message-State: AOAM532QKxvUogSjEbpqaSqbXOu7zTe+9s5g/xX+xSfI13pdTfkjgArG 1xz5bUK7sBRD370IqExI3KnrzY3xqe3P X-Google-Smtp-Source: ABdhPJwMBTgk+xzHhrOf7diiO6pKvFsFa+nBGQazRqVB1zzwDjDYGzDQkOsS9ibLYzZ2nicgVL/MVG58Ll6W X-Received: from luke.lon.corp.google.com ([2a00:79e0:d:210:669b:5b16:60b7:a3d4]) (user=qperret job=sendgmr) by 2002:a17:906:8281:: with SMTP id h1mr15169765ejx.352.1633338219898; Mon, 04 Oct 2021 02:03:39 -0700 (PDT) Date: Mon, 4 Oct 2021 10:03:12 +0100 Message-Id: <20211004090328.540941-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-20211004_020343_439317_EB2F2AD7 X-CRM114-Status: UNSURE ( 9.40 ) 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(-) Acked-by: Will Deacon