From patchwork Sat Jul 1 06:55:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 698313 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp813227wrs; Fri, 30 Jun 2023 23:56:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlGHD552dcBydTSYtSkcLwUVhfdecOVZolNECdfhyUc289D+cz8wdHHqdWQFkmCskgbQkmLO X-Received: by 2002:a05:6214:124c:b0:5f7:a9e1:bbbf with SMTP id r12-20020a056214124c00b005f7a9e1bbbfmr6842151qvv.44.1688194603402; Fri, 30 Jun 2023 23:56:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688194603; cv=none; d=google.com; s=arc-20160816; b=zIMuplRb772J/CPqs45oRFAmL6iYV6mjTd3HaXa1cgUlD1TsMRHTPlhQAL/ri/pBbV YNfed5jfuqWLy2S6O3NS8mSKinIMGhiM6uNIdtIJTneDOZKlPUwWd+A+dq2aokGa1/nt f3ELsNCjFKQTi78acGMVGwSkphM5hVfRCHg0ml/Y5XmyPyR5r6+xKJ3P4P/yUlIMgtum C0fcfcBAne2Kel2mj4fSuVYsNh2HU51ulder2JmVNoq8Fe+mHRtdR8e4TFzELaV5GFPh 9OJ3Ojsof43aZD/oKKrcFewBbYBZKaeEpDGklRRMI77qTN/FIG+2EfrwhvUsV5r5ROrM 9HrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=guLrkyvnxpE2Di61jdSFFK1pil20iWnpknoQn5xGxP4=; fh=J4M4Z4TZxvAT8lkmK1LtxqMjpO7Qiod4IMBL2bk0hxA=; b=QQaK3lqat656+qb85CaWTnAgq98m9gN3oCBOxuz5hLWzpuiR8AGmMgYbNoTTPKi0la hZgpiyTFUO2+0k1UK6fdq25HAjv9kcsG+tXFuLAXWYdMpEb0z1cuPKBEeuWLUdv8ASpM eG8CIBFbLwK0rmB63kXx0YgZz+tNKlWQP/CAuoB74ZPXlWgIkeJYG90UEtvNKTD87M2e 1vTdiXWtExSZRUZZanky6WDxTn4ljnA2/HCNEsZfQiIlPHyceBI759vUwOcNt64S45Kd M0gAmfuQcNzOV5Oxg7AjAmmsZJg6QGD+8eMYtHowzGwyOX2W/DFaXHs5qyDHKv/uJ7pF KQcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FvKPMtka; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dv4-20020ad44ee4000000b0057104cd4825si9139498qvb.68.2023.06.30.23.56.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 23:56:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FvKPMtka; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFUVs-0007Ui-0x; Sat, 01 Jul 2023 02:55:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFUVr-0007UV-1d for qemu-devel@nongnu.org; Sat, 01 Jul 2023 02:55:19 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFUVp-0007Ex-7H for qemu-devel@nongnu.org; Sat, 01 Jul 2023 02:55:18 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fbc59de009so20388975e9.3 for ; Fri, 30 Jun 2023 23:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688194515; x=1690786515; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=guLrkyvnxpE2Di61jdSFFK1pil20iWnpknoQn5xGxP4=; b=FvKPMtkac/boNy3/r1tm2aIAobRFpgPHT93iGO6YkmhwpTzvNcxwpgt/C+IRhHaiK/ rB2t91xQ/8TeCfxDbd6MBXVwQNPa2C5Inj0WQj8h5LfCWwR40HSWGKy9wwuidUC6Oxv4 ANcHuxOzRNZ0f3l++bsBL4sfWhto+NfD5PimOR9fC9orcjxabdZlB0ZMD1q66QNOxt31 h1apDS/MfveZwLkdY2tht2EAU3m1UhtajodRNhewRCDuuN5gmFIYxc74RIXbtWfUlK0e cYQqCRZcFPea/KrN4VPRDtp2GqdZUkrmNK5SbbboXDPS6bid8qQRJNvukYGqBGmapti3 /GfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688194515; x=1690786515; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=guLrkyvnxpE2Di61jdSFFK1pil20iWnpknoQn5xGxP4=; b=UOu4QsZHR+B9x9GuBAeU3LuhHwZdByID3wVH4M0EDtO2Lcxiql1BMrB4TjFybk4+/K XxiH8iOUcreegVMqLRr7Gd8omz768/pYV8LOH6z790Cd3S811dYqcflhyc6zenLT1w0S SRXd9Py2DXkAuMeHK6wV2wDaxfM96+Nvcx2TtpgMLZL3Utm90l12MS0CVeim9+wXc/No sfWNZDOIOjn4j6Gy8NFBKKT90G5HkNxqWq+VQpPVN2HOtFvG6avn/eqfv/peQAH+hQUf TQhLiBrpqCFpKkvQM1YeKThJAFFmKGeD41b1xtU5W9Tq+ryrdFgMMhDs/Fgx3s+hKusF u3eA== X-Gm-Message-State: AC+VfDxLoEb+oIO0yMadkjeNk+K3xuo/8ybBJKY545IpxOmSSDAgQeoc qysMdsEYZV4ln9HWtqokNOoZW9sIgHjFCnxMmwnjMg== X-Received: by 2002:a05:600c:2292:b0:3f8:fc2a:c7eb with SMTP id 18-20020a05600c229200b003f8fc2ac7ebmr3381081wmf.5.1688194515409; Fri, 30 Jun 2023 23:55:15 -0700 (PDT) Received: from localhost.localdomain ([139.47.41.96]) by smtp.gmail.com with ESMTPSA id w10-20020a1cf60a000000b003f9bd9e3226sm20874918wmc.7.2023.06.30.23.55.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 23:55:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PULL 04/11] accel/tcg: Assert one page in tb_invalidate_phys_page_range__locked Date: Sat, 1 Jul 2023 08:55:03 +0200 Message-Id: <20230701065510.514743-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230701065510.514743-1-richard.henderson@linaro.org> References: <20230701065510.514743-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Mark Cave-Ayland Ensure that that both the start and last addresses are within the same guest page. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230629082522.606219-3-mark.cave-ayland@ilande.co.uk> [rth: Use tcg_debug_assert, simplify the expression] Signed-off-by: Richard Henderson --- accel/tcg/tb-maint.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 33ea1aadd1..9566224d18 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -1092,6 +1092,9 @@ tb_invalidate_phys_page_range__locked(struct page_collection *pages, TranslationBlock *current_tb = retaddr ? tcg_tb_lookup(retaddr) : NULL; #endif /* TARGET_HAS_PRECISE_SMC */ + /* Range may not cross a page. */ + tcg_debug_assert(((start ^ last) & TARGET_PAGE_MASK) == 0); + /* * We remove all the TBs in the range [start, last]. * XXX: see if in some cases it could be faster to invalidate all the code