From patchwork Sat Jul 1 06:55:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 698308 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp813170wrs; Fri, 30 Jun 2023 23:56:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4yiCtzDD3NcNvHcJZ6MOzfbuLo5R3G1v8cG7L2f1et8FjbFYdvVzI2tVORr9rFOXzxexIw X-Received: by 2002:a05:620a:b57:b0:765:ada8:e939 with SMTP id x23-20020a05620a0b5700b00765ada8e939mr4920242qkg.28.1688194584733; Fri, 30 Jun 2023 23:56:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688194584; cv=none; d=google.com; s=arc-20160816; b=jRztaccHTvnDRCyXPe32RgfF9zWYBpXTiJpJQ2uow8F5gJ7zPUVKolkQP+/pR4j+Wk s4EFh6YNatxU26Yt2mIZpZLhVCgT53CL2C6hFgToPZ4kfppgDNicIkK186JkGg1H7w9w lRwQ0kpE1K0MgsKGRhyUGr00u6OgDVDXek2/9uXE2jxdXmFOeItXIN6ZvL0w98jaiirZ M3ZMH5IkNhSE+Kf0StlSIFbitIHbYQE2hrDikzOqTSsMstGU0UuANbRISa9l+jx/upvA w/+hbS0P71L/Vlpk83EQqTI4Or+ZW2zXUUGXpUZ9G3QkbAHBGBY9uiNirAs5gKvmkisJ whlg== 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=Fh8ll0z1/lWAw6IZ8VRZwP3jq46crriqiBekj/aaK3E=; fh=rYI8DiHAAFX3O5g969KmOAQ7d45Sb8OxQX1+DywGDk4=; b=Y+izgFOlXrvLxNvXC3BeM0FfT31rgyjkyEVvYHuOieGXk5n+nTY71dI1plO4hfiaL+ Ru1zdf08Lwc25BVGYmRNlh/P6TFSYbuoI11C3ZvvRctpsVc7KlToDnje784qinBcFH4j Vt8Yb+mtoLOoF9msF/evZl2Poy3k4W3G22mqjdJgr9bwUdNJ4cUhtv2wryMl6MmrJfC0 xDyP+koojh8lWOtUo4E/DO0py5uKn4xFE9+Lll6YrdBDw24lXvqfltYB/qF82I/CEZRE rv8YMwVDzIINvf4HQlyIlKdlSW7cxMexXUdZn2eJhNUjM1lJDnCZsHJT0mrn+Qvoorot fLmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mj4XliJD; 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 o18-20020a05620a2a1200b007672ac73968si5174243qkp.519.2023.06.30.23.56.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jun 2023 23:56:24 -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=mj4XliJD; 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 1qFUVr-0007Uf-O6; Sat, 01 Jul 2023 02:55:19 -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 1qFUVq-0007U0-Fz for qemu-devel@nongnu.org; Sat, 01 Jul 2023 02:55:18 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFUVo-0007Er-EY for qemu-devel@nongnu.org; Sat, 01 Jul 2023 02:55:18 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fbc77e769cso16615065e9.0 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=Fh8ll0z1/lWAw6IZ8VRZwP3jq46crriqiBekj/aaK3E=; b=mj4XliJDtCbPwsixJcrD1aSt+HPFMNM0RFuIozXeQY4jMjZvypXS7Pm6yP2CSTRNlA xC1ZgJjbpaRnrhV5AShZVKwx5V2aF3CNsjAXr+S9izLjDq0nSv0K3B0RbkJISA82qx75 o9tPqpAsAaVID/MDw8u+Q75u6Zo433saZxDlU4wBHbKpmbEx5hFve2rAuhXNfwfvXuGQ xW24JxXDBT+soQY0cDVmWkMwhad9obEL6WnM6b9d7/vaIdpSg9j6IBtd1xTkevdLpfRs IcbRXHQpn2cKGEshgYrZ7iu3PU4oK4gaqD7cD/S0arRKVHIh79scW0i0QUe0/PeDX1Zy TXKQ== 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=Fh8ll0z1/lWAw6IZ8VRZwP3jq46crriqiBekj/aaK3E=; b=hDbmPS0GEjGF641LXeWDnbmajxK7fQ0Gjg7WuKsAx4Y5KLjuYLwLboxtrmcWUS+mBm 8VrrsrV21sL2k9Sd6hx8vHquNfSLmTD5GvGxxmYvl2FXTrHWN28TSEBK2AJ0Sw2XGm4j kJ71KmRP29fbIw17iQywTOCLmanD/5rwOSLKOSITR0y6bJa3KcTzQt6YRxrycasiVMaQ B7Uerbq2W+GDlIktqsdA6PkmCtAI4EOLp1en0aH+/jSjFG04HXiGTzaw7A6oEPCNMUhZ 38q0+MjVUAWxe9aIatrtDyemftYaYKpfGcGiyjHVPqOsqNb7C4GzdsRPk0/S60HNCsvd iAzQ== X-Gm-Message-State: AC+VfDybDUBYrH2AgljoYhUwEf5HBeavAlyuHvccfr7UlXmJ7G/fvYWR 5s69l8EUG0vHkLG5XRbNx5mtcc5tx3b//Bcw1n4dOA== X-Received: by 2002:a1c:f702:0:b0:3fa:8866:14af with SMTP id v2-20020a1cf702000000b003fa886614afmr3822303wmh.14.1688194514617; Fri, 30 Jun 2023 23:55:14 -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:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 03/11] accel/tcg: Fix start page passed to tb_invalidate_phys_page_range__locked Date: Sat, 1 Jul 2023 08:55:02 +0200 Message-Id: <20230701065510.514743-4-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::32a; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x32a.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 Due to a copy-paste error in tb_invalidate_phys_range, the wrong start address was passed to tb_invalidate_phys_page_range__locked. Correct is to use the start of each page in turn. Signed-off-by: Mark Cave-Ayland Fixes: e506ad6a05 ("accel/tcg: Pass last not end to tb_invalidate_phys_range") Message-Id: <20230629082522.606219-2-mark.cave-ayland@ilande.co.uk> Signed-off-by: Richard Henderson --- accel/tcg/tb-maint.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 3541419845..33ea1aadd1 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -1182,15 +1182,17 @@ void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t last) index_last = last >> TARGET_PAGE_BITS; for (index = start >> TARGET_PAGE_BITS; index <= index_last; index++) { PageDesc *pd = page_find(index); - tb_page_addr_t bound; + tb_page_addr_t page_start, page_last; if (pd == NULL) { continue; } assert_page_locked(pd); - bound = (index << TARGET_PAGE_BITS) | ~TARGET_PAGE_MASK; - bound = MIN(bound, last); - tb_invalidate_phys_page_range__locked(pages, pd, start, bound, 0); + page_start = index << TARGET_PAGE_BITS; + page_last = page_start | ~TARGET_PAGE_MASK; + page_last = MIN(page_last, last); + tb_invalidate_phys_page_range__locked(pages, pd, + page_start, page_last, 0); } page_collection_unlock(pages); }