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

[PATCH 2/2] x86/time: add CF-clobber annotations


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 1 Mar 2022 12:06:33 +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=7Hcjv5yq81hzSD4vfgXUo4NPyGvjN63yGcHqxJqVJiY=; b=fuRvz87fIqhfNko060phsYx6S1OJVgl4BX08S8RPneS2gvQYhT+kGwL4C7RccNxdpYLfAqx9Xmpq3JjXMYmm5Zsm+svkIrnMlTDomYBOOoHu/Z1kgvav52AzenfHQXqf5MJpGtqIh0V8dryHw21PU7nVZiZn+9YydadRTJbvvVQoPJwyUD9+ss0h4nmp/DVxcXOlHv2Wa9hB0RmuUBIGbaPfZi2CxpkoCYdwaSoMh2k9Tb3+T1mWD3nFF6iVnMENCKVwkc6NIgNTpG2uy/K+SZIBxCs+qo3T7IhsPpdqLYzdX6edu50VxCJA/9J6JOEMrmf6hWMtpI0ZvOuxwbwGyQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XoYDXQIh6HdPVxe+FEDuGpz8xMLiqZzSV6fkP+UPJ+Ok1/PTKfjN/ocImxVrNI9eImI0iPYxYfqs6V244N1FuhLmKvtBNjyfuFkBj+h5RzS9xl8tLwzyy5B6S+7PK3re+0aHd7zEayMDKbfLJr52h01abo1B7znC7bX0ZmASA4lD4aNGkC5IsLkUfhFcVhQokxVC1wQRkwUFzCEoWSQ1odXON4CbCjQ+W75FEC2fmDwMhgdSx9XajGOsddfWCyBs8d7yzCn6H8iZ/hl2f1DGk315+XoqQak7HmLfjCM2MKXesEdHEUq5R7Bba1XBUjaEgTSOW7Z64XvKstzP+cHUBA==
  • 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: Tue, 01 Mar 2022 11:06:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

With bed9ae54df44 ("x86/time: switch platform timer hooks to altcall")
in place we can further arrange for ENDBR removal from the functions no
longer subject to indirect calls. Note that plt_tsc is left untouched,
for not holding any pointer eligible for ENDBR removal.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
I did consider converting most of the plt_* to const (plt_hpet and
plt_pmtimer cannot be converted), but this would entail quite a few
further changes.

--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -375,7 +375,7 @@ static void cf_check resume_pit(struct p
     outb(0, PIT_CH2);     /* MSB of count */
 }
 
-static struct platform_timesource __initdata plt_pit =
+static struct platform_timesource __initdata_cf_clobber plt_pit =
 {
     .id = "pit",
     .name = "PIT",
@@ -483,7 +483,7 @@ static void cf_check resume_hpet(struct
     hpet_resume(NULL);
 }
 
-static struct platform_timesource __initdata plt_hpet =
+static struct platform_timesource __initdata_cf_clobber plt_hpet =
 {
     .id = "hpet",
     .name = "HPET",
@@ -528,7 +528,7 @@ static s64 __init cf_check init_pmtimer(
     return adjust_elapsed(rdtsc_ordered() - start, elapsed, target);
 }
 
-static struct platform_timesource __initdata plt_pmtimer =
+static struct platform_timesource __initdata_cf_clobber plt_pmtimer =
 {
     .id = "acpi",
     .name = "ACPI PM Timer",
@@ -683,7 +683,7 @@ static void cf_check resume_xen_timer(st
     write_atomic(&xen_timer_last, 0);
 }
 
-static struct platform_timesource __initdata plt_xen_timer =
+static struct platform_timesource __initdata_cf_clobber plt_xen_timer =
 {
     .id = "xen",
     .name = "XEN PV CLOCK",
@@ -780,7 +780,7 @@ static uint64_t cf_check read_hyperv_tim
     return hv_scale_tsc(tsc, scale, offset);
 }
 
-static struct platform_timesource __initdata plt_hyperv_timer =
+static struct platform_timesource __initdata_cf_clobber plt_hyperv_timer =
 {
     .id = "hyperv",
     .name = "HYPER-V REFERENCE TSC",




 


Rackspace

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