Re: Re: [PATCH v2 0/2] Make it possible to reserve memory on 64bit platform

2021-01-22 Thread Andy Shevchenko
On Fri, Jan 22, 2021 at 03:36:19PM +0800, zhaowei1...@thundersoft.com wrote:
> On 18.01.21 04:51, zhaowei1...@thundersoft.com wrote:
> > > On Sat, Jan 16, 2021 at 2:43 AM Wesley Zhao
> > >  wrote:

> > Dan's point is that you should look into using "memmap=" instead of
> > "reserve=".
> Oh~,sorry miss understand,i can try this, thanks!!

And AFAICS you don't need to alter cmdline.c. But if you are going to, don't
forget test cases (and FYI: I have few patches pending against it here [1]).

[1]: 
https://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git/log/?h=for-next

-- 
With Best Regards,
Andy Shevchenko




Re: [PATCH v2 0/2] Make it possible to reserve memory on 64bit platform

2021-01-18 Thread Andy Shevchenko
On Sat, Jan 16, 2021 at 02:41:11AM -0800, Wesley Zhao wrote:
> I was trying to reserve some memory to save logs incase that Android panic or 
> hang and then
> I can read the logs from QNX side from the memory reserved before on the 
> Qualcomm 8155 hypervisor platform,
> and I find the "reserve=" parameter only support 32bit,so I made some change 
> and send these patches.

Your series has disrupter in-reply-to change, can you fix your tools to have
all patches in one email thread?

> testcase:
>   I test on the qemu with some cmdline like[qemu-system-x86_64 -kernel 
> linux-next/arch/x86_64/boot/bzImage
>   -hda ubuntu-system.ext4 -append "root=/dev/sda init=/bin/bash 
> console=ttyS0 reserve=0x18000,0x123456"
>   -nographic] and check the /proc/iomem with 18000-180123455 : 
> reserved.
>   And some other tests with the get_option with the parameter(-12345678) 
> and so on

It's good but I was talking about unit test. Look into cmdline_kunit.c.

> Wesley Zhao (2):
>   lib/cmdline: add new function get_option_ull()
>   resource: Make it possible to reserve memory on 64bit platform

-- 
With Best Regards,
Andy Shevchenko




Re: [PATCH v2 0/2] Make it possible to reserve memory on 64bit platform

2021-01-18 Thread David Hildenbrand
On 18.01.21 04:51, zhaowei1...@thundersoft.com wrote:
> On Sat, Jan 16, 2021 at 2:43 AM Wesley Zhao
>  wrote:
> >>
> >> I was trying to reserve some memory to save logs incase that
> Android panic or hang and then
> >> I can read the logs from QNX side from the memory reserved before
> on the Qualcomm 8155 hypervisor platform,
> >> and I find the "reserve=" parameter only support 32bit,so I made
> some change and send these patches.
> > 
> >See Documentation/admin-guide/kernel-parameters.txt
> > 
> >        memmap=nn[KMG]$ss[KMG]
> >                        [KNL,ACPI] Mark specific memory as reserved.
> >                        Region of memory to be reserved is from ss
> to ss+nn.
> >                        Example: Exclude memory from
> 0x1869-0x1869
> >                                 memmap=64K$0x1869
> >                                 or
> >                                 memmap=0x1$0x1869
> >                        Some bootloaders may need an escape character
> >before '$',
> >                        like Grub2, otherwise '$' and the following
> number
> >                        will be eaten.
> Sorry,what is your point:
>  static int __init reserve_setup(char *str)
>  static struct resource reserve[MAXRESERVE];
>  for (;;) {
>  unsigned int io_start, io_num;*  // these code is not compatible
> with 64bit,i start from here*
> 

Dan's point is that you should look into using "memmap=" instead of
"reserve=".

-- 
Thanks,

David / dhildenb



Re: [PATCH v2 0/2] Make it possible to reserve memory on 64bit platform

2021-01-17 Thread Dan Williams
On Sat, Jan 16, 2021 at 2:43 AM Wesley Zhao  wrote:
>
> I was trying to reserve some memory to save logs incase that Android panic or 
> hang and then
> I can read the logs from QNX side from the memory reserved before on the 
> Qualcomm 8155 hypervisor platform,
> and I find the "reserve=" parameter only support 32bit,so I made some change 
> and send these patches.

See Documentation/admin-guide/kernel-parameters.txt

memmap=nn[KMG]$ss[KMG]
[KNL,ACPI] Mark specific memory as reserved.
Region of memory to be reserved is from ss to ss+nn.
Example: Exclude memory from 0x1869-0x1869
 memmap=64K$0x1869
 or
 memmap=0x1$0x1869
Some bootloaders may need an escape character
before '$',
like Grub2, otherwise '$' and the following number
will be eaten.


[PATCH v2 0/2] Make it possible to reserve memory on 64bit platform

2021-01-16 Thread Wesley Zhao
I was trying to reserve some memory to save logs incase that Android panic or 
hang and then
I can read the logs from QNX side from the memory reserved before on the 
Qualcomm 8155 hypervisor platform,
and I find the "reserve=" parameter only support 32bit,so I made some change 
and send these patches.

testcase:
I test on the qemu with some cmdline like[qemu-system-x86_64 -kernel 
linux-next/arch/x86_64/boot/bzImage
-hda ubuntu-system.ext4 -append "root=/dev/sda init=/bin/bash 
console=ttyS0 reserve=0x18000,0x123456"
-nographic] and check the /proc/iomem with 18000-180123455 : 
reserved.
And some other tests with the get_option with the parameter(-12345678) 
and so on

Wesley Zhao (2):
  lib/cmdline: add new function get_option_ull()
  resource: Make it possible to reserve memory on 64bit platform

 include/linux/kernel.h |  2 ++
 kernel/resource.c  |  6 ++--
 lib/cmdline.c  | 94 ++
 3 files changed, 85 insertions(+), 17 deletions(-)

-- 
2.7.4