Re: [PATCH 2/6] KVM MMU: fix kvm_mmu_zap_page() and its calling path

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Xiao Guangrong
Date: Monday, April 12, 2010 - 2:22 am

Hi Avi,

Avi Kivity wrote:


If we destroyed the next point, hlist_for_each_entry_safe() is unsafe.

List hlist_for_each_entry_safe()'s code:

|#define hlist_for_each_entry_safe(tpos, pos, n, head, member) 		 \
|	for (pos = (head)->first;					 \
|	     pos && ({ n = pos->next; 1; }) && 				 \
|		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
|	     pos = n)

if n is destroyed:
'pos = n, n = pos->next'
then it access n again, it's unsafe/illegal for us.

Xiao
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/6] KVM MMU: remove unused struct, Xiao Guangrong, (Mon Apr 12, 12:59 am)
[PATCH 4/6] KVM MMU: optimize for writing cr4, Xiao Guangrong, (Mon Apr 12, 1:03 am)
[PATCH 5/6] KVM MMU: reduce kvm_mmu_page size, Xiao Guangrong, (Mon Apr 12, 1:05 am)
[PATCH 6/6] KVM MMU: optimize synchronization shadow pages, Xiao Guangrong, (Mon Apr 12, 1:06 am)
Re: [PATCH 4/6] KVM MMU: optimize for writing cr4, Avi Kivity, (Mon Apr 12, 1:34 am)
Re: [PATCH 5/6] KVM MMU: reduce kvm_mmu_page size, Avi Kivity, (Mon Apr 12, 1:36 am)
Re: [PATCH 2/6] KVM MMU: fix kvm_mmu_zap_page() and its ca ..., Xiao Guangrong, (Mon Apr 12, 2:22 am)
Re: [PATCH 4/6] KVM MMU: optimize for writing cr4, Xiao Guangrong, (Mon Apr 12, 3:42 am)
Re: [PATCH 5/6] KVM MMU: reduce kvm_mmu_page size, Xiao Guangrong, (Mon Apr 12, 4:11 am)
Re: [PATCH 4/6] KVM MMU: optimize for writing cr4, Avi Kivity, (Mon Apr 12, 4:22 am)
Re: [PATCH 4/6] KVM MMU: optimize for writing cr4, Xiao Guangrong, (Mon Apr 12, 8:07 pm)
Re: [PATCH 4/6] KVM MMU: optimize for writing cr4, Avi Kivity, (Mon Apr 12, 11:42 pm)