Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933790AbdCWJWK (ORCPT ); Thu, 23 Mar 2017 05:22:10 -0400 Received: from terminus.zytor.com ([65.50.211.136]:57005 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933751AbdCWJWI (ORCPT ); Thu, 23 Mar 2017 05:22:08 -0400 Date: Thu, 23 Mar 2017 02:15:12 -0700 From: tip-bot for Andy Lutomirski Message-ID: 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 Reply-To: hpa@zytor.com, peterz@infradead.org, jgross@suse.com, dvlasenk@redhat.com, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, boris.ostrovsky@oracle.com, tglx@linutronix.de, jpoimboe@redhat.com, thgarnie@google.com, luto@kernel.org, bp@alien8.de, mingo@kernel.org, brgerst@gmail.com In-Reply-To: <46108fb35e1699252b1b6a85039303ff562c9836.1490218061.git.luto@kernel.org> References: <46108fb35e1699252b1b6a85039303ff562c9836.1490218061.git.luto@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/mm] x86/gdt: Get rid of the get_*_gdt_*_vaddr() helpers Git-Commit-ID: 59c58ceb29d0f030eddb36a3a9dbadcc499786a6 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3558 Lines: 105 Commit-ID: 59c58ceb29d0f030eddb36a3a9dbadcc499786a6 Gitweb: http://git.kernel.org/tip/59c58ceb29d0f030eddb36a3a9dbadcc499786a6 Author: Andy Lutomirski AuthorDate: Wed, 22 Mar 2017 14:32:33 -0700 Committer: Ingo Molnar 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 Cc: Boris Ostrovsky Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Garnier Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/46108fb35e1699252b1b6a85039303ff562c9836.1490218061.git.luto@kernel.org Signed-off-by: Ingo Molnar --- 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