Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1650215rwi; Thu, 27 Oct 2022 19:31:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7M1EgqVvrKJ835KiMNU3/N8LvYHv0/KKLtBTxIN4jJ+4hb4H7iLlvvUR1uDovDECJcRCH2 X-Received: by 2002:a17:907:9811:b0:7ad:9455:d551 with SMTP id ji17-20020a170907981100b007ad9455d551mr4075694ejc.205.1666924313963; Thu, 27 Oct 2022 19:31:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666924313; cv=none; d=google.com; s=arc-20160816; b=zLEVcIJMHhW1OH2BuPat4kD//vEB0krs6MRlJEfr07krmLB5rtHt6ac/lvOBqCtmyY JoCfIN0v12ZMY/K3Mm/ivNX8BplNR83IvZ2GQyWVTD+TYSRXxE+2kOj3VG2VkqkHGDcb 9O1EMhzYItIJr92aOkmR9axjZCML10K1yKAYCU7e5YZxrHar/iITOz9I1qIE8vQOjfdJ 21eZuelwIkabZmqpVKgV18kjnQitMdBvHXS8nCcBJPxAlt+P5irqx1MMZHIPEnkaZqDg 3OyzMa7DvL0mvh5dVUna3gXuLX7WUDOortxYypeIzdORb712AAIhSMfAO5I+a6XIhfIR Zs2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=SkQYuV4+b730CzT5zD1g0FiUQ2JmbpTlSlS1qDYNYfk=; b=xHaPj23VJZUV3CVd+e1vf0EoW2xtGkMxs286VzgIWmC2bGbVTVAf8vD2rfAm8QC7lt fm5HIpaxPpJ9VbfXDN73kFIvc+f2MKocTTtoPLo/YcNVHmmEaPW/Acty1Vj5DPu1Y9QX 2L3MPQNShhnuGD8o2AdZ5LfwsPEY0FdqWfk+v27tRLNeZWfiMZy5/z4V0vFu3anSdOSk E0uMM+0Z75SZEA96s0Qb8m9wSi6CCG9t+L16S8JodETKflsbP/oJOygl+BPJ6JvuNsHt xV9pqtOf/J307t2pxDyliRfv0nvwDXfeMPfq79oAWr3a93q1QlrhPRy/qvo2ouil9G9v ApSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn19-20020a1709070d1300b007a4feae7ae7si3288243ejc.575.2022.10.27.19.31.28; Thu, 27 Oct 2022 19:31:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236117AbiJ1CTC (ORCPT + 99 others); Thu, 27 Oct 2022 22:19:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235973AbiJ1CS5 (ORCPT ); Thu, 27 Oct 2022 22:18:57 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E757B879E; Thu, 27 Oct 2022 19:18:56 -0700 (PDT) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Mz5jq1J5qzpWFv; Fri, 28 Oct 2022 10:15:27 +0800 (CST) Received: from kwepemm600007.china.huawei.com (7.193.23.208) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 28 Oct 2022 10:18:54 +0800 Received: from [10.174.185.179] (10.174.185.179) by kwepemm600007.china.huawei.com (7.193.23.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 28 Oct 2022 10:18:53 +0800 Subject: Re: [PATCH V2] arm64/mm: Fix __enable_mmu() for new TGRAN range values To: Anders Roxell CC: Anshuman Khandual , , James Morse , Catalin Marinas , Will Deacon , Marc Zyngier , Suzuki K Poulose , "Ard Biesheuvel" , Mark Rutland , , , , , References: <1615355590-21102-1-git-send-email-anshuman.khandual@arm.com> <20220826120020.GB520@mutt> From: Zenghui Yu Message-ID: <84e674ab-3eee-3f2b-28c1-a08ff99d6d3b@huawei.com> Date: Fri, 28 Oct 2022 10:18:41 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20220826120020.GB520@mutt> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.185.179] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600007.china.huawei.com (7.193.23.208) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/8/26 20:00, Anders Roxell wrote: > On 2021-03-10 11:23, Anshuman Khandual wrote: >> From: James Morse >> >> As per ARM ARM DDI 0487G.a, when FEAT_LPA2 is implemented, ID_AA64MMFR0_EL1 >> might contain a range of values to describe supported translation granules >> (4K and 16K pages sizes in particular) instead of just enabled or disabled >> values. This changes __enable_mmu() function to handle complete acceptable >> range of values (depending on whether the field is signed or unsigned) now >> represented with ID_AA64MMFR0_TGRAN_SUPPORTED_[MIN..MAX] pair. While here, >> also fix similar situations in EFI stub and KVM as well. >> >> Cc: Catalin Marinas >> Cc: Will Deacon >> Cc: Marc Zyngier >> Cc: James Morse >> Cc: Suzuki K Poulose >> Cc: Ard Biesheuvel >> Cc: Mark Rutland >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: kvmarm@lists.cs.columbia.edu >> Cc: linux-efi@vger.kernel.org >> Cc: linux-kernel@vger.kernel.org >> Acked-by: Marc Zyngier >> Signed-off-by: James Morse >> Signed-off-by: Anshuman Khandual > > Hi, > > When building an arm64 defconfig kernel from stable/linux-5.10.y and > booting that in QEMU (version: 1:7.0+dfsg-2~bpo11+2) with '-cpu max' the > kernel doesn't boot. I don't get any output. The kernel boots fine if I > change to '-cpu cortex-a72'. > > If I cherry-pick this patch to stable/linux-5.10.y I'm able too boot the > kernel with '-cpu max'. You can workaround the kernel boot failure by specifying '-cpu max,lpa2=off' [*] in the QEMU command line. > However, I'm not comfortable to backport this patch to older kernels > since there are a lot of conflicts. > Can someone help out to do the packport? Upstream commit 26f55386f964 ("arm64/mm: Fix __enable_mmu() for new TGRAN range values") can still be applied cleanly on top of linux-5.10.y. I can send it to if maintainers are okay with the stable-5.10 backport. [*] https://gitlab.com/qemu-project/qemu/-/commit/69b2265d5fe8 Zenghui