Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756681AbdLOOme (ORCPT ); Fri, 15 Dec 2017 09:42:34 -0500 Received: from terminus.zytor.com ([65.50.211.136]:43449 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756606AbdLOOm2 (ORCPT ); Fri, 15 Dec 2017 09:42:28 -0500 Date: Fri, 15 Dec 2017 06:37:38 -0800 From: tip-bot for Andy Lutomirski Message-ID: Cc: linux-kernel@vger.kernel.org, rui.zhang@intel.com, luto@kernel.org, peterz@infradead.org, pavel@ucw.cz, jarkko.nikula@linux.intel.com, bpetkov@suse.de, hpa@zytor.com, jpoimboe@redhat.com, rafael.j.wysocki@intel.com, rjw@rjwysocki.net, tglx@linutronix.de, mingo@kernel.org, torvalds@linux-foundation.org Reply-To: rui.zhang@intel.com, luto@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, jpoimboe@redhat.com, bpetkov@suse.de, peterz@infradead.org, jarkko.nikula@linux.intel.com, pavel@ucw.cz, rjw@rjwysocki.net, tglx@linutronix.de, rafael.j.wysocki@intel.com, torvalds@linux-foundation.org, mingo@kernel.org In-Reply-To: <967909ce38d341b01d45eff53e278e2728a3a93a.1513286253.git.luto@kernel.org> References: <967909ce38d341b01d45eff53e278e2728a3a93a.1513286253.git.luto@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/power/64: Use struct desc_ptr for the IDT in struct saved_context Git-Commit-ID: 090edbe23ff57940fca7f57d9165ce57a826bd7a 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: 2812 Lines: 81 Commit-ID: 090edbe23ff57940fca7f57d9165ce57a826bd7a Gitweb: https://git.kernel.org/tip/090edbe23ff57940fca7f57d9165ce57a826bd7a Author: Andy Lutomirski AuthorDate: Thu, 14 Dec 2017 13:19:05 -0800 Committer: Ingo Molnar CommitDate: Fri, 15 Dec 2017 12:18:29 +0100 x86/power/64: Use struct desc_ptr for the IDT in struct saved_context x86_64's saved_context nonsensically used separate idt_limit and idt_base fields and then cast &idt_limit to struct desc_ptr *. This was correct (with -fno-strict-aliasing), but it's confusing, served no purpose, and required #ifdeffery. Simplify this by using struct desc_ptr directly. No change in functionality. Tested-by: Jarkko Nikula Signed-off-by: Andy Lutomirski Acked-by: Rafael J. Wysocki Acked-by: Thomas Gleixner Cc: Borislav Petkov Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Pavel Machek Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Zhang Rui Link: http://lkml.kernel.org/r/967909ce38d341b01d45eff53e278e2728a3a93a.1513286253.git.luto@kernel.org Signed-off-by: Ingo Molnar --- arch/x86/include/asm/suspend_64.h | 3 +-- arch/x86/power/cpu.c | 11 +---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/arch/x86/include/asm/suspend_64.h b/arch/x86/include/asm/suspend_64.h index 7306e91..600e9e0 100644 --- a/arch/x86/include/asm/suspend_64.h +++ b/arch/x86/include/asm/suspend_64.h @@ -30,8 +30,7 @@ struct saved_context { u16 gdt_pad; /* Unused */ struct desc_ptr gdt_desc; u16 idt_pad; - u16 idt_limit; - unsigned long idt_base; + struct desc_ptr idt; u16 ldt; u16 tss; unsigned long tr; diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c index 5191de1..472bc8c 100644 --- a/arch/x86/power/cpu.c +++ b/arch/x86/power/cpu.c @@ -82,12 +82,8 @@ static void __save_processor_state(struct saved_context *ctxt) /* * descriptor tables */ -#ifdef CONFIG_X86_32 store_idt(&ctxt->idt); -#else -/* CONFIG_X86_64 */ - store_idt((struct desc_ptr *)&ctxt->idt_limit); -#endif + /* * We save it here, but restore it only in the hibernate case. * For ACPI S3 resume, this is loaded via 'early_gdt_desc' in 64-bit @@ -219,12 +215,7 @@ static void notrace __restore_processor_state(struct saved_context *ctxt) * now restore the descriptor tables to their proper values * ltr is done i fix_processor_context(). */ -#ifdef CONFIG_X86_32 load_idt(&ctxt->idt); -#else -/* CONFIG_X86_64 */ - load_idt((const struct desc_ptr *)&ctxt->idt_limit); -#endif #ifdef CONFIG_X86_64 /*