Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp851923pxb; Fri, 22 Apr 2022 12:36:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyGrCyCiWBXaeeu7YncoYnjk5UAT5x1iX+XWERx4tuakXD+kxBZgEltCN9J456pkLPSEfB X-Received: by 2002:a17:90b:4f85:b0:1d2:828f:9860 with SMTP id qe5-20020a17090b4f8500b001d2828f9860mr7107503pjb.54.1650656190059; Fri, 22 Apr 2022 12:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650656190; cv=none; d=google.com; s=arc-20160816; b=CNIBVHCUbgDSc2PKbise6f79Ht4q+9TCGFX1R0uRybRuy9SBVixz4zCepjSiRfNL/7 uH1HrgNOh4NKQqVrjM5VWE5ZDy5SIVw/ihw50oGnpPqT5AulTahyDsQCi4zpSOxrfWrn Sr2JcnF4R3iS3S1LoP9DzW+Qnt/MIQrvu5zrhhxU85ea7m/RzQ9f21I5BpzjFIeg5wmJ 4lqim36hbqxW9YXz71eCC+XNdD2xNXLCQuSjUe9TZk0073QOyIRgXvQdayTdSWkBs3cx g7YGyTrVJj8VEl2hlaQsuCR4wpcHsHGiXJhKGhs243tLNFrTd7A9zQov+nBbKdOhoxlx WuMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=67sfB0IzHVXeR5A8puxseus3O+X5kUTFhlECjiPj6x4=; b=DPh30vcYS2y5X+w5VxEfVLBnvnaK3YA5lgFc+PAJC4jgx+DzTWn1h7QUn9RgfOTW8L mO2YluU7+qtaiPQ/ioEdGLGhEVh+5+OOcU5XIZ5JHJjXCMHy//1pSkFfj7FnwC6U3c9g rY36Qqv/nV4K06uMWXqSJdXVTQEn4n4UCD7BeuhRqd45Y2pdzaAyILt4+cA8eqyMA0Hn PEvI+/G9vpdlV0XQWXq45eIvS5awGsGhuyiQu+Efe3oQVbf+pmeHDqHF03LxSbgyMgd6 QIBfsaJ1dqViQoGaxqnWhyZ1EjvZj4AvXqE/wRepk1XrgqPcaL6pD9WK/kOESVRwHvNb 33Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=fmIPbE1I; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id mh14-20020a17090b4ace00b001ce6da85d4csi9382686pjb.189.2022.04.22.12.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 12:36:30 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=fmIPbE1I; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E5A9E1668E5; Fri, 22 Apr 2022 11:44:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387671AbiDUJdK (ORCPT + 99 others); Thu, 21 Apr 2022 05:33:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386167AbiDUJdJ (ORCPT ); Thu, 21 Apr 2022 05:33:09 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 391BCDED5 for ; Thu, 21 Apr 2022 02:30:20 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id p12so2068231lfs.5 for ; Thu, 21 Apr 2022 02:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=67sfB0IzHVXeR5A8puxseus3O+X5kUTFhlECjiPj6x4=; b=fmIPbE1IBLcf3qYXbw+olE1xUMN93LGj1KaoeCohxNiXqe/IYmOR+GNMCYDO9BV3c5 v8VrA2RrG9XLDbSN1FgCSuioGJ5TOoSErvJmCZpZsunnR+EtJv70QquoeihauNHuR0UP RirMlujj/Ha9r1dj1uUgIFTR3YrP1u/zjmXzkYSgv1J68uNJPbBu/73B2Sh2kwRKqugs inRGGd2FlV103fq8wddg04I7qf3rcM2wr7PTd0UYBkj36CXEV4Uf5QfdjYvDFLwyOON2 aj5KJBCk1OJIDEVhC5GjAywZQAa/N1Xi6UfsgqhbtrtTWIeyitADL3C3l2X1Syi4OyB2 9VCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=67sfB0IzHVXeR5A8puxseus3O+X5kUTFhlECjiPj6x4=; b=tPY+wRsdttJGQYUOlLZEZQXsvrybSuhrSnloYs2VmZGJ5RPMOxbvmnialjQKUKlajv hGrVLk84x9YLo3tXdOOzDTyokl7ZoFWmLrhCpORQ3nPkhoSzGHPxcpJ53Ur7dFtriLT8 +aeu61Hafd/er9HLTuXY9JCqdxc57yDr8MxKc/9c8tqPvuauXqCH6uRSw5J0RcXTMhGx Itf784j9kO368HLinnqQ3OhlQmcgm+D1wxTShzTOeZqhMtTLH84HW5QONNDCNL58v4AC cq9+y2muxmyQkRAJXgp175um3hr0EEN7EEdd2Mgxq/oaSzQLAnlqoBgXKrWLt94qd8r2 qJ/A== X-Gm-Message-State: AOAM533LMsWYqruqsOaxfAd3VmIQdByGn+vnKYCHh3K8LuWMgYB9Po6B wBbTbsYUwWh5Ky3xjZhCpaBPZbju02oH02FOF0jt/w== X-Received: by 2002:ac2:5ddc:0:b0:46b:85a3:9c3 with SMTP id x28-20020ac25ddc000000b0046b85a309c3mr18314110lfq.130.1650533418465; Thu, 21 Apr 2022 02:30:18 -0700 (PDT) MIME-Version: 1.0 References: <20220412033335.1384230-1-apatel@ventanamicro.com> In-Reply-To: <20220412033335.1384230-1-apatel@ventanamicro.com> From: Anup Patel Date: Thu, 21 Apr 2022 15:00:05 +0530 Message-ID: Subject: Re: [PATCH] RISC-V: mm: Fix set_satp_mode() for platform not having Sv57 To: Palmer Dabbelt , Paul Walmsley Cc: Alexandre Ghiti , Atish Patra , Alistair Francis , Anup Patel , linux-riscv , "linux-kernel@vger.kernel.org List" , Mayuresh Chitale Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no 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 Hi Palmer, On Tue, Apr 12, 2022 at 9:04 AM Anup Patel wrote: > > When Sv57 is not available the satp.MODE test in set_satp_mode() will > fail and lead to pgdir re-programming for Sv48. The pgdir re-programming > will fail as well due to pre-existing pgdir entry used for Sv57 and as > a result kernel fails to boot on RISC-V platform not having Sv57. > > To fix above issue, we should clear the pgdir memory in set_satp_mode() > before re-programming. > > Fixes: 011f09d12052 ("riscv: mm: Set sv57 on defaultly") > Reported-by: Mayuresh Chitale > Signed-off-by: Anup Patel Can this be considered for 5.18-rcX ? Regards, Anup > --- > arch/riscv/mm/init.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c > index 9535bea8688c..b0793dc0c291 100644 > --- a/arch/riscv/mm/init.c > +++ b/arch/riscv/mm/init.c > @@ -718,6 +718,7 @@ static __init void set_satp_mode(void) > if (!check_l4) { > disable_pgtable_l5(); > check_l4 = true; > + memset(early_pg_dir, 0, PAGE_SIZE); > goto retry; > } > disable_pgtable_l4(); > -- > 2.25.1 >