From patchwork Sun Jun 19 00:15:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 582989 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:7814:0:0:0:0 with SMTP id b20csp622813mav; Sat, 18 Jun 2022 17:17:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v+GSzGVdHRCow8+e52aX5DHUYt1kZvgyfHihW8il7iayELvDgNLxZCNf98ZeTwM3qcOFqP X-Received: by 2002:a05:622a:1715:b0:304:f325:5562 with SMTP id h21-20020a05622a171500b00304f3255562mr14224787qtk.573.1655597849145; Sat, 18 Jun 2022 17:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655597849; cv=none; d=google.com; s=arc-20160816; b=n32fguzObKOwPL2kDTXTuK7XDlq9fFvgCI1zeJhOkTHbn1UArPOIQ3GFUbhjfiMKnw L891HytY1LE0/s3uWjWTWJd30L6HfrFdgxKaIeRyiteeWuu5aVzAg8KI9rZmnuRoczQQ PGDeNz8FsZxrEKC8yNCQHEccWfbZ7iof/45FelIohR7jB6hOFUbqtDakCDeiQu3DGBI6 xkQc2PgIVMC2wdL95UwSgjTPgwwoGKux58suFA5E0z4cEzzjeSmWCtH0KlpiZB/gj6qv 7+rza4mi+vrZhIZCBWzbA53M6NRMcay3GYHHbMXw3klFdm56t8CUWta05DLEk5Kqd3IL lDtg== 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=cQ3LSmMq/PEbxO4xqtFc8lNO19/pPJ0Q5K0mnc2j/gw=; b=ebKp4GWWgrX13YEr2prwla9Uw4MmLBr+y6SXkxHLn+ggj0MPCqgzaxl096ygaRQQmX wbjoTFwvQuXGQfObTFLDL9/d5gOtfJVFqk1XsW3J91P7D23ak6CMi8KeZDEmMizDm4n1 W0BrVKiPDRer1oqO7oKzS910DRsfVz4LTbKCADyEoLQWsNd8kv6Npb1selSHkg5d1umU MPGGGjzXKAeYdQSVapLi4Vgro5iWO+D38hSv18SQAqqpxPhpy0STfXFImV3pqUj0THL2 SmufSZVYkuLYkEnPwPBKkn9BdWvOUVPhqSDFfFHVRBwn7I1uH2VAx90mKK0ljFxqoGsc WXDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aSH7Eh6d; 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 u5-20020a376005000000b006a6c4d52e3fsi4673419qkb.293.2022.06.18.17.17.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Jun 2022 17:17:29 -0700 (PDT) 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=aSH7Eh6d; 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]:38172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2id6-0008LI-Nb for patch@linaro.org; Sat, 18 Jun 2022 20:17:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2ibf-0007XM-Id for qemu-devel@nongnu.org; Sat, 18 Jun 2022 20:15:59 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:34483) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2ibR-0001xB-SK for qemu-devel@nongnu.org; Sat, 18 Jun 2022 20:15:58 -0400 Received: by mail-pl1-x62a.google.com with SMTP id i15so6807982plr.1 for ; Sat, 18 Jun 2022 17:15:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cQ3LSmMq/PEbxO4xqtFc8lNO19/pPJ0Q5K0mnc2j/gw=; b=aSH7Eh6dEq3QXFoaoAqNIvWxq4x/l7/ouqdQhkaZG1eTwCkFzEG4kVXo4OIjTuI9Xz gGT7qY7bKNMCoa3o4dDr7/kpQeH//7yvNLkgVz5bpCZyp9G8KEEbLWy3BjwKWYZ/UNZV z6IVo7Yh8JFFsSa1jN5o1olOXdbVOL/hkJg21a5kiHNHBTf0S41SuSFc3NXkai/zQlrx WK/ptP1/GMp3Qzl5FoicebpFBdTQmXauyFdvyo3b/y11a+6Xb2atlVkBflprOPfa4vtb BtHfgjrBmfAM48XGZj5So5rHw6cbwcllDwwIxrsEwjFzLlXRQegE10HWv1JSWcGCcBKv G2nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cQ3LSmMq/PEbxO4xqtFc8lNO19/pPJ0Q5K0mnc2j/gw=; b=ErBlkI7Djg4aUYOvOYHwZXvdX2D1Cevgx3u28uALSFVdoD2mOnkyVNWxByJJ60KJyO 6JPQO3XhgMJTbpxuEW8dmi4hescHD7GS2DgXnU8yw8sZMWXFP/My8JF7fUw60+M7fMsm avJxLaxd54MGdt4VgZQS4nrAFUDZ11bvuU+Vp8ypCPN1yq9NqeRvdyOjEjvq9oMsNtJ2 Ros2dGbwkzJiP7zKVgNPK0AJW2Ka4xfF6ToFYzkUOXUobmwLH6a7ZMJHrj3uTHuXAoRF +70c/VvDHQeBPvWomQp+nAlPId7M1OffC9YTPi8Z/ldxS0RAUmdRynmtqGVzbpoh88/R UwLw== X-Gm-Message-State: AJIora9ALYW5y8/PYXgJy/zu4U6HONne4uLf1GTo+lgzL41qYYlVuPFG ke+OLLBBeuOSK9fhECVo59wYKs1L1FWgXQ== X-Received: by 2002:a17:90b:4ac1:b0:1e6:7c82:9aee with SMTP id mh1-20020a17090b4ac100b001e67c829aeemr29260148pjb.234.1655597744476; Sat, 18 Jun 2022 17:15:44 -0700 (PDT) Received: from stoup.. ([2602:47:d49e:3c01:848a:b814:8a9c:88d6]) by smtp.gmail.com with ESMTPSA id s17-20020a17090a5d1100b001e0d4169365sm7790724pji.17.2022.06.18.17.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 17:15:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 2/2] target/arm: Check V7VE as well as LPAE in arm_pamax Date: Sat, 18 Jun 2022 17:15:41 -0700 Message-Id: <20220619001541.131672-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220619001541.131672-1-richard.henderson@linaro.org> References: <20220619001541.131672-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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, 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In machvirt_init we create a cpu but do not fully initialize it. Thus the propagation of V7VE to LPAE has not been done, and we compute the wrong value for some v7 cpus, e.g. cortex-a15. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1078 Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/ptw.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 07f7a21861..da478104f0 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -47,7 +47,13 @@ unsigned int arm_pamax(ARMCPU *cpu) assert(parange < ARRAY_SIZE(pamax_map)); return pamax_map[parange]; } - if (arm_feature(&cpu->env, ARM_FEATURE_LPAE)) { + + /* + * In machvirt_init, we call arm_pamax on a cpu that is not fully + * initialized, so we can't rely on the propagation done in realize. + */ + if (arm_feature(&cpu->env, ARM_FEATURE_LPAE) || + arm_feature(&cpu->env, ARM_FEATURE_V7VE)) { /* v7 with LPAE */ return 40; }