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: 140823 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp128866ljj; Mon, 2 Jul 2018 09:10:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf41axSLqtFwjMwCaLQKixnRamsaglzGweKN1Ch38+k5RJ6jmxRzlJkWZZJS+IlUVRCaOtp X-Received: by 2002:ae9:e105:: with SMTP id g5-v6mr10467492qkm.264.1530547846904; Mon, 02 Jul 2018 09:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530547846; cv=none; d=google.com; s=arc-20160816; b=AYfU7CXxJYG0paK+un8DE138aowCXJzmrIiOCJl4l300ShaSnbIpNrOwLDb+2BmcVo +Zq8bGw7K6oE+FS7W0oiDkGuNBo1Wg9tK0EJHeSS0+mG8PEICoNpRqinPiB6J9TZUJI+ sVOpa/Tj3vEVB55Rk7/FrRocugEGV/aOGXPBIwfOUP1wxzIjlXqXu6lROp732K6I6UL7 xHgsJnLRRi/hgQczR7Oua/uoFuw05K7n3ZJBnePGim2u7YPX/ZORJ/5IoYlhKtylQA2R u5VcwUxEIg4r4wbktXXjI3Z9pgmm14AnoG1xA2/T+sDxuWrOODs6RjlmUUa2aYbCI2// g8Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=CFbsIeZbs3j7ab2Zy+DvzMawS9IkD3pOZfIsc+sHoIc=; b=ZzncalwcT9ArV4Iw5nkv5Wf91dJt9ShUgLdeHwXykIK46ihDgzxBOWdNT+I7EuJIrO PfwAG4iayTf0eWeoY66htVzkZOB84h/t1z/POdG8YjK25IoAdGoMsHLMAdnTHlHi5hcU mjMszChjegOCWeIi/KPqKyhH/AoRTNMNxBoR2m7xB6bWsacJu0/6fwLkr6uQVBTOAESU obnuB5ZI8ZiCem9hqyNl/Zo/3BCZaRBERsp6kJbngSROrtU9+DFyXsjyEg4GoHZtLpt7 hq9o54tyHIC/x51H2O9sBA1IyNmRGlFy/uz1cT2JRxKsJlVUXYW8+E4Gs/4gj6T9mG4/ OzIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SGVPSy1w; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f187-v6si6796925qkc.374.2018.07.02.09.10.46 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 02 Jul 2018 09:10:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SGVPSy1w; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa1Pa-0007av-Dq for patch@linaro.org; Mon, 02 Jul 2018 12:10:46 -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-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+patch=linaro.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(-) -- 2.17.1 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