From patchwork Tue Feb 25 18:04:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 868142 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f56:0:b0:38f:210b:807b with SMTP id cm22csp434950wrb; Tue, 25 Feb 2025 10:08:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXFXIOfHrYLHjMOBVeTNz3/7UuC39FPG0Mc1+QqDK5sg8pE0ZfRRVvFQpdHyQ6+qPaD/SK1ew==@linaro.org X-Google-Smtp-Source: AGHT+IE53/q4azY089RUSuy20GSFjMfqJXRHIQEZ6aJESMGoXD5yVL+6i1mLBBM5YtnMovGwSXh2 X-Received: by 2002:a05:6214:e87:b0:6e4:2963:1d8e with SMTP id 6a1803df08f44-6e6ae967561mr241621966d6.35.1740506934457; Tue, 25 Feb 2025 10:08:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1740506934; cv=none; d=google.com; s=arc-20240605; b=AIytJLVJdCqUDtsl1p/yqwJEuPlWCxF0+4W/ufTW07Mi0j9U2EuVoQlnyCvmJqxlar kGMWlfS/cjAHWIarsbJCTM7zsEW2wuZ1I7C7Ms+5vKbvVm4KLcF0hh5kA0VSKZ4Ldl8s njNEp0TI4srRij7vAs/ty4JYbiMoOGfzC9E+rWc4kfjs8TF65tH/Xj2ddsAdWilrj4GP VXQ24naxz5DbOjoIT1jts4w9EbZIdkuVakQm/HojFGRU/u4LpPRaRw58vbE8ZlLflbnO i+PzN/EAwp5+QLxRY+AWQ6dpekTm1Wxk1qvVaKl94BjJlI4pDq7uaZXAjtc4ktv+aEif QbFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:to:from :dkim-signature; bh=+KRNDOAM2UifPdugrP+Z6GvcaB2Pzjsk9KwzwCOMbUs=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=B+SL7U1+jMOKu5oWTitqRl14DTnNjYYkd7w1SRDK6QFtNJf3gpPnLgVCdBA4lYlkk/ yKST52Q4J5VFH8vCqhRzBYA8l6sJCuC5bwdMHoEbpVvMeIZFRrXpY0zS5bsh4V6Gj1Dl OZBAuMTGavzYMh7ypexq7XFEmMGhwyiVC1DjRKQL6CgdJoQUI+ZaVV8zjwKJkPf/fhb/ DglWD2tmw3xnmv6utruV67GOR6NnV26JrIhTPnZgvZ8SaSD2/48cRdY5iRWIlmuHopOH FKWI+1RTR6XjTpC2XBdmEA0KXcndfPSEieBXA+9qnTi+FnFECO2lCV2mkuJZ4wqgmZer hYwA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H6PDuuaI; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e87b146658si20576916d6.498.2025.02.25.10.08.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Feb 2025 10:08:54 -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=H6PDuuaI; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tmzKr-0001lo-Sp; Tue, 25 Feb 2025 13:07:17 -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 1tmzJZ-000072-4r for qemu-devel@nongnu.org; Tue, 25 Feb 2025 13:05:57 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tmzJU-0002Ib-My for qemu-devel@nongnu.org; Tue, 25 Feb 2025 13:05:51 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4399d14334aso52069895e9.0 for ; Tue, 25 Feb 2025 10:05:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740506744; x=1741111544; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+KRNDOAM2UifPdugrP+Z6GvcaB2Pzjsk9KwzwCOMbUs=; b=H6PDuuaIUiSCBtAck2wHjDmqeGVlLNUMdKgpckZrgWThsVBc/2l7ORZwdQe2JzMpA2 70Fyix/PiMY9/21hdiSCil34419IRZs5m6bN1qKGRMSg95I7qWBr9dLfTQvcAwfbs2GC D4E8e1ew63mLph1SJdW/30innSNtO1ZFdMduNLsCgLgIeLcHA7KuSj7DdZAavbb5l0D8 7ZchDu1UseRN2rUW71WjwnzGlROi4AtIkxrzPhZZ2lVA/Vyfp1q1BEfD9AcUwO+R1j1n 5SDGTc+8dz8HuWDUS/3X4XAZEpHdlmOxY7C7wqfGo0LZozDzGgMqjZI9/PhieKfCiNiY 5xZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740506744; x=1741111544; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+KRNDOAM2UifPdugrP+Z6GvcaB2Pzjsk9KwzwCOMbUs=; b=m4P9PZ7FTkxCouoqwXvlHGNijVECiLdpn2cR0B7Ob2VAXeOHF24JDqbuTdXSla1Yb6 +0XY2EIVPfw0PSDMxa3NV1j70hQv+Gzl0LXnKDg16Ipu9A3fGl6XTonRYOzTZWxu5+2x zCKC9OP3kSDwTTF5Ns5xd3cmFglfRVc3DxTNKi5eBGRXCpQScYLWhDTYsvribXxvgIXK 8diLX9CHq2Jzx1x8rfrrBEo1x0z8OkjcHSB1UWGltlvGj+pHBIH4EBgdiaEAlrXwTpnl SSJbklir1+c2ZdarXJWqCu3mEsx/RnGYhuS8gWmOB9BK0dewAFmTEFP+Ncw3VeA3pRDM uLIA== X-Gm-Message-State: AOJu0YwTmY586ILTL4PLSGEl0FbxnnqddUbF+1UxI2cX0r+a0fuEY5fd q3KjjU77Vu/zdhCT5bdJmowOmZJFIkqwyjzCCgfDt9ivj7du1MYiOwWjuO8lxz8OdicjhMZif3R f X-Gm-Gg: ASbGncsaptdtOuuemdAlXpAo4OZAbJemGRtG2tsaIWX8C7UI5eiZ7EtrVW3sJloejF8 m9P/pYzXNEiOfCO829Z05BTFGVB0TMyNVGD7If83xU1LZ/bXqVDmay+9NWDMnOJKnNFgDnnz3FJ CwZlCv29cdrabT1oG/WVzS3ooRlDBCeNJmKyj+aKRHEm3of8J1SeeRw9gYwWOmRv3jcmvKvVf0m 4byvzxa+oQ63FQwmnknKm4YiYsihyJTbr1IDgNszH+BZFyHka+vdL0DvlWEv0+24+gqjCEGkugz /9oIRURQu5G1bFdB0d/tprI+sBHnFc53 X-Received: by 2002:a05:600c:3588:b0:439:6304:e28a with SMTP id 5b1f17b1804b1-43ab8f6fe56mr5771505e9.0.1740506742211; Tue, 25 Feb 2025 10:05:42 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ab156a136sm35147875e9.35.2025.02.25.10.05.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 10:05:41 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 25/43] target/arm/hvf: Disable SME feature Date: Tue, 25 Feb 2025 18:04:51 +0000 Message-ID: <20250225180510.1318207-26-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250225180510.1318207-1-peter.maydell@linaro.org> References: <20250225180510.1318207-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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 From: Joelle van Dyne macOS 15.2's Hypervisor.framework exposes SME feature on M4 Macs. However, QEMU's hvf accelerator code does not properly support it yet, causing QEMU to fail to start when hvf accelerator is used on these systems, with the error message: qemu-aarch64-softmmu: cannot disable sme4224 All SME vector lengths are disabled. With SME enabled, at least one vector length must be enabled. Ideally we would have SME support on these hosts; however, until that point, we must suppress the SME feature in the ID registers, so that users can at least run non-SME guests. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2665 Signed-off-by: Joelle van Dyne Message-id: 20250224165735.36792-1-j@getutm.app Reviewed-by: Peter Maydell [PMM: expanded commit message, comment] Signed-off-by: Peter Maydell --- target/arm/hvf/hvf.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 0afd96018e0..872a25be869 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -899,6 +899,18 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) clamp_id_aa64mmfr0_parange_to_ipa_size(&host_isar.id_aa64mmfr0); + /* + * Disable SME, which is not properly handled by QEMU hvf yet. + * To allow this through we would need to: + * - make sure that the SME state is correctly handled in the + * get_registers/put_registers functions + * - get the SME-specific CPU properties to work with accelerators + * other than TCG + * - fix any assumptions we made that SME implies SVE (since + * on the M4 there is SME but not SVE) + */ + host_isar.id_aa64pfr1 &= ~R_ID_AA64PFR1_SME_MASK; + ahcf->isar = host_isar; /*