From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXa2d-0007cj-Bp for qemu-devel@nongnu.org; Fri, 17 Jun 2011 10:29:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXa2a-00077e-9V for qemu-devel@nongnu.org; Fri, 17 Jun 2011 10:28:59 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:42991) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXa2Z-00077H-Oh for qemu-devel@nongnu.org; Fri, 17 Jun 2011 10:28:55 -0400 Received: by pzk30 with SMTP id 30so1991636pzk.4 for ; Fri, 17 Jun 2011 07:28:54 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4d014871a007ddf2a7da0fe1b1a1647b6ad887cf.1307014902.git.quintela@redhat.com> References: <4d014871a007ddf2a7da0fe1b1a1647b6ad887cf.1307014902.git.quintela@redhat.com> Date: Fri, 17 Jun 2011 12:38:30 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 09/14] exec: last_first_tb was only used in !ONLY_USER case List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On 2 June 2011 12:53, Juan Quintela wrote: > Once there, use a better variable name. > > Signed-off-by: Juan Quintela Reviewed-by: Peter Maydell > --- > =C2=A0exec.c | =C2=A0 10 +++++++--- > =C2=A01 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/exec.c b/exec.c > index 8529390..4b1afec 100644 > --- a/exec.c > +++ b/exec.c > @@ -1208,12 +1208,16 @@ static inline void tb_alloc_page(TranslationBlock= *tb, > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned int n, tb_page_addr_t= page_addr) > =C2=A0{ > =C2=A0 =C2=A0 PageDesc *p; > - =C2=A0 =C2=A0TranslationBlock *last_first_tb; > +#ifndef CONFIG_USER_ONLY > + =C2=A0 =C2=A0bool page_already_protected; > +#endif > > =C2=A0 =C2=A0 tb->page_addr[n] =3D page_addr; > =C2=A0 =C2=A0 p =3D page_find_alloc(page_addr >> TARGET_PAGE_BITS, 1); > =C2=A0 =C2=A0 tb->page_next[n] =3D p->first_tb; > - =C2=A0 =C2=A0last_first_tb =3D p->first_tb; > +#ifndef CONFIG_USER_ONLY > + =C2=A0 =C2=A0page_already_protected =3D p->first_tb !=3D NULL; > +#endif > =C2=A0 =C2=A0 p->first_tb =3D (TranslationBlock *)((long)tb | n); > =C2=A0 =C2=A0 invalidate_page_bitmap(p); > > @@ -1249,7 +1253,7 @@ static inline void tb_alloc_page(TranslationBlock *= tb, > =C2=A0 =C2=A0 /* if some code is already present, then the pages are alre= ady > =C2=A0 =C2=A0 =C2=A0 =C2=A0protected. So we handle the case where only th= e first TB is > =C2=A0 =C2=A0 =C2=A0 =C2=A0allocated in a physical page */ > - =C2=A0 =C2=A0if (!last_first_tb) { > + =C2=A0 =C2=A0if (!page_already_protected) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 tlb_protect_code(page_addr); > =C2=A0 =C2=A0 } > =C2=A0#endif > -- > 1.7.5.2 > > > --=20 123456789012345678901234567890123456789012345678901234567890123456789012345= 67890 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 1 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 3 =C2=A0 =C2=A0 =C2=A0 =C2=A0 4 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 5 =C2=A0 =C2=A0 =C2=A0 =C2=A0 6 =C2=A0 =C2=A0 =C2=A0 =C2=A0 7 =C2=A0= =C2=A0 =C2=A0 =C2=A0 8