Skip to contentSkip to conversation

xen/x86: Question about alloc_domheap_page in pod code

DISCUSSION Julien Grall 3 participants 3 messages Oct 22, 2015

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw
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_4K is 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

#2 lore raw
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_4K is 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_4K is 0, and means "no memflag restrictions".

+1

-George