Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2520119yba; Mon, 15 Apr 2019 13:27:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAVlwpIBQhUgkiiucqUARIAuVtIhzA0GrYzOX6ogZy3ej114XZdSa3GGYCjapTV8bTA7l+ X-Received: by 2002:aa7:9095:: with SMTP id i21mr77477625pfa.134.1555360043466; Mon, 15 Apr 2019 13:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555360043; cv=none; d=google.com; s=arc-20160816; b=oPdyyTiTFPiZo5YQ+1rtwGP7HiSevX9UYFSaW9dAj2sjQ/Jo3tX208VjHd0RF6WvRZ kLe421tm7pR0tQwqicYbXWC6KhwExURUJccA+F1MKVSYm3eHQNT9uKxvljfWKuCFcD13 xpM82lkb5Wm0iXW4QkesNl92DOu4l3M2yiFmncRXBEZyBJM9wP4Cwq+0pQx7wwUVbVHV cGOX58zsZIJnDp1UmFY3Pg+XVxEpflrHY079bg72BDwGQg0Kt3kwfc6b6d/krYLwjYoN MLN3+mROYCiOt+CcAxRyDQLGXjFV1uOcq+lcsHoS0vGuWbHDzu6YGbXZYynaQjyCfbB4 49GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wSwk/dZmdwGrY7gaYRe8fL5czmL74xi9pmxa1wVw8Mo=; b=RFGemtAmuCnUNdL2ZRoWRx4kNt5yOyukOrvOgaJ+FKiEqH7sxpfyTpEvrqoSg0wCR1 sRATXMYh3abO3ATD/VsXGNOxmKBWlMXOauM9JgJSKoOZbOievNspKYMvkwODKEuzD7mQ VTNJJ9UqbsM44fdiLyse6XUNJLcjY+eMVErZRC2P9t51utVyQQToPvBp+NnfaxP1Xb2I dIiaLJX9Dby47HOmMqYNxPTGvYy3PV/jyKKu0ilQvWSP9iUQ0QvOQ4a35bzq5bKDB/Z1 doeNUYlwvN5M4vC5z7gpoMeQvomOt/JkeqUbt7Hk80SuuIUoU+MA60q8p4Kbx+HcMwdW OmCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wZXEDJzC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c20si45725599pls.53.2019.04.15.13.27.07; Mon, 15 Apr 2019 13:27:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wZXEDJzC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728271AbfDOSpA (ORCPT + 99 others); Mon, 15 Apr 2019 14:45:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:47028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728173AbfDOSo6 (ORCPT ); Mon, 15 Apr 2019 14:44:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AB662218D3; Mon, 15 Apr 2019 18:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555353897; bh=tkvAW89GK7drc5vQY5yCy4q7yluyQUsa649zRA4ciEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wZXEDJzCEMBD2M4VN9jNm9CcLvItBh/Z7+lBQ2XJV9WLXQDpec0dqgO6w+vWsSus0 r78bRLZiWl3xqpEewawQrgoDpbv5epfAzDceY4F4FNDM5fV+Et9OOCGXGfWW0LwIBs 2KtE4GDrpL19bN7m1cP9X+Pesre+UZzQjqxS55y8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jarkko Nikula , Andy Lutomirski , "Rafael J. Wysocki" , Thomas Gleixner , Borislav Petkov , Josh Poimboeuf , Linus Torvalds , Pavel Machek , Peter Zijlstra , "Rafael J. Wysocki" , Zhang Rui , Ingo Molnar , Sasha Levin Subject: [PATCH 4.9 02/76] x86/power/64: Use struct desc_ptr for the IDT in struct saved_context Date: Mon, 15 Apr 2019 20:43:26 +0200 Message-Id: <20190415183708.245258644@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183707.712011689@linuxfoundation.org> References: <20190415183707.712011689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 090edbe23ff57940fca7f57d9165ce57a826bd7a ] 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 Signed-off-by: Sasha Levin --- 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 2bd96b4df140..ab899e5f3a85 100644 --- a/arch/x86/include/asm/suspend_64.h +++ b/arch/x86/include/asm/suspend_64.h @@ -29,8 +29,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 73063dfed476..ec923a1cdaf0 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 @@ -215,12 +211,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 /* -- 2.19.1