The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Punit Agrawal <punit.agrawal@bytedance.com>
To: palmer@dabbelt.com
Cc: Alexandre Ghiti <alex@ghiti.fr>,
	 punit.agrawal@bytedance.com, paul.walmsley@sifive.com,
	 aou@eecs.berkeley.edu, alexghiti@rivosinc.com,
	 chenjiahao16@huawei.com,  guoren@kernel.org,
	vishal.moola@gmail.com,  stuart.menefy@codasip.com,
	linux-riscv@lists.infradead.org,  linux-kernel@vger.kernel.org,
	yunhui cui <cuiyunhui@bytedance.com>
Subject: Re: [External] Re: [PATCH] riscv: add a warning when physical memory address overflows
Date: Wed, 23 Oct 2024 15:25:22 +0100	[thread overview]
Message-ID: <87fromgalp.fsf@bytedance.com> (raw)
In-Reply-To: <CAEEQ3w=S=Gn9qER=qNwUn8+Gs9AN4Y5-0Zg0w8-4Vps4L7n97w@mail.gmail.com> (yunhui cui's message of "Wed, 18 Sep 2024 11:49:27 +0800")

Hi Palmer,

[...]

>> On 14/08/2024 08:26, Yunhui Cui wrote:
>> > The part of physical memory that exceeds the size of the linear mapping
>> > will be discarded. When the system starts up normally, a warning message
>> > will be printed to prevent confusion caused by the mismatch between the
>> > system memory and the actual physical memory.
>> >
>> > Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
>> > ---
>> >   arch/riscv/mm/init.c | 8 ++++++--
>> >   1 file changed, 6 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
>> > index 52290c9bd04bd..c93164dc51658 100644
>> > --- a/arch/riscv/mm/init.c
>> > +++ b/arch/riscv/mm/init.c
>> > @@ -236,8 +236,12 @@ static void __init setup_bootmem(void)
>> >        */
>> >       if (IS_ENABLED(CONFIG_64BIT)) {
>> >               max_mapped_addr = __pa(PAGE_OFFSET) + KERN_VIRT_SIZE;
>> > -             memblock_cap_memory_range(phys_ram_base,
>> > -                                       max_mapped_addr - phys_ram_base);
>> > +             if (memblock_end_of_DRAM() > max_mapped_addr) {
>> > +                     memblock_cap_memory_range(phys_ram_base,
>> > +                                               max_mapped_addr - phys_ram_base);
>> > +                     pr_warn("Physical memory overflows the linear mapping size: region above 0x%llx removed",
>> > +                             max_mapped_addr);
>> > +             }
>> >       }
>> >
>> >
>>
>>
>> A bit weird to review and test my own patch, but here it is anyway :)
>>
>> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
>>
>> Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com>

Looks like the patch has been ready for a while now. If there are no
further problems, can it be merged please?

[...]

  reply	other threads:[~2024-10-23 14:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-14  6:26 [PATCH] riscv: add a warning when physical memory address overflows Yunhui Cui
2024-08-15 11:01 ` Alexandre Ghiti
2024-09-18  3:49   ` [External] " yunhui cui
2024-10-23 14:25     ` Punit Agrawal [this message]
2025-02-03 15:59       ` Palmer Dabbelt
2025-01-30 14:10 ` patchwork-bot+linux-riscv

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=87fromgalp.fsf@bytedance.com \
    --to=punit.agrawal@bytedance.com \
    --cc=alex@ghiti.fr \
    --cc=alexghiti@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=chenjiahao16@huawei.com \
    --cc=cuiyunhui@bytedance.com \
    --cc=guoren@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=stuart.menefy@codasip.com \
    --cc=vishal.moola@gmail.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox