From patchwork Tue Jan 17 13:23:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 6256 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 227E323E0E for ; Tue, 17 Jan 2012 13:23:21 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 06EEDA18707 for ; Tue, 17 Jan 2012 13:23:21 +0000 (UTC) Received: by bkbzt4 with SMTP id zt4so1661417bkb.11 for ; Tue, 17 Jan 2012 05:23:20 -0800 (PST) Received: by 10.204.10.73 with SMTP id o9mr1209312bko.99.1326806600729; Tue, 17 Jan 2012 05:23:20 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs118648bkc; Tue, 17 Jan 2012 05:23:20 -0800 (PST) Received: by 10.180.73.72 with SMTP id j8mr17540787wiv.2.1326806599374; Tue, 17 Jan 2012 05:23:19 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id u2si12555819weq.118.2012.01.17.05.23.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Jan 2012 05:23:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1Rn90L-0005fo-AK; Tue, 17 Jan 2012 13:23:13 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Alexander Graf , =?UTF-8?q?=E9=99=B3=E9=9F=8B=E4=BB=BB?= Subject: [PATCH] exec.c: Clarify comment about tlb_flush() flush_global parameter Date: Tue, 17 Jan 2012 13:23:13 +0000 Message-Id: <1326806593-21785-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 Clarify the comment about tlb_flush()'s flush_global parameter, so it is clearer what it does and why it is OK that the implementation currently ignores it. Signed-off-by: Peter Maydell Reviewed-by: Andreas Färber --- Minor clarification following a conversation on IRC... exec.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 7f9f730..f667cf0 100644 --- a/exec.c +++ b/exec.c @@ -1876,8 +1876,18 @@ static CPUTLBEntry s_cputlb_empty_entry = { .addend = -1, }; -/* NOTE: if flush_global is true, also flush global entries (not - implemented yet) */ +/* NOTE: + * If flush_global is true (the usual case), flush all tlb entries. + * If flush_global is false, flush (at least) all tlb entries not + * marked global. + * + * Since QEMU doesn't currently implement a global/not-global flag + * for tlb entries, at the moment tlb_flush() will also flush all + * tlb entries in the flush_global == false case. This is OK because + * CPU architectures generally permit an implementation to drop + * entries from the TLB at any time, so flushing more entries than + * required is only an efficiency issue, not a correctness issue. + */ void tlb_flush(CPUState *env, int flush_global) { int i;