Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1338174

[PATCH 8/9] x86/rtc: replace paravirt_enabled() check with subarch check

From "Luis R. Rodriguez" <mcgrof@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 8/9] x86/rtc: replace paravirt_enabled() check with subarch check
Date 2016-02-19 14:10 +0100
Message-ID <r3SYP-5z8-25@gated-at.bofh.it> (permalink)
References <r3SYO-5z8-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The current check is a super long winded way of asking if this
is on lguest. The flags is used for legacy features, this is
likely inspired by the ACPI IA-PC boot architecture flags, where
as for RTC it annotates No CMOS real-time clock present. I don't
expect we will be implementing more legacy features, its simply
pointless so just remove this legacy flag feature thing as well.

Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
 arch/x86/include/asm/paravirt.h       | 6 ------
 arch/x86/include/asm/paravirt_types.h | 5 -----
 arch/x86/include/asm/processor.h      | 1 -
 arch/x86/kernel/rtc.c                 | 3 ++-
 arch/x86/xen/enlighten.c              | 3 ---
 5 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index f6192502149e..c261402340e3 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -19,12 +19,6 @@ static inline int paravirt_enabled(void)
 	return pv_info.paravirt_enabled;
 }
 
-static inline int paravirt_has_feature(unsigned int feature)
-{
-	WARN_ON_ONCE(!pv_info.paravirt_enabled);
-	return (pv_info.features & feature);
-}
-
 static inline void load_sp0(struct tss_struct *tss,
 			     struct thread_struct *thread)
 {
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index 77db5616a473..2489d6a08e89 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -70,14 +70,9 @@ struct pv_info {
 #endif
 
 	int paravirt_enabled;
-	unsigned int features;	  /* valid only if paravirt_enabled is set */
 	const char *name;
 };
 
-#define paravirt_has(x) paravirt_has_feature(PV_SUPPORTED_##x)
-/* Supported features */
-#define PV_SUPPORTED_RTC        (1<<0)
-
 struct pv_init_ops {
 	/*
 	 * Patch may replace one of the defined code sequences with
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 20c11d1aa4cc..10f3614265c1 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -472,7 +472,6 @@ static inline unsigned long current_top_of_stack(void)
 #else
 #define __cpuid			native_cpuid
 #define paravirt_enabled()	0
-#define paravirt_has(x) 	0
 
 static inline void load_sp0(struct tss_struct *tss,
 			    struct thread_struct *thread)
diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c
index 4af8d063fb36..8471523ee127 100644
--- a/arch/x86/kernel/rtc.c
+++ b/arch/x86/kernel/rtc.c
@@ -14,6 +14,7 @@
 #include <asm/time.h>
 #include <asm/intel-mid.h>
 #include <asm/rtc.h>
+#include <asm/setup.h>
 
 #ifdef CONFIG_X86_32
 /*
@@ -200,7 +201,7 @@ static __init int add_rtc_cmos(void)
 	}
 #endif
 
-	if (paravirt_enabled() && !paravirt_has(RTC))
+	if (boot_params.hdr.hardware_subarch == X86_SUBARCH_LGUEST)
 		return -ENODEV;
 
 	platform_device_register(&rtc_device);
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 5b3f1c763806..5c06169bce27 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1192,7 +1192,6 @@ static const struct pv_info xen_info __initconst = {
 #ifdef CONFIG_X86_64
 	.extra_user_64bit_cs = FLAT_USER_CS64,
 #endif
-	.features = 0,
 	.name = "Xen",
 };
 
@@ -1526,8 +1525,6 @@ asmlinkage __visible void __init xen_start_kernel(void)
 
 	/* Install Xen paravirt ops */
 	pv_info = xen_info;
-	if (xen_initial_domain())
-		pv_info.features |= PV_SUPPORTED_RTC;
 	pv_init_ops = xen_init_ops;
 	if (!xen_pvh_domain()) {
 		pv_cpu_ops = xen_cpu_ops;
-- 
2.7.0

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/9] x86/init: replace paravirt_enabled() were possible "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-02-19 14:10 +0100
  [PATCH 8/9] x86/rtc: replace paravirt_enabled() check with subarch check "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-02-19 14:10 +0100
    Re: [Xen-devel] [PATCH 8/9] x86/rtc: replace paravirt_enabled() check  with subarch check Juergen Gross <jgross@suse.com> - 2016-02-19 14:30 +0100
      Re: [Xen-devel] [PATCH 8/9] x86/rtc: replace paravirt_enabled()  check with subarch check "Luis R. Rodriguez" <mcgrof@suse.com> - 2016-02-19 15:50 +0100
        Re: [Xen-devel] [PATCH 8/9] x86/rtc: replace paravirt_enabled()  check with subarch check "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-02-22 07:10 +0100
          Re: [Xen-devel] [PATCH 8/9] x86/rtc: replace paravirt_enabled()  check with subarch check Borislav Petkov <bp@alien8.de> - 2016-02-22 11:30 +0100
            Re: [Xen-devel] [PATCH 8/9] x86/rtc: replace paravirt_enabled() check  with subarch check Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-22 15:40 +0100
    Re: [Xen-devel] [PATCH 8/9] x86/rtc: replace paravirt_enabled() check  with subarch check David Vrabel <david.vrabel@citrix.com> - 2016-02-19 14:30 +0100
  [PATCH 5/9] apm32: remove paravirt_enabled() use "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-02-19 14:10 +0100
    Re: [PATCH 5/9] apm32: remove paravirt_enabled() use Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-19 16:20 +0100
      Re: [PATCH 5/9] apm32: remove paravirt_enabled() use "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-02-19 22:00 +0100
        Re: [PATCH 5/9] apm32: remove paravirt_enabled() use Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-19 23:20 +0100
          Re: [PATCH 5/9] apm32: remove paravirt_enabled() use "Luis R. Rodriguez" <mcgrof@suse.com> - 2016-02-20 01:50 +0100
            Re: [PATCH 5/9] apm32: remove paravirt_enabled() use Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-22 15:20 +0100
  [PATCH 4/9] x86/init: make ebda depend on PC subarch "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-02-19 14:20 +0100
  [PATCH 1/9] x86/boot: enumerate documentation for the x86 hardware_subarch "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-02-19 14:20 +0100
    Re: [Xen-devel] [PATCH 1/9] x86/boot: enumerate documentation for the  x86 hardware_subarch Juergen Gross <jgross@suse.com> - 2016-02-19 14:30 +0100
    Re: [Xen-devel] [PATCH 1/9] x86/boot: enumerate documentation for the  x86 hardware_subarch David Vrabel <david.vrabel@citrix.com> - 2016-02-19 14:50 +0100
      Re: [Xen-devel] [PATCH 1/9] x86/boot: enumerate documentation for  the x86 hardware_subarch "Luis R. Rodriguez" <mcgrof@suse.com> - 2016-02-19 15:50 +0100
  [PATCH 6/9] x86/tboot: remove paravirt_enabled() "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-02-19 14:20 +0100
  [PATCH 7/9] x86/cpu/intel: replace paravirt_enabled() for f00f work around "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-02-19 14:20 +0100
  [PATCH 3/9] x86/xen: use X86_SUBARCH_XEN for PV guest boots "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-02-19 14:20 +0100
  Re: [Xen-devel] [PATCH 0/9] x86/init: replace paravirt_enabled() were  possible David Vrabel <david.vrabel@citrix.com> - 2016-02-19 14:40 +0100
    Re: [Xen-devel] [PATCH 0/9] x86/init: replace paravirt_enabled()  were possible "Luis R. Rodriguez" <mcgrof@suse.com> - 2016-02-19 15:40 +0100

csiph-web