From nobody Fri Oct 14 10:03:50 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Mphml0fKgz4g56S; Fri, 14 Oct 2022 10:03:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mphmk73Mdz3mBD; Fri, 14 Oct 2022 10:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665741831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UvYV3dQd5QWkTY2Wld8pWlDl5HUJ0DMbWi+lhv40Www=; b=YKMrKvsg8BXCNhJU9ym0kZvlHAhlUCHO98VA6LCqyN0P4zqBJZA46AeAQavHGm9W8/H3De 7PW7j5Q8KGH4NeP3OJy9ksq9my/qjXCB/TzmldXVfwyOwOlazT6c6hGVwT3jPAZZtuGSLO 8zu/O7qVCMppo5aK9d54lTeLZptaTK/wyDugLVUm9SqFfdanvYcCixzGFlAvovLp62qb26 WruQcnzz7LzDgYnJZQbQ2P7ZnchxOXFohZANgntX7oM/WHJzc0WAe1mTBvze0pvbJjzKVV ioOWkqd3tqgzXziJkF4g0aK09lOwFBSBeLDnwnWn/gr0w4sRqeumefpsNAevIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Mphmk5wj6zl0v; Fri, 14 Oct 2022 10:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 29EA3oAP091052; Fri, 14 Oct 2022 10:03:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29EA3o3Y091051; Fri, 14 Oct 2022 10:03:50 GMT (envelope-from git) Date: Fri, 14 Oct 2022 10:03:50 GMT Message-Id: <202210141003.29EA3o3Y091051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: f56801d6d977 - main - vmm: increase vlapic version List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f56801d6d9777ba0a7e398d370bb755de8102697 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665741831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UvYV3dQd5QWkTY2Wld8pWlDl5HUJ0DMbWi+lhv40Www=; b=HSeVVDIEJ06cCfXDDNAGU+66PxpZZvgt45eUF4DU/gXlYz+7wFjKljD2mf/Kh6sDgda6o9 vtqxw8eXLr0jTtLJ3LUxsPWyTkaZg6VY/XK0seOw8ytaFnzUsdklKSevoB3UuZ6ELl/OYc Z/McwmGMrHfkMJylCaW30d6Wuna3/E6PanVAHssh1PdfXu/IIhLZlcLkl7pTV3+V05jR6Y +UYGLvRIZJEOdASFidWnXr0STAtAdOxA9ABsIJSqvJ7B5bU+61GzmmjbFH0Dpip3HnGZq7 hNbUqF4eeRBV9lHHYh8XQiWLXA8tkzUIkGCoiGiL+YkYrK3tEuyrgeC2PVRg5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665741831; a=rsa-sha256; cv=none; b=oI0qr2RzztMWumqXxp7Vm7tzHuXs0M0gxwsUCUObtV33BJrARUtZ2CDJXex4IGrQnHj8D3 o3AQjkd2zySthQJFUj/AEXlfnKW/DQzHwnmG7jjKQVyUcNPRExRJetRjKDrKpaGCOrQ80E XlFNYb/wjQ8s9lKHYXlhK6uRqMrqqlVsELZs4vubfMGqoLE9Ztgii5PtDF0QZ9oEFcumLT Cs9EK+ll7IbkgavyhW3UeXYpajc/5ZnXEButVHQIo5HnaeGqEiOB4jtnlK58TSc6cXZH+e nDQ4PsvGdn7iWpCxGNDGSc+nY5kdHq7mqDe+hKttRTrrJQh680wczhbnS/0A/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=f56801d6d9777ba0a7e398d370bb755de8102697 commit f56801d6d9777ba0a7e398d370bb755de8102697 Author: Corvin Köhne AuthorDate: 2022-10-10 12:56:00 +0000 Commit: Emmanuel Vadot CommitDate: 2022-10-14 10:03:05 +0000 vmm: increase vlapic version Mac os panics on apic versions lower than 0x14. See https://opensource.apple.com/source/xnu/xnu-7195.81.3/osfmk/i386/lapic_native.c.auto.html Additionally, an upcoming commit will validate the icr values written by the guest. Older intel processors allow some different combinations than the newer ones. AMD documents that only the newer combinations are allowed. So, bumping the version allows us to avoid a differentiation between AMD and Intel. Intel documents that newer processors than the P6 are using the new combinations. Sadly, Intel does not document which apic version belongs to those processors. Linux identifies newer apics by a version larger or equal to 0x14. Intel and AMD allow apic version between 0x10 and 0x15. So, using 0x14 seems to be fine. See https://github.com/torvalds/linux/blob/3eba620e7bd772a0c7dc91966cb107872b54a910/arch/x86/kernel/apic/apic.c#L238 Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D36945 Sponsored by: Beckhoff Automation GmbH & Co. KG --- sys/amd64/vmm/io/vlapic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c index 8283c3cb422c..c5db5af0ca95 100644 --- a/sys/amd64/vmm/io/vlapic.c +++ b/sys/amd64/vmm/io/vlapic.c @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #define PRIO(x) ((x) >> 4) -#define VLAPIC_VERSION (16) +#define VLAPIC_VERSION (0x14) #define x2apic(vlapic) (((vlapic)->msr_apicbase & APICBASE_X2APIC) ? 1 : 0)