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

[PATCH v2 9/9] xen/x86: adjust data placement


  • To: Juergen Gross <jgross@xxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 30 Sep 2021 14:21:13 +0200
  • 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; bh=Ditd68ADMvga99ZSd2S+JMyE109ILHuWeFBMIRmBXp8=; b=CV37N+srVIulJ63nHpN171ukDgxMSgk/z84ghwN0bFrTnsWhEF7Rm3SLwPGJNuzCoHCyoZUriWzTw1d0lwFm/ciVd5q5YfdW9Y/J1pC41vTCYic1SfuRHv0NodvVAvuYvTW5qlG6+aJVHz8nnAsWAlNf2z/i8uGjTtCSU2BfHFBzStmOfS5IjXCI0EJQdxKa2OqndNogxm8cfxWLLbusnR7Hcf8jkgfUZrqVWH8HCVyiZkYCdgCSonCkhSl8tc44owzkp3y4PF2ujmo846e9jeZUpTOJ29U8uH952N8F8s7b+v6oKdggM+koOL4y/o4fke6tp8UOl4nvLd+Rj9Zrmw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UpUYlH/GwjqQxxAyph4HQ61KdVBWuzcE+U3pVdILhNNcYHrkzJx5DJlzsPSCVYJ3Kh7OkjJ44gJ9hv6n5GzNj22jtcQVn2l6trPzXEGmJ52U9AJNlGuvafswwfTbyDI3RwzWq9Ko42xFSvmtYduqIkOGlTa1jHOIzxMUx5hxkEQ0owBJ4Ykg/qTzq3u/EQwYE7dRCX2XOMXv5OC+r0kif3Gy/bJhFxW0rssnzhFOTU+qPe5hQd96bDPnZNMSZ/KIgCMoteGZ5wNKsA/x66xJhvB8VHLOR9rt9dkLKI9rnYNkEPo7ctZ207q2CIaZISstn9DhU5tMn/K84f2WYG44tw==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, lkml <linux-kernel@xxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 30 Sep 2021 12:21:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Both xen_pvh and xen_start_flags get written just once early during
init. Using the respective annotation then allows the open-coded placing
in .data to go away.

Additionally the former, like the latter, wants exporting, or else
xen_pvh_domain() can't be used from modules.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
I have to admit that it is completely unclear to me which form of
exporting I should have used: xen_domain_type is GPL-only while
xen_start_flags is not, yet both are used in similar ways, extending to
xen_pvh. Picking the GPL version was suggested by Jürgen.
---
v2: Use EXPORT_SYMBOL_GPL().

--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -75,7 +75,7 @@ EXPORT_SYMBOL_GPL(xen_have_vector_callba
  */
 enum xen_domain_type __ro_after_init xen_domain_type = XEN_NATIVE;
 EXPORT_SYMBOL_GPL(xen_domain_type);
-uint32_t xen_start_flags __section(".data") = 0;
+uint32_t __ro_after_init xen_start_flags;
 EXPORT_SYMBOL(xen_start_flags);
 
 /*
--- a/arch/x86/xen/enlighten_pvh.c
+++ b/arch/x86/xen/enlighten_pvh.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <linux/acpi.h>
+#include <linux/export.h>
 
 #include <xen/hvc-console.h>
 
@@ -18,10 +19,11 @@
 /*
  * PVH variables.
  *
- * The variable xen_pvh needs to live in the data segment since it is used
+ * The variable xen_pvh needs to live in a data segment since it is used
  * after startup_{32|64} is invoked, which will clear the .bss segment.
  */
-bool xen_pvh __section(".data") = 0;
+bool __ro_after_init xen_pvh;
+EXPORT_SYMBOL_GPL(xen_pvh);
 
 void __init xen_pvh_init(struct boot_params *boot_params)
 {




 


Rackspace

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