linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Andy Lutomirski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:x86/urgent] x86/power/64: Use struct desc_ptr for the IDT in struct saved_context
Date: Fri, 15 Dec 2017 06:37:38 -0800	[thread overview]
Message-ID: <tip-090edbe23ff57940fca7f57d9165ce57a826bd7a@git.kernel.org> (raw)
In-Reply-To: <967909ce38d341b01d45eff53e278e2728a3a93a.1513286253.git.luto@kernel.org>

Commit-ID:  090edbe23ff57940fca7f57d9165ce57a826bd7a
Gitweb:     https://git.kernel.org/tip/090edbe23ff57940fca7f57d9165ce57a826bd7a
Author:     Andy Lutomirski <luto@kernel.org>
AuthorDate: Thu, 14 Dec 2017 13:19:05 -0800
Committer:  Ingo Molnar <mingo@kernel.org>
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 <jarkko.nikula@linux.intel.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bpetkov@suse.de>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Zhang Rui <rui.zhang@intel.com>
Link: http://lkml.kernel.org/r/967909ce38d341b01d45eff53e278e2728a3a93a.1513286253.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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
 	/*

  reply	other threads:[~2017-12-15 14:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 21:19 [PATCH urgent 0/3] __restore_processor_state() fixes Andy Lutomirski
2017-12-14 21:19 ` [PATCH urgent 1/3] x86/power/64: Use struct desc_ptr for the IDT in struct saved_context Andy Lutomirski
2017-12-15 14:37   ` tip-bot for Andy Lutomirski [this message]
2017-12-14 21:19 ` [PATCH urgent 2/3] x86/power/32: Move SYSENTER MSR restoration to fix_processor_context() Andy Lutomirski
2017-12-15 14:38   ` [tip:x86/urgent] " tip-bot for Andy Lutomirski
2017-12-14 21:19 ` [PATCH urgent 3/3] x86/power: Make restore_processor_context() sane Andy Lutomirski
2017-12-14 22:32   ` Pavel Machek
2017-12-15 14:38   ` [tip:x86/urgent] " tip-bot for Andy Lutomirski
2017-12-15  1:28 ` [PATCH urgent 0/3] __restore_processor_state() fixes Rafael J. Wysocki
2017-12-15  1:35   ` Linus Torvalds
2017-12-15 11:21     ` Ingo Molnar
2017-12-15  9:18   ` Jarkko Nikula
2017-12-15 11:31     ` Ingo Molnar

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-090edbe23ff57940fca7f57d9165ce57a826bd7a@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bpetkov@suse.de \
    --cc=hpa@zytor.com \
    --cc=jarkko.nikula@linux.intel.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=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=tglx@linutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).