From patchwork Fri Mar 4 20:03:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 548129 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp352087mag; Fri, 4 Mar 2022 12:09:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZ0HBvXWpoe3uWuAda3JDL0krophH6q3Ect4khoSL7MEtsbG9Q+M7I4ruj9TacwE196pdK X-Received: by 2002:a25:c385:0:b0:614:d2fd:c9bc with SMTP id t127-20020a25c385000000b00614d2fdc9bcmr155282ybf.270.1646424556671; Fri, 04 Mar 2022 12:09:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646424556; cv=none; d=google.com; s=arc-20160816; b=xEo6nLbmFEf73I0SXGZdx+MVr8VP/ydewC8keEvl7Gflq83QploxScZ6cuwS9EWRea OcU4jEZfQcUDrZyKQdajrqs4mpXw5cMvWtnitdh2RgX6GTc/RHJf8P5qCl1+u/mlVOKt 8rD8YxNDbF8UYQPhxWsbG1hlb/UsypgR5UW9ofv4rmknLZVOCXP5cYi49mxkMNLRAOyS XguJ415rqmBxVg2rvxj4jBWlIAKqZsxVZCI0hfbMGILG1dEpPLbSPTfvK4GSBf1YBt5m pt4TykczLicCK+3oi3CG4sd16vt+WFW1xYrv49OZVmusj1WQcgtALoDxKrZYir26p2fV lQAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=TLjgVybJvPoE9KhD4vPFEO3Qby2QVt4ZAtq9+cFyp24=; b=AjauqFuKIvjynxqkoWsM06mlL8lH7eVfdDdK+DTeayi4PM3kGUJBIrPyuOaagTCERB OrV96zSrBnAp93TEJrEQ5moF8tv55YAczRJZej4cuvtNa6ekWdIOLPkWGJk9Gom//gH5 EiCZ3yCwIQlT98BMISyDzj5cxRmR4lPLvsCwDEM+4qBGXRI7x+NgzZVREZ/mnWfDy2wU Rxm2Q1sASNazwWtjoMyY7yWjZaRdAZgzRsTEfnbILMUFX/6UdiSHF0B04kQmd2r8Ncew GxnCb1+Id6YQ6Me+XXvw3FVZ04qDLMxpo0fW0l29ChuY7DP+yOxY6sR3muFe9sEVs+8E YXCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=m2ehXtTa; 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=fail (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 d17-20020a5b00d1000000b006220e248ea7si5123256ybp.433.2022.03.04.12.09.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Mar 2022 12:09:16 -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=fail header.i=@linaro.org header.s=google header.b=m2ehXtTa; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQEEm-0004g0-6B for patch@linaro.org; Fri, 04 Mar 2022 15:09:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQE8q-0004zu-Bd for qemu-devel@nongnu.org; Fri, 04 Mar 2022 15:03:08 -0500 Received: from [2607:f8b0:4864:20::62e] (port=40806 helo=mail-pl1-x62e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQE8o-0005xu-K4 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 15:03:08 -0500 Received: by mail-pl1-x62e.google.com with SMTP id z11so8694624pla.7 for ; Fri, 04 Mar 2022 12:03:06 -0800 (PST) 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=TLjgVybJvPoE9KhD4vPFEO3Qby2QVt4ZAtq9+cFyp24=; b=m2ehXtTaHFJ87qpPsfMv9GvJbGPuTBmbxAyLMzwWufNEnLaFqDmJ8cSyHUfYMOIivi RWYNwoxKf2G0BmYRdOJUfbc/91U0X2UbWJVl/a4hpHa0YMGdo/TvRdD103lftdL/gzxn w6WbYXJWNDp6WXcT3YntgUsxMyGHggxoKMTGBt8rOX9s7nlmxsOxKIdUZo586lhzaXUL 2cX9rCHj3KbadTgKzrq7iR4Vx55AbHWil8/9HzC5X850Ut4jzQhCoWUv3moTxfd4u5dY FvbEB8v5H1AzzKxr8it1kv2vzOhmXVEidJkoQufmdgVqRTxkFjSGNrW1rJmjVJobxboU pFoA== 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=TLjgVybJvPoE9KhD4vPFEO3Qby2QVt4ZAtq9+cFyp24=; b=CEDgjfrYJyp+PWh2ocNHG6g/6HYpiAWsTVx1YIYM7wk7Wrh2vuDZ6rjgfT/iSrCO6b Qu/FA8k+ubuwtgrLROtUzt6pqEw67l6Rr4IhFiM9eFT2tYb0zETotOrecbBG2ObsFtse gNbAEciw7YumFsTD7jwQVIF/bBpRiwNdkXlXwvwLUtLaqic7Oj3aGufbr++mlfEavKHC 4LU7PzWFX3/eGIihBzoJQ2D8mfnwmJZVBEt40/se0Me+etJcIrrcDodeK5YuzD6Vzg01 iMWKUzG6sWTnWbThnjD8vNen7fCGiu2X63qHdhenOxXfcNKZvMf7Xr9cxerMr1Muu/g0 jJJA== X-Gm-Message-State: AOAM532c8wZ12ceYkEvV5GH9HZ/mhuExSnTIpCnvt9e7a1Zo7cbYGBmg rcMW8H17k/BfKbd9X/ecLezgHsbPI+c0Mg== X-Received: by 2002:a17:903:11c4:b0:151:9bf6:f481 with SMTP id q4-20020a17090311c400b001519bf6f481mr122410plh.50.1646424185235; Fri, 04 Mar 2022 12:03:05 -0800 (PST) Received: from localhost.localdomain (2603-800c-1201-c600-f24b-57b2-da7c-e304.res6.spectrum.com. [2603:800c:1201:c600:f24b:57b2:da7c:e304]) by smtp.gmail.com with ESMTPSA id hk2-20020a17090b224200b001bf0a7d9da3sm5716744pjb.9.2022.03.04.12.03.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 12:03:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 1/2] target/arm: Provide cpu property for controling FEAT_LPA2 Date: Fri, 4 Mar 2022 10:03:00 -1000 Message-Id: <20220304200301.524525-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304200301.524525-1-richard.henderson@linaro.org> References: <20220304200301.524525-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There is a Linux kernel bug present until v5.12 that prevents booting with FEAT_LPA2 enabled. As a workaround for TCG, allow the feature to be disabled from -cpu max. Since this kernel bug is present in the Fedora 31 image that we test in avocado, disable lpa2 on the command-line. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.h | 5 ++++- target/arm/cpu.c | 6 ++++++ target/arm/cpu64.c | 24 ++++++++++++++++++++++++ tests/avocado/boot_linux.py | 2 ++ 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 24d9fff170..4aa70ceca1 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -204,10 +204,12 @@ typedef struct { # define ARM_MAX_VQ 16 void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp); void arm_cpu_pauth_finalize(ARMCPU *cpu, Error **errp); +void arm_cpu_lpa2_finalize(ARMCPU *cpu, Error **errp); #else # define ARM_MAX_VQ 1 static inline void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) { } static inline void arm_cpu_pauth_finalize(ARMCPU *cpu, Error **errp) { } +static inline void arm_cpu_lpa2_finalize(ARMCPU *cpu, Error **errp) { } #endif typedef struct ARMVectorReg { @@ -975,10 +977,11 @@ struct ARMCPU { /* * Intermediate values used during property parsing. - * Once finalized, the values should be read from ID_AA64ISAR1. + * Once finalized, the values should be read from ID_AA64*. */ bool prop_pauth; bool prop_pauth_impdef; + bool prop_lpa2; /* DCZ blocksize, in log_2(words), ie low 4 bits of DCZID_EL0 */ uint32_t dcz_blocksize; diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 7091684a16..185d4e774d 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1392,6 +1392,12 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp) error_propagate(errp, local_err); return; } + + arm_cpu_lpa2_finalize(cpu, &local_err); + if (local_err != NULL) { + error_propagate(errp, local_err); + return; + } } if (kvm_enabled()) { diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 2fdc16bf18..eb44c05822 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -688,6 +688,29 @@ void aarch64_add_pauth_properties(Object *obj) } } +static Property arm_cpu_lpa2_property = + DEFINE_PROP_BOOL("lpa2", ARMCPU, prop_lpa2, true); + +void arm_cpu_lpa2_finalize(ARMCPU *cpu, Error **errp) +{ + uint64_t t; + + /* + * We only install the property for tcg -cpu max; this is the + * only situation in which the cpu field can be true. + */ + if (!cpu->prop_lpa2) { + return; + } + + t = cpu->isar.id_aa64mmfr0; + t = FIELD_DP64(t, ID_AA64MMFR0, TGRAN16, 2); /* 16k pages w/ LPA2 */ + t = FIELD_DP64(t, ID_AA64MMFR0, TGRAN4, 1); /* 4k pages w/ LPA2 */ + t = FIELD_DP64(t, ID_AA64MMFR0, TGRAN16_2, 3); /* 16k stage2 w/ LPA2 */ + t = FIELD_DP64(t, ID_AA64MMFR0, TGRAN4_2, 3); /* 4k stage2 w/ LPA2 */ + cpu->isar.id_aa64mmfr0 = t; +} + static void aarch64_host_initfn(Object *obj) { #if defined(CONFIG_KVM) @@ -897,6 +920,7 @@ static void aarch64_max_initfn(Object *obj) aarch64_add_sve_properties(obj); object_property_add(obj, "sve-max-vq", "uint32", cpu_max_get_sve_max_vq, cpu_max_set_sve_max_vq, NULL, NULL); + qdev_property_add_static(DEVICE(obj), &arm_cpu_lpa2_property); } static void aarch64_a64fx_initfn(Object *obj) diff --git a/tests/avocado/boot_linux.py b/tests/avocado/boot_linux.py index ab19146d1e..ee584d2fdf 100644 --- a/tests/avocado/boot_linux.py +++ b/tests/avocado/boot_linux.py @@ -79,6 +79,7 @@ def test_virt_tcg_gicv2(self): """ self.require_accelerator("tcg") self.vm.add_args("-accel", "tcg") + self.vm.add_args("-cpu", "max,lpa2=off") self.vm.add_args("-machine", "virt,gic-version=2") self.add_common_args() self.launch_and_wait(set_up_ssh_connection=False) @@ -91,6 +92,7 @@ def test_virt_tcg_gicv3(self): """ self.require_accelerator("tcg") self.vm.add_args("-accel", "tcg") + self.vm.add_args("-cpu", "max,lpa2=off") self.vm.add_args("-machine", "virt,gic-version=3") self.add_common_args() self.launch_and_wait(set_up_ssh_connection=False) From patchwork Fri Mar 4 20:03:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 548128 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp350934mag; Fri, 4 Mar 2022 12:07:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQRN30JUH2FGixmuIAh7XMnATrxgzd/mqvP3dA0dqDDaewOWa+7asTGagEnOMygpIshUN+ X-Received: by 2002:a5b:242:0:b0:61d:b9c9:5431 with SMTP id g2-20020a5b0242000000b0061db9c95431mr168120ybp.82.1646424463491; Fri, 04 Mar 2022 12:07:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646424463; cv=none; d=google.com; s=arc-20160816; b=HWic+7G4962RHfWLfa3uALW+zq4uu6zqkP4GyUANqKDq/bANlgRGYC7J7zBWrSTIpU vz5fSajd9EJrV2o7DJuEHeY0rzr+Z3e/W5AU9y/r6+V1j8HptuWrGTucxVdPDQpIhP2/ HIyT2tOInnod5g2o8aNhdLZ94gy2nDFlBN4LB858wXMqpo2E/oE4YvBxodvl/cgSf0zF TjUJmwS9VR4+1O+il86rh29SsFWWOnWRS1mJhWm2Vt8uGn58nGsU3i+4t26SoLmXyzvW FtdSlk7ouuhsMx3bsAZtNO5m/9OegJiWfX9A9VLckY1zhsk0gIxDnFNvozVRB5xG5CsC gvXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=Yi+EL9Y616xgLruwinXIVDzc3CuIbCMiF0BTJMc+UOg=; b=wOtPuJalwU9JXTKdZR09SzsYzCj0ebHzSIDEcWVyBsatUeQofV7KrVJdHSMTk1yD1Q n2K/WJ9w3pk9Feqf+vOAjO7qUkVfdhqgAJ5ZcoFSu+CPD6WdzYx/xdZhKYlIdwkbE7hz CsP5NAXc+282eMbAGCSB2ei8MDghOlbwggy0FIulAiTvJo/r6bjBf47B/wG+y5UAJClS ljk+2nxloSzE/TjOos2r3YBCPKDywV85hc0B8WgNsYJBkoGNckYppr9gV+cgViC1DiCW QsSg8Z9S7Mr72QNWu0nhX+CN+cwWqMIVKj4vFcHikdQ8Q477YhqL6IYZqODkmdVg946J 3SBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="KGZm/T7R"; 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=fail (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 l133-20020a81258b000000b002dc19d54519si4471242ywl.431.2022.03.04.12.07.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Mar 2022 12:07:43 -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=fail header.i=@linaro.org header.s=google header.b="KGZm/T7R"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQEDG-0002oD-NC for patch@linaro.org; Fri, 04 Mar 2022 15:07:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQE8r-00051U-Gj for qemu-devel@nongnu.org; Fri, 04 Mar 2022 15:03:14 -0500 Received: from [2607:f8b0:4864:20::633] (port=36377 helo=mail-pl1-x633.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQE8p-0005yF-U4 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 15:03:09 -0500 Received: by mail-pl1-x633.google.com with SMTP id e13so8706558plh.3 for ; Fri, 04 Mar 2022 12:03:07 -0800 (PST) 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=Yi+EL9Y616xgLruwinXIVDzc3CuIbCMiF0BTJMc+UOg=; b=KGZm/T7R3DSVgO5Ml373UVOvKgzN2cad6Aj7WkfSGgFYtMFX8/IaO5uDD3HHFMzDUC NzV34No+jwCRbWqioZLE1KOpO+pqEvcCnMiNa3EdpyPosh0bYSWJYnQVRuth4J2do2v5 Ndvd1Oo1gYEGRKlVEESmLjRHuoORLbSoOJRlX19ln57bD21QccBMgQB5W0sQHu5EZIr2 noAzwey9B+Q0wdcW8bPob7oCmdfkObXDH60T3/kN5IUIsSb64N3erC2ZAT9WflEgabFO mUyTqfketqSIu3L5cWA9o5kyd3KbeE0GdM4YiA300i5Axn65c9O86yZGKVc3/doxCYk1 +dqA== 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=Yi+EL9Y616xgLruwinXIVDzc3CuIbCMiF0BTJMc+UOg=; b=Lj97G08u5KY7jiswJvOb2Fd+vEaOzlL5Jc3RWHg2+kozw2puqyQMBagQ4kVICOfKyE DUXe+7a3xv+mOEtsZwLG9qyE/TmRHf/K4C72qbLM3z6OIOmr3VK6B8efxs3aavb/WNNX FvZkfI9hcsD1LaCUYNwtMlGgR5FKpBm+VoxZiycYa48b/5Y7jheppHlebrlucWl8LuM/ x+HYywplPsV5ygiaCXMUNzLvfeT1JtoKMFXVcLyJR+QhyLgDZ9Qv4C7xHk50Rr8ThPSV xiMLgJCx6Zh+x7h6DJBY6s6XVlgsmU5B7mGa+i+jb148QpeLjCuujZZ5ULJMoeacjpZK akVA== X-Gm-Message-State: AOAM533R7A/LzhniQiBGPIZXKefzX8MQ+ZnXr+AiwgcbbUcKTtXwEtct 89gdRp6/wxwTYaOViMZ1oNcE9lH6tTFWHQ== X-Received: by 2002:a17:90b:1b0e:b0:1bf:1c4f:2bc4 with SMTP id nu14-20020a17090b1b0e00b001bf1c4f2bc4mr317616pjb.200.1646424186636; Fri, 04 Mar 2022 12:03:06 -0800 (PST) Received: from localhost.localdomain (2603-800c-1201-c600-f24b-57b2-da7c-e304.res6.spectrum.com. [2603:800c:1201:c600:f24b:57b2:da7c:e304]) by smtp.gmail.com with ESMTPSA id hk2-20020a17090b224200b001bf0a7d9da3sm5716744pjb.9.2022.03.04.12.03.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 12:03:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 2/2] hw/core: Disable LPA2 for -machine virt-6.2 Date: Fri, 4 Mar 2022 10:03:01 -1000 Message-Id: <20220304200301.524525-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304200301.524525-1-richard.henderson@linaro.org> References: <20220304200301.524525-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::633 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There is a Linux kernel bug present until v5.12 that prevents booting with FEAT_LPA2 enabled. As a workaround for TCG, disable this feature for machine versions prior to 7.0. Signed-off-by: Richard Henderson --- hw/core/machine.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index d856485cb4..f3c410fe58 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -37,7 +37,9 @@ #include "hw/virtio/virtio.h" #include "hw/virtio/virtio-pci.h" -GlobalProperty hw_compat_6_2[] = {}; +GlobalProperty hw_compat_6_2[] = { + { "max-arm-cpu", "lpa2", "off" }, +}; const size_t hw_compat_6_2_len = G_N_ELEMENTS(hw_compat_6_2); GlobalProperty hw_compat_6_1[] = {