From patchwork Mon Jun 17 16:12:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 804891 Delivered-To: patch@linaro.org Received: by 2002:adf:fb90:0:b0:360:93e7:1765 with SMTP id a16csp628825wrr; Mon, 17 Jun 2024 09:13:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVOeXQLxXGvUtwzo0p1cUw3jKuCnqWEO40P2odm6xcGmhaHecszQ5uwbZ1RX0ST1Hdju+kLSc8fDikCLTylRmjN X-Google-Smtp-Source: AGHT+IEFl2jX/FXNdWWQnNeLo4JiieP5no02ykEQENu5UKTE8/niZCDZYLiSCTKk0Agq7kDG2kwI X-Received: by 2002:a9d:68d7:0:b0:6fb:fb0e:5160 with SMTP id 46e09a7af769-6fbfb0e5273mr10512459a34.7.1718640808885; Mon, 17 Jun 2024 09:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718640808; cv=none; d=google.com; s=arc-20160816; b=KwcmB9qVTXuiyhlLLKqA90klOWbndeeEmKTWlgfNoOiHmPAzDYxOP5Y9GyeLA8PTOS lY/1Q1Y0qd5dCTuAZ0/CvtnHojg3EqvoH+oC3wSyEMFk6mROHN1Ll3BtOIRdoBSgIgca iw0uFXx94c6EtB646GW41AAVq4xRCONUwhbpbd9Lkgm9HSa8ALen5e09ISmBHqm1q+fP Xxj8YB2WdpNCwCf0PGfGCn9i+4WEMp64zKKsdLyjRCnVXKfoGvHnGanaITRdVfYlSrCQ iwUDPhP+YKVkKveQ6XXNbxSdcaMMFFBYpNvre6m7plQjGdVD5mO5sL3nxkr9OPcPb98m qyIQ== 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=QTNFGS8vX+zjeGw3tiagWM4V6BogHHP8tAf3WNuhRt4=; fh=3mEp7FusppN5Drq2PN08R8D/9xXM9YdbtG5TkJxJBiE=; b=YPc2OcLzBr6ZT6ihmaOzRSAeaOlqWo0E2DkPCAtM2GceDoKwasfGfYQTcYvYrDAUyj exbFb0Vti8z0Qv+DoDgErAkNVocf8kovboiW4HC6UpvRqcUhPFFYt2nST2kn8eRLBi3O e8Oaz33XS7hlKgTx8mMkbGCTZM1QmWad483XoS0PfQWrNzskHH1dJpANOYJHp7T0D2ia lHmAeVVEkDl6dhGTbedMABKGtFMc5IS9oJuljE2CPg36SApKYylJPLRxO09jHkzCFYLz Sw/7A9JnfkrKwIVC78r4eXbY+a48OeEMTb3AYVXLvUD9bYq9BzrXIOq059zhhHiPBLzj GmQQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WrN4pQdH; 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 6a1803df08f44-6b2a5eaac24si101597866d6.606.2024.06.17.09.13.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Jun 2024 09:13:28 -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=WrN4pQdH; 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 1sJExx-0005E8-CZ; Mon, 17 Jun 2024 12:12:21 -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 1sJExu-0005DI-3y for qemu-devel@nongnu.org; Mon, 17 Jun 2024 12:12:18 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJExs-00089q-Gf for qemu-devel@nongnu.org; Mon, 17 Jun 2024 12:12:17 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1f480624d0fso32880765ad.1 for ; Mon, 17 Jun 2024 09:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718640733; x=1719245533; 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=QTNFGS8vX+zjeGw3tiagWM4V6BogHHP8tAf3WNuhRt4=; b=WrN4pQdHuflbOaFHjX/eIds0gyjBpdAwHMVIZ0CvKuHwuvLhPQDOv9h5bdBY7E8O76 PpT+oarg6/rNr5Jh+4SKehJ/QQ/bI9BjD+HR31KT9ZCzt8h/Hj7IPb2ftk8yZ91A+U5G 59L+1272YkYLJao+t7yLE/SDUD9j7zeNH3Bn+1jiD4byvZx61gXoOUg+pQaKDGuUzMnp dQQzto7jBio6H6AePDzOZmaALNs85pXJ/n2Hm+4S2Y8PLZ8IGmSZR4oddAQbWFbhSpuh W0vZLEd/EKvJfFrpuMNzs8J3maJik97Vxxrnwtd9+ToUMBCOu9YVCDPbX5hPR5LJ+Vgo FIQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718640733; x=1719245533; 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=QTNFGS8vX+zjeGw3tiagWM4V6BogHHP8tAf3WNuhRt4=; b=lpl1NHH//qFl6Wg+GXSFBBDw8kr5PriRdJnNAYInqFS6vIeTfJMVubcP265fDewUU6 sdSkBZDhXj6pWw7WHlQrpED+CjS34tggCXgrIkEZQVge5YlB9aShCQokTd4sxKgT4sLH Ov97G/oTYJXme/ezltHNYhwvJEDcJ1u3gUbOGDm/eYbt2XRaGtusAa/8Xw+OVDwTxuah AeQvyJFKSQeiL8feSGJcGE88QF0FuGJz28ezofPv2yeczMMpt86/5ipKnlksepaZLNsV MnLyN5kfMBVA+3xB92IwfrcygTB0n9AaOeAhYohZv+Ewr23AZIz7L4NmurhWU/nQJTxM AuWw== X-Gm-Message-State: AOJu0YyglZahS1gui7UstoIstJz7+hE7MeFgPcDF6bcDJDK8UoddaolY +8KDt6v+5dhopCr5zQgQ7ys6OLPGA1W+cj/MpJ7onWPY5kU7bQPrNDCOT9GwtCQaQ+tIuHSaOiJ f X-Received: by 2002:a17:902:c40f:b0:1f6:8157:b52f with SMTP id d9443c01a7336-1f8625c60a2mr115174255ad.8.1718640733455; Mon, 17 Jun 2024 09:12:13 -0700 (PDT) Received: from stoup.. ([71.212.132.216]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f855ee8317sm80829285ad.145.2024.06.17.09.12.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 09:12:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Subject: [PATCH 2/3] target/i386: Remove SEG_ADDL Date: Mon, 17 Jun 2024 09:12:09 -0700 Message-Id: <20240617161210.4639-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240617161210.4639-1-richard.henderson@linaro.org> References: <20240617161210.4639-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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 This truncation is now handled by MMU_*32_IDX, which is how this was working for PUSHW/POPW, which did not use SEG_ADDL. Signed-off-by: Richard Henderson --- target/i386/tcg/seg_helper.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index 715db1f232..8884d82b33 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -579,10 +579,6 @@ int exception_has_error_code(int intno) } while (0) #endif -/* in 64-bit machines, this can overflow. So this segment addition macro - * can be used to trim the value to 32-bit whenever needed */ -#define SEG_ADDL(ssp, sp, sp_mask) ((uint32_t)((ssp) + (sp & (sp_mask)))) - /* XXX: add a is_user flag to have proper security support */ #define PUSHW_RA(ssp, sp, sp_mask, val, ra) \ { \ @@ -593,7 +589,7 @@ int exception_has_error_code(int intno) #define PUSHL_RA(ssp, sp, sp_mask, val, ra) \ { \ sp -= 4; \ - cpu_stl_kernel_ra(env, SEG_ADDL(ssp, sp, sp_mask), (uint32_t)(val), ra); \ + cpu_stl_kernel_ra(env, (ssp) + (sp & (sp_mask)), (val), ra); \ } #define POPW_RA(ssp, sp, sp_mask, val, ra) \ @@ -604,7 +600,7 @@ int exception_has_error_code(int intno) #define POPL_RA(ssp, sp, sp_mask, val, ra) \ { \ - val = (uint32_t)cpu_ldl_kernel_ra(env, SEG_ADDL(ssp, sp, sp_mask), ra); \ + val = (uint32_t)cpu_ldl_kernel_ra(env, (ssp) + (sp & (sp_mask)), ra); \ sp += 4; \ }