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=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 8510DC433E0 for ; Mon, 1 Feb 2021 18:40:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 2D32764E9A for ; Mon, 1 Feb 2021 18:40:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D32764E9A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vOyKLy63enDJKkWwDGvL9W2tFM+NK4AvjhbL2JTZos4=; b=b+F1iQS7Uifke6sZaTxI05+8W 0r1p8Jn6+PbuxK6zFTe1Oc+DlTEA5X3dAGbwLKmvQQIQOODAp9jYBgXDl2m5O7KYB4jC8QYy6rVNz ewqUbIxd4JM9l9myBm6uJeh7fx45q1oGKe0nShKtcpTDT+o2wUAKCZ+ehwZ7Aj7WsSyWyVoPiVtVv H6qAsqGau0GF8UpgfZYuoZ4RFIQxUg/R4gRfuLrxtxmj1h+EvJXaVv8yF2tRUjxt3TMZOILOpF1eT uzJXyXu8NGtCDbvRIKnBU5yEtcqhOWdyAf7oV+O0aCzpxRdyzmsCCpb8qPUgy/VxhRk6RpckQF/Mh lgBU83D6Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6e73-0002Mn-E8; Mon, 01 Feb 2021 18:39:49 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6e71-0002MC-FN for linux-arm-kernel@lists.infradead.org; Mon, 01 Feb 2021 18:39:48 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id DDE4B64EA2; Mon, 1 Feb 2021 18:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612204786; bh=RWCEVvMfMr07Mj0Dm990NJYMdt/tnBLc1r3RkW1LOpI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Sv7mWTQjdOhFcDIMCbW1iFI0zjx5NhutKWWEwARZFwdSFhjVgHc9Uom5VsUoIPSbv bbsxnuSIKgBN1r5PdCf0vCJDRfzwhL89aJH52aldgfb3hZjzPRWkZ8XSif8y25PBLn OMrHbjZNJSHYSr7y8V3yg6VYCfSgtZSGUtCDFOohMW1atWBUdSRHmjlVw/zDPjdllJ S/Iv5U4ieWYllL8w/npt5/62CWCqdJZMDNdtRLuPjdlD47xFGt0PXJR6oBoi6dPegC Ox9HxzXwXkB506lhN2unGnFjmaoQhkXP8X5+IGSaS7Yvs3mI8o7KYXXNw9zYFCyREZ YeC5KviL9q0gA== Date: Mon, 1 Feb 2021 18:39:40 +0000 From: Will Deacon To: Quentin Perret Subject: Re: [RFC PATCH v2 06/26] KVM: arm64: Factor memory allocation out of pgtable.c Message-ID: <20210201183940.GF15632@willie-the-truck> References: <20210108121524.656872-1-qperret@google.com> <20210108121524.656872-7-qperret@google.com> <20210201181607.GD15632@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210201_133947_596775_4260A8E3 X-CRM114-Status: GOOD ( 17.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, kernel-team@android.com, Suzuki K Poulose , android-kvm@google.com, Catalin Marinas , Fuad Tabba , linux-kernel@vger.kernel.org, Rob Herring , James Morse , linux-arm-kernel@lists.infradead.org, Marc Zyngier , David Brazdil , Frank Rowand , kvmarm@lists.cs.columbia.edu, Julien Thierry Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 01, 2021 at 06:32:52PM +0000, Quentin Perret wrote: > On Monday 01 Feb 2021 at 18:16:08 (+0000), Will Deacon wrote: > > On Fri, Jan 08, 2021 at 12:15:04PM +0000, Quentin Perret wrote: > > > +static struct kvm_pgtable_mm_ops kvm_s2_mm_ops = { > > > + .zalloc_page = stage2_memcache_alloc_page, > > > + .zalloc_pages_exact = kvm_host_zalloc_pages_exact, > > > + .free_pages_exact = free_pages_exact, > > > + .get_page = kvm_host_get_page, > > > + .put_page = kvm_host_put_page, > > > + .page_count = kvm_host_page_count, > > > + .phys_to_virt = kvm_host_va, > > > + .virt_to_phys = kvm_host_pa, > > > +}; > > > > Idle thought, but I wonder whether it would be better to have these > > implementations as the default and make the mm_ops structure parameter > > to kvm_pgtable_stage2_init() optional? I guess you don't gain an awful > > lot though, so feel free to ignore me. > > No strong opinion really, but I suppose I could do something as simple > as having static inline wrappers which provide kvm_s2_mm_ops to the > pgtable API for me. I'll probably want to make sure these are not > defined when compiling EL2 code, though, to avoid confusion. > > Or maybe you had something else in mind? No, just food for thought. If we can reduce the changes for normal KVM then it's probably worth considering if it doesn't add divergent code paths. But I'm also fine with the proposal you have here, so if it doesn't work then don't get hung up on it. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel