From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bee-0003eu-Mu for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:43:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9beZ-0005pB-Ns for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:43:48 -0500 Received: from mail-qg0-x230.google.com ([2607:f8b0:400d:c04::230]:33136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9beZ-0005p1-Iz for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:43:43 -0500 Received: by mail-qg0-x230.google.com with SMTP id k90so32441113qge.0 for ; Thu, 17 Dec 2015 08:43:43 -0800 (PST) Sender: Richard Henderson References: <1450360829-1955-1-git-send-email-pbonzini@redhat.com> From: Richard Henderson Message-ID: <5672E63B.6050003@twiddle.net> Date: Thu, 17 Dec 2015 08:43:39 -0800 MIME-Version: 1.0 In-Reply-To: <1450360829-1955-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-i386: do not duplicate page protection checks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: ehabkost@redhat.com 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 > --- > target-i386/helper.c | 65 +++++++++++++++++++--------------------------------- > 1 file changed, 23 insertions(+), 42 deletions(-) Reviewed-by: Richard Henderson r~