Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp804121pxb; Fri, 22 Apr 2022 11:29:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXQ/Ksz1Kg4ZraWVr2W2MLuw1SvIguzQVExS/LVLJxa7Xa3bXx7LpSFgIe+mIukRL+AhGI X-Received: by 2002:a17:902:aa07:b0:158:6d3e:7c54 with SMTP id be7-20020a170902aa0700b001586d3e7c54mr5538803plb.91.1650652166421; Fri, 22 Apr 2022 11:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650652166; cv=none; d=google.com; s=arc-20160816; b=jY1fXYlTAJUlMm2qaLDrfXLFEyChV3AxdnjYh7AiVep3RVj+A0RZPY3jMASKw1Kv9U BkDKd6wcVhO3IUKel/+1iz8KeF5FKKXA26WvBcmh7PxA0GYejHuoO369pw2qRFpM40dq QZzFV+FUvoaFLRfwpR2jWkXNaPt/5Vvz/PKoo6s+SZAu/DzGRuJkdz+/Wf2AgEPPEGrL +w3TT4vQXb8hfAVfFinMREnFygScCG0flVPUdSuI93MAuQyLaBWCXfMwCzKlSfGvZH9k OeXgN4aOzoTQp0eN8D1Ll7skHXUm1LlTELxcOmzG6xiW4w5H1zbpKejDX7bJTqaq0yud Kjtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=Av/ziOvsBe24F2oAdgKNQqRde9/UDT0IRqk3LqZYlqs=; b=HikZM6y0VPdg4BoTpHfuszQqStJ6CR50j5C8MAr6Al/LI6SoOhlCmN4UiEsqSg6pB6 CcFmweFN37K3mXsvpmiw0z4wfuvdMJVd1qwT8fvb+cBn3ErVeoGvUiccOSddd+H2mxP9 DT4KaUUAPT/kh0dK0lhNQjTsA3AhuKLwDYEfwQPQQ/10MozMSfTqQTrsOpaukU//2u6e 1jC4UUmw4hqTi96ityHU6DLALwXRIrqtL7YCCHvXrZNNT8ZmBJ8UKbrWO7j2HGUf/dKz NvM2wAHVcoEWNuzcrFE6HW36SYEbbsmXr0GdNHKnAEiqfctx5MMxtYwhu7joyh4oWCwi xQ8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=S6Q8xGgq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id nl10-20020a17090b384a00b001d4ee9f6eaasi8112899pjb.34.2022.04.22.11.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 11:29:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=S6Q8xGgq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 73BA714CC1A; Fri, 22 Apr 2022 10:58:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441820AbiDUVPn (ORCPT + 99 others); Thu, 21 Apr 2022 17:15:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245344AbiDUVPl (ORCPT ); Thu, 21 Apr 2022 17:15:41 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A68D349244 for ; Thu, 21 Apr 2022 14:12:50 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id h12so2803438plf.12 for ; Thu, 21 Apr 2022 14:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20210112.gappssmtp.com; s=20210112; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=Av/ziOvsBe24F2oAdgKNQqRde9/UDT0IRqk3LqZYlqs=; b=S6Q8xGgqM2kfoIUPKvTDKebAdhxR75QL9mtWQP3WR5Jm3lbnjbvaiVV6Br7rZy+pzt 5cRgVtohDq1YlQvWSplyA61T3eO/4DPMCQ/Fbdw4pCvXJyutRP0j64EnFN14wvCedz5r lHxF76La2CJL8tCvUeZdTPU14bKLgyBykRINW/78Ldd/6OYbJEKYfBNfYjOcoWULuMnr 3I5B46xF9AZ+F/xUhnJ0b/zSNlLUXiLb3odiOHZJfsYIEQnXn2q2uEzZdDldP8IGAsp5 b0wokV7PIGRjQg40xvtCh/aUweT6Rl6ffS/02fBvhaBFsOu+epFmnXwzdKusJBuC08R6 fklw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=Av/ziOvsBe24F2oAdgKNQqRde9/UDT0IRqk3LqZYlqs=; b=5HT3BJ3PN1eqmoOP3ILlThaKQs76BKEIEybtc0qyA+f/O+6t7gJIX2lA3udhcJ9Tpx MDysPMU7dPfVd+deNbEMH69HpSOm+RTD3Iveh0HU3AbCiPJNGLNMKZDFJpEK/JjtA6s6 iowgRgx+9rm1W+p3jPP1Fr4GNgYvOO3fDA1xhEv6bbnwDh+fBapK9IXUGYB/vsyep8Gg qoWZdIBcHe4jVozZxc78AKecMzFDY1utXsYfPbZ9MsHtSLViCr9lF2Ipnpytt6yBBXMr W6A/vAWHAxeXtVitxnHdIhtYc3cCxvmW9HdRUW+yFtQd3V2ejldfJo380wdc3ah5Zx5J pfOg== X-Gm-Message-State: AOAM533rO1ivpsA//PI86QqXbOGanfXkn+iHyed2RAwDmyd0J2lVjsPV 9wpkmDLTU4ojNKqT/S7HQoIVAQ== X-Received: by 2002:a17:90b:4d01:b0:1d0:f39f:6073 with SMTP id mw1-20020a17090b4d0100b001d0f39f6073mr1628253pjb.175.1650575570116; Thu, 21 Apr 2022 14:12:50 -0700 (PDT) Received: from localhost ([12.3.194.138]) by smtp.gmail.com with ESMTPSA id m23-20020a17090a7f9700b001cd4989feedsm3697189pjl.57.2022.04.21.14.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 14:12:49 -0700 (PDT) Date: Thu, 21 Apr 2022 14:12:49 -0700 (PDT) X-Google-Original-Date: Thu, 21 Apr 2022 14:12:46 PDT (-0700) Subject: Re: [PATCH] RISC-V: mm: Fix set_satp_mode() for platform not having Sv57 In-Reply-To: CC: Paul Walmsley , alexandre.ghiti@canonical.com, atishp@atishpatra.org, Alistair Francis , anup@brainfault.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, mchitale@ventanamicro.com From: Palmer Dabbelt To: apatel@ventanamicro.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 On Thu, 21 Apr 2022 02:30:05 PDT (-0700), apatel@ventanamicro.com wrote: > 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 ? Sorry, there's a queue but I just say this one at the top and it's super simple so I'm going to take it now -- IRC is good to ping this sort of stuff. It's in fixes. Thanks! > > 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 >>