From nobody Sun Feb 23 12:03:27 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1740146537; cv=none; d=zohomail.com; s=zohoarc; b=Ka+X1p5oKHAjQxypZiPyq+R2K/oM+9ZnC7zD0ldyIEUkFtdBQOMXeSJOwxCH74BdjHvniunx00ykE86vSY9gOGL6WDBUg3Jaak4pab+P3MmM+EZ1Q41EaXtjZUfwehc0aLBNz1vUe8+FpUpYjIBcZNJuvf4VzUe3w/Ui+tJI8oc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1740146537; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fgVhyxoTFagJw7DG+jshhAjelZ84w/cVh14rC/yyEDg=; b=Zds0plusTG7GcQLWEJ+FU3pfeL3o4lkO0p1LV1IpwG6yDSVz1hbDqlRc826qpemjXcPDoK/f7P02nXoP9Evj1torJDngVzDnRVwLA+NzKsab1G5NzAnkRKBCneSzKW6gOfEuybnJCQZFVTTcg2mG1O7wgB1xRvd1ET1EfI6Fjmk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1740146537390462.09584693155955; Fri, 21 Feb 2025 06:02:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tlTbI-0008JC-Rq; Fri, 21 Feb 2025 09:01:57 -0500 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 1tlOWh-0006Qt-N9 for qemu-devel@nongnu.org; Fri, 21 Feb 2025 03:36:52 -0500 Received: from linux.microsoft.com ([13.77.154.182]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tlOWd-00015M-Qn for qemu-devel@nongnu.org; Fri, 21 Feb 2025 03:36:50 -0500 Received: by linux.microsoft.com (Postfix, from userid 1031) id 7C24F204E5B8; Fri, 21 Feb 2025 00:36:29 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7C24F204E5B8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1740126989; bh=fgVhyxoTFagJw7DG+jshhAjelZ84w/cVh14rC/yyEDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RyJuqdVKRuZV34EjJJKvXHw+xM/nsc4zrj9rY3RHYCf/LpCl3kgb48oKrAbwScmce x89P5vpqUhG2JUt6Sc9DzOwlQs1VVSgd2/Wou2Vf9IqaeHOf7TN60bhvQw+y1tCE+a yHrdspsnYSFv5fUw+hr9o4aHHMpQkMXwpLT5NLX0= From: Wei Liu To: qemu-devel@nongnu.org Cc: wei.liu@kernel.org, dirty@apple.com, rbolshakov@ddn.com, phil@philjordan.eu, jinankjain@linux.microsoft.com, liuwe@microsoft.com, muislam@microsoft.com, ziqiaozhou@microsoft.com, mukeshrathor@microsoft.com, magnuskulke@microsoft.com, prapal@microsoft.com, jpiotrowski@microsoft.com, deviv@microsoft.com, Wei Liu Subject: [RFC PATCH v1 05/19] target/i386/hvf: remove HVF specific calls from x86_decode.c Date: Fri, 21 Feb 2025 00:36:13 -0800 Message-Id: <1740126987-8483-6-git-send-email-liuwe@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1740126987-8483-1-git-send-email-liuwe@linux.microsoft.com> References: <1740126987-8483-1-git-send-email-liuwe@linux.microsoft.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=13.77.154.182; envelope-from=liuwe@linux.microsoft.com; helo=linux.microsoft.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 21 Feb 2025 09:00:54 -0500 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linux.microsoft.com) X-ZM-MESSAGEID: 1740146538290019000 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use the newly defined emul_ops. This allows the module to be reused by other accelerator in the future. No functional change intended. Signed-off-by: Wei Liu --- target/i386/hvf/x86_decode.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/target/i386/hvf/x86_decode.c b/target/i386/hvf/x86_decode.c index d6d5894e54..31285952ad 100644 --- a/target/i386/hvf/x86_decode.c +++ b/target/i386/hvf/x86_decode.c @@ -21,6 +21,7 @@ #include "panic.h" #include "x86_decode.h" #include "vmx.h" +#include "x86_emu.h" #include "x86_mmu.h" #include "x86_descr.h" =20 @@ -74,7 +75,7 @@ static inline uint64_t decode_bytes(CPUX86State *env, str= uct x86_decode *decode, break; } target_ulong va =3D linear_rip(env_cpu(env), env->eip) + decode->len; - vmx_read_mem(env_cpu(env), &val, va, size); + emul_ops->read_mem(env_cpu(env), &val, va, size); decode->len +=3D size; =20 return val; @@ -1893,16 +1894,6 @@ static void decode_prefix(CPUX86State *env, struct x= 86_decode *decode) } } =20 -static struct x86_segment_descriptor get_cs_descriptor(CPUState *s) -{ - struct vmx_segment vmx_cs; - x86_segment_descriptor cs; - vmx_read_segment_descriptor(s, &vmx_cs, R_CS); - vmx_segment_to_x86_descriptor(s, &vmx_cs, &cs); - - return cs; -} - void set_addressing_size(CPUX86State *env, struct x86_decode *decode) { decode->addressing_size =3D -1; @@ -1914,7 +1905,8 @@ void set_addressing_size(CPUX86State *env, struct x86= _decode *decode) } } else if (!x86_is_long_mode(env_cpu(env))) { /* protected */ - x86_segment_descriptor cs =3D get_cs_descriptor(env_cpu(env)); + x86_segment_descriptor cs; + emul_ops->read_segment_descriptor(env_cpu(env), &cs, R_CS); /* check db */ if (cs.db) { if (decode->addr_size_override) { @@ -1950,7 +1942,8 @@ void set_operand_size(CPUX86State *env, struct x86_de= code *decode) } } else if (!x86_is_long_mode(env_cpu(env))) { /* protected */ - x86_segment_descriptor cs =3D get_cs_descriptor(env_cpu(env)); + x86_segment_descriptor cs; + emul_ops->read_segment_descriptor(env_cpu(env), &cs, R_CS); /* check db */ if (cs.db) { if (decode->op_size_override) { --=20 2.39.5 (Apple Git-154)