From nobody Tue Mar 14 08:52:09 2023 X-Original-To: dev-commits-ports-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 4PbS2L1nsJz3xxgp; Tue, 14 Mar 2023 08:52:10 +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 4PbS2L1CDXz3GfS; Tue, 14 Mar 2023 08:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678783930; 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=0RO5PO+NuGC/truRKd6AM8PQdKktfd4LTSZOK383Bl0=; b=sqReksHtB6cvmpmvZWT3BM6LkWezdmn+QGevFVOGvG6GaH8UOSUeND5/ZsPCiZk4Iip+Og Tojd+Nt2t2c40JCaXEZgQAUN8iRGlMKmwBTEy7TP/FMjAmJxo18f74aqG4TFUIB++1vf2f iV+R0BC4mkYtA4MHk/bDHcce7srS/Jpw/GOerhnNC3oi8RrtCYXtj1VYM0KaqszrZyw+7s 6etH1TkMOiqahlzeqLxF3X8e1p55CI3imPmHXpWE/5MUdXQYL6Dw1vnRLhpBggJsdTmOPb 59KUu2rtSRcaTIvXVBf3zds5UkkGlWJk+nrQd/xSsYj9B80lrIWHQJGxrHP9xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678783930; 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=0RO5PO+NuGC/truRKd6AM8PQdKktfd4LTSZOK383Bl0=; b=pgi+xpNBg0JwG5NLQI0iIItijb98ezBsKjijSgmmZ6mMraqqGQpw9ZGS2t3huE1qIz9DDs mNtpKujwbBLaXcFENXcWTNeyO6V+moynnrfa3IEkGd8iCOfVhySW1Wir84evCdVMWlcwTo 4HiCIVTXocldXr8JymRpSAZuu28PfF+SyYutH9shDiPnMdooxkei5bXiPl3yc8m1uZfCDw Y0XN6Hi+Dr2Bx8Hi7HsXunigg4a2J79LdfqgIiaQXYSvI3wFZKqOyJt5xqOQHcCJpSCNTI BIh3uwvtFgZo7MkDgNSS3X70MHyUlytMqJVloLeDr8vw2TNaUty5tpRwXyXiUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678783930; a=rsa-sha256; cv=none; b=JmE5h92JtknfqjRGVt18Y57KqClDRTeF0Fv47/FQtN/m1ghVVmouiRjv2jDwrJ0Qfue0XV mkeT0oQQsnh2K2gOsqiCs3The5nDjgtFO2YoUYIUJ/6OmrsiStB4cX8mCHR1F4ZtqOwXYh oOC3wTRqKY5LixaEt5jDR++WpBs3H68iTlp5S3EP8E+7BdOqzwnyfdA+QXg6dKrFdDS1D/ +ZJHIRIgs8X/1IAgPGpLQJQLurBaAMkXjdMheS0Rfj4EH4WGwYiMfU+9OTKtVcYl339DS9 THmyxFD0Zq07bEa1zB3oQtHwntUZgDRhtU/e13Wfh7mfZ/Q0Nv+axkLfU0OxWA== 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 4PbS2L0HnKzTcP; Tue, 14 Mar 2023 08:52:10 +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 32E8q9BR013611; Tue, 14 Mar 2023 08:52:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32E8q9lw013610; Tue, 14 Mar 2023 08:52:09 GMT (envelope-from git) Date: Tue, 14 Mar 2023 08:52:09 GMT Message-Id: <202303140852.32E8q9lw013610@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: =?utf-8?Q?Roger=20Pau=20Monn=C3=A9?= Subject: git: 7326a17b98b6 - main - emulators/xen-kernel: add fix for fetching video mode List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7326a17b98b6b80b81dbfa193da69bca182483ef Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/ports/commit/?id=7326a17b98b6b80b81dbfa193da69bca182483ef commit 7326a17b98b6b80b81dbfa193da69bca182483ef Author: Roger Pau Monné AuthorDate: 2023-03-14 08:49:33 +0000 Commit: Roger Pau Monné CommitDate: 2023-03-14 08:51:27 +0000 emulators/xen-kernel: add fix for fetching video mode Sponsored by: Citrix Systems R&D Approved by: bapt (implicit) --- emulators/xen-kernel/Makefile | 5 +- ...m-make-XENPF_get_dom0_console-actually-us.patch | 58 ++++++++++++++++++++++ 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/emulators/xen-kernel/Makefile b/emulators/xen-kernel/Makefile index 4844d8675227..d08ba8c7fdb3 100644 --- a/emulators/xen-kernel/Makefile +++ b/emulators/xen-kernel/Makefile @@ -1,6 +1,6 @@ PORTNAME= xen PORTVERSION= 4.17.0 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= emulators MASTER_SITES= http://downloads.xenproject.org/release/xen/${PORTVERSION}/ PKGNAMESUFFIX= -kernel @@ -34,7 +34,8 @@ EXTRA_PATCHES+= ${PATCHDIR}/xsa425.patch:-p1 \ # clang build fixes EXTRA_PATCHES+= ${PATCHDIR}/0001-xen-x86-Remove-the-use-of-K-R-functions.patch:-p1 # Support for fetching video mode from PVH dom0 -EXTRA_PATCHES+= ${PATCHDIR}/0001-x86-platform-introduce-hypercall-to-get-initial-vide.patch:-p1 +EXTRA_PATCHES+= ${PATCHDIR}/0001-x86-platform-introduce-hypercall-to-get-initial-vide.patch:-p1 \ + ${PATCHDIR}/0001-x86-platform-make-XENPF_get_dom0_console-actually-us.patch:-p1 .include diff --git a/emulators/xen-kernel/files/0001-x86-platform-make-XENPF_get_dom0_console-actually-us.patch b/emulators/xen-kernel/files/0001-x86-platform-make-XENPF_get_dom0_console-actually-us.patch new file mode 100644 index 000000000000..ff57b27f5ea9 --- /dev/null +++ b/emulators/xen-kernel/files/0001-x86-platform-make-XENPF_get_dom0_console-actually-us.patch @@ -0,0 +1,58 @@ +From 7d43e4b2aa42b826e3d373b8e802ba925cc73088 Mon Sep 17 00:00:00 2001 +From: Jan Beulich +Date: Mon, 13 Mar 2023 15:14:38 +0100 +Subject: [PATCH] x86/platform: make XENPF_get_dom0_console actually usable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +struct dom0_vga_console_info has been extended in the past, and it may +be extended again. The use in PV Dom0's start info already covers for +that by supplying the size of the provided data. For the recently +introduced platform-op size needs providing similarly. Go the easiest +available route and simply supply size via the hypercall return value. + +While there also add a build-time check that possibly future growth of +the struct won't affect xen_platform_op_t's size. + +Fixes: 4dd160583c79 ("x86/platform: introduce hypercall to get initial video console settings") +Signed-off-by: Jan Beulich +Acked-by: Roger Pau Monné +--- + xen/arch/x86/platform_hypercall.c | 2 ++ + xen/include/public/platform.h | 6 +++++- + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c +index 08ab2fea62..85c69c5be5 100644 +--- a/xen/arch/x86/platform_hypercall.c ++++ b/xen/arch/x86/platform_hypercall.c +@@ -841,6 +841,8 @@ ret_t do_platform_op( + + #ifdef CONFIG_VIDEO + case XENPF_get_dom0_console: ++ BUILD_BUG_ON(sizeof(op->u.dom0_console) > sizeof(op->u.pad)); ++ ret = sizeof(op->u.dom0_console); + if ( !fill_console_start_info(&op->u.dom0_console) ) + { + ret = -ENODEV; +diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h +index 14784dfa77..60caa5ce7e 100644 +--- a/xen/include/public/platform.h ++++ b/xen/include/public/platform.h +@@ -605,7 +605,11 @@ struct xenpf_symdata { + typedef struct xenpf_symdata xenpf_symdata_t; + DEFINE_XEN_GUEST_HANDLE(xenpf_symdata_t); + +-/* Fetch the video console information and mode setup by Xen. */ ++/* ++ * Fetch the video console information and mode setup by Xen. A non- ++ * negative return value indicates the size of the (part of the) structure ++ * which was filled. ++ */ + #define XENPF_get_dom0_console 64 + typedef struct dom0_vga_console_info xenpf_dom0_console_t; + DEFINE_XEN_GUEST_HANDLE(xenpf_dom0_console_t); +-- +2.39.0 +