From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axJw9-0007hz-LG for qemu-devel@nongnu.org; Mon, 02 May 2016 15:55:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axJvy-0000Mf-0n for qemu-devel@nongnu.org; Mon, 02 May 2016 15:55:16 -0400 Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]:35450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axJvw-0000Fn-20 for qemu-devel@nongnu.org; Mon, 02 May 2016 15:55:09 -0400 Received: by mail-lf0-x22b.google.com with SMTP id j8so68217667lfd.2 for ; Mon, 02 May 2016 12:54:53 -0700 (PDT) From: Sergey Fedorov Message-ID: <5727B088.1090400@gmail.com> Date: Mon, 2 May 2016 22:54:48 +0300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------020209020406000709020004" Subject: [Qemu-devel] tcg: How CPUState::current_tb is used? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Cc: =?UTF-8?Q?Alex_Benn=c3=a9e?= , Paolo Bonzini , Richard Henderson , Blue Swirl , Riku Voipio This is a multi-part message in MIME format. --------------020209020406000709020004 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi, I can't figure out how this field is used. The comment says it's "Currently executing TB", but actually it's the first TB in a chain of TBs executed. Grep shows the only place it is really checked is tb_invalidate_phys_page_range(). That code seems to be introduced long ago in: commit ea1c18022edd0e2c45552d6fc2da6e15a3486b33 Author: bellard Date: Mon Jun 14 18:56:36 2004 +0000 fixed self modifying code in case of asynchronous interrupt I suspect it's only related to user emulation. But I would appreciate if someone could give me an idea of how this really works :) Thanks, Sergey --------------020209020406000709020004 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Hi,

I can't figure out how this field is used. The comment says it's "Currently executing TB", but actually it's the first TB in a chain of TBs executed. Grep shows the only place it is really checked is tb_invalidate_phys_page_range(). That code seems to be introduced long ago in:

commit ea1c18022edd0e2c45552d6fc2da6e15a3486b33
Author: bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Date:   Mon Jun 14 18:56:36 2004 +0000

    fixed self modifying code in case of asynchronous interrupt

I suspect it's only related to user emulation. But I would appreciate if someone could give me an idea of how this really works :)

Thanks,
Sergey
--------------020209020406000709020004--