From nobody Tue Feb 10 09:58:38 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1661213988; cv=none; d=zohomail.com; s=zohoarc; b=mISsNmC/l2hUrYwmk1OB/NBtmNpzVx4ZOexzPjRaT0mxtk6ruwknt5+kr7n0BwBkYjjueTJ5J+ZgyNMtnRB/D2pI7zxjlWdFAb4shgg05kcTBVFNjz1oxwu42kNfjuxGB66rYDjDQLR7M6zeY3w5BxC7MgZCEZjP3RC2zSZiGls= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661213988; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dKKPqc9i5CiF5LwFzHQi/Z8WbYaXN7VuC10J23PoypU=; b=ZOHgFUbgb4X9c2DJs6IRz8tv2OJapWp5u04BZO2JW/bL0LQn47f4BWjk/4iWkSi/KXGhp94yD6Ix5uF4VReJO+oKq06NYm9yxpOMBRzPv67cqtk28Jbn7Vs8e5hgKUfD4nmeYckf81vpoQ31vnCkR8zjQuxuzXVVRAmBjsHhSeg= 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 1661213988800313.4241511730527; Mon, 22 Aug 2022 17:19:48 -0700 (PDT) Received: from localhost ([::1]:48458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQHdz-0002m5-Ia for importer@patchew.org; Mon, 22 Aug 2022 20:19:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQHJ7-000472-QQ for qemu-devel@nongnu.org; Mon, 22 Aug 2022 19:58:13 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:40498) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQHJ6-0002hj-64 for qemu-devel@nongnu.org; Mon, 22 Aug 2022 19:58:13 -0400 Received: by mail-pf1-x42a.google.com with SMTP id y141so11875074pfb.7 for ; Mon, 22 Aug 2022 16:58:11 -0700 (PDT) Received: from stoup.. ([2602:47:d49d:ec01:c3f1:b74f:5edd:63af]) by smtp.gmail.com with ESMTPSA id w190-20020a6230c7000000b0052d52de6726sm9173159pfw.124.2022.08.22.16.58.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 16:58:10 -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; bh=dKKPqc9i5CiF5LwFzHQi/Z8WbYaXN7VuC10J23PoypU=; b=bTN5uk409jCZyBgsAvZZUlItev1zuARYymNFWT/7XNngYAKixJP/g/qRnZI65936Mf mCBC3jtffIaYZVN5TUZKRdvFvgWPcGdZZlrBE8dhvfaEeyTYEdrGkUMe5w8cHfK9iVLN EeCwmDQ+nE/cyLbSeefRvYpN48ZPCjUZkcgkcZJ/TjYeg9F6wBxb0n3JUR9Y3wqNodBi d3DYcEEv+KvqEMRBdG9XFHUjMazvcet0eeLDvIi5e9SfNPBiFr5yea2NgdKajvt1OL2Q 07wFqrOC2jkMp9eSz/1gFtTOMB3fhu67tOKnPcTuLeQlUnoqlH61j83HzB2h23UJPyhV Xkgw== 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; bh=dKKPqc9i5CiF5LwFzHQi/Z8WbYaXN7VuC10J23PoypU=; b=6NTfDHKIUcR5LpcmMPbn5BhCHVxqPB22OhqupcAjiJ1ANniH04BirdoeWjQZ0SuEjg +c7sq54tnRYB6R3UVloPLYwPQu4eQtf9eFIC2Fr4GLYw99JefMzFmFC1flylx2EbuVZP U2JTx3EM+AfxkoLBUZUpBlUVuTzmWzl3s6h5w7mMa1wepcAS2ueMu06yX+PSxwLY0Zvi OKB+VvNen3aX5Wnxst4byhN5h/grXcAdr/WBbZ1AOZAt6ZWIMefwk5Tvz/CdImWPg+Bg 1M6LLToyr0MIijIU6csSx4CyCz5RbbH8a+kf0H/Pwz9DRuRwN+XWYW0iDAMiyW0jRAVM dUNA== X-Gm-Message-State: ACgBeo1hRVvKyLF3sNZ9FLXqK06cG5KOhOuZ/qJkmMRg9BAAXer/h2oq 95pnmR6zlUC4NCqd2uxn85J3GRUAFeXnbg== X-Google-Smtp-Source: AA6agR5cb8a2AvUVrzZgIBkcoeYLZ+xEjdCkyr3KF/VV5Eqj1RsVLrUlbkliA1FsbvzHx2Kn6TXBzw== X-Received: by 2002:a63:564f:0:b0:425:f2cd:d0ce with SMTP id g15-20020a63564f000000b00425f2cdd0cemr18394170pgm.143.1661212691328; Mon, 22 Aug 2022 16:58:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, eduardo@habkost.net Subject: [PATCH 08/14] target/i386: Direct call get_hphys from mmu_translate Date: Mon, 22 Aug 2022 16:57:57 -0700 Message-Id: <20220822235803.1729290-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220822235803.1729290-1-richard.henderson@linaro.org> References: <20220822235803.1729290-1-richard.henderson@linaro.org> 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=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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, T_SCC_BODY_TEXT_LINE=-0.01 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" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1661213989607100001 Content-Type: text/plain; charset="utf-8" Use a boolean to control the call to get_hphys instead of passing a null function pointer. Signed-off-by: Richard Henderson --- target/i386/tcg/sysemu/excp_helper.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/= excp_helper.c index 414d8032de..ea195f7a28 100644 --- a/target/i386/tcg/sysemu/excp_helper.c +++ b/target/i386/tcg/sysemu/excp_helper.c @@ -24,14 +24,10 @@ =20 #define PG_ERROR_OK (-1) =20 -typedef hwaddr (*MMUTranslateFunc)(CPUState *cs, hwaddr gphys, MMUAccessTy= pe access_type, - int *prot); - #define GET_HPHYS(cs, gpa, access_type, prot) \ - (get_hphys_func ? get_hphys_func(cs, gpa, access_type, prot) : gpa) + (use_stage2 ? get_hphys(cs, gpa, access_type, prot) : gpa) =20 -static int mmu_translate(CPUState *cs, hwaddr addr, - MMUTranslateFunc get_hphys_func, +static int mmu_translate(CPUState *cs, hwaddr addr, bool use_stage2, uint64_t cr3, MMUAccessType access_type, int mmu_idx, int pg_mode, hwaddr *xlat, int *page_size, int *prot) @@ -329,7 +325,7 @@ hwaddr get_hphys(CPUState *cs, hwaddr gphys, MMUAccessT= ype access_type, return gphys; } =20 - exit_info_1 =3D mmu_translate(cs, gphys, NULL, env->nested_cr3, + exit_info_1 =3D mmu_translate(cs, gphys, false, env->nested_cr3, access_type, MMU_USER_IDX, env->nested_pg_m= ode, &hphys, &page_size, &next_prot); if (exit_info_1 =3D=3D PG_ERROR_OK) { @@ -395,7 +391,7 @@ static int handle_mmu_fault(CPUState *cs, vaddr addr, i= nt size, } } =20 - error_code =3D mmu_translate(cs, addr, get_hphys, env->cr[3], acce= ss_type, + error_code =3D mmu_translate(cs, addr, true, env->cr[3], access_ty= pe, mmu_idx, pg_mode, &paddr, &page_size, &prot); } --=20 2.34.1