From patchwork Wed May 19 18:30:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 442498 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1597756jac; Wed, 19 May 2021 11:56:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWi8sThjGVk3Tz2ZxPMX5ERrtDLNZuBoK0uZrXTMBioLI0wdqDp17XIk3R6sNMEGa0AKtL X-Received: by 2002:a05:6e02:19ce:: with SMTP id r14mr583387ill.4.1621450614853; Wed, 19 May 2021 11:56:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621450614; cv=none; d=google.com; s=arc-20160816; b=sZqElYbBTW8Gksyk9GBdZnNRS4YgNIfpW9QlRtdGFTRIfX6BskPCi0mthCMtzi+h69 rZ8LkW5DqD6Da0CMhDMLdCc5rRYUc1CGQTdVDOormtNyZyfCJu2RgXC1anlJPsM7guTS DAQDrFr/+ZUPaadkjSz1a7PePUA38XE07bKu8kyulyrwurFBuePISqx6yeNAGt11L7z9 3GPmV6VYW7lJFV8Yo3LH9ZxUFgja2gY/6bOzeocWJJ3XZXLWpawHxVqbXf7sWEuOmnwL NtpFTY4OaixT9B7QLcI+WLvHPimycZyblWDk4axmzRZFYg8C5Dt99HPx/XvjKwV+EvrS P7YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=o+bSpPqvUS5hXLbtWM0XfAjDH/PGAEYXlkUYshXGyEo=; b=Q59I7n+aER2apiUAw1LIQ3LrDB9fA2lOaS29zWFKHMvmH6kMclBRebm2LtWixA1R+w 8skkTco0o+zvFz28kY9RgD3s5am94JYzw0QBCrCcxxKpsvFLJfHb79wkCY29hqLMRqc5 SppF7xpzrVuk+QoKlH7G+3x0VwR53I1NHP/UU42i6VzF9HL+JM13PEwoOvA5a0Qq9g6m ybXAdrMogScgeC9OL/TuMwHkNBMQ6Gg1QrUZswZJu/q9fFKrY+7bl/FMI694NcxaSkU2 iQv1IicQwCtY62tv2Rw+U7O1RarY5fmGLGOMd3GzA4AaJSwTXvUeRaj38DuxmYu+IcW6 fSEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mj9CiSl3; 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 a13si478120ilf.41.2021.05.19.11.56.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 May 2021 11:56:54 -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=Mj9CiSl3; 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]:56408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljRNG-0006zi-AD for patch@linaro.org; Wed, 19 May 2021 14:56:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljQyu-0004Yv-T2 for qemu-devel@nongnu.org; Wed, 19 May 2021 14:31:44 -0400 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]:33299) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ljQyh-0005pA-4X for qemu-devel@nongnu.org; Wed, 19 May 2021 14:31:44 -0400 Received: by mail-ot1-x333.google.com with SMTP id i23-20020a9d68d70000b02902dc19ed4c15so12662099oto.0 for ; Wed, 19 May 2021 11:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o+bSpPqvUS5hXLbtWM0XfAjDH/PGAEYXlkUYshXGyEo=; b=Mj9CiSl30M5SrX+Hfe73nhCiqAVlYMbRoQrPasxPO7N4Uy+sYMmInR+3mV/BITZ+yU OL2E6V9fHo2QVCgZTtuBZqkIXngysrJRs6VilPfbQKjtEm7g41HRiW62lJu+5WsIPTjw utqVAFT2cOWHDP8Iw7I65K8ZBWzUQT7FSvM0xAuLXY/3xnkaShCokqM63t/6qPAX9Uef rZ+++G+jdkrJLKMObKCgz4GRthb45fc6oAvAH/5eNgRlI3ZWufAjY43FM9KxG9B/YN7H zq5HZ8m/bn6ZC53vojAhY3v8H3VXg7t5TBf5wIG7r69aywHZg38XG2AKnSemk+BvSUie SBnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o+bSpPqvUS5hXLbtWM0XfAjDH/PGAEYXlkUYshXGyEo=; b=dWS2s7Ck4zQrfWspKT56UXyCFQeRSS6myctWLZ360XIVtT8uOH8Mg7kYgWMrn3NlK/ 2PjtFLpnFJAmD9NYGuNq+8HkW0Y2U5eECD/BWcd0cu7tNXl9Lpk0aA7cM9g+W/jd7pAT RrhrfqwLBOPrTnLGwjSQ38fN1w9A5kiTuj/C37dmqY/rb9LC4KbukHcnyUn5nIRTrsTP VmaBiq/8LV0mv5j5e1A4FJtPVj8Ll3R4lFaWkJK+agtpfz8bElEOrgG+1WTesMLamR9W eTxt5XCY6qqEt5F10CKc1ScRYC7k1Cphu090cRa5nDXM/aJftGRQ2KTEDy55ktY9ytGZ Hr7A== X-Gm-Message-State: AOAM5326eIu5vGt47ZpcIoEL4MNaEEh4q3Wesw6h6Z4M15jRONiHQ08J 8sV7JxdgowMwCGhtvhCmlc6wOXDmzfmRVEQi X-Received: by 2002:a9d:6c47:: with SMTP id g7mr645929otq.67.1621449087801; Wed, 19 May 2021 11:31:27 -0700 (PDT) Received: from localhost.localdomain ([45.235.253.15]) by smtp.gmail.com with ESMTPSA id l9sm28428oou.43.2021.05.19.11.31.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 11:31:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 36/50] target/i386: Tidy svm_check_intercept from tcg Date: Wed, 19 May 2021 13:30:36 -0500 Message-Id: <20210519183050.875453-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210519183050.875453-1-richard.henderson@linaro.org> References: <20210519183050.875453-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::333; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x333.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Paolo Bonzini Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The param argument to helper_svm_check_intercept_param is always 0; eliminate it and rename to helper_svm_check_intercept. Fold gen_svm_check_intercept_param into gen_svm_check_intercept. Signed-off-by: Richard Henderson Reviewed-by: Paolo Bonzini Message-Id: <20210514151342.384376-37-richard.henderson@linaro.org> --- target/i386/helper.h | 2 +- target/i386/tcg/sysemu/svm_helper.c | 5 ++--- target/i386/tcg/translate.c | 16 ++++------------ 3 files changed, 7 insertions(+), 16 deletions(-) -- 2.25.1 diff --git a/target/i386/helper.h b/target/i386/helper.h index f794d1c7c7..86484a4ec4 100644 --- a/target/i386/helper.h +++ b/target/i386/helper.h @@ -107,7 +107,7 @@ DEF_HELPER_2(inl, tl, env, i32) #ifndef CONFIG_USER_ONLY DEF_HELPER_FLAGS_4(bpt_io, TCG_CALL_NO_WG, void, env, i32, i32, tl) -DEF_HELPER_3(svm_check_intercept_param, void, env, i32, i64) +DEF_HELPER_2(svm_check_intercept, void, env, i32) DEF_HELPER_4(svm_check_io, void, env, i32, i32, i32) DEF_HELPER_3(vmrun, void, env, int, int) DEF_HELPER_1(vmmcall, void, env) diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c index 79c73d67af..b431016e72 100644 --- a/target/i386/tcg/sysemu/svm_helper.c +++ b/target/i386/tcg/sysemu/svm_helper.c @@ -506,10 +506,9 @@ void cpu_svm_check_intercept_param(CPUX86State *env, uint32_t type, } } -void helper_svm_check_intercept_param(CPUX86State *env, uint32_t type, - uint64_t param) +void helper_svm_check_intercept(CPUX86State *env, uint32_t type) { - cpu_svm_check_intercept_param(env, type, param, GETPC()); + cpu_svm_check_intercept_param(env, type, 0, GETPC()); } void helper_svm_check_io(CPUX86State *env, uint32_t port, uint32_t param, diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 36e38ebebf..ad2e6cdd8c 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -197,7 +197,7 @@ STUB_HELPER(clgi, TCGv_env env) STUB_HELPER(invlpga, TCGv_env env, TCGv_i32 aflag) STUB_HELPER(set_dr, TCGv_env env, TCGv_i32 reg, TCGv val) STUB_HELPER(stgi, TCGv_env env) -STUB_HELPER(svm_check_intercept_param, TCGv_env env, TCGv_i32 t, TCGv_i64 p) +STUB_HELPER(svm_check_intercept, TCGv_env env, TCGv_i32 type) STUB_HELPER(svm_check_io, TCGv_env env, TCGv_i32 port, TCGv_i32 p, TCGv_i32 a) STUB_HELPER(vmload, TCGv_env env, TCGv_i32 aflag) STUB_HELPER(vmmcall, TCGv_env env) @@ -2423,9 +2423,8 @@ static inline int svm_is_rep(int prefixes) return ((prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) ? 8 : 0); } -static inline void -gen_svm_check_intercept_param(DisasContext *s, target_ulong pc_start, - uint32_t type, uint64_t param) +static void gen_svm_check_intercept(DisasContext *s, target_ulong pc_start, + uint32_t type) { /* no SVM activated; fast case */ if (likely(!GUEST(s))) { @@ -2433,14 +2432,7 @@ gen_svm_check_intercept_param(DisasContext *s, target_ulong pc_start, } gen_update_cc_op(s); gen_jmp_im(s, pc_start - s->cs_base); - gen_helper_svm_check_intercept_param(cpu_env, tcg_const_i32(type), - tcg_const_i64(param)); -} - -static inline void -gen_svm_check_intercept(DisasContext *s, target_ulong pc_start, uint64_t type) -{ - gen_svm_check_intercept_param(s, pc_start, type, 0); + gen_helper_svm_check_intercept(cpu_env, tcg_constant_i32(type)); } static inline void gen_stack_update(DisasContext *s, int addend)