From: Palmer Dabbelt <palmer@dabbelt.com> To: apatel@ventanamicro.com Cc: Paul Walmsley <paul.walmsley@sifive.com>, alexandre.ghiti@canonical.com, atishp@atishpatra.org, Alistair Francis <Alistair.Francis@wdc.com>, anup@brainfault.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, mchitale@ventanamicro.com Subject: Re: [PATCH] RISC-V: mm: Fix set_satp_mode() for platform not having Sv57 Date: Thu, 21 Apr 2022 14:12:49 -0700 (PDT) [thread overview] Message-ID: <mhng-95003209-d4f2-4394-be70-d041a44af77b@palmer-ri-x1c9> (raw) In-Reply-To: <CAK9=C2UB-SKcb2Lf=m9VQZnOmkoY1W=kNeSJ40VcVXfr5WuPZQ@mail.gmail.com> 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 <apatel@ventanamicro.com> 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 <mchitale@ventanamicro.com> >> Signed-off-by: Anup Patel <apatel@ventanamicro.com> > > 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 >>
WARNING: multiple messages have this Message-ID (diff)
From: Palmer Dabbelt <palmer@dabbelt.com> To: apatel@ventanamicro.com Cc: Paul Walmsley <paul.walmsley@sifive.com>, alexandre.ghiti@canonical.com, atishp@atishpatra.org, Alistair Francis <Alistair.Francis@wdc.com>, anup@brainfault.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, mchitale@ventanamicro.com Subject: Re: [PATCH] RISC-V: mm: Fix set_satp_mode() for platform not having Sv57 Date: Thu, 21 Apr 2022 14:12:49 -0700 (PDT) [thread overview] Message-ID: <mhng-95003209-d4f2-4394-be70-d041a44af77b@palmer-ri-x1c9> (raw) In-Reply-To: <CAK9=C2UB-SKcb2Lf=m9VQZnOmkoY1W=kNeSJ40VcVXfr5WuPZQ@mail.gmail.com> 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 <apatel@ventanamicro.com> 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 <mchitale@ventanamicro.com> >> Signed-off-by: Anup Patel <apatel@ventanamicro.com> > > 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 >> _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2022-04-21 21:12 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-12 3:33 [PATCH] RISC-V: mm: Fix set_satp_mode() for platform not having Sv57 Anup Patel 2022-04-12 3:33 ` Anup Patel 2022-04-15 4:47 ` 潘庆霖 2022-04-15 4:47 ` 潘庆霖 2022-04-15 4:53 ` Anup Patel 2022-04-15 4:53 ` Anup Patel 2022-04-15 5:10 ` 潘庆霖 2022-04-15 5:10 ` 潘庆霖 2022-04-15 5:47 ` Atish Patra 2022-04-15 5:47 ` Atish Patra 2022-04-21 9:30 ` Anup Patel 2022-04-21 9:30 ` Anup Patel 2022-04-21 21:12 ` Palmer Dabbelt [this message] 2022-04-21 21:12 ` Palmer Dabbelt
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=mhng-95003209-d4f2-4394-be70-d041a44af77b@palmer-ri-x1c9 \ --to=palmer@dabbelt.com \ --cc=Alistair.Francis@wdc.com \ --cc=alexandre.ghiti@canonical.com \ --cc=anup@brainfault.org \ --cc=apatel@ventanamicro.com \ --cc=atishp@atishpatra.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-riscv@lists.infradead.org \ --cc=mchitale@ventanamicro.com \ --cc=paul.walmsley@sifive.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.