Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752127AbdIAOkP (ORCPT ); Fri, 1 Sep 2017 10:40:15 -0400 Received: from mail-ve1eur01on0116.outbound.protection.outlook.com ([104.47.1.116]:28384 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751970AbdIAOkN (ORCPT ); Fri, 1 Sep 2017 10:40:13 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=avagin@virtuozzo.com; Date: Fri, 1 Sep 2017 07:39:53 -0700 From: Andrei Vagin To: Ingo Molnar Cc: tip-bot for Jacob Shin , Thomas Gleixner , Cyrill Gorcunov , linux-tip-commits@vger.kernel.org, luto@kernel.org, peterz@infradead.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org, hpa@zytor.com, brgerst@gmail.com, jpoimboe@redhat.com, bp@alien8.de, torvalds@linux-foundation.org, dvlasenk@redhat.com Subject: Re: [PATCH] x86/idt: Fix the X86_TRAP_BP gate Message-ID: <20170901143952.GA9394@outlook.office365.com> References: <20170901062815.GA349@outlook.office365.com> <20170901082630.xvyi5bwk6etmppqc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20170901082630.xvyi5bwk6etmppqc@gmail.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [73.140.212.29] X-ClientProxiedBy: MWHPR11CA0018.namprd11.prod.outlook.com (2603:10b6:301:1::28) To DB5PR08MB0743.eurprd08.prod.outlook.com (2a01:111:e400:599c::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 17fef5d7-f1af-4ec3-802d-08d4f14757fc X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DB5PR08MB0743; X-Microsoft-Exchange-Diagnostics: 1;DB5PR08MB0743;3:55TnOEgQlZuvYPkprrN7BUT+9+c3n8i+Sqv7s1rafyzCYNdoOprQWAtD+FD8Ub8WtaC3ntewWiGaEtwJaxo5I1LOjBfi/V7AT9kKO8DEsP3ZTDH9B/AUQHgNvKNH4LTNIF4zIGS6z5SL3kmFsVsufpbwddQbI5w1FCsA9+HtSvdzwrUQl8IxV1xGc/aTxb9sTM736IL8YiMwxkHOJ7GYMqEB1fQwewAOFI6/sjsDmWDxHrhMTHU+JFQDit7TCtrc;25:GoEemalfyLs2u/na3yc6LUDIuNc6IqXZSI21E5QUMxP/q7x5s2LSRL6qwq8HQJtEyCV3tJNdXyaPssq0eXyMQqbVjLNPb9Cls177BU9QHJoxXto4pYPikK4k4jKLLoIaUjz5YUnLIDoSOkCJXKOVNcBcSuw4HjGdF5UOvK5kUTUTHBWuYok2txg9skfSsdJWfDg0jhDlowIMgA9nCP1R7pZEul2SeI4e81zBkpipNSHwpg7fLhRJfWb4LdlzpzkKnMwb2jyZoZGhYujCt4GAw/eO5LcUBmYv8Cz7Ns4nri8B9+0iPsy/IEyy8/IvcqNABqiu2rPk4llSDZ98OG3A4A==;31:0QvkD1PP1TrZsmBGOWOs4rH03y9LkNFANovOpRSXaT7UGijHhK+HffGajp5iaBmM5A9jIdXP7C+SVddNQb0Yjt7rXrbK7xbhwI8sAbgUKx3iqScWCs22ThpKWGaZAM5Ym5Q15S0WT6ZxQU7ZzyZb7/LZiwMAPu2y4d8A9dBBrDBgyxS6V1ZbQIzIrFZBSuIRIGYu99hfQ3sfM3S4S7YWAIXlEZG2Wltj9ShsU2VA/+0= X-MS-TrafficTypeDiagnostic: DB5PR08MB0743: X-Microsoft-Exchange-Diagnostics: 1;DB5PR08MB0743;20:wVszbfXzWoHAcQ5AIMINEtlunJVdDzm847qnJskbxshkTmn8HrT5qVqUwwFRNM3OaokFns0Z1zgPuFEGo7DZCfOjbYaaznxJvZaQUwLyJLehdmzaprdfZQHe4WAH4tCXiIZ/Z6DlUzwI8+rYpGnrPGd2OMbrh7BpaavPwn1uJB7QODG3NSIEYgp6topOb3b55IBNOD8HjCOJzB9/pESt+aJkDSsVqvlHaTg71xhbUl5iVwFNtzI7xmzJX14Spx5XQncj/jaIxR3rdRt1xJrBfPkhaBsE4454tP3uEmbGrquWeemYhoOmFIGiA1qiX+LLsBwH8twPdrAEwTdpTFsHZwiGCx5zGYGy35S3g4tThico0yUpJWZC3OdIikuh0gIP5gLD7bsBOjmqYo1S2K4svz1pzmYzbLZgNZkZaWfuyA0=;4:Aev8kX0JKSVb47iBNAyTVspcjqDTq+MJRjG78YnLW1ax3TT81anAEunu//eLwiZJ7hL23/OYBlf/f+zsVMNmw7mw3T3/Rnv1b23oYZKFMWa7TYynFs8GreLzEix33qX2pi8nwfDA2vim6bP1PXtJATIU77wo/i8pDmW3rdPMYDRXo//2bWnnpJvqf9m9HUujhkRlbxvuijWJqR8vTPFQW2ycRMXoYxIMQRkSs8gacz/ArwMc5oNM0mEA4/UHkSq8 X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123562025)(20161123560025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DB5PR08MB0743;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DB5PR08MB0743; X-Forefront-PRVS: 0417A3FFD2 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(7370300001)(4630300001)(6009001)(39830400002)(199003)(24454002)(189002)(1076002)(6246003)(110136004)(7416002)(86362001)(575784001)(50466002)(66066001)(7350300001)(4326008)(101416001)(189998001)(305945005)(6666003)(55016002)(9686003)(54906002)(2950100002)(42186005)(53416004)(6916009)(478600001)(5660300001)(105586002)(229853002)(47776003)(53936002)(83506001)(3846002)(106356001)(33656002)(6506006)(6116002)(2906002)(68736007)(81166006)(81156014)(69596002)(50986999)(8676002)(54356999)(7736002)(25786009)(4001350100001)(76176999)(23686003)(97736004)(18370500001);DIR:OUT;SFP:1102;SCL:1;SRVR:DB5PR08MB0743;H:outlook.office365.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?koi8-r?Q?1;DB5PR08MB0743;23:cLuJiOhlkVsl9iDhnGEgk8DYaYbKLdGVFaMb6MdsAXy?= =?koi8-r?Q?MdYa3e2KHC19uXpF6fnUGGh7kXbyEFjRPTbGOb31C13SLWaRhmMNUw56jGMyr1?= =?koi8-r?Q?3uVptJF2kxbOpec5QDUF6euHBxeHeH/zWT4BrMJ9bS99KnFIUgOR+lcvX8RWoe?= =?koi8-r?Q?7qXNtmUSvGKdRqpJuWXs1bdR6+Cl0jUvKPA0tRzz2F6AHw4I8xjvfW37u+xlCh?= =?koi8-r?Q?rr3RtQf8xPV8dI9GkxfJt7Wh8aiCHN0cLFpjYQN2LuBvgcoTafd/diJu9UIQUA?= =?koi8-r?Q?r/g3QSDohTVjeDgJqRT4BZg3i2tC+KMgSyeBz+QiJm9O8oWjMPSZxuWqCajLwl?= =?koi8-r?Q?ZJF0BatkrvpC3dqMW8GCNK+yOPhwvVmBsqCXmIJa8gqVDBiXZ6BLWbzlI0Fhai?= =?koi8-r?Q?BQ3oT7ssGGan1234RtR+yMPhPLqTB7Box1ETlg8kZJHyOkyMzYEoLUd1hTZElw?= =?koi8-r?Q?bpUGKtXOG8xV89xo0eX3Jl5OL76bbJdvdXuSQAWj6JSU/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9rBGj+R1eVpoqadZWlA55M9QY3IOCTl4z32MZ1l2Wtwgqb++pXv20ljf5m0Miu7ImNvp9N7jw6pC1sApxyHiqmpHwxkzuXbliZaQFdUASgddxAZbJ84wlz/hjbgJV6EICc1fRBaYXdwW6MK5cIen0BxhRlEcMy7p9nLU78L3hxm3l4haLckCmbnZHvYnNrckIqlCYKFRddfhv8J2udSM4FO8HyJ0pMkajVs5B4C2VBbXsD+g3S/6DOcSU2PMO28VFPMrVrgtARmMtNZShf7pT72Wx+u+UqcCAgVuhbR2gg==;5:3BU/IDgiEPEr6LmvLbqUm++P1xKOoBeASsJdq4j4vCf4YL85kGRX5bqa93lVRUmmVo4omqd62AO+cyP3b9OZM2+JAmCpatQItVeQVqgF40HxRGuxABNuhX10X0PxzKKQRqcJlEjUDepWvWRLE/vgUA==;24:nEPcjamijvuZdQI88mFFIx/vI7MAGf1y7111JIXHRUHC7pVYukUIKYzRlRvEnjaGS4rMmh1tcV+X0bJlr2PxD962FmaB/TfuOWnT/NeXTsw=;7:qa+ZKpMTyAwKUIm9bKdwFNHwfSOOyAErVYnCrNVJHc6x3vn9+nYw96OSiqVuNy4besby3jKh+R61jAzkhegPnT2d339AJ/BamPjUuYYVwxYRgpaLdOQy28/ltv5R41iwicZ79E3Z2QLGk0g8CpYNhiurhc02MT7nY28hMgTzM5FpHdPC1xPGk3mf67EseHlfRLjfK59kgg+vCcJvQVll4Acqt2TiQnLxMDrShkeQHB0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DB5PR08MB0743;20:zKRIi7uFV/SO6OVqW9fY7g+2aTS4RgnW7eZfmhe4bjxhh3vRbOaIbWJ63Fwrqvn20EgWAyPR5O4BLmJjcbC5Cz9DerHVYdShUCZWyFCKCVYImEARupO1imvQRiFEZsMDIz0egn+eNUaqgh1CaCMQ7HeymSbMVcgN4h5IQKQdzB0= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2017 14:40:06.0031 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB0743 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2262 Lines: 70 On Fri, Sep 01, 2017 at 10:26:30AM +0200, Ingo Molnar wrote: > > Hi Andrei, > > * Andrei Vagin wrote: > > > Hi Thomas, > > > > We run CRIU tests for linux-next and today they detected an issue. I've > > bisected this problem and it looks like a problem is in this patch. > > Ok, there appears to be a bug in that conversion - does the patch below fix the > regression for you? Yes, it is. Thank you! > > Thanks, > > Ingo > > ================================> > Subject: x86/idt: Fix the X86_TRAP_BP gate > From: Ingo Molnar > > Andrei Vagin reported a CRIU regression and bisected it back to: > > 90f6225fba0c ("x86/idt: Move IST stack based traps to table init") > > This table init conversion loses the system-gate property of X86_TRAP_BP > and erroneously moves it from DPL3 to DPL0. > > Fix it. > > Reported-by: Andrei Vagin > Cc: Linus Torvalds > Cc: Peter Zijlstra > Cc: Thomas Gleixner > Signed-off-by: Ingo Molnar > --- > arch/x86/kernel/idt.c | 6 +++++- > arch/x86/kernel/idt.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > Index: tip/arch/x86/kernel/idt.c > =================================================================== > --- tip.orig/arch/x86/kernel/idt.c > +++ tip/arch/x86/kernel/idt.c > @@ -44,6 +44,10 @@ struct idt_data { > #define ISTG(_vector, _addr, _ist) \ > G(_vector, _addr, _ist, GATE_INTERRUPT, DPL0, __KERNEL_CS) > > +/* System interrupt gate with interrupt stack */ > +#define SISTG(_vector, _addr, _ist) \ > + G(_vector, _addr, _ist, GATE_INTERRUPT, DPL3, __KERNEL_CS) > + > /* Task gate */ > #define TSKG(_vector, _gdt) \ > G(_vector, NULL, DEFAULT_STACK, GATE_TASK, DPL0, _gdt << 3) > @@ -181,7 +185,7 @@ gate_desc debug_idt_table[IDT_ENTRIES] _ > static const __initdata struct idt_data ist_idts[] = { > ISTG(X86_TRAP_DB, debug, DEBUG_STACK), > ISTG(X86_TRAP_NMI, nmi, NMI_STACK), > - ISTG(X86_TRAP_BP, int3, DEBUG_STACK), > + SISTG(X86_TRAP_BP, int3, DEBUG_STACK), > ISTG(X86_TRAP_DF, double_fault, DOUBLEFAULT_STACK), > #ifdef CONFIG_X86_MCE > ISTG(X86_TRAP_MC, &machine_check, MCE_STACK),