From patchwork Wed Oct 18 12:33:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 116283 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6016130qgn; Wed, 18 Oct 2017 05:37:54 -0700 (PDT) X-Received: by 10.200.48.103 with SMTP id g36mr2718514qte.289.1508330274865; Wed, 18 Oct 2017 05:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330274; cv=none; d=google.com; s=arc-20160816; b=uNURSNjuJna011frgXeLnsmYlrya2VM5arI4t4BdiAVWWUtM0baB+oHFhoIySg2SDh Ev2VoCwXqVyzIPwAIWp6rkPFNqMvgyDBSN6TulQZQbEleM29cZ55G0h8HjjJECe2jAM7 2qomRta0fR5GLWJdpsoNds+2/MXmaytQEuRqpkHkV6mgxhtVw+7uQgNsAqPhJVSxnmPz +CVPzvwyd8Nhh97Ov4uCGpS4KN/3iBKgKStxN7Kh0P2dynUdi5h5T6HbjD79TMyz7pJn pXoclRLsmyja/+lFJrkvL9X0N0J+TwxNaBoK37QoOarKXh3j0kFmgD0zCAQcsDww7V7z /gzw== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=/g52S3gQHjUWSaEKKe6eKfm3KBTEVMilKCG42SLZ9IY=; b=UD/stFS3AEbH0CFi0fTBY1IjO9TpeB0F0niiN6cWLDKOW+FfqP3X1PbnMTecJ0W0ze FLeGxTwoC/nWDNWwsRiQaOrMteR6Eqm9LwpL20km2GwRMa49pZd5JN5OA0JuzCHJ5KTj T2tzyGD82zUNFjPYsCN5p/JOBHWTMLrHR6DqZSu9UlerbLX99lgYi/5d1G7L2Byinonx xNG28iFNL+4f/wdJmBIOlYsJZRH19BOM3m1wkbtO5Tkud+QQNYgVZo6Tqusi3BPfsfTD uAO4TUTj4I0WxWnfnPtMohsJEvo8XVAoIG3t0VqO2d6Gq6ANt7YwIMm9rBJSJF/+Njen NNag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iolxd6Ki; 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 h42si10751440qta.91.2017.10.18.05.37.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:37:54 -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=iolxd6Ki; 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]:44445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nbc-0008Df-Pw for patch@linaro.org; Wed, 18 Oct 2017 08:37:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXV-0005Cq-F7 for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXU-0003wR-JL for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:37 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:48470) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXU-0003w8-BB for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:36 -0400 Received: by mail-lf0-x243.google.com with SMTP id a69so5627118lfe.5 for ; Wed, 18 Oct 2017 05:33:36 -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 :mime-version:content-transfer-encoding; bh=/g52S3gQHjUWSaEKKe6eKfm3KBTEVMilKCG42SLZ9IY=; b=iolxd6KiEKBM1O8tzHZkMijJHN/TVPgv7cFZyCkhFSM1nghPKsHD/Bbjgm3EAtvQrE nMS+5ZgRI6Da7SkFhDumwf7A88IqusdUD7hyRauKMfvFJn9Eigyd9gv6gMrRrvhubmnW h0RmdMylsa76MixQg7gEgKzKST1YfdPVeC5Ic= 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:mime-version:content-transfer-encoding; bh=/g52S3gQHjUWSaEKKe6eKfm3KBTEVMilKCG42SLZ9IY=; b=OmDfzpnjRqkFJYx70WG3FbgvJzUyp4m5989H5BdE7zlAjcqZaKk168iyTfoNHE2x/i 3D6P8qVhdgDmjlBEzU8Pc7jmdC7z6mlTIa3xDjgHZMbYgNpHmgeV6nGuuJEC3XcoesY3 L8WVSvna5Q2ZsKtkb3vHISbDJVji6XmvImiO8vRfgQ3om5xmkAOx3Wr6mUBM3p4n6zax RskkY6nvsyGcvi/e9y5plt4vv03oONpeCj0a0ZPmTseFAnpnAoFbyvMF+qVOeqOdX8c9 wZUO7iwLjUZQc6bhJGHgjetkHt99HfdiW9zCECvM4vRQM3l+lzra2w01i2aWwKSNwc/e m0oA== X-Gm-Message-State: AMCzsaVaQc1r4N/yTIsWx9CcZQA4pHUupoEOePasTV/OGfI9v2aj5hqS J1gp/c30CEirWDFh9z3iKIeJ9JbZxdg= X-Google-Smtp-Source: ABhQp+RbptEvSMg1e3lkJogwcqnnEAbnuAfVR3XMUD4sxWU0XE2PuccvGye2VioRCm4bmxtpm11DeQ== X-Received: by 10.46.19.18 with SMTP id 18mr2630918ljt.141.1508330014639; Wed, 18 Oct 2017 05:33:34 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:33 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:19 +0300 Message-Id: X-Mailer: git-send-email 2.14.2 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: [Qemu-devel] [PULL 05/10] tcg: Fix off-by-one in assert in page_set_flags 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: Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Most of the users of page_set_flags offset (page, page + len) as the end points. One might consider this an error, since the other users do supply an endpoint as the last byte of the region. However, the first thing that page_set_flags does is round end UP to the start of the next page. Which means computing page + len - 1 is in the end pointless. Therefore, accept this usage and do not assert when given the exact size of the vm as the endpoint. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20170708025030.15845-2-rth@twiddle.net> Signed-off-by: Riku Voipio --- accel/tcg/translate-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.14.2 diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index c5ce99d549..1b43deb0cd 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -2114,7 +2114,7 @@ void page_set_flags(target_ulong start, target_ulong end, int flags) guest address space. If this assert fires, it probably indicates a missing call to h2g_valid. */ #if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS - assert(end < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS)); + assert(end <= ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS)); #endif assert(start < end); assert_memory_lock();