From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rn90Y-0005a4-6c for qemu-devel@nongnu.org; Tue, 17 Jan 2012 08:23:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rn90S-00009c-Cw for qemu-devel@nongnu.org; Tue, 17 Jan 2012 08:23:26 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:37155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rn90S-00008w-4C for qemu-devel@nongnu.org; Tue, 17 Jan 2012 08:23:20 -0500 From: Peter Maydell Date: Tue, 17 Jan 2012 13:23:13 +0000 Message-Id: <1326806593-21785-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] exec.c: Clarify comment about tlb_flush() flush_global parameter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexander Graf , =?UTF-8?q?=E9=99=B3=E9=9F=8B=E4=BB=BB?= , patches@linaro.org 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 --- 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; -- 1.7.1