On 12/17/2015 06:00 AM, Paolo Bonzini wrote:
x86_cpu_handle_mmu_fault is currently checking twice for writability
and executability of pages; the first time to decide whether to
trigger a page fault, the second time to compute the "prot" argument
to tlb_set_page_with_attrs.

Reorganize code so that first "prot" is computed, then it is used
to check whether to raise a page fault, then finally PROT_WRITE is
removed if the D bit will have to be set.

Signed-off-by: Paolo Bonzini<[email protected]>
---
  target-i386/helper.c | 65 +++++++++++++++++++---------------------------------
  1 file changed, 23 insertions(+), 42 deletions(-)

Reviewed-by: Richard Henderson <[email protected]>


r~

Reply via email to