Skip to contentSkip to conversation

Is this a data corruption bug for p2m_ram_shared page in hvm_hap_nested_page_fault()

DISCUSSION nai.xia 2 participants 4 messages Feb 2, 2012

lore
Share & tools
lore

nai.xia

author
#0 lore raw

Hi,

In hvm_hap_nested_page_fault(), it seems that all valid write faults are now handled by p2m_mem_access_check(), right? Then when will mem_sharing_unshare_page() be called? And if p2m->access_required == false, the access restrictions is cleared , then the data in this shared page could be corrupted by this page write access?

Thanks,

Nai

author
#1 lore raw
Quoted 5 lines · nai.xia

Hi,

In hvm_hap_nested_page_fault(), it seems that all valid write faults are now handled by p2m_mem_access_check(), right? Then when will mem_sharing_unshare_page() be called? And if p2m->access_required == false, the access restrictions is cleared

Oh, sorry, I notice that with p2m_ram_shared, the write permissions is always cleared. But, still, this seems cannot lead to the call of mem_sharing_unshare_page() and this write fault will happen again and again?

Thanks,

Nai

Quoted 6 lines

, then the data in this shared page could be corrupted by this page write access?

Thanks,

Nai

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 11 lines · nai.xia
Quoted 5 lines · nai.xia

In hvm_hap_nested_page_fault(), it seems that all valid write faults are now handled
by p2m_mem_access_check(), right? Then when will mem_sharing_unshare_page() be called? And if p2m->access_required == false, the access restrictions is cleared

Oh, sorry, I notice that with p2m_ram_shared, the write permissions is always cleared. But, still, this seems cannot lead to the call of mem_sharing_unshare_page() and this write fault will happen again and again?

There's an explicit call of mem_sharing_unshare_page() in hvm_hap_nested_page_fault(); the only thing that will skip that is if the fault is caused by a p2m_access violation, in which case we report the fault on the p2m_access ring and wait for the consumer of that ring to fix the problem.

Cheers,

Tim.

author
#3 lore raw
Quoted 13 lines · Tim Deegan
Quoted 11 lines · nai.xia
Quoted 5 lines · nai.xia

In hvm_hap_nested_page_fault(), it seems that all valid write faults are now handled
by p2m_mem_access_check(), right? Then when will mem_sharing_unshare_page() be called? And if p2m->access_required == false, the access restrictions is cleared

Oh, sorry, I notice that with p2m_ram_shared, the write permissions is always cleared. But, still, this seems cannot lead to the call of mem_sharing_unshare_page() and this write fault will happen again and again?

Quoted 5 lines

There's an explicit call of mem_sharing_unshare_page() in hvm_hap_nested_page_fault(); the only thing that will skip that is if the fault is caused by a p2m_access violation, in which case we report the fault on the p2m_access ring and wait for the consumer of that ring to fix the problem.

Oh, yes! I was mistaken that the write flag of p2m_access would also be removed for p2m_ram_shared pages just like entry->w in ept_set_entry(). I am clear about the role of the p2m_access_t now.

Thanks for the reply! :)

Regards,

Nai

Quoted 4 lines

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel