[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 4/4] i386/hvf: Fixes dirty memory tracking by page granula
From: |
Roman Bolshakov |
Subject: |
Re: [PATCH v2 4/4] i386/hvf: Fixes dirty memory tracking by page granularity RX->RWX change |
Date: |
Mon, 6 Nov 2023 14:23:13 +0530 |
On Sat, Oct 21, 2023 at 10:05:18PM +0200, Phil Dennis-Jordan wrote:
> When using x86 macOS Hypervisor.framework as accelerator, detection of
> dirty memory regions is implemented by marking logged memory region
> slots as read-only in the EPT, then setting the dirty flag when a
> guest write causes a fault. The area marked dirty should then be marked
> writable in order for subsequent writes to succeed without a VM exit.
>
> However, dirty bits are tracked on a per-page basis, whereas the fault
> handler was marking the whole logged memory region as writable. This
> change fixes the fault handler so only the protection of the single
> faulting page is marked as dirty.
>
> (Note: the dirty page tracking appeared to work despite this error
> because HVF’s hv_vcpu_run() function generated unnecessary EPT fault
> exits, which ended up causing the dirty marking handler to run even
> when the memory region had been marked RW. When using
> hv_vcpu_run_until(), a change planned for a subsequent commit, these
> spurious exits no longer occur, so dirty memory tracking malfunctions.)
>
> Additionally, the dirty page is set to permit code execution, the same
> as all other guest memory; changing memory protection from RX to RW not
> RWX appears to have been an oversight.
>
Hi Phil, I don't observe a problem with SVGA if I apply CPU kick patch
on top of it. Thanks for fixing this,
Reviewed-by: Roman Bolshakov <roman@roolebo.dev>
Tested-by: Roman Bolshakov <roman@roolebo.dev>
Regards,
Roman
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v2 4/4] i386/hvf: Fixes dirty memory tracking by page granularity RX->RWX change,
Roman Bolshakov <=