linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [QUESTION] arm64: mmap to the hugetlbfs with hugepagesize=512M got SIGILL
@ 2021-06-01  9:34 Yongqiang Liu
  2021-06-01 15:00 ` David Hildenbrand
  0 siblings, 1 reply; 3+ messages in thread
From: Yongqiang Liu @ 2021-06-01  9:34 UTC (permalink / raw)
  To: catalin.marinas, will.deacon
  Cc: linux-arm-kernel, linux-mm, liuyongqiang13, wangkefeng.wang

Hi Catalin and Will,

when we mmap the addr NULL with MAP_FIXED flag to the hugetlbfs, system 
will return NULL successfully.

My question is: Why mmap to file with the hugepagesize=512M  we got 
SIGILL but mmap to the file with hugepagesize=2M we got a success ? Here 
is my test steps:

     1. echo 10 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

         echo 10 > /sys/kernel/mm/hugepages/hugepages-524288kB/nr_hugepages

     2. mount none /mnt -t tmpfs

     3. mkdir /mnt/huge1

         mkdir /mnt/huge2

     4. mount none /mnt/huge1 -t hugetlbfs -o pagesize=512MB

         mount none /mnt/huge2 -t hugetlbfs -o pagesize=2MB

     5. test_case.c

         ... ...

         fd = open("/mnt/huge1/file", O_RDWR | O_CREAT, 0777);

         addr = mmap(NULL, hugepagesize, PROT_READ|PROT_WRITE|PROT_EXEC, 
MAP_PRIVATE | MAP_FIXED, fd, 0);

         ... ...

The result is , mmap to the /mnt/huge1/file will got a success while 
mmap to the /mnt/huge2/file will got SIGILL. Meanwile, we have found 
that the kernel return the address NULL success but set the variable failed.

Here is the pc when SIGILL occured:

         4009bc:   97ffff7d    bl  4007b0 <mmap@plt>

pc->4009c0:   aa0003e1    mov x1, x0



Kind regards,

Yongqiang Liu



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [QUESTION] arm64: mmap to the hugetlbfs with hugepagesize=512M got SIGILL
  2021-06-01  9:34 [QUESTION] arm64: mmap to the hugetlbfs with hugepagesize=512M got SIGILL Yongqiang Liu
@ 2021-06-01 15:00 ` David Hildenbrand
  2021-06-02  1:33   ` Yongqiang Liu
  0 siblings, 1 reply; 3+ messages in thread
From: David Hildenbrand @ 2021-06-01 15:00 UTC (permalink / raw)
  To: Yongqiang Liu, catalin.marinas, will.deacon
  Cc: linux-arm-kernel, linux-mm, wangkefeng.wang

On 01.06.21 11:34, Yongqiang Liu wrote:
> Hi Catalin and Will,
> 
> when we mmap the addr NULL with MAP_FIXED flag to the hugetlbfs, system
> will return NULL successfully.
> 
> My question is: Why mmap to file with the hugepagesize=512M  we got
> SIGILL but mmap to the file with hugepagesize=2M we got a success ? Here
> is my test steps:
> 
>       1. echo 10 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
> 
>           echo 10 > /sys/kernel/mm/hugepages/hugepages-524288kB/nr_hugepages

Which values do you get when you read back these knobs?


-- 
Thanks,

David / dhildenb


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [QUESTION] arm64: mmap to the hugetlbfs with hugepagesize=512M got SIGILL
  2021-06-01 15:00 ` David Hildenbrand
@ 2021-06-02  1:33   ` Yongqiang Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Yongqiang Liu @ 2021-06-02  1:33 UTC (permalink / raw)
  To: David Hildenbrand, catalin.marinas, will.deacon
  Cc: linux-arm-kernel, linux-mm, wangkefeng.wang


在 2021/6/1 23:00, David Hildenbrand 写道:
> On 01.06.21 11:34, Yongqiang Liu wrote:
>> Hi Catalin and Will,
>>
>> when we mmap the addr NULL with MAP_FIXED flag to the hugetlbfs, system
>> will return NULL successfully.
>>
>> My question is: Why mmap to file with the hugepagesize=512M  we got
>> SIGILL but mmap to the file with hugepagesize=2M we got a success ? Here
>> is my test steps:
>>
>>       1. echo 10 > 
>> /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
>>
>>           echo 10 > 
>> /sys/kernel/mm/hugepages/hugepages-524288kB/nr_hugepages
>
> Which values do you get when you read back these knobs?
>
> 10. I forgot that the selinux should be disabled or mmap return failed 
> with error code 13.


Thanks,

Yongqiang Liu



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-02  1:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01  9:34 [QUESTION] arm64: mmap to the hugetlbfs with hugepagesize=512M got SIGILL Yongqiang Liu
2021-06-01 15:00 ` David Hildenbrand
2021-06-02  1:33   ` Yongqiang Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).