xen/x86: Question about alloc_domheap_page in pod code
Hi,
I was looking to the pod code (arch/x86/mm/p2m-pod.c) and noticed that the calls to alloc_domheap_page{s,} seems to take wrong parameter:
page = alloc_domheap_pages(d, order, PAGE_ORDER_4K);
p = alloc_domheap_page(d, PAGE_ORDER_4K);
AFAICT the last parameter is the memory flags and not the order so using PAGE_ORDER_4K is wrong. Am I right?
I don't know much x86, hence my question before sending a patch to fix it.
Regards,
Signature · 1 line
Julien Grall
Quoted 5 lines · Julien Grall
Hi,
I was looking to the pod code (
arch/x86/mm/p2m-pod.c) and noticed that the calls to alloc_domheap_page{s,} seems to take wrong parameter:
Quoted 8 lines
page =
alloc_domheap_pages(d, order, PAGE_ORDER_4K);p =
alloc_domheap_page(d, PAGE_ORDER_4K);AFAICT the last parameter is the memory flags and not the order so using
PAGE_ORDER_4Kis wrong. Am I right?I don't know much x86, hence my question before sending a patch to fix it.
You are completely correct. It is wrong.
It happens to function as PAGE_ORDER_4K is 0, and means "no memflag restrictions".
~Andrew
Quoted 13 lines · Andrew Cooper
Quoted 12 lines · Julien Grall
Hi,
I was looking to the pod code (
arch/x86/mm/p2m-pod.c) and noticed that the calls to alloc_domheap_page{s,} seems to take wrong parameter:page =
alloc_domheap_pages(d, order, PAGE_ORDER_4K);p =
alloc_domheap_page(d, PAGE_ORDER_4K);AFAICT the last parameter is the memory flags and not the order so using
PAGE_ORDER_4Kis wrong. Am I right?
Quoted 6 lines
Quoted 1 line
I don't know much x86, hence my question before sending a patch to fix it.
You are completely correct. It is wrong.
It happens to function as
PAGE_ORDER_4Kis 0, and means "no memflag restrictions".
+1
-George