From patchwork Mon Jan 30 20:59:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 648576 Delivered-To: patch@linaro.org Received: by 2002:a17:906:c198:b0:888:9ecf:6623 with SMTP id g24csp895348ejz; Mon, 30 Jan 2023 13:01:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXuiGXqBAImPfvq6iYBplVEy8Nr7FiZX1msaSgBq/CVXcdK8uuUGTN5jsSLRqVH5dlKjfA2d X-Received: by 2002:a05:6122:2002:b0:3e1:56b8:9feb with SMTP id l2-20020a056122200200b003e156b89febmr35373819vkd.7.1675112474581; Mon, 30 Jan 2023 13:01:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675112474; cv=none; d=google.com; s=arc-20160816; b=Jg/53sncibMRw3qbvJz84fXsp0fF7HlXxBxk5DXoWldyVstVeHkLUDKgNT5JJLh7PA T6EPoanMQj8jevfJrDkqVipYma2VgGhEV8ojbykCEYy8jO4zRhtHc6t5qpEngR7PnLy5 9Kw7XRhUmmXyx4xhGkMIhke84kDMAGmznjx8Q2yPC+SD4gS3rgFBkkCXczkITW8Qdoat yR0qNWH3x+44Hfz4XMhdobRf1H3qJ26HKnQjheOJWkFkuh6NBP0KprWxSLHBNGGNZLQJ UXpgQXy/Al/Hc9+O6sYxSvbxPmVKdiGR5G9dhYtb+0oz9PeenUfyER/Wu8/vHHwT5Fo9 ZsBg== 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=oAq23tFP3V7GoWjZJ9sICzNMmPCjvQ4jyu54tebclPo=; b=HmrKc2ugvUeeSuEEHCHBi84X+0JPKLM8EBg1XpBCcE175nBgTU86lEjnf8NamDveIm X9eGVOmgIjVwGLrRSOj/wLBSxW8BneJ2oT8NlbO/nJszAFgoP9ynPjjJEnxKvQWyWQ1+ tQhvwucI9EODXoWiAVdN1i41h+LcPcFsM+LUzNJ9GMH1Yn3fHUQLsvpL+g98BN2b04f5 P8W+Ugx+aziIEDqcnABSsiUidL3+1hczEUXv+MeqFO45pZ9yUpCmpftcSv/4nfIBOqNl 09gN/mqnimZMYmjCLf0b1z3cSZfspO7Cx1WCbBELI9qt6XXB7OkHJmQwgemM4AG1avr6 5YpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qjQiZGB9; 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 v5-20020a05620a440500b00705b57741e1si3932405qkp.296.2023.01.30.13.01.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jan 2023 13:01:14 -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=qjQiZGB9; 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 1pMbFs-0007s0-2e; Mon, 30 Jan 2023 15:59:56 -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 1pMbFi-0007UP-Nz for qemu-devel@nongnu.org; Mon, 30 Jan 2023 15:59:48 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMbFf-0005Bt-9w for qemu-devel@nongnu.org; Mon, 30 Jan 2023 15:59:46 -0500 Received: by mail-pf1-x42f.google.com with SMTP id 144so8751981pfv.11 for ; Mon, 30 Jan 2023 12:59:41 -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=oAq23tFP3V7GoWjZJ9sICzNMmPCjvQ4jyu54tebclPo=; b=qjQiZGB93/f0oBHU0w7HbzFnLfeIZcG+X+RObLIoh3CAPm8jFSc39N6utnjMKHWslO Pnhf4btS3E0jbc86VKqmKJLswQCXzrLOs68QZhqr5XmGwD6xB7gdYQ/N9GGMJuWloD9k EonqPWoXmJE2husTCDWHgiTqTPEqxekO5pdXLsQL+Eh1vK/J9LQqPjrVXkINuC31asJO Go2TCa2sqLj+jnIRkd+MH65eHXF7ufiXbaqjpg9dNyUZZdbRpLXgzrOh72BKtt7Q1N6K Oe2/TwncXCqBxMvDAx73oA6tkQ7d3VBwn+bDaSCxaoTOU9yLmmaPwyZXxJAC+hbfkT7Y WyRQ== 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=oAq23tFP3V7GoWjZJ9sICzNMmPCjvQ4jyu54tebclPo=; b=uqxY/PB5TJ8UZmXmRt6GDYgedSX2FisqWG6rhl7qATcPodgocYmCjpFiRXRDDKU1Gx 69N0qo+BaQS2b2rpi7I66wWeimU2j497f2qtRTwxfQ6EafFA9C/orgClFNgB8r7n9dCL 9K/d2ujVqAZVSM4bv/BcBpVm23ZiTuwVDPOwaGAXkoB7MH+pdKORN2kL6/Mje2xljX0g lE9CLWYgTMXMFgZS13fENov0Q2pQnINfU/SCx4KRoYaSLSQ2ksvrOJF/5W5MFfdT4vsO 1hBf2g5CMA2In+Hu+AzpdniUeFXL6ShwLu0xj9DB+lZTkpSZbwESyfkyOZQQl7DWs9Tp 6WHA== X-Gm-Message-State: AO0yUKWEmpUVsDIxdV4WAkv7SbD2LOLfCyb8OZ/DD48/kdpYh0ld9QzT FJx9jX1iPzLh6R0iZ8dSN5o3AmK5BWBrKl1m X-Received: by 2002:aa7:8493:0:b0:593:b538:760a with SMTP id u19-20020aa78493000000b00593b538760amr5341858pfn.5.1675112380636; Mon, 30 Jan 2023 12:59:40 -0800 (PST) Received: from stoup.. (rrcs-173-197-98-118.west.biz.rr.com. [173.197.98.118]) by smtp.gmail.com with ESMTPSA id x10-20020aa79a4a000000b00593eb3a5e44sm102933pfj.37.2023.01.30.12.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 12:59:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, cota@braap.org, qemu-stable@nongnu.org, Sid Manning Subject: [PATCH] target/arm: Fix physical address resolution for Stage2 Date: Mon, 30 Jan 2023 10:59:08 -1000 Message-Id: <20230130205935.1157347-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230130205935.1157347-1-richard.henderson@linaro.org> References: <20230130205935.1157347-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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.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 Conversion to probe_access_full missed applying the page offset. Cc: qemu-stable@nongnu.org Reported-by: Sid Manning Fixes: f3639a64f602 ("target/arm: Use softmmu tlbs for page table walking") Signed-off-by: Richard Henderson --- target/arm/ptw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 57f3615a66..2b125fff44 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -266,7 +266,7 @@ static bool S1_ptw_translate(CPUARMState *env, S1Translate *ptw, if (unlikely(flags & TLB_INVALID_MASK)) { goto fail; } - ptw->out_phys = full->phys_addr; + ptw->out_phys = full->phys_addr | (addr & ~TARGET_PAGE_MASK); ptw->out_rw = full->prot & PAGE_WRITE; pte_attrs = full->pte_attrs; pte_secure = full->attrs.secure;