From patchwork Wed Jun 2 09:43:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 12293565 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=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 3904AC4708F for ; Wed, 2 Jun 2021 09:46:18 +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 0711B613BF for ; Wed, 2 Jun 2021 09:46:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0711B613BF Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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=8uPkPD8p/XbrNPqdrmjOlqHbUH/moc8lp0qF42MSczc=; b=p2m 8hvo659jIJV+RHvEkvu1Kcm1jJ9j7mnzzMtyPDcxWD0f6Yt8uIlqFAK7CtIItY7PUStQsDkn6n4Xn ZNfDFTNOxiMEMtOH6669WQhF2owx2UBjnM/chhGNesPmhGq85LZ+7knYja3c2r//TuasiKpUee9PP qQ9tf4CLIs3UANvqC7GDWa2z80IW262UYdfCtXSVOYit+zXD6jutLyV2DrtxOiKjidPuP2lGRuxrc SEC5LQaJuJzVXJpbBpUozFutKCiBl+U6VMmj9VROgj0rjYnNPaJ/sFrKXO3dBkVLYDc4GkyyNVvs6 kSA67Wjxq3ZPXe0vv+n7ApPplC6zPmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loNPp-003271-IV; Wed, 02 Jun 2021 09:43:57 +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 1loNPm-00326X-E7 for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 09:43:55 +0000 Received: by mail-ed1-x549.google.com with SMTP id f12-20020a056402150cb029038fdcfb6ea2so1060603edw.14 for ; Wed, 02 Jun 2021 02:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=PXs9u6dzCmMe63YEsmhUrb93h0mWmoLs1gTxAQd7MEA=; b=oPgorK2YXYRV0NwbupNNErxxwaXHhcqOGNqd8VNe+P/7Nj5Uz7T7moZyrqR/KdQp5E iUOHFTmYLgjY+7moRvw+AKjjV2DBSZUDC7d+1Zn2fjOJu8WVLJq6Eq0T+m9uNQZE4Qdv 68oufbungBm2FDwfThF94Fvb51/PTNHpNr0PqVJDP9Fai7qCvEORLB+XK0FZ+6MpTuKx w42/J0YFONYdkPPmysoMeWv9wfLLp7FgmZskg3IHlybRnVZD3yizxXzCveGebPdlVIaf kDua8A5CGclwlqWaUqvjFXuwm+AlAFlwyuDMET2h9JWGKzOlnh2KLZl9vpYdpX0KKae+ G4XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=PXs9u6dzCmMe63YEsmhUrb93h0mWmoLs1gTxAQd7MEA=; b=skcJ1h0expFiOlrmIeBX6VXeg0go3ZxuMnyAkl7N/AqFZ+8s/BUR1vr8BmqR9/NPYR baCglWIl+3kkOQy/Nc7R1IJyDqpxoflifUDx1Pa4Rwe66QtVJ8iPoWLe/+Ba4Ips944g lLrcIu+9ejV14m7/tOx1k1tLDqKw9L3FlHfCaKm2zI1dkUz9ofE/lFBUX4ZAjermB9cF v/4pi8g8yNkqfEd6HJuIAVWBK7+l8H3jM5y7cunk+sC43gBOWsbNiVEIweUZHEj+E4i/ h7UD9Sy8iQntj4pUM6/lRaJ/60CTo8XnM5ngnzQUw3r/lt+xxali5sMDUsv7Stzunzrb F0cQ== X-Gm-Message-State: AOAM531RIUwCWeVgSUTbN4qCW3SvETs2A8dwDNY2A0qmUovCccNjfe8K /rT/AfKWu/Hfwh4gCy0oC80HfEE6NEDB X-Google-Smtp-Source: ABdhPJwI732qm8er6IebqhgRNDcxCaKLRuDj57CyEYHgzxVlmlFpf/MCKV1O0VnL1RhgrhvYbef7nwiw583Q X-Received: from r2d2-qp.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1652]) (user=qperret job=sendgmr) by 2002:aa7:d893:: with SMTP id u19mr38230483edq.258.1622627031729; Wed, 02 Jun 2021 02:43:51 -0700 (PDT) Date: Wed, 2 Jun 2021 09:43:40 +0000 Message-Id: <20210602094347.3730846-1-qperret@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.rc0.204.g9fa02ecfa5-goog Subject: [PATCH v2 0/7] KVM: arm64: Reduce hyp_vmemmap overhead From: Quentin Perret To: maz@kernel.org, will@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, catalin.marinas@arm.com, suzuki.poulose@arm.com Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kernel-team@android.com, linux-kernel@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_024354_523093_63AA78A1 X-CRM114-Status: GOOD ( 11.38 ) 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 is a v2 of the patch series previously posted here: https://lore.kernel.org/r/20210527125134.2116404-1-qperret@google.com/ Please refer to the cover letter of v1 for the context and motivation behind the series. Changes since v1: - Added comment/doc in page_alloc.c explaining the locking expectations; - Removed unnecessary casts in the 'page-to-list-node' helpers; - A few other cosmetic changes in the allocator. Thanks, Quentin Quentin Perret (7): KVM: arm64: Move hyp_pool locking out of refcount helpers KVM: arm64: Use refcount at hyp to check page availability KVM: arm64: Remove list_head from hyp_page KVM: arm64: Unify MMIO and mem host stage-2 pools KVM: arm64: Remove hyp_pool pointer from struct hyp_page KVM: arm64: Use less bits for hyp_page order KVM: arm64: Use less bits for hyp_page refcount arch/arm64/kvm/hyp/include/nvhe/gfp.h | 45 +------ arch/arm64/kvm/hyp/include/nvhe/mem_protect.h | 2 +- arch/arm64/kvm/hyp/include/nvhe/memory.h | 7 +- arch/arm64/kvm/hyp/include/nvhe/mm.h | 13 +- arch/arm64/kvm/hyp/nvhe/mem_protect.c | 60 +++++----- arch/arm64/kvm/hyp/nvhe/page_alloc.c | 112 +++++++++++++----- arch/arm64/kvm/hyp/nvhe/setup.c | 30 +++-- arch/arm64/kvm/hyp/reserved_mem.c | 3 +- 8 files changed, 145 insertions(+), 127 deletions(-)