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 Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97376C433FE for ; Tue, 15 Nov 2022 17:24:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 08CB24B8C5; Tue, 15 Nov 2022 12:24:00 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@linux.dev Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c+vMCjjJjXwd; Tue, 15 Nov 2022 12:23:58 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id D42B34B8A9; Tue, 15 Nov 2022 12:23:58 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id ACB0E4B8AA for ; Tue, 15 Nov 2022 12:23:57 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ADjcKq73XGxS for ; Tue, 15 Nov 2022 12:23:56 -0500 (EST) Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 93CFE4B7FC for ; Tue, 15 Nov 2022 12:23:56 -0500 (EST) Date: Tue, 15 Nov 2022 17:23:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1668533035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=epDwsDiYoNZ6uhKBqwMbJzXJpjRcm2DVB2PP1BGcjP8=; b=LMKySPNF2K08tEU8/pacucf93qxXUOua+1KWhnakFetm4VAYbi1ofKjDaiEZ/IDYEaYhj6 E7ssklZu9Y1+ZIf9KUl4UgiMCAQQp1LHUO0YfCVLJh7TB2gsxpFsg3cKGGkiXQTlKgdwTV BR8S7QBQCXemVNgYdPzwfxfjQlgLYOE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Will Deacon Subject: Re: [PATCH 1/1] KVM: arm64: Use a separate function for hyp stage-1 walks Message-ID: References: <20221114201127.1814794-1-oliver.upton@linux.dev> <20221114201127.1814794-2-oliver.upton@linux.dev> <20221115132532.GA524@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221115132532.GA524@willie-the-truck> X-Migadu-Flow: FLOW_OUT Cc: kvm@vger.kernel.org, Marc Zyngier , linux-kernel@vger.kernel.org, Catalin Marinas , kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Hey Will, On Tue, Nov 15, 2022 at 01:25:34PM +0000, Will Deacon wrote: [...] > On Mon, Nov 14, 2022 at 08:11:27PM +0000, Oliver Upton wrote: > > +int kvm_pgtable_hyp_walk(struct kvm_pgtable *pgt, u64 addr, u64 size, > > + struct kvm_pgtable_walker *walker); > > Hmm, this feels like slightly the wrong abstraction to me -- there's nothing > hyp-specific about the problem being solved, it's just that the only user > is for hyp walks. > > Could we instead rework 'struct kvm_pgtable' slightly so that the existing > 'flags' field is no-longer stage-2 specific and includes a KVM_PGTABLE_LOCKED > flag which could be set by kvm_pgtable_hyp_init()? > > That way the top-level API remains unchanged and the existing callers will > continue to work. Thanks for the suggestion! Yeah, this should be described by the flags instead. We already have KVM_PGTABLE_WALK_SHARED, I could actually condition the RCU lock/unlock on that one. That would make it an explicit opt-in instead of requiring an opt out with callers passing KVM_PGTABLE_LOCKED. Thoughts? -- Thanks, Oliver _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C0E024F29 for ; Tue, 15 Nov 2022 17:23:58 +0000 (UTC) Date: Tue, 15 Nov 2022 17:23:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1668533035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=epDwsDiYoNZ6uhKBqwMbJzXJpjRcm2DVB2PP1BGcjP8=; b=LMKySPNF2K08tEU8/pacucf93qxXUOua+1KWhnakFetm4VAYbi1ofKjDaiEZ/IDYEaYhj6 E7ssklZu9Y1+ZIf9KUl4UgiMCAQQp1LHUO0YfCVLJh7TB2gsxpFsg3cKGGkiXQTlKgdwTV BR8S7QBQCXemVNgYdPzwfxfjQlgLYOE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Will Deacon Cc: Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] KVM: arm64: Use a separate function for hyp stage-1 walks Message-ID: References: <20221114201127.1814794-1-oliver.upton@linux.dev> <20221114201127.1814794-2-oliver.upton@linux.dev> <20221115132532.GA524@willie-the-truck> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221115132532.GA524@willie-the-truck> X-Migadu-Flow: FLOW_OUT Message-ID: <20221115172351.cxoUmBbV84-m5kcuj8o0Tj9HcVKkVzU6wv54TXVKDIw@z> Hey Will, On Tue, Nov 15, 2022 at 01:25:34PM +0000, Will Deacon wrote: [...] > On Mon, Nov 14, 2022 at 08:11:27PM +0000, Oliver Upton wrote: > > +int kvm_pgtable_hyp_walk(struct kvm_pgtable *pgt, u64 addr, u64 size, > > + struct kvm_pgtable_walker *walker); > > Hmm, this feels like slightly the wrong abstraction to me -- there's nothing > hyp-specific about the problem being solved, it's just that the only user > is for hyp walks. > > Could we instead rework 'struct kvm_pgtable' slightly so that the existing > 'flags' field is no-longer stage-2 specific and includes a KVM_PGTABLE_LOCKED > flag which could be set by kvm_pgtable_hyp_init()? > > That way the top-level API remains unchanged and the existing callers will > continue to work. Thanks for the suggestion! Yeah, this should be described by the flags instead. We already have KVM_PGTABLE_WALK_SHARED, I could actually condition the RCU lock/unlock on that one. That would make it an explicit opt-in instead of requiring an opt out with callers passing KVM_PGTABLE_LOCKED. Thoughts? -- Thanks, Oliver 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C2412C4332F for ; Tue, 15 Nov 2022 17:25:56 +0000 (UTC) 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=H0/wh6FPap1vyxNEZSHhWghLhSbe0+/uljJIgEkyZzs=; b=WXpTTNkjAHO9w7 ht12P0cJA7L/pa8CmCPAPRvuznf6n0zR5eKiPAocLwgEWDUctgvFiUvygh0dornu6EEQldTxBI1tQ HU9sowSFrt9d9Ib83yI36RB4WvZ4RsSpMjr3xHBGZSOBdg7KSjyUmQBMsu9QOyEXbq1HFla/5bB72 EJKtT4pbA98syM24zmNM/tO2sffnblqdodlv/HHsy4XP1Oxoyd1CJHDoO6lKp1ygfkwXtrjLzXBqC +0FGMIE0UmMXNIL4VDEDPs0WnOjrRvh+B0i7aA4KtuocKikjqNmGwLk8XsQEBKtxSjR4kwPkvU0c9 X+tjCQt3rr9AahiCgrqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouzfL-00DSdw-GJ; Tue, 15 Nov 2022 17:24:07 +0000 Received: from out2.migadu.com ([188.165.223.204]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouzfH-00DSWf-Jt for linux-arm-kernel@lists.infradead.org; Tue, 15 Nov 2022 17:24:06 +0000 Date: Tue, 15 Nov 2022 17:23:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1668533035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=epDwsDiYoNZ6uhKBqwMbJzXJpjRcm2DVB2PP1BGcjP8=; b=LMKySPNF2K08tEU8/pacucf93qxXUOua+1KWhnakFetm4VAYbi1ofKjDaiEZ/IDYEaYhj6 E7ssklZu9Y1+ZIf9KUl4UgiMCAQQp1LHUO0YfCVLJh7TB2gsxpFsg3cKGGkiXQTlKgdwTV BR8S7QBQCXemVNgYdPzwfxfjQlgLYOE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Will Deacon Cc: Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] KVM: arm64: Use a separate function for hyp stage-1 walks Message-ID: References: <20221114201127.1814794-1-oliver.upton@linux.dev> <20221114201127.1814794-2-oliver.upton@linux.dev> <20221115132532.GA524@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221115132532.GA524@willie-the-truck> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221115_092404_823029_4AFFBC8B X-CRM114-Status: GOOD ( 13.47 ) 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: , 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 Hey Will, On Tue, Nov 15, 2022 at 01:25:34PM +0000, Will Deacon wrote: [...] > On Mon, Nov 14, 2022 at 08:11:27PM +0000, Oliver Upton wrote: > > +int kvm_pgtable_hyp_walk(struct kvm_pgtable *pgt, u64 addr, u64 size, > > + struct kvm_pgtable_walker *walker); > > Hmm, this feels like slightly the wrong abstraction to me -- there's nothing > hyp-specific about the problem being solved, it's just that the only user > is for hyp walks. > > Could we instead rework 'struct kvm_pgtable' slightly so that the existing > 'flags' field is no-longer stage-2 specific and includes a KVM_PGTABLE_LOCKED > flag which could be set by kvm_pgtable_hyp_init()? > > That way the top-level API remains unchanged and the existing callers will > continue to work. Thanks for the suggestion! Yeah, this should be described by the flags instead. We already have KVM_PGTABLE_WALK_SHARED, I could actually condition the RCU lock/unlock on that one. That would make it an explicit opt-in instead of requiring an opt out with callers passing KVM_PGTABLE_LOCKED. Thoughts? -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel