public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: Finn Thain <fthain@linux-m68k.org>, linux-m68k@lists.linux-m68k.org
Subject: Re: [RFC] m68k: Enable memtest kernel parameter
Date: Mon, 13 Sep 2021 17:49:05 +1200	[thread overview]
Message-ID: <ee0206da-f188-73e5-1512-2d057957ca63@gmail.com> (raw)
In-Reply-To: <YT7ky3zuUk5msHDs@kernel.org>

Hi Mike,

thanks - from what I can see, the easiest way to fix the problem we see 
with memtest clobbering the ramdisk data then is to either move the 
memblock_reserve() for the ramdisk image into paging_init(), or else 
move early_memtest() into setup_mm.c:setup_arch().

(Tried excepting the ramdisk range in when calling early_memtest() from 
paging_init() but that requires exporting m68k_ramdisk, Geert might not 
be overly keen on that).

Cheers,

	Michael


On 13/09/21 17:42, Mike Rapoport wrote:
> Hi Michael,
>
> On Mon, Sep 13, 2021 at 03:40:12PM +1200, Michael Schmitz wrote:
>> Hi Finn,
>>
>> On 13/09/21 13:34, Finn Thain wrote:
>>>
>>> This appears to work on Aranym, QEMU and the Quadra 630 I have here.
>>> It is completely untested on Coldfire etc. I don't even know whether the
>>> right memory mappings are in place for this to actually work as intended.
>>
>> The comment just above the section from paging_init() in your patch states
>> that all physical memory is mapped into kernel virtual address space. I
>> don't think that mapping is contiguous though.
>
> early_memtest() operates on physical ranges, so it does not matter what is
> the virtual mapping.
>
>>> Would someone take a look please?
>>>
>>> diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
>>> index 6e40f7f29ebc..d87e12b4855b 100644
>>> --- a/arch/m68k/Kconfig
>>> +++ b/arch/m68k/Kconfig
>>> @@ -9,6 +9,7 @@ config M68K
>>>  	select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS
>>>  	select ARCH_MIGHT_HAVE_PC_PARPORT if ISA
>>>  	select ARCH_NO_PREEMPT if !COLDFIRE
>>> +	select ARCH_USE_MEMTEST
>>>  	select ARCH_WANT_IPC_PARSE_VERSION
>>>  	select BINFMT_FLAT_ARGVP_ENVP_ON_STACK
>>>  	select DMA_DIRECT_REMAP if HAS_DMA && MMU && !COLDFIRE
>>> diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
>>> index 3a653f0a4188..d6301a094fc1 100644
>>> --- a/arch/m68k/mm/motorola.c
>>> +++ b/arch/m68k/mm/motorola.c
>>> @@ -455,6 +455,8 @@ void __init paging_init(void)
>>>
>>>  	flush_tlb_all();
>>>
>>> +	early_memtest(min_addr, max_addr);
>>> +
>>>  	/*
>>>  	 * initialize the bad page table and bad page to point
>>>  	 * to a couple of allocated pages
>>>
>>
>> I'd rather start that from availmem, not from min_addr ... I'm amazed this
>> works - I'd expect the kernel text segment to get trashed by the memory test
>> routines.
>
> early_memtest() checks only free memory ranges, i.e. those that were not
> memblock_reserve()d, so as long as we reserve the range [min_addr,
> availmem] the memtest will skip it.
>

      reply	other threads:[~2021-09-13  5:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13  1:34 [RFC] m68k: Enable memtest kernel parameter Finn Thain
2021-09-13  3:40 ` Michael Schmitz
2021-09-13  5:17   ` Michael Schmitz
2021-09-13  5:17   ` Finn Thain
2021-09-13  5:51     ` Michael Schmitz
2021-09-13  5:56     ` Mike Rapoport
2021-09-13  6:42       ` Mike Rapoport
2021-09-13  6:53       ` Michael Schmitz
2021-09-13  7:59       ` Finn Thain
2021-09-13  5:42   ` Mike Rapoport
2021-09-13  5:49     ` Michael Schmitz [this message]

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=ee0206da-f188-73e5-1512-2d057957ca63@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=fthain@linux-m68k.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=rppt@kernel.org \
    /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