[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86/platform: make XENPF_get_dom0_console actually usable


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 13 Feb 2023 15:51:50 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ShS9+tjms6qa9jf847ybPoBZS94S1cWmOo2Zxm6z5J4=; b=i8WdS4fmedNMIxtkTtXW9vSxdn6PwCplxx7Nrsutxla0QaGTBuwJcbalXHh3YBmqFrTQUD7Q1Hb/oSGhYS7XZBFjbn5eLY2sjXdL1/Q7PyILYVsdAJc4NetCiQfHuhcpzjBhDohAWvUCxpZpa2A8qXfdtjLOzGdy6WHnb4peM8s4AKw0RJr3/yr7H2JFvL6zn9tDDI4+L0UnyHNdo/J/LGj7wRQvYxGxyzWwc2lMB3MCC3g6ElSUwcU2z4H02Qc3gcy5adW31UL2ynYQ02YPy1Cht9s4kDVCcEwEmlEatqCJsfWbuSalJZ4j9xvwmJYEfTGvxurSrhGfxHNTLXmbog==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l6yxHOstGHZui11p+BdH729lVFzxyI6NS09pGAmv1l8h8A4/h29OzNI18dy8jyf9MTNeh5Pw5QVb4g/qvryF0BYTB6KtpwaeEgZOANrUarP9xjCnztip5ICqK1yMsWNguTD0lbLUR4fzYOxo9/bwXgUcoJm+E1+dhOdH5pldu97+i7W/WxfmNkSj1Bk7oYLWtxnp0HZBUjdNOUlVudoERh8Yp9S/yMSuDgNwiPjXUkDAaabNi21wGlwRFCaxnueWTvK5CP9gnk6RPXgsEuXH5LcAa/8kK69SVxioII1Y+A6IMdHAwtObeD/iIH72ZRMBSaFzJ1zMkfteTcnUTlXKSw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 13 Feb 2023 14:52:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 <jbeulich@xxxxxxxx>
---
Noticed while trying to actually use the new hypercall in Linux.

--- 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;



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.