Skip to contentSkip to conversation

About getting guest pfn number from virtual address

DISCUSSION Ming Liu 2 participants 2 messages Oct 11, 2012

lore
Share & tools
lore

Ming Liu

author
#0 lore raw

Hi,
I find that the shadow page fault entry function is : sh_page_fault.
It has three parameters: struct vcpu *v, unsigned long va and struct cpu_user_regs *regs.

I have two questions here:
1. The "unsigned long va" means the virtual address of the guest?
2. How can I get the physical frame number (PFN) from this va variable? Thanks.

Best,

#1 lore raw
Quoted 6 lines · Ming Liu

Hi,
I find that the shadow page fault entry function is : sh_page_fault.
It has three parameters: struct vcpu *v, unsigned long va and struct cpu_user_regs *regs.

I have two questions here:
1. The "unsigned long va" means the virtual address of the guest?

Yes. Yes, it is.

Quoted 1 line

2. How can I get the physical frame number (PFN) from this va variable?

Did you read the rest of that function? Among other things, it finds the GFN and MFN of the faulting address.

Tim.