From: tip-bot for Andy Lutomirski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: boris.ostrovsky@oracle.com, jpoimboe@redhat.com,
tglx@linutronix.de, thgarnie@google.com, dvlasenk@redhat.com,
linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
hpa@zytor.com, peterz@infradead.org, jgross@suse.com,
brgerst@gmail.com, luto@kernel.org, bp@alien8.de,
mingo@kernel.org
Subject: [tip:x86/mm] x86/gdt: Get rid of the get_*_gdt_*_vaddr() helpers
Date: Thu, 23 Mar 2017 02:15:12 -0700 [thread overview]
Message-ID: <tip-59c58ceb29d0f030eddb36a3a9dbadcc499786a6@git.kernel.org> (raw)
In-Reply-To: <46108fb35e1699252b1b6a85039303ff562c9836.1490218061.git.luto@kernel.org>
Commit-ID: 59c58ceb29d0f030eddb36a3a9dbadcc499786a6
Gitweb: http://git.kernel.org/tip/59c58ceb29d0f030eddb36a3a9dbadcc499786a6
Author: Andy Lutomirski <luto@kernel.org>
AuthorDate: Wed, 22 Mar 2017 14:32:33 -0700
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 23 Mar 2017 08:25:08 +0100
x86/gdt: Get rid of the get_*_gdt_*_vaddr() helpers
There's a single caller that is only there because it's passing a
pointer into a function (vmcs_writel()) that takes an unsigned long.
Let's just cast it in place rather than having a bunch of trivial
helpers.
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Garnier <thgarnie@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/46108fb35e1699252b1b6a85039303ff562c9836.1490218061.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/include/asm/desc.h | 20 --------------------
arch/x86/kvm/vmx.c | 4 ++--
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h
index bde1169..17cb46e 100644
--- a/arch/x86/include/asm/desc.h
+++ b/arch/x86/include/asm/desc.h
@@ -53,22 +53,12 @@ static inline struct desc_struct *get_cpu_gdt_rw(unsigned int cpu)
return per_cpu(gdt_page, cpu).gdt;
}
-static inline unsigned long get_cpu_gdt_rw_vaddr(unsigned int cpu)
-{
- return (unsigned long)get_cpu_gdt_rw(cpu);
-}
-
/* Provide the current original GDT */
static inline struct desc_struct *get_current_gdt_rw(void)
{
return this_cpu_ptr(&gdt_page)->gdt;
}
-static inline unsigned long get_current_gdt_rw_vaddr(void)
-{
- return (unsigned long)get_current_gdt_rw();
-}
-
/* Get the fixmap index for a specific processor */
static inline unsigned int get_cpu_gdt_ro_index(int cpu)
{
@@ -82,22 +72,12 @@ static inline struct desc_struct *get_cpu_gdt_ro(int cpu)
return (struct desc_struct *)__fix_to_virt(idx);
}
-static inline unsigned long get_cpu_gdt_ro_vaddr(int cpu)
-{
- return (unsigned long)get_cpu_gdt_ro(cpu);
-}
-
/* Provide the current read-only GDT */
static inline struct desc_struct *get_current_gdt_ro(void)
{
return get_cpu_gdt_ro(smp_processor_id());
}
-static inline unsigned long get_current_gdt_ro_vaddr(void)
-{
- return (unsigned long)get_current_gdt_ro();
-}
-
/* Provide the physical address of the GDT page. */
static inline phys_addr_t get_cpu_gdt_paddr(unsigned int cpu)
{
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 596a76d..3acde66 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2264,7 +2264,7 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
}
if (!already_loaded) {
- unsigned long gdt = get_current_gdt_ro_vaddr();
+ void *gdt = get_current_gdt_ro();
unsigned long sysenter_esp;
kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu);
@@ -2275,7 +2275,7 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
*/
vmcs_writel(HOST_TR_BASE,
(unsigned long)this_cpu_ptr(&cpu_tss));
- vmcs_writel(HOST_GDTR_BASE, gdt); /* 22.2.4 */
+ vmcs_writel(HOST_GDTR_BASE, (unsigned long)gdt); /* 22.2.4 */
/*
* VM exits change the host TR limit to 0x67 after a VM
next prev parent reply other threads:[~2017-03-23 9:22 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-22 21:32 [PATCH 0/7] Misc GDT fixes and a cleanup Andy Lutomirski
2017-03-22 21:32 ` [PATCH 1/7] selftests/x86/ldt_gdt_32: Work around a glibc sigaction bug Andy Lutomirski
2017-03-23 9:13 ` [tip:x86/mm] selftests/x86/ldt_gdt_32: Work around a glibc sigaction() bug tip-bot for Andy Lutomirski
2017-03-22 21:32 ` [PATCH 2/7] x86/gdt: Fix setup_fixmap_gdt() to use the correct PA Andy Lutomirski
2017-03-23 9:13 ` [tip:x86/mm] " tip-bot for Andy Lutomirski
[not found] ` <cover.1490218061.git.luto-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-03-22 21:32 ` [PATCH 3/7] x86/efi/32: Fix EFI on systems where the percpu GDT is virtually mapped Andy Lutomirski
2017-03-22 21:32 ` Andy Lutomirski
2017-03-23 9:14 ` [tip:x86/mm] x86/efi/32: Fix EFI on systems where the per-cpu " tip-bot for Andy Lutomirski
2017-03-22 21:32 ` [PATCH 4/7] x86/boot/32: Defer resyncing initial_page_table until percpu is set up Andy Lutomirski
2017-03-22 21:32 ` Andy Lutomirski
2017-03-23 9:14 ` [tip:x86/mm] x86/boot/32: Defer resyncing initial_page_table until per-cpu " tip-bot for Andy Lutomirski
[not found] ` <tip-23b2a4ddebdd17fad265b4bb77256c2e4ec37dee-Ckxz5ZWcFp/9qxiX1TGQuw@public.gmane.org>
2017-05-08 6:31 ` Jan Kiszka
2017-05-08 6:31 ` Jan Kiszka
[not found] ` <0c4d6d04-7038-fb82-87b3-343784550d0a-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org>
2017-05-08 9:32 ` Andy Shevchenko
2017-05-08 9:32 ` Andy Shevchenko
[not found] ` <CAHp75VdX-kUqW0MKOSTz9zByU-eipBMnKpdUbTt2SVOJ8Kvrig-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-08 11:21 ` Andy Lutomirski
2017-05-08 11:21 ` Andy Lutomirski
2017-05-08 12:34 ` Jan Kiszka
[not found] ` <7f5916b5-01c0-52d5-9f44-dee4bf355212-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org>
2017-05-08 14:45 ` Andy Shevchenko
2017-05-08 14:45 ` Andy Shevchenko
2017-05-08 15:24 ` Jan Kiszka
2017-05-08 17:53 ` Jan Kiszka
2017-05-08 17:53 ` Jan Kiszka
[not found] ` <7ce941e5-5a9b-acd7-c7b6-7be464572de5-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org>
2017-05-09 0:03 ` Andy Lutomirski
2017-05-09 0:03 ` Andy Lutomirski
2017-03-22 21:32 ` [PATCH 5/7] x86/gdt: Get rid of the get_*_gdt_*_vaddr() helpers Andy Lutomirski
2017-03-23 9:15 ` tip-bot for Andy Lutomirski [this message]
2017-03-22 21:32 ` [PATCH 6/7] x86/xen/gdt: Use X86_FEATURE_XENPV instead of globals for the GDT fixup Andy Lutomirski
2017-03-23 9:15 ` [tip:x86/mm] " tip-bot for Andy Lutomirski
2017-03-22 21:32 ` [PATCH 7/7] x86/boot/32: Rewrite test_wp_bit() Andy Lutomirski
2017-03-23 7:31 ` [PATCH 0/7] Misc GDT fixes and a cleanup Ingo Molnar
2017-03-23 12:18 ` Boris Ostrovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-59c58ceb29d0f030eddb36a3a9dbadcc499786a6@git.kernel.org \
--to=tipbot@zytor.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=thgarnie@google.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.