Skip to content

Commit 4018164

Browse files
jgross1KAGA-KOKO
authored andcommitted
x86/paravirt: Move items in pv_info under PARAVIRT_XXL umbrella
All items but name in pv_info are needed by Xen PV only. Define them with CONFIG_PARAVIRT_XXL set only. Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: xen-devel@lists.xenproject.org Cc: virtualization@lists.linux-foundation.org Cc: akataria@vmware.com Cc: rusty@rustcorp.com.au Cc: boris.ostrovsky@oracle.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/20180828074026.820-12-jgross@suse.com
1 parent c00a280 commit 4018164

File tree

6 files changed

+9
-3
lines changed

6 files changed

+9
-3
lines changed

arch/x86/include/asm/paravirt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ static inline void wbinvd(void)
104104
PVOP_VCALL0(cpu.wbinvd);
105105
}
106106

107+
#ifdef CONFIG_PARAVIRT_XXL
107108
#define get_kernel_rpl() (pv_info.kernel_rpl)
109+
#endif
108110

109111
static inline u64 paravirt_read_msr(unsigned msr)
110112
{

arch/x86/include/asm/paravirt_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ struct paravirt_callee_save {
6666

6767
/* general info */
6868
struct pv_info {
69+
#ifdef CONFIG_PARAVIRT_XXL
6970
unsigned int kernel_rpl;
7071
int shared_kernel_pmd;
7172

7273
#ifdef CONFIG_X86_64
7374
u16 extra_user_64bit_cs; /* __USER_CS if none */
75+
#endif
7476
#endif
7577

7678
const char *name;

arch/x86/include/asm/pgtable-3level_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ typedef union {
2020
} pte_t;
2121
#endif /* !__ASSEMBLY__ */
2222

23-
#ifdef CONFIG_PARAVIRT
23+
#ifdef CONFIG_PARAVIRT_XXL
2424
#define SHARED_KERNEL_PMD ((!static_cpu_has(X86_FEATURE_PTI) && \
2525
(pv_info.shared_kernel_pmd)))
2626
#else

arch/x86/include/asm/ptrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static inline int v8086_mode(struct pt_regs *regs)
144144
static inline bool user_64bit_mode(struct pt_regs *regs)
145145
{
146146
#ifdef CONFIG_X86_64
147-
#ifndef CONFIG_PARAVIRT
147+
#ifndef CONFIG_PARAVIRT_XXL
148148
/*
149149
* On non-paravirt systems, this is the only long mode CPL 3
150150
* selector. We do not allow long mode selectors in the LDT.

arch/x86/include/asm/segment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211

212212
#endif
213213

214-
#ifndef CONFIG_PARAVIRT
214+
#ifndef CONFIG_PARAVIRT_XXL
215215
# define get_kernel_rpl() 0
216216
#endif
217217

arch/x86/kernel/paravirt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,14 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
293293

294294
struct pv_info pv_info = {
295295
.name = "bare hardware",
296+
#ifdef CONFIG_PARAVIRT_XXL
296297
.kernel_rpl = 0,
297298
.shared_kernel_pmd = 1, /* Only used when CONFIG_X86_PAE is set */
298299

299300
#ifdef CONFIG_X86_64
300301
.extra_user_64bit_cs = __USER_CS,
301302
#endif
303+
#endif
302304
};
303305

304306
#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)

0 commit comments

Comments
 (0)