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 40E36C4332F for ; Mon, 19 Dec 2022 19:45:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id AD03B4B7D2; Mon, 19 Dec 2022 14:45:54 -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 t+QUiYnNDZ2J; Mon, 19 Dec 2022 14:45:53 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 6B4CE4B636; Mon, 19 Dec 2022 14:45:53 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id ECB494B62A for ; Mon, 19 Dec 2022 14:45:51 -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 g851If0JfcHp for ; Mon, 19 Dec 2022 14:45:50 -0500 (EST) Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 7C60B4B4D7 for ; Mon, 19 Dec 2022 14:45:50 -0500 (EST) Date: Mon, 19 Dec 2022 19:45:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1671479149; 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=KILJmguHjqQ6SByYTuCuINiGP5uaLk6cxMS8sOPjn0c=; b=UfsgUfhaKwCbijceLCFVlsniHw9mVLe92O73X3euqvwK/tvJJ2CqD8V/7eFD4ARw29WQR1 pTc5kpTexZK235ggECEhD+EDZob46yI6/gEiSer2XrUOMQdRojyFehkN6it7ws5H3BlvPc slZRldJaA9A8izfOqzfwYG+BqoQpzK8= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Ryan Roberts Subject: Re: [PATCH v1 05/12] KVM: arm64: Maintain page-table format info in struct kvm_pgtable Message-ID: References: <20221206135930.3277585-1-ryan.roberts@arm.com> <20221206135930.3277585-6-ryan.roberts@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221206135930.3277585-6-ryan.roberts@arm.com> X-Migadu-Flow: FLOW_OUT Cc: Marc Zyngier , Anshuman Khandual , kvmarm@lists.cs.columbia.edu, Catalin Marinas , kvmarm@lists.linux.dev, Will Deacon , 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 Hi Ryan, On Tue, Dec 06, 2022 at 01:59:23PM +0000, Ryan Roberts wrote: > As the next step on the journey to supporting FEAT_LPA2 in KVM, add a > flag to struct kvm_pgtable, which functions can then use to select the > approprate behavior for either the `classic` or `lpa2` page-table > formats. For now, all page-tables remain in the `classic` format. > > No functional changes are intended. > > Signed-off-by: Ryan Roberts > --- > arch/arm64/include/asm/kvm_pgtable.h | 2 ++ > arch/arm64/kvm/hyp/pgtable.c | 2 ++ > arch/arm64/kvm/mmu.c | 1 + > 3 files changed, 5 insertions(+) > > diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h > index 2247ed74871a..744e224d964b 100644 > --- a/arch/arm64/include/asm/kvm_pgtable.h > +++ b/arch/arm64/include/asm/kvm_pgtable.h > @@ -157,6 +157,7 @@ typedef bool (*kvm_pgtable_force_pte_cb_t)(u64 addr, u64 end, > * @start_level: Level at which the page-table walk starts. > * @pgd: Pointer to the first top-level entry of the page-table. > * @mm_ops: Memory management callbacks. > + * @lpa2_ena: Format used for page-table; false->classic, true->lpa2. I'd prefer that we describe the paging structure purely in terms of input and output address. If you add the latter it should be possible to decide if LPA2 is actually in use. (i.e. PAGE_SIZE != SZ_64K && pgt->oa_bits > 48) -- 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 EF0416FB4 for ; Mon, 19 Dec 2022 19:45:56 +0000 (UTC) Date: Mon, 19 Dec 2022 19:45:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1671479149; 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=KILJmguHjqQ6SByYTuCuINiGP5uaLk6cxMS8sOPjn0c=; b=UfsgUfhaKwCbijceLCFVlsniHw9mVLe92O73X3euqvwK/tvJJ2CqD8V/7eFD4ARw29WQR1 pTc5kpTexZK235ggECEhD+EDZob46yI6/gEiSer2XrUOMQdRojyFehkN6it7ws5H3BlvPc slZRldJaA9A8izfOqzfwYG+BqoQpzK8= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Ryan Roberts Cc: Marc Zyngier , Catalin Marinas , Will Deacon , Ard Biesheuvel , Suzuki K Poulose , Anshuman Khandual , James Morse , Alexandru Elisei , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu Subject: Re: [PATCH v1 05/12] KVM: arm64: Maintain page-table format info in struct kvm_pgtable Message-ID: References: <20221206135930.3277585-1-ryan.roberts@arm.com> <20221206135930.3277585-6-ryan.roberts@arm.com> 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: <20221206135930.3277585-6-ryan.roberts@arm.com> X-Migadu-Flow: FLOW_OUT Message-ID: <20221219194544.EHR3D_KYT9_oLT1sR0Z56gaytEIU8Cp8xmYhn9CBGIA@z> Hi Ryan, On Tue, Dec 06, 2022 at 01:59:23PM +0000, Ryan Roberts wrote: > As the next step on the journey to supporting FEAT_LPA2 in KVM, add a > flag to struct kvm_pgtable, which functions can then use to select the > approprate behavior for either the `classic` or `lpa2` page-table > formats. For now, all page-tables remain in the `classic` format. > > No functional changes are intended. > > Signed-off-by: Ryan Roberts > --- > arch/arm64/include/asm/kvm_pgtable.h | 2 ++ > arch/arm64/kvm/hyp/pgtable.c | 2 ++ > arch/arm64/kvm/mmu.c | 1 + > 3 files changed, 5 insertions(+) > > diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h > index 2247ed74871a..744e224d964b 100644 > --- a/arch/arm64/include/asm/kvm_pgtable.h > +++ b/arch/arm64/include/asm/kvm_pgtable.h > @@ -157,6 +157,7 @@ typedef bool (*kvm_pgtable_force_pte_cb_t)(u64 addr, u64 end, > * @start_level: Level at which the page-table walk starts. > * @pgd: Pointer to the first top-level entry of the page-table. > * @mm_ops: Memory management callbacks. > + * @lpa2_ena: Format used for page-table; false->classic, true->lpa2. I'd prefer that we describe the paging structure purely in terms of input and output address. If you add the latter it should be possible to decide if LPA2 is actually in use. (i.e. PAGE_SIZE != SZ_64K && pgt->oa_bits > 48) -- 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 89356C4332F for ; Mon, 19 Dec 2022 20:08:57 +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=aX7bCnCoaIh0ypy9XScLbw/gqYig/bLFarh0aHYyghg=; b=SZJloLVnX55IfD hHb0Bb2nEk+t9lo1e+AhrrZzjQ48rHH+g3gOZd6eS7V3KNx3iqLWPgaSEAya2ULRIFxOhhjLm5ljD 6Dt6l4i0GXCnp4sfTjNsJiyK1YSOdPnYw09/mO2Ve0CpxeltG8xnpdOO3Tx+VHjhTH49Ll/NIurvo Qz0D8ib96MudhFF/K+FNG65PgPud36VQK3jwNUficE4zSLvBQ9dP3KRQ6+YFz4T0RyTna6G9YBkyb NCp/f3ekSekK+1j9MydSLtZ/jsiYGZA4tToUBdt+2TMsu1ZQobslmgkpBZ0kzrc3fC1g/TqA6YhoX q8CkDoQtTb/P7TsGx4NA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7MQN-001g32-VI; Mon, 19 Dec 2022 20:07:48 +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 1p7M5F-001HRn-LE for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 19:46:09 +0000 Date: Mon, 19 Dec 2022 19:45:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1671479149; 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=KILJmguHjqQ6SByYTuCuINiGP5uaLk6cxMS8sOPjn0c=; b=UfsgUfhaKwCbijceLCFVlsniHw9mVLe92O73X3euqvwK/tvJJ2CqD8V/7eFD4ARw29WQR1 pTc5kpTexZK235ggECEhD+EDZob46yI6/gEiSer2XrUOMQdRojyFehkN6it7ws5H3BlvPc slZRldJaA9A8izfOqzfwYG+BqoQpzK8= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Ryan Roberts Cc: Marc Zyngier , Catalin Marinas , Will Deacon , Ard Biesheuvel , Suzuki K Poulose , Anshuman Khandual , James Morse , Alexandru Elisei , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu Subject: Re: [PATCH v1 05/12] KVM: arm64: Maintain page-table format info in struct kvm_pgtable Message-ID: References: <20221206135930.3277585-1-ryan.roberts@arm.com> <20221206135930.3277585-6-ryan.roberts@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221206135930.3277585-6-ryan.roberts@arm.com> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_114602_844798_03B237D9 X-CRM114-Status: GOOD ( 16.76 ) 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 Hi Ryan, On Tue, Dec 06, 2022 at 01:59:23PM +0000, Ryan Roberts wrote: > As the next step on the journey to supporting FEAT_LPA2 in KVM, add a > flag to struct kvm_pgtable, which functions can then use to select the > approprate behavior for either the `classic` or `lpa2` page-table > formats. For now, all page-tables remain in the `classic` format. > > No functional changes are intended. > > Signed-off-by: Ryan Roberts > --- > arch/arm64/include/asm/kvm_pgtable.h | 2 ++ > arch/arm64/kvm/hyp/pgtable.c | 2 ++ > arch/arm64/kvm/mmu.c | 1 + > 3 files changed, 5 insertions(+) > > diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h > index 2247ed74871a..744e224d964b 100644 > --- a/arch/arm64/include/asm/kvm_pgtable.h > +++ b/arch/arm64/include/asm/kvm_pgtable.h > @@ -157,6 +157,7 @@ typedef bool (*kvm_pgtable_force_pte_cb_t)(u64 addr, u64 end, > * @start_level: Level at which the page-table walk starts. > * @pgd: Pointer to the first top-level entry of the page-table. > * @mm_ops: Memory management callbacks. > + * @lpa2_ena: Format used for page-table; false->classic, true->lpa2. I'd prefer that we describe the paging structure purely in terms of input and output address. If you add the latter it should be possible to decide if LPA2 is actually in use. (i.e. PAGE_SIZE != SZ_64K && pgt->oa_bits > 48) -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel