Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751499AbdIAG2m (ORCPT ); Fri, 1 Sep 2017 02:28:42 -0400 Received: from mail-eopbgr10109.outbound.protection.outlook.com ([40.107.1.109]:55742 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751125AbdIAG2j (ORCPT ); Fri, 1 Sep 2017 02:28:39 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=avagin@virtuozzo.com; Date: Thu, 31 Aug 2017 23:28:16 -0700 From: Andrei Vagin To: tip-bot for Jacob Shin , Thomas Gleixner , Cyrill Gorcunov Cc: linux-tip-commits@vger.kernel.org, luto@kernel.org, tglx@linutronix.de, mingo@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: [tip:x86/apic] x86/idt: Move IST stack based traps to table init Message-ID: <20170901062815.GA349@outlook.office365.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [73.140.212.29] X-ClientProxiedBy: BN6PR08CA0072.namprd08.prod.outlook.com (2603:10b6:404:b9::34) To HE1PR08MB0748.eurprd08.prod.outlook.com (2a01:111:e400:59b1::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2d260206-491f-4a89-37a7-08d4f102ad44 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:HE1PR08MB0748; X-Microsoft-Exchange-Diagnostics: 1;HE1PR08MB0748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FQxUE9UkNitA7mM5mH/Hlj2ceu0pFSu5EeQ4tG/L1IillA65jhlSrFyfz8d/IVD4S0cUZM+lhk4h050vzoIZWF0AP133/tI4RaJTwSRyW485r9g2RMVDGrylHwZ4RfzgYgVUEa7MqcWAt2A2SyUwiRPsWztpA4AlCoMPLg2K4SWMNx7rqOMvEvSbMkC3FhG0UMyZ4tbXNnRyHDNnmxiL7PfeWX7hyYyrWn3yj/6va4cwv/2iMuAigmbKaEFKrXqCIKcZwEysS5U=;4:3AuenuZhaEYcSFHICQjUd1fIIkC/fjTHBc2aA36s/NxIbXSivObBmvQsnfJ7/P3Ntf22QScE/2yrEms9A1/mkcEBTT0nuGUrl1cPSUgDYSqcw1niEeA/bjVLiNlz8ChNdiwN1IwoLDL1TuxN+4XnO9DdJi7h9d/JkGeh0v6aEExm/G4bPlSNFB1wk+B423NS2bGlQKbuIjmSmce9Gs7lfdfLlstmb52beaCdscqDGebsDoGtziQ+G7Bxuyr+gLbf0fjN8CuXs+5U7rYs2Pj/0ui35v3DghkL30oYTF4ShwLLwkt1AOWHxgWBPSXTiq6/sv7BbLqv+psptdtpR/ugalcOaOUJD8J2i6rbFVBOd3zQ5BaO94iZP8wAZKPyNyca X-Exchange-Antispam-Report-Test: UriScan:(166708455590820)(42068640409301)(84791874153150); 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)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR08MB0748;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR08MB0748; X-Forefront-PRVS: 0417A3FFD2 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(7370300001)(6009001)(189002)(24454002)(199003)(33656002)(4001350100001)(50986999)(97736004)(76176999)(54356999)(1076002)(3846002)(6116002)(83506001)(8676002)(81166006)(81156014)(1720100001)(23686003)(68736007)(2906002)(53416004)(575784001)(86362001)(106356001)(478600001)(966005)(2950100002)(50466002)(229853002)(66066001)(6306002)(47776003)(6666003)(105586002)(55016002)(4326008)(9686003)(69596002)(7350300001)(5660300001)(6506006)(189998001)(42186005)(53936002)(25786009)(7416002)(7736002)(305945005)(6246003)(101416001)(18370500001);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR08MB0748;H:outlook.office365.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?koi8-r?Q?1;HE1PR08MB0748;23:BTGuazyuNYNl0LelB36Tz8qOfBC94syNy0MpfKfmEnJ?= =?koi8-r?Q?WvOdMjyiw8zkEjqvemnYsZ7DrvzeN6ghP7WQlN1aXw6+buh5u6nwjhPMx/5aiS?= =?koi8-r?Q?r39duGuxkSt3lC/S8OwKIxxFF643kaw1JohUo+QvnocRrCslxENPlJhppeRyhR?= =?koi8-r?Q?t2JypqCja09lNTGNpGD+dw0lCrzDQiAtdZIpOuzpayExXW3fKTSVY52xaNj8pM?= =?koi8-r?Q?iCSNQ3njJV2QDGhQWKVVDH5DzUrdEGBd9FdJCuUhuB1YBZqQkD6vCLU5e0eoTr?= =?koi8-r?Q?KbugGTlkro5VTpZJuExpt/LRDCw75xmYK7y2yqiU+L7CN7CfZDhSwB6pZmGFGr?= =?koi8-r?Q?6a4adcECbZMyt1do/JCA8/YMQYJDpp8k3GtAAtTbBJT0z0PK+n5oQhr4TLC6Qn?= =?koi8-r?Q?oN5VNGv1Smb/e7xbWgSr/N/+ZSMGvSwMgDmnVynQqaFWUb3vC2PSo5O2Zg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7625g76nOe8c= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2017 06:28:27.5236 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB0748 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5518 Lines: 148 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. [root@fc24 criu]# python ./test/zdtm.py run -t zdtm/static/env00 === Run 1/1 ================ zdtm/static/env00 ========================== Run zdtm/static/env00 in h ========================== Start test ./env00 --pidfile=env00.pid --outfile=env00.out --envname=ENV_00_TEST Run criu dump =[log]=> dump/zdtm/static/env00/36/1/dump.log ------------------------ grep Error ------------------------ (00.004013) Dump private signals of 36 (00.004022) Dump shared signals of 36 (00.004036) Parasite syscall_ip at 0x400000 (00.004097) ** delivering signal 11 si_code=128 (00.004103) Error (compel/src/lib/infect.c:528): Unexpected 36 task interruption, aborting (00.004118) Error (criu/cr-dump.c:1371): Can't infect (pid: 36) with parasite (00.004208) Unlock network (00.004218) Unfreezing tasks into 1 (00.004223) Unseizing 36 into 1 (00.004244) Error (criu/cr-dump.c:1807): Dumping FAILED. ------------------------ ERROR OVER ------------------------ ################### Test zdtm/static/env00 FAIL at CRIU dump ################### Send the 9 signal to 36 Wait for zdtm/static/env00(36) to die for 0.100000 ##################################### FAIL ##################################### Here is a line in a code where we get this unexpected error: https://github.com/xemul/criu/blob/criu-dev/compel/src/lib/infect.c#L735 At this moment criu tries to execute the memfd_create syscall in a context of another task with help of ptrace. Here is a link to a test job: https://travis-ci.org/avagin/linux/builds/270623449 Thanks, Andrei On Tue, Aug 29, 2017 at 04:18:51AM -0700, tip-bot for Jacob Shin wrote: > Commit-ID: 90f6225fba0c732f3f5f9f5e265bdefa021ff12d > Gitweb: http://git.kernel.org/tip/90f6225fba0c732f3f5f9f5e265bdefa021ff12d > Author: Thomas Gleixner > AuthorDate: Mon, 28 Aug 2017 08:47:52 +0200 > Committer: Ingo Molnar > CommitDate: Tue, 29 Aug 2017 12:07:27 +0200 > > x86/idt: Move IST stack based traps to table init > > Initialize the IST based traps via a table. > > Signed-off-by: Thomas Gleixner > Cc: Andy Lutomirski > Cc: Borislav Petkov > Cc: Brian Gerst > Cc: Denys Vlasenko > Cc: H. Peter Anvin > Cc: Josh Poimboeuf > Cc: Linus Torvalds > Cc: Peter Zijlstra > Cc: Steven Rostedt > Link: http://lkml.kernel.org/r/20170828064959.091328949@linutronix.de > Signed-off-by: Ingo Molnar > --- > arch/x86/include/asm/desc.h | 2 ++ > arch/x86/kernel/idt.c | 22 ++++++++++++++++++++++ > arch/x86/kernel/traps.c | 9 +-------- > 3 files changed, 25 insertions(+), 8 deletions(-) > > diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h > index 930acd5..e624527 100644 > --- a/arch/x86/include/asm/desc.h > +++ b/arch/x86/include/asm/desc.h > @@ -509,9 +509,11 @@ extern void idt_setup_early_traps(void); > > #ifdef CONFIG_X86_64 > extern void idt_setup_early_pf(void); > +extern void idt_setup_ist_traps(void); > extern void idt_setup_debugidt_traps(void); > #else > static inline void idt_setup_early_pf(void) { } > +static inline void idt_setup_ist_traps(void) { } > static inline void idt_setup_debugidt_traps(void) { } > #endif > > diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c > index f5281b8..a6326fd 100644 > --- a/arch/x86/kernel/idt.c > +++ b/arch/x86/kernel/idt.c > @@ -92,6 +92,20 @@ struct desc_ptr idt_descr __ro_after_init = { > gate_desc debug_idt_table[IDT_ENTRIES] __page_aligned_bss; > > /* > + * The exceptions which use Interrupt stacks. They are setup after > + * cpu_init() when the TSS has been initialized. > + */ > +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), > + ISTG(X86_TRAP_DF, double_fault, DOUBLEFAULT_STACK), > +#ifdef CONFIG_X86_MCE > + ISTG(X86_TRAP_MC, &machine_check, MCE_STACK), > +#endif > +}; > + > +/* > * Override for the debug_idt. Same as the default, but with interrupt > * stack set to DEFAULT_STACK (0). Required for NMI trap handling. > */ > @@ -158,6 +172,14 @@ void __init idt_setup_early_pf(void) > } > > /** > + * idt_setup_ist_traps - Initialize the idt table with traps using IST > + */ > +void __init idt_setup_ist_traps(void) > +{ > + idt_setup_from_table(idt_table, ist_idts, ARRAY_SIZE(ist_idts)); > +} > + > +/** > * idt_setup_debugidt_traps - Initialize the debug idt table with debug traps > */ > void __init idt_setup_debugidt_traps(void) > diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c > index 1492bf5..293f5bd 100644 > --- a/arch/x86/kernel/traps.c > +++ b/arch/x86/kernel/traps.c > @@ -979,14 +979,7 @@ void __init trap_init(void) > */ > cpu_init(); > > - /* > - * X86_TRAP_DB and X86_TRAP_BP have been set > - * in early_trap_init(). However, ITS works only after > - * cpu_init() loads TSS. See comments in early_trap_init(). > - */ > - set_intr_gate_ist(X86_TRAP_DB, &debug, DEBUG_STACK); > - /* int3 can be called from all */ > - set_system_intr_gate_ist(X86_TRAP_BP, &int3, DEBUG_STACK); > + idt_setup_ist_traps(); > > x86_init.irqs.trap_init(); >