From nobody Mon Feb 9 09:08:20 2026 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=1764075507; cv=none; d=zohomail.com; s=zohoarc; b=gL65IvF5oWzqFi9xEEx8c+7jG83Pitaj0duJSkvCXdWMPNQ8FMLryOsyn/A2Z1BkA0AQRoITDM8fzJ7n0A2PbDpAztwrGm2Kpsk33Jdjt0ro6fJiV3oUzsJsF+SuOE2P6jUERRjDMvJqSX2ZBgjdQt1gcv8ePz1jYLaZqdvl5Hw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764075507; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JTo/K6E/wQATvBEl3UpUlNw2rzMGWy1zwGjD2ibgDwQ=; b=OzTuRsViux7yh2jhb09iY9fSseU9EpLwtYucMkUnqsebT+WRGwjaZwZIdZnPxvVsYtOQdCL3sf94LXMLaYBwe5JHoPClSzO4+GgVmaly/IevfMu75xqn/AB04fBrbulmmggbRJkO6NrD0D6p6XAEmfhsgWKphnkHucsW+QUz0+U= 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 1764075507309738.498358240656; Tue, 25 Nov 2025 04:58:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vNrqz-0003zg-TC; Tue, 25 Nov 2025 07:09:06 -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 1vNrqv-0003yN-RJ for qemu-devel@nongnu.org; Tue, 25 Nov 2025 07:09:01 -0500 Received: from linux.microsoft.com ([13.77.154.182]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vNrqt-0004hI-7t for qemu-devel@nongnu.org; Tue, 25 Nov 2025 07:09:00 -0500 Received: from DESKTOP-TUU1E5L.localdomain (unknown [167.220.208.65]) by linux.microsoft.com (Postfix) with ESMTPSA id E509E2120E87; Tue, 25 Nov 2025 04:08:54 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E509E2120E87 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1764072535; bh=JTo/K6E/wQATvBEl3UpUlNw2rzMGWy1zwGjD2ibgDwQ=; h=From:To:Cc:Subject:Date:From; b=nCC5lLWo/JzUuJlge9Ro9dE4FagHL/EoZ+eUgtqVmNIXbVeEB6bwop1BuXGp9B4lB kbAHYghmPai9ibUPFF0EB9OBbCrgz/IsWi9vVKMg+Xs2Js9KZQAFdK41gRHGD+8o82 +Xr1KAW4SOkTFrZ/TNTkg3qAVTsJLflhmllt5VXA= From: Magnus Kulke To: qemu-devel@nongnu.org Cc: Magnus Kulke , Bernhard Beschow , Wei Liu Subject: [PATCH] target/i386/mshv: remove unused gpa txl optimization Date: Tue, 25 Nov 2025 13:08:52 +0100 Message-Id: <20251125120852.250149-1-magnuskulke@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=magnuskulke@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-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: 1764075508117019200 Content-Type: text/plain; charset="utf-8" The removed parameters are remnants of a prior attempt to optimize gva=3D>gpa translation. Currently there is only one call site and it's not using it. So we can remove it as dead code. Signed-off-by: Magnus Kulke Reviewed-by: Wei Liu --- target/i386/mshv/mshv-cpu.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/target/i386/mshv/mshv-cpu.c b/target/i386/mshv/mshv-cpu.c index 1c3db02188..03ef085d5e 100644 --- a/target/i386/mshv/mshv-cpu.c +++ b/target/i386/mshv/mshv-cpu.c @@ -1189,7 +1189,7 @@ static int handle_unmapped_mem(int vm_fd, CPUState *c= pu, remap_result =3D mshv_remap_overlap_region(vm_fd, gpa); *exit_reason =3D MshvVmExitIgnore; =20 - switch (remap_result) { + switch (remap_result) { case MshvRemapNoMapping: /* if we didn't find a mapping, it is probably mmio */ return handle_mmio(cpu, msg, exit_reason); @@ -1374,23 +1374,19 @@ static int read_memory(const CPUState *cpu, uint64_= t initial_gva, return 0; } =20 -static int write_memory(const CPUState *cpu, uint64_t initial_gva, - uint64_t initial_gpa, uint64_t gva, const uint8_t = *data, +static int write_memory(const CPUState *cpu, uint64_t gva, const uint8_t *= data, size_t len) { int ret; uint64_t gpa, flags; =20 - if (gva =3D=3D initial_gva) { - gpa =3D initial_gpa; - } else { - flags =3D HV_TRANSLATE_GVA_VALIDATE_WRITE; - ret =3D translate_gva(cpu, gva, &gpa, flags); - if (ret < 0) { - error_report("failed to translate gva to gpa"); - return -1; - } + flags =3D HV_TRANSLATE_GVA_VALIDATE_WRITE; + ret =3D translate_gva(cpu, gva, &gpa, flags); + if (ret < 0) { + error_report("failed to translate gva to gpa"); + return -1; } + ret =3D mshv_guest_mem_write(gpa, data, len, false); if (ret !=3D MEMTX_OK) { error_report("failed to write to mmio"); @@ -1445,7 +1441,7 @@ static int handle_pio_str_read(CPUState *cpu, for (size_t i =3D 0; i < repeat; i++) { pio_read(port, data, len, false); =20 - ret =3D write_memory(cpu, 0, 0, dst, data, len); + ret =3D write_memory(cpu, dst, data, len); if (ret < 0) { error_report("Failed to write memory"); return -1; --=20 2.34.1