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 2C3ACC4332F for ; Tue, 20 Dec 2022 00:32:51 +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=XEmZVGiFzVc06G9Kk/it599fyU2PXpVShol7O+hyh0w=; b=y5cTKcVrkv4tvu MbWyfANxrqhwnsHFEmAmsXsNlXPWWU4+THd+MKygqTGWcGEVut66zYb/KSwrLjCJPN4CbLIKE0gzl ZSSF2uHtNSEc3ZvR4wg9b+dfj24BruC3Q2zvdmUUJztWot76uhpuidmdI45byib3Y+3zkLBNPE0Ex 3xYhwY55MMOqytVs2VR3tM7qrt/2/zkPExypScDUk6rqvxAt7oTYZ00ywljaFmciWblppm8+EWm3S Lnzd30YKuHXmaq3ZGOmdcRIBsLsubBs4DRK0yLCPEE6jWL+xbSHmKb4w3WIrNbISsWt01pf44E69l UBTsTTwnVHaZdqYNz9bA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7QXr-005efu-CX; Tue, 20 Dec 2022 00:31:47 +0000 Received: from out-40.mta0.migadu.com ([91.218.175.40]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7QA4-005OGW-Gf for linux-arm-kernel@lists.infradead.org; Tue, 20 Dec 2022 00:07:14 +0000 Date: Tue, 20 Dec 2022 00:06:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1671494814; 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=foi+cM9gEI1JlVJgipQwf5m4Su0pKjKEMr5jntc/8X4=; b=FEA5Zx40ThQP3Y+aileQBqtWae2jAdWjSK9yyTnmOMbwatS5Kprq0K0HMUDAPCinU4n1qd dMWsHrxEbTE/SD3HHfKK9dsdzUwrPFsaEj/4Fnc4/Zj+TXLgmqu0wcwLDEkwYmYnx64cIO 3cvJSQ3d0B/XcfXFOPWRY7eBF6GsT08= 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 10/12] KVM: arm64: Rework logic to en/decode VTCR_EL2.{SL0, SL2} fields Message-ID: References: <20221206135930.3277585-1-ryan.roberts@arm.com> <20221206135930.3277585-11-ryan.roberts@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221206135930.3277585-11-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_160713_242332_8EE7280B X-CRM114-Status: GOOD ( 10.29 ) 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:28PM +0000, Ryan Roberts wrote: > In order to support 5 level translation, FEAT_LPA2 introduces the 1-bit > SL2 field within VTCR_EL2 to extend the existing 2-bit SL0 field. The > SL2[0]:SL0[1:0] encodings have no simple algorithmic relationship to the > start levels they represent (that I can find, at least), so replace the > existing macros with functions that do lookups to encode and decode the > values. These new functions no longer make hardcoded assumptions about > the maximum level and instead rely on KVM_PGTABLE_FIRST_LEVEL and > KVM_PGTABLE_LAST_LEVEL. > > This is preparatory work for enabling 52-bit IPA for 4KB and 16KB pages > with FEAT_LPA2. > > No functional change intended. > > Signed-off-by: Ryan Roberts Why do we need to support 5-level paging at stage-2? A configuration of start_level = 0, T0SZ = 12 with 4K paging would result in 16 concatenated tables at level 0, avoiding the level -1 lookup altogether. -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel