From patchwork Sat Oct 1 14:09:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 611366 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp224379pvb; Sat, 1 Oct 2022 07:29:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4lmjTQOvuVCdPILr7LqZChTmAyJXfd8JSJ51k1LgY00RNLR+MckyyzWes/GeE15Zt6ZtoA X-Received: by 2002:a05:620a:22db:b0:6ce:4e82:5cc7 with SMTP id o27-20020a05620a22db00b006ce4e825cc7mr9555288qki.29.1664634597340; Sat, 01 Oct 2022 07:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664634597; cv=none; d=google.com; s=arc-20160816; b=d/yN1SjrycHwuzmvotP/vyukWY4iiRd/IKQCRiVWpEArLqsUlnmvzDS2LbFPIFh4Gb KvCOyeJdNFQbh4sHq6G63YJrVpgk8zqvC5KJpW2apzZOk6sOxnuN2NfaLQVgLE0bWMDc B2q9aZNSmbUfg0deARwCRk02+cC6TI48n9sAAFImFgrWxonZHGJMV+vLaCQSZ6vtBIiy pQyWHd6fJ7d6kvOWkGg1JIBeOtp3Lfq+hIINjD9adlMgHp3sWbb/2//vO5KxUjqiC52x Bl6WUC9KkUpqQZSe84H21s7euP0G75TyK5D3AcIXYMfUjs8LrBY9N/dvHcOGm6jnr77s nsFg== 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=AZ0dGRYodrffbhoE2FtdP+WtEJ39nROJL21LulCmqEM=; b=CCxVw+QzkRQWzkV/pfcbq5ktbmBlLpXxCN2167aeMVgo3UTS7x66nev1OGgEk6mvfM dK2qEsF4OACcrkNcHPjhTgEAv2jtK0rsrinoRLSRjYm5FWPK5u1rERYsk43FhUtGHsiL F6fqDs3j8ISFL/F4aB+n5ctaPyv9Xd8MSyO8wD54ongeDgPpOacB/iQgmMQ3Ag2z6fbm xXXoDqUIimayDiNlw0Bc39OuvOO9gt+XerZgiAyEbGiedf/38Tl4ppAm1rMjU4lGoQnX dovyI0Ks9yIONjKA/C918Lrkju+HKWJnpPQPKdYYT3AXRzuLN0dRB47DvLRSLBViIXhh 4t/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U6wVHHvk; 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 h5-20020a0562140da500b004aaa653517fsi2788511qvh.232.2022.10.01.07.29.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Oct 2022 07:29:57 -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=U6wVHHvk; 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]:51116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oedV6-0000dU-My for patch@linaro.org; Sat, 01 Oct 2022 10:29:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oedC5-0002uq-7v for qemu-devel@nongnu.org; Sat, 01 Oct 2022 10:10:17 -0400 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]:36819) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oedC3-0004Di-EA for qemu-devel@nongnu.org; Sat, 01 Oct 2022 10:10:16 -0400 Received: by mail-qk1-x72f.google.com with SMTP id i3so4421547qkl.3 for ; Sat, 01 Oct 2022 07:10:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=AZ0dGRYodrffbhoE2FtdP+WtEJ39nROJL21LulCmqEM=; b=U6wVHHvkwSJwOztpGLZng6521uiEeqNsOsZ5yOYvfxJM5GbX9aRcPCQA2sHerwy8FI ktuw7r0eWo2bQyauDkAkFeo9ysAJ7qIML64mAWvQ64F+6l6Cu/trL1ISRk8T+zN0Ac03 PM3+BJUgCx/YkDHV3+faMHFHov9s9JPyqExBORU8Ug+u/gmZQfd57UK9kod5K5bu+Mvs TOzjDDKyypXRELdZ77wquUztpDrAqpQu3peNXD+KPYLZ7mXVdhYhLHaducjoWzXpipkY 1Zu9kBNZ9W8cjNLD9I6d5Cf1RdecrhycF0SH17uTRtZpJpCnOvWtq5at4yAYNNYblbmN 3cbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=AZ0dGRYodrffbhoE2FtdP+WtEJ39nROJL21LulCmqEM=; b=OZqeaYW4jF5U+ulZvF/zZVv8XJ4sRRu7H0tgTLxTjoScofn23cq8ICjHNuIe4Con9w s3rdc9cRGEIWnDDma0LZZkrPhQhNGgYEayF0iIiC2fdpRMyoqNNf9moE8RGFh/VYxeoT s1JfJAmhMuVy+y/yRJ0KPwnYl7WO+4FzGATTRDy6yiiD+XhFDon9zqzcC7UkrVQlOfNw t+uoALGcU4707zuQwwaJzjffSLN+wUYElWDi/1a3GVrbQXh3iJCyEC9YAGGkid0Nl2Q6 d5db5nPz0D87+p8vFURh9gep1XmTjgTXT+ptrn5PO2fcvD7Vuh/BP9hCmQh/SEJoLGGz dwwQ== X-Gm-Message-State: ACrzQf1otfUzsvJAC+d1RWZvGN9C+Xm2pB1rWf9niukxjAB7Q3zT8ABz i577Thl5uPNcuooQt7b8q5/i0e9knYVeUb8T X-Received: by 2002:a05:620a:12f0:b0:6ce:4076:a80e with SMTP id f16-20020a05620a12f000b006ce4076a80emr9470857qkl.541.1664633414545; Sat, 01 Oct 2022 07:10:14 -0700 (PDT) Received: from stoup.. ([2605:ef80:8080:8162:afc7:8362:2616:ac15]) by smtp.gmail.com with ESMTPSA id j16-20020a05620a289000b006b615cd8c13sm6075914qkp.106.2022.10.01.07.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Oct 2022 07:10:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Subject: [PATCH v3 14/26] target/i386: Truncate values for lcall_real to i32 Date: Sat, 1 Oct 2022 07:09:23 -0700 Message-Id: <20221001140935.465607-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221001140935.465607-1-richard.henderson@linaro.org> References: <20221001140935.465607-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::72f; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x72f.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 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" Use i32 not int or tl for eip and cs arguments. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/helper.h | 2 +- target/i386/tcg/seg_helper.c | 6 ++---- target/i386/tcg/translate.c | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/target/i386/helper.h b/target/i386/helper.h index ac3b4d1ee3..39a3c24182 100644 --- a/target/i386/helper.h +++ b/target/i386/helper.h @@ -37,7 +37,7 @@ DEF_HELPER_2(lldt, void, env, int) DEF_HELPER_2(ltr, void, env, int) DEF_HELPER_3(load_seg, void, env, int, int) DEF_HELPER_4(ljmp_protected, void, env, int, tl, tl) -DEF_HELPER_5(lcall_real, void, env, int, tl, int, int) +DEF_HELPER_5(lcall_real, void, env, i32, i32, int, i32) DEF_HELPER_5(lcall_protected, void, env, int, tl, int, tl) DEF_HELPER_2(iret_real, void, env, int) DEF_HELPER_3(iret_protected, void, env, int, int) diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index bffd82923f..539189b4d1 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -1504,14 +1504,12 @@ void helper_ljmp_protected(CPUX86State *env, int new_cs, target_ulong new_eip, } /* real mode call */ -void helper_lcall_real(CPUX86State *env, int new_cs, target_ulong new_eip1, - int shift, int next_eip) +void helper_lcall_real(CPUX86State *env, uint32_t new_cs, uint32_t new_eip, + int shift, uint32_t next_eip) { - int new_eip; uint32_t esp, esp_mask; target_ulong ssp; - new_eip = new_eip1; esp = env->regs[R_ESP]; esp_mask = get_sp_mask(env->segs[R_SS].flags); ssp = env->segs[R_SS].base; diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 7db6f617a1..1aa5b37ea6 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -5346,7 +5346,8 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) tcg_const_tl(s->pc - s->cs_base)); } else { tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); - gen_helper_lcall_real(cpu_env, s->tmp2_i32, s->T1, + tcg_gen_trunc_tl_i32(s->tmp3_i32, s->T1); + gen_helper_lcall_real(cpu_env, s->tmp2_i32, s->tmp3_i32, tcg_const_i32(dflag - 1), tcg_const_i32(s->pc - s->cs_base)); }