From patchwork Mon Feb 20 23:26:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 655143 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1661815wrc; Mon, 20 Feb 2023 15:29:00 -0800 (PST) X-Google-Smtp-Source: AK7set8oSY0Xv5uClJkM2zOeVOfGak1QxYT/IVfSJ3u0nofxaLjDe0/ZZzRrjgytcYUv+pt+grYA X-Received: by 2002:a05:622a:182:b0:3b9:bd77:1971 with SMTP id s2-20020a05622a018200b003b9bd771971mr19092837qtw.42.1676935740192; Mon, 20 Feb 2023 15:29:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676935740; cv=none; d=google.com; s=arc-20160816; b=X5UTY/Xnk0WFr6zmZmZ2ZNiqEi35rAFRadPMZn6dGU+MAN+35NgO1Hmfh5nDc24r4P GNLibhzSyNbXA3AdbjVL4LaatAzvtKBrMfSWmTLEYlvc48o5nF6n2SVmIjh+LSRonDP0 cP0831fAbtP6kqK3IkUNKnf3wTCXImHmKD2ojxnNRIOQwHzCDUDGewyXikMzL96LcsdA HozqYi1ILRGSt+GIwBjDd6dFXlgK0LAH0VIQy3up3DgeZmrimymGa4cHZJ7WCBkb3hg6 AiLBKt7Y8x+y53PZd/BzYn+dw7eNllWYUHT8er9Eqf+Nqssi17Y7SbHu8skWvzExY9Ql oohQ== 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=d4Ci3OKSOkWsuhLLCd9XsBSP6q75DdfzpORQaA+1Aqs=; b=r1th81hmFs96PEszutPlQGTRWs9peDraOiSr72gAZ6X4z646JrwVNJvM+EhSgnDSfY jlvaqwJXXm5HPD5v6i16zfVNTKQ07n8Qb37pbZbJ37kIRnCm6g5U7gPBR+71K7UzTicb c3zrrCDoAqCzIUfH33JUt7/XWoPVZeq58ieA9mfg6MeXVayfR9zeNkZYJI0XL1/UBc/c GIXUUm/62QJpjqPIC2Jm8ALIZRY1PeU3tTESCMB4G9Le/Xlcx/rQikkl/KFHeBQu6oGd Sh79LJTs+YYF70j6z/tPqh/nCZAhJB+U0BPd7wqpc7b7mutICPFc1k1p6pNkRjRuij59 4i7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F6+sFcFd; 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 x7-20020a05620a448700b0071c19e6d114si1177387qkp.113.2023.02.20.15.29.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 15:29:00 -0800 (PST) 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=F6+sFcFd; 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 1pUFYj-0004Sf-EE; Mon, 20 Feb 2023 18:27:01 -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 1pUFYe-0004F6-NO for qemu-devel@nongnu.org; Mon, 20 Feb 2023 18:26:56 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUFYc-0000QK-3j for qemu-devel@nongnu.org; Mon, 20 Feb 2023 18:26:56 -0500 Received: by mail-pj1-x1034.google.com with SMTP id v3-20020a17090a6b0300b002341a2656e5so2795817pjj.1 for ; Mon, 20 Feb 2023 15:26:53 -0800 (PST) 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:subject:date :message-id:reply-to; bh=d4Ci3OKSOkWsuhLLCd9XsBSP6q75DdfzpORQaA+1Aqs=; b=F6+sFcFdW1ZtAnPQO4GNXDAuyz+Q5bFePcMX6bH5wEf8dqWAfCSSbjDG47dxVIXFKa Ed7KwcyusTxKS0uEEQxt0ggaXA8AQ5pS5hRdwB727Pz7dXcT5NdzM0BVEDV+PPG/Oh5V j/PoWFd9bTplJ5jjf/Wpwf3hWeybIf/kGTfEIUlvaeT+rAS8/aLG9/XjLl0NYeyoXp8d EjM3WLdZIQqgdBlygpF3JzNRBf8TYzE3uO0/oHESxtdxlIWfIreot5dZj7fWTDCnMN6r 6xKZM856uexts1tP5D9qszL+atib9EOFNywhzIRQf5h/pGJUMWinVTJfPfI1GH8u7Wbp vQZw== 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 :subject:date:message-id:reply-to; bh=d4Ci3OKSOkWsuhLLCd9XsBSP6q75DdfzpORQaA+1Aqs=; b=a4pChJ4GZCG9/VhBopvBSMzZn7C6wSwRf4CkezygqEDSQbGU2wXR1i6GRgDVoH2uY0 Ob92eXDtp9l5UsKvvajomQ/5yxY6lZU+wLWmtWGY8EH+IuMDQbIXi25IQbKJuSPRFKhx YXY/cUHtZ5OYC6p3JIv99I25Njw+oGPOvuSWhfN4G8d75wN/x/e+WyodffVm1TZix+eW xvsn6PV+C9/QDSkkCh+/loJ0A6apiWqeciW76XVX/WFuD8XvrZMkEg07ZOpz3OaYLnhq vyo0yCswN2zp/FwiKFN1F2hwzUK8inwSOcpByI6c/7dWSVqMgDxpnDR0ebO7KGMHRIdY jGfA== X-Gm-Message-State: AO0yUKUXayJ+r2C+Un6a9YOx69uhywTJ0x0N3CyLylqmm8597pwN0AJv b8f0MW4wjeljz8y64yJ1PWiiSK48haeF3RylBF8= X-Received: by 2002:a17:902:c40d:b0:19a:8284:83a2 with SMTP id k13-20020a170902c40d00b0019a828483a2mr4647179plk.10.1676935612564; Mon, 20 Feb 2023 15:26:52 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id j10-20020a170902690a00b001992e74d058sm2665348plk.7.2023.02.20.15.26.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:26:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v2 14/21] target/arm: Use get_phys_addr_with_struct in S1_ptw_translate Date: Mon, 20 Feb 2023 13:26:19 -1000 Message-Id: <20230220232626.429947-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230220232626.429947-1-richard.henderson@linaro.org> References: <20230220232626.429947-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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=unavailable 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 Do not provide a fast-path for physical addresses, as those will need to be validated for GPC. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/ptw.c | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 54e72baff5..6e980654be 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -234,29 +234,22 @@ static bool S1_ptw_translate(CPUARMState *env, S1Translate *ptw, * From gdbstub, do not use softmmu so that we don't modify the * state of the cpu at all, including softmmu tlb contents. */ - if (regime_is_stage2(s2_mmu_idx)) { - S1Translate s2ptw = { - .in_mmu_idx = s2_mmu_idx, - .in_ptw_idx = arm_space_to_phys(space), - .in_space = space, - .in_secure = is_secure, - .in_debug = true, - }; - GetPhysAddrResult s2 = { }; + S1Translate s2ptw = { + .in_mmu_idx = s2_mmu_idx, + .in_ptw_idx = arm_space_to_phys(space), + .in_space = space, + .in_secure = is_secure, + .in_debug = true, + }; + GetPhysAddrResult s2 = { }; - if (get_phys_addr_lpae(env, &s2ptw, addr, MMU_DATA_LOAD, - false, &s2, fi)) { - goto fail; - } - ptw->out_phys = s2.f.phys_addr; - pte_attrs = s2.cacheattrs.attrs; - pte_secure = s2.f.attrs.secure; - } else { - /* Regime is physical. */ - ptw->out_phys = addr; - pte_attrs = 0; - pte_secure = is_secure; + if (get_phys_addr_with_struct(env, &s2ptw, addr, + MMU_DATA_LOAD, &s2, fi)) { + goto fail; } + ptw->out_phys = s2.f.phys_addr; + pte_attrs = s2.cacheattrs.attrs; + pte_secure = s2.f.attrs.secure; ptw->out_host = NULL; ptw->out_rw = false; } else {