From patchwork Sat Apr 27 15:57:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 792666 Delivered-To: patch@linaro.org Received: by 2002:adf:cc13:0:b0:346:15ad:a2a with SMTP id x19csp973369wrh; Sat, 27 Apr 2024 08:57:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXXaDm3/xrCqdtQDPPOhXIFRDayISvEvOToxf/IWvFx/97qIEp0pnwm7StsIhgiHOrppGxqdHosNgf5RKo9Kdyb X-Google-Smtp-Source: AGHT+IEWM59Nw5CfKU3faqs1Gm3dGfqGhkleOTQSMW7A36vxhtH68rCRixLM2UclExU+KsrzrDyR X-Received: by 2002:a25:9d88:0:b0:dcf:f9bd:fe05 with SMTP id v8-20020a259d88000000b00dcff9bdfe05mr5952733ybp.48.1714233477850; Sat, 27 Apr 2024 08:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714233477; cv=none; d=google.com; s=arc-20160816; b=ltdVnhL6YymB2H5tT2Wag4EKcs640OpHyoARILmcs4Hcy5Vm+koByvwETDOgd+Kwz6 COkzy6NCfUXDjj2U+a6jCJAwXHI9Y254LU22CiACP6jA+aovOiurSbsAwt7t9t6oSpfb crY5QKiu9mwa7C9PPIbTjFFWcXFHH1ZJwBsqfoNHFmC+TBSFgvgkPL5LuXi9YliQv61P Goiizi5Au4ju6BrR6VKiYFGRJsjTEJX7ODXbYXqczLzirvljStJhhnZpbSHczUIj8GKo XWz0qpyUVdxHayqzaJc/MieI3eB4qRWcy9KxkbXB1btbBhbvU1nrz0s/z4CE+xJuiU4X esyw== 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=9YCHViXrIvsiDzRF1J1rW6k7RCjgqLKR+ps9Q4CzIQQ=; fh=ZXDWg7hKG7Hj19AbRuutTLw+Zvn/B9RsGUUw/YagpFI=; b=Bxxq8h6qUfx1KEGwAAPrsBrSYEFnlXB8GRU6f1DIrlGsBZwrBpmlvd5nAePdiGKl// RORpuH/lamoWznq4jKy4TIF6PF7zg6UoiYew0sxFKn/qgxIwbhwM2wXa3Os/gNfQS4+o RYR+RCSdna2m2RvV9b0x3KPlCQ9hUIuAwRCb2bYopoADP+M4kDf91U44BMxBUsMKwPwz 8tyFQDC1eTd732/LaPEFU4D7m+fR5bpv8W1bqB3QjaJiVsuuHQctg8fdnd2S92YguSWi L8aJ9wGUp+bJwbg2MyYpYvOf2VYlKxwVZhh7ItSPUZzqqdYomnyySKhDOQiQmxe1C10S dzIw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="CkY/JMTh"; 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 ew11-20020a05622a514b00b00437c0ce6da1si21124175qtb.694.2024.04.27.08.57.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Apr 2024 08:57: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="CkY/JMTh"; 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 1s0kQa-0002gq-M4; Sat, 27 Apr 2024 11:57:28 -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 1s0kQY-0002g0-Ir for qemu-devel@nongnu.org; Sat, 27 Apr 2024 11:57:26 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s0kQW-0005Ib-S8 for qemu-devel@nongnu.org; Sat, 27 Apr 2024 11:57:26 -0400 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2df9af57b5eso13349151fa.2 for ; Sat, 27 Apr 2024 08:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714233443; x=1714838243; 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=9YCHViXrIvsiDzRF1J1rW6k7RCjgqLKR+ps9Q4CzIQQ=; b=CkY/JMTh2NJIoU7Gr6hidQKc1gbD14HXWIg22szKaX43oKbjIVg7nnnE8D5STxQOSc PbR+6dN1nXuis5KFkwCKzEya06aauO18Pw/b50pfM6kDjO5zpmdo1xQyK4+p1PfjqSBT R5vo9sxZeUi58hNqfCGcBQqHNCZs27EVmjfHdJy6zIuJc5KmWLoGQY68Rwn74/KLm1R+ TXk+FYzM8zPQR4Z1iqEKhNwt6+TwreTQd9cUEUulKni8NmDSWLkZscxfgc71XGcWROyA wAOrSU/cNIs2Pd74P5uEOo/mvEcA1OIvlgjVhoOYdiPVx1MjW3+VZX8a+tm0f+7rD23X NSwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714233443; x=1714838243; 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=9YCHViXrIvsiDzRF1J1rW6k7RCjgqLKR+ps9Q4CzIQQ=; b=w5T7eYvaBip2f4LfqWtEnuySnGOpPf2mcRw7jFmMvjJmhf54CzOWyg5C0RQpl2ljx/ Vr2taiun+TWjTUdakIYvDnvUJ7VO4erYJqly6u1dn+1PCVlYD7A1Y5zODRukI338tD2s 6QzE5cmuxEPME+Q0JfPvurnbHG3IjI8wzz742B+CzmOL3fW6fmyobivZdrjr9tIc6AwM ou4dLVggecHsQ8x2H2vIPoZRdw6X9VB2bu27LjTa9xT8cealTst+Fex1vd1NnJ+1rvEM uEMhtV0G7vk+VeMCDM2jh06pRl1QVtVj/rUYTZCW7XIMwb7u57Uj5FsdJSNbGbuVMNTm 2bzg== X-Gm-Message-State: AOJu0Yxc93MOFtvo3IhRG6pD0HMo/TMiit4gmUGCGV1TbGyWBUVNWDY8 RIyCmA7+bgN+f8QeMIHQuCCv9WsnitafXqk2O8sCOE//dykJmGe2Ydv1TA0TdgGMt8Q5Aru55Tc o+Zo= X-Received: by 2002:a05:651c:199e:b0:2df:81a1:70fa with SMTP id bx30-20020a05651c199e00b002df81a170famr3663020ljb.20.1714233442651; Sat, 27 Apr 2024 08:57:22 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.2]) by smtp.gmail.com with ESMTPSA id p14-20020a05600c1d8e00b0041bab13cd74sm4957207wms.17.2024.04.27.08.57.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 27 Apr 2024 08:57:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH 01/14] target/i386: Simplify get_memio_eip() Date: Sat, 27 Apr 2024 17:57:01 +0200 Message-ID: <20240427155714.53669-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240427155714.53669-1-philmd@linaro.org> References: <20240427155714.53669-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=philmd@linaro.org; helo=mail-lj1-x236.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-bounces+patch=linaro.org@nongnu.org The single call to get_memio_eip(), in cpu_report_tpr_access(), is protected by a check on tcg_enabled(). Since the call only exists when CONFIG_TCG is defined, we can slightly simplify. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/helper.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/i386/helper.c b/target/i386/helper.c index 23ccb23a5b..a3e70a630a 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -512,9 +512,9 @@ void cpu_x86_inject_mce(Monitor *mon, X86CPU *cpu, int bank, } } +#ifdef CONFIG_TCG static inline target_ulong get_memio_eip(CPUX86State *env) { -#ifdef CONFIG_TCG uint64_t data[TARGET_INSN_START_WORDS]; CPUState *cs = env_cpu(env); @@ -528,10 +528,8 @@ static inline target_ulong get_memio_eip(CPUX86State *env) } else { return data[0] - env->segs[R_CS].base; } -#else - qemu_build_not_reached(); -#endif } +#endif void cpu_report_tpr_access(CPUX86State *env, TPRAccess access) {