From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YICht-0004xm-Bq for qemu-devel@nongnu.org; Mon, 02 Feb 2015 03:50:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIChq-0000Bl-5O for qemu-devel@nongnu.org; Mon, 02 Feb 2015 03:50:09 -0500 Received: from mail-la0-f41.google.com ([209.85.215.41]:39277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIChp-00009W-UY for qemu-devel@nongnu.org; Mon, 02 Feb 2015 03:50:06 -0500 Received: by mail-la0-f41.google.com with SMTP id gm9so38539147lab.0 for ; Mon, 02 Feb 2015 00:50:05 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <54CF37BD.3020605@greensocs.com> References: <1421428797-23697-1-git-send-email-fred.konrad@greensocs.com> <1421428797-23697-3-git-send-email-fred.konrad@greensocs.com> <54CF37BD.3020605@greensocs.com> From: Peter Maydell Date: Mon, 2 Feb 2015 08:49:44 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [RFC 02/10] use a different translation block list for each cpu. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Frederic Konrad Cc: mttcg@listserver.greensocs.com, "J. Kiszka" , Mark Burton , QEMU Developers , Alexander Graf , Paolo Bonzini On 2 February 2015 at 08:39, Frederic Konrad wrote: > On 29/01/2015 16:24, Peter Maydell wrote: >> >> On 16 January 2015 at 17:19, wrote: >>> >>> From: KONRAD Frederic >>> >>> We need a different TranslationBlock list for each core in case of >>> multithread >>> TCG. >>> >>> Signed-off-by: KONRAD Frederic >>> --- >>> translate-all.c | 40 ++++++++++++++++++++++------------------ >>> 1 file changed, 22 insertions(+), 18 deletions(-) >>> >>> diff --git a/translate-all.c b/translate-all.c >>> index 8fa4378..0e11c70 100644 >>> --- a/translate-all.c >>> +++ b/translate-all.c >>> @@ -72,10 +72,11 @@ >>> #endif >>> >>> #define SMC_BITMAP_USE_THRESHOLD 10 >>> +#define MAX_CPUS 256 >>> >>> typedef struct PageDesc { >>> /* list of TBs intersecting this ram page */ >>> - TranslationBlock *first_tb; >>> + TranslationBlock *first_tb[MAX_CPUS]; >> >> Do we really need to know this for every CPU, or just for >> the one that's using this PageDesc? I am assuming we're going to make >> the l1_map be per-CPU. > > > Do we have any clue of which cpu is using this PageDesc? If you're making the l1_map per-CPU then the PageDescs you get to from that l1_map are for that CPU. Basically my (possibly naive) view of the PageDesc struct is that it's just the leaf descriptors for the l1_map, and the l1_map has to be per-CPU (because it's a virtual-address-space indexed data structure). So I think if you have a PageDesc you know already which CPU it relates to, because you got it from that CPU thread's l1_map. -- PMM