Re: [PATCH] kvm: rework remove-write-access for a slot

2010-06-06 Thread Avi Kivity
On 06/04/2010 11:14 AM, Lai Jiangshan wrote: - I thought of a different approach to write protection: write protect the L4 sptes, on write fault add write permission to the L4 spte and write protect the L3 sptes that it points to, etc. This method can use the slot bitmap to reduce the number

Re: [PATCH] kvm: rework remove-write-access for a slot

2010-06-04 Thread Lai Jiangshan
Avi Kivity wrote: On 06/02/2010 11:53 AM, Lai Jiangshan wrote: Current code uses slot_bitmap to find ptes who map a page from the memory slot, it is not precise: some ptes in the shadow page are not map any page from the memory slot. This patch uses rmap to find the ptes precisely, and

Re: [PATCH] kvm: rework remove-write-access for a slot

2010-06-04 Thread Marcelo Tosatti
On Fri, Jun 04, 2010 at 04:14:08PM +0800, Lai Jiangshan wrote: Avi Kivity wrote: On 06/02/2010 11:53 AM, Lai Jiangshan wrote: Current code uses slot_bitmap to find ptes who map a page from the memory slot, it is not precise: some ptes in the shadow page are not map any page from the

[PATCH] kvm: rework remove-write-access for a slot

2010-06-02 Thread Lai Jiangshan
Current code uses slot_bitmap to find ptes who map a page from the memory slot, it is not precise: some ptes in the shadow page are not map any page from the memory slot. This patch uses rmap to find the ptes precisely, and remove the unused slot_bitmap. Signed-off-by: Lai Jiangshan

Re: [PATCH] kvm: rework remove-write-access for a slot

2010-06-02 Thread Avi Kivity
On 06/02/2010 11:53 AM, Lai Jiangshan wrote: Current code uses slot_bitmap to find ptes who map a page from the memory slot, it is not precise: some ptes in the shadow page are not map any page from the memory slot. This patch uses rmap to find the ptes precisely, and remove the unused