From patchwork Mon Jul 2 16:05:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 938026 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="SGVPSy1w"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41KByt4CnCz9s2R for ; Tue, 3 Jul 2018 02:09:26 +1000 (AEST) Received: from localhost ([::1]:33989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa1OG-0006w8-7P for incoming@patchwork.ozlabs.org; Mon, 02 Jul 2018 12:09:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa1Kv-0004gH-Pw for qemu-devel@nongnu.org; Mon, 02 Jul 2018 12:06:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fa1Ku-0005RG-RM for qemu-devel@nongnu.org; Mon, 02 Jul 2018 12:05:57 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:44420) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fa1Ku-0005Qk-LF for qemu-devel@nongnu.org; Mon, 02 Jul 2018 12:05:56 -0400 Received: by mail-pf0-x244.google.com with SMTP id j3-v6so7715719pfh.11 for ; Mon, 02 Jul 2018 09:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CFbsIeZbs3j7ab2Zy+DvzMawS9IkD3pOZfIsc+sHoIc=; b=SGVPSy1wikf9SgKwbCepFRIKax2PVh63yNZvipA8xiGYkjv3HuY1gUuAq3JKsC0fEZ XRfL7ZV+F5m7uVIknOV1UcKORk7IaU5PrFFXJyAysD7x7hSx8SNI/E8PpKGBjqLMUkGM 75oog7OXQ6Xo0wOaT7Cok+QHf04GMwb4ObFTU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CFbsIeZbs3j7ab2Zy+DvzMawS9IkD3pOZfIsc+sHoIc=; b=sUhDJpuMTHL73os53vriywRwEWv4LIRdbxkhyTieORrCY+OY2aIexlGkK852Z/hA6o beYp6nBa1K5F9BuSxOGlQQbgfxMXzNazLTKJH/WoF6zYM4NnKA9fkvNZ0xawcmZPHrwY FV3y8Y3EcGfEE/fJysZ8nEvaQGt0afH3uYsOnFUe8+M4q/2MQuSw5fwXhiHTsF1Lc1Mq wC/ccwXdAtfeuO1I3YVqqRucPw/9+Y5nEkbr+QmyDzfR9UNzTJCo3AnWeY0YJVWkc4xy Mq83eC58b88mAQOCWDCwSOfp8LtJzgu4t1UgfaHuacyQI9UK5oLBAUc0WWxRy6DqBwDB FvxQ== X-Gm-Message-State: APt69E3QDAhyZC2W/3EaKoeouH1sIOakIwU5TmNx4pWcneXR99sEM9l4 ZnjPv6N9sufWAK0DgjwG9tcg70EyB2A= X-Google-Smtp-Source: AAOMgpfC/5yif9A3kyy5XBr7eJQ1r2QhOu8E/uD1UjCSlZ+00TxJfu0JP+o1cXeduqOaMeHp+WkNRg== X-Received: by 2002:a63:ad46:: with SMTP id y6-v6mr14905202pgo.144.1530547555498; Mon, 02 Jul 2018 09:05:55 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-112-211.tukw.qwest.net. [97.126.112.211]) by smtp.gmail.com with ESMTPSA id e17-v6sm38107002pfd.15.2018.07.02.09.05.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 09:05:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 2 Jul 2018 09:05:44 -0700 Message-Id: <20180702160546.31969-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180702160546.31969-1-richard.henderson@linaro.org> References: <20180702160546.31969-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PULL 4/6] accel/tcg: Don't treat invalid TLB entries as needing recheck X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell In get_page_addr_code() when we check whether the TLB entry is marked as TLB_RECHECK, we should not go down that code path if the TLB entry is not valid at all (ie the TLB_INVALID bit is set). Tested-by: Laurent Vivier Reported-by: Laurent Vivier Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell Message-Id: <20180629161731.16239-1-peter.maydell@linaro.org> Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 3ae1198c24..cc90a5fe92 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -963,7 +963,8 @@ tb_page_addr_t get_page_addr_code(CPUArchState *env, target_ulong addr) } } - if (unlikely(env->tlb_table[mmu_idx][index].addr_code & TLB_RECHECK)) { + if (unlikely((env->tlb_table[mmu_idx][index].addr_code & + (TLB_RECHECK | TLB_INVALID_MASK)) == TLB_RECHECK)) { /* * This is a TLB_RECHECK access, where the MMU protection * covers a smaller range than a target page, and we must