From patchwork Wed Jun 19 20:59:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 805647 Delivered-To: patch@linaro.org Received: by 2002:a5d:508d:0:b0:362:4979:7f74 with SMTP id a13csp15011wrt; Wed, 19 Jun 2024 14:04:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV1uymlN6e+TulhPsIzPHg4FxYl8gX3w1EHaQNgdTnb6x9/CMCr0Ex/fQ6q0Pd7SCgm1DGB0ijJ5bxJ5g3h/eW8 X-Google-Smtp-Source: AGHT+IGv13rER5bfpdJWCBwefiIqNwsfwXgz06iGZFoRHNa1Mfmy2hklDXJL6nZxyEU8AgibH9dM X-Received: by 2002:a05:620a:1a9e:b0:795:5ca2:3742 with SMTP id af79cd13be357-79bb3e55929mr358290985a.34.1718831045767; Wed, 19 Jun 2024 14:04:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718831045; cv=none; d=google.com; s=arc-20160816; b=qwFVQZCEfmqRd8kGgYyRq6C/S/71B3FMtDTC4vod16QlxOGdMHBY7D5GTKzhld1CSy 2Qs/lqWtH9MwKF89bYdMDFZAYh6ZoXFv0hx8WxoXeVs4psg40hZVdT97T+9vOulekkgP vOfit5aAiTNVW2+I7BxDoV2gUUmLwvaV+VesrfNC5JdgZgvdLdfHXN7SO7OsHaq1xdPQ XmAq91HsSRoN7X6hhR9bLFDESvsGTHE2UGn4PsDLRQZfh2GCHWmJTWO+7F95X+zBtYqg JnLNYGaQqHIkgn9W4iTZRgUkd4WMzV/X3yuJHCBKt0wrTB2BN2t09UKftuEhCtNPjIFb HEmw== 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=kWCrz2KU8h744vxLguDhIrWWg2q5qa6M3b4q4pYmIRw=; fh=BVGnS8WLajkqYel2RhVPfl4Sswy7Qsiw9pHqIy9Wjhw=; b=pMGnE4BMn6ZDsrtE8ia8f8bDvHj/ed29roO7G/4KjSYR37IBTYBlt3bJ9uacNZoVg8 H1ogTTaioR/FJ7Ippyc8sPwF975xqZvmi6Fo0fzhksQi5x0bqHYCeS566uz/uJACInIF h3Pmw/+7s11JBSUT7IJizvVIFIWrgcxA/ZS2qOtiNncxqCQLr5GVHPeM1SsKiASNH9hL TEhcO9NP+X+vPWUr+An+ypQELM82ZBFmFilY7PG8+N8+fDjKJwHa5sOp3TxWO5qEhoLj chBZolazCHWppy7w3HHxYuumh3E3ExgcQsZCByxAU+ewEW62eW1bpIJmp84sZ7tNLDx/ +f0g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mBXKUZ1I; 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 af79cd13be357-798abd1d54fsi1519669385a.462.2024.06.19.14.04.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2024 14:04:05 -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=mBXKUZ1I; 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 1sK2Pj-0002ML-2Q; Wed, 19 Jun 2024 17:00: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 1sK2Ph-0002L9-1r for qemu-devel@nongnu.org; Wed, 19 Jun 2024 17:00:17 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sK2Pf-0000h9-6e for qemu-devel@nongnu.org; Wed, 19 Jun 2024 17:00:16 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1f6fabe9da3so1749825ad.0 for ; Wed, 19 Jun 2024 14:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718830813; x=1719435613; darn=nongnu.org; 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=kWCrz2KU8h744vxLguDhIrWWg2q5qa6M3b4q4pYmIRw=; b=mBXKUZ1I4lHVSJcaHvCDDCIQZSzQXEttWhrRkuewz7fa3Sm2YPMBPJ7QE9bfH9BudY /j1+KHwKZYRdUEozPD+926N5OGM9UDNkIy2U4OQ8opPXUkSYDOftftzWJu8MFgoY+lOo BFyekneKM2DG5en86zduLVmBoJxOLsbjo73mLn5r59KFTx3rOtj094QUTnOb0D2gOIH+ KI7wJMBZJOByEsYSuig1mNSO8QDCW+A5kTw5g/HmaRejv+eL5PEs96+gg6vaN+Q2mc5X 1Li6IorUHOnWKw1EAokqp32fl8xBqfMK9b9XvRIlN18RcThA7+RrvGyu4PZbsbb6fFDE chJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718830813; x=1719435613; 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=kWCrz2KU8h744vxLguDhIrWWg2q5qa6M3b4q4pYmIRw=; b=TB9KTh3vxC+RcefLNsWuO4dpbQ70mubqW8KqddP0ZIPbbMPIJJhaVOv9bV/NAIa4PZ WFbh/sZ3QP+EA5cgDeFo97f6iWk950qtt6F+7OmN5Z8VVeOWZAOkJy7YoZYL9bk24+Qy AzpB0ZVB9yNpeLYuiuTj/K4jym6ckXNPK5XsuhX/EQuqNxTE0B6WtKs81NUCKlfCOmps E7GHj9Kk/gsAD7q0PP36nSgB97rSbHtKiNAX8ofnGwxy9YWxYwZYZOn4equQ3k/uSor/ 6bpnuz2+Fstog55uOTvtngPn3HOtdRHiQY9xquT59eCJq24SVcZ9TZ3DsJEU5FfqUhxJ n1Ug== X-Gm-Message-State: AOJu0YyKe8T828iTOnflt566cjKj2bJ83R0mKLE3Vsh0ULTc1gXDfLbE WElK/OwimO6YvnTxxqqI0PCocpekPh+19TSe7rQu2J3s9PZ0ealG6nW9snYhoQlbOmzdiAgBfV4 s X-Received: by 2002:a17:902:fc4e:b0:1f9:c661:7b9 with SMTP id d9443c01a7336-1f9c661092amr6024045ad.42.1718830813126; Wed, 19 Jun 2024 14:00:13 -0700 (PDT) Received: from stoup.. ([71.212.132.216]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f98f8f8c42sm39183765ad.162.2024.06.19.14.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 14:00:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson , qemu-stable@nongnu.org, Manos Pitsidianakis , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PULL 21/24] accel/tcg: Fix typo causing tb->page_addr[1] to not be recorded Date: Wed, 19 Jun 2024 13:59:49 -0700 Message-Id: <20240619205952.235946-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240619205952.235946-1-richard.henderson@linaro.org> References: <20240619205952.235946-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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: Anton Johansson For TBs crossing page boundaries, the 2nd page will never be recorded/removed, as the index of the 2nd page is computed from the address of the 1st page. This is due to a typo, fix it. Cc: qemu-stable@nongnu.org Fixes: deba78709a ("accel/tcg: Always lock pages before translation") Signed-off-by: Anton Johansson Reviewed-by: Manos Pitsidianakis Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Message-Id: <20240612133031.15298-1-anjo@rev.ng> Signed-off-by: Richard Henderson --- accel/tcg/tb-maint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 19ae6793f3..cc0f5afd47 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -713,7 +713,7 @@ static void tb_record(TranslationBlock *tb) tb_page_addr_t paddr0 = tb_page_addr0(tb); tb_page_addr_t paddr1 = tb_page_addr1(tb); tb_page_addr_t pindex0 = paddr0 >> TARGET_PAGE_BITS; - tb_page_addr_t pindex1 = paddr0 >> TARGET_PAGE_BITS; + tb_page_addr_t pindex1 = paddr1 >> TARGET_PAGE_BITS; assert(paddr0 != -1); if (unlikely(paddr1 != -1) && pindex0 != pindex1) { @@ -745,7 +745,7 @@ static void tb_remove(TranslationBlock *tb) tb_page_addr_t paddr0 = tb_page_addr0(tb); tb_page_addr_t paddr1 = tb_page_addr1(tb); tb_page_addr_t pindex0 = paddr0 >> TARGET_PAGE_BITS; - tb_page_addr_t pindex1 = paddr0 >> TARGET_PAGE_BITS; + tb_page_addr_t pindex1 = paddr1 >> TARGET_PAGE_BITS; assert(paddr0 != -1); if (unlikely(paddr1 != -1) && pindex0 != pindex1) {