From nobody Fri Nov 14 21:01:20 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1761228967; cv=none; d=zohomail.com; s=zohoarc; b=PzaRBlpH8ghCu0VSAoLzexjtF6zIaPvYxISyJ0WhXailMMJ1FT2YCwtX6oHDXmzyAC21GcSrq2DhjYnwPJtkN9r+ZDCdZ+Kd3wcdXT41pjD88bN7cBAPfPRczNqi8zFfj8YAbebQdTaN0vJ7wohYjnqy3AuD63Pp9djIwqtD1yA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761228967; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8YWr4zExFLVkS/USY8dnF7Z2qM9YsNMJfD7DIjDOS2k=; b=FIPeD2PxCgRzPjuYjiMjDmcGOzvT3orfKCExqiNFVc7l60Iy7xVEt9L4BSNZzluDB2XUDlUNa24n7W2rc6QgtIifNqSmq7uu4cIKaUd/3+u+MQbnkCITcBAGAsiByD09IzBYkU8OzwIgJAjZ0ug/+dahGM/dPtNsAI0Jz5eWYO0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17612289672461007.0176324259571; Thu, 23 Oct 2025 07:16:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vBw4y-0005qZ-Pk; Thu, 23 Oct 2025 10:14:12 -0400 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 1vBw4t-0005pQ-Jv for qemu-devel@nongnu.org; Thu, 23 Oct 2025 10:14:07 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vBw4q-0007O5-8K for qemu-devel@nongnu.org; Thu, 23 Oct 2025 10:14:06 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3ed20bdfdffso857092f8f.2 for ; Thu, 23 Oct 2025 07:14:02 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429897f57cesm4406320f8f.17.2025.10.23.07.14.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Oct 2025 07:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1761228841; x=1761833641; darn=nongnu.org; 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=8YWr4zExFLVkS/USY8dnF7Z2qM9YsNMJfD7DIjDOS2k=; b=Re+VSc/4URZQ/dH+o8iJwGvAfA5CEgfcExw7kZi7D1XFLfj+RSgItN8hJxnvo70S+7 wHEI0BdI7oqnYOYIAGjJks5+61hy2qInyQPWelFmvdMxK+gdrT8tzyjPI2kB8mBkhtQj Jns0hByKyrkWkGBeKIn3MU5onwOsmItoMWDvHqtrFCCacJcb7UJ93XOrD+YJlG9Vqpvo J/b0RAAlU+bXYCgoDC3h1zraYCL4eKxR8vIOjZ+YDHyyDr0ysfrngQkSgSoYfP6ZGa1H UmALz7YoGz2sfC7z7rA3dLUgEVBP2sWIoTrg6dS4MM51p8yRqZOlJekijGPk7j/aUY93 hsaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761228841; x=1761833641; 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=8YWr4zExFLVkS/USY8dnF7Z2qM9YsNMJfD7DIjDOS2k=; b=tYKQDKT7Ygvbur2qbkbis0uNibkPN/scUxTCHFoFZIwkoKYrkqmejy7btH2H8NDvsi czDceeo1OWgxJuPp3PEtGfl36ZwN3GmrYPbYeUMREgQ27Wqb0Sv+/sdp7/U8O7wLqR+e +P9te/EWfpvNf1fSgVILIFPBQVqbxZClTi3rvL4K+iW8QdRtGmH1LVnEM2A4rndSoAAe XUXOpzVOxlV2PtCJDPm8v/WsMBwyBwOR3DuKyDlS8x6qHB46E6FgOcztpdK1VBs/nkGt uOkxTKW1QqjGFEfhbZ/DnKqTUs1lpGUvO644rtP0X1YGdmCIsxBuXwsI9zzIAsNcOyxW p9iA== X-Gm-Message-State: AOJu0Yy9QT0KMnWm7d5Hp0I7SyZJLdoKRqY+Crwmfs9uCnsI17A+4pC0 4Z1eWHbsFglJMTi9tMZiGcaaTwvNmVpO3cyihd2AK462U0ltYJjewS+gkYDNFP6ZryamS6pUwak cCKU58qo= X-Gm-Gg: ASbGncsBLsIl0C4nh3h6oCY4E8KhhxN+1mTxWFQFRyBXJl02kKDnIzxd2/0eGfuHtl0 YpTAU84QHpA9DACjNeo6Lgvueb8XdJ0fwadPuf1RQXjOZe13mZYkJy1szkXWAIPe501XiyYmU2+ zRwa4Gb8yRSobASfnPzRn8hzXfomz7Ye9aYKTSff2SUxx4ko0jx/1/L68H7EOMdMsP2HyYu1WgP epEpDXTp55oHRDOYZlgt3u3zNhDR/7FxUknE0DPM+nNZb5tm3TJKoc31pGnLlpX4w2lMnhgU1D9 4iK7f1MyDTgDDc9NRDxwe6QX1lwG7GyCPX+O8N2ggHRyFOOxc/pyEHqK+lG8ZBJLRxjMaRKvDp/ a5wwBTkYxrqXX+UY3+vqJyaWCDYWNoPhpKd3JDLzAzDZH760J7oaD5Kh7mGg+u4syVAEOc8zUKv TWeSttnEnOfT4cRbsHsGMOj/QC1z/bFe80dpv5u2UR93dS3pMuhg== X-Google-Smtp-Source: AGHT+IE5kJMbKIloHuIF+iO0x/rjaYysicQVlzEsz/rTTGf5wI8KNHrB+CP6oynYwyhQy10+JtgltQ== X-Received: by 2002:a5d:5f82:0:b0:425:86c8:c4ff with SMTP id ffacd0b85a97d-42704d90011mr18488871f8f.22.1761228841290; Thu, 23 Oct 2025 07:14:01 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Peter Maydell , Richard Henderson , Alexander Graf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cameron Esfahani , Stefan Hajnoczi , Peter Collingbourne , qemu-arm@nongnu.org, Paolo Bonzini , Phil Dennis-Jordan , Mads Ynddal , Roman Bolshakov Subject: [PATCH v2 14/58] target/arm/hvf: Hardcode Apple MIDR Date: Thu, 23 Oct 2025 16:13:33 +0200 Message-ID: <20251023141339.10143-5-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251023114638.5667-1-philmd@linaro.org> References: <20251023114638.5667-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1761228970422154100 From: Mohamed Mediouni Hardcode MIDR because Apple deliberately doesn't expose a divergent MIDR across systems. Signed-off-by: Mohamed Mediouni Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/arm/hvf/hvf.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index d13ccf5508c..890e9266f93 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -763,6 +763,7 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPUFea= tures *ahcf) hv_vcpu_t fd; hv_return_t r =3D HV_SUCCESS; hv_vcpu_exit_t *exit; + uint64_t t; int i; =20 ahcf->dtb_compatible =3D "arm,armv8"; @@ -781,9 +782,19 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPUFe= atures *ahcf) for (i =3D 0; i < ARRAY_SIZE(regs); i++) { r |=3D hv_vcpu_get_sys_reg(fd, regs[i].reg, regs[i].val); } - r |=3D hv_vcpu_get_sys_reg(fd, HV_SYS_REG_MIDR_EL1, &ahcf->midr); r |=3D hv_vcpu_destroy(fd); =20 + /* + * Hardcode MIDR because Apple deliberately doesn't expose a divergent + * MIDR across systems. + */ + t =3D FIELD_DP64(0, MIDR_EL1, IMPLEMENTER, 0x61); /* Apple */ + t =3D FIELD_DP64(t, MIDR_EL1, ARCHITECTURE, 0xf); /* v7 or later */ + t =3D FIELD_DP64(t, MIDR_EL1, PARTNUM, 0); + t =3D FIELD_DP64(t, MIDR_EL1, VARIANT, 0); + t =3D FIELD_DP64(t, MIDR_EL1, REVISION, 0); + ahcf->midr =3D t; + clamp_id_aa64mmfr0_parange_to_ipa_size(&host_isar); =20 /* --=20 2.51.0