From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751923AbeAGIRT (ORCPT + 1 other); Sun, 7 Jan 2018 03:17:19 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:54402 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751541AbeAGIRR (ORCPT ); Sun, 7 Jan 2018 03:17:17 -0500 Date: Sun, 7 Jan 2018 09:17:18 +0100 From: Greg Kroah-Hartman To: Thomas Zeitlhofer Cc: Peter Zijlstra , Thomas Gleixner , Hugh Dickins , LKML Subject: Re: "BUG: using smp_processor_id() in preemptible" with KPTI on 4.14.11 Message-ID: <20180107081718.GB9509@kroah.com> References: <20180104015906.czhm7kis33iizsia@toau> <20180104102029.tpv5utpbdkrisgvl@toau> <20180104105111.GA2754@kroah.com> <20180104124320.eawuo6q7wnwzpf7s@toau> <20180104125528.GA15548@kroah.com> <20180104152516.3sql2ayoemlephig@toau> <20180104170712.GB3040@hirez.programming.kicks-ass.net> <20180104183800.ewx42etmmzk5b544@toau> <20180106213838.zxzbvufa3j7xeyhe@toau> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180106213838.zxzbvufa3j7xeyhe@toau> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Sat, Jan 06, 2018 at 10:38:38PM +0100, Thomas Zeitlhofer wrote: > On Thu, Jan 04, 2018 at 07:38:00PM +0100, Thomas Zeitlhofer wrote: > > On Thu, Jan 04, 2018 at 06:07:12PM +0100, Peter Zijlstra wrote: > > > On Thu, Jan 04, 2018 at 04:37:24PM +0100, Thomas Gleixner wrote: > > > > > Yes: > > > > > > > > > > BUG: using smp_processor_id() in preemptible [00000000] code: ovsdb-server/4498 > > > > > caller is native_flush_tlb_single+0x57/0xc0 > > > > > CPU: 2 PID: 4498 Comm: ovsdb-server Not tainted 4.15.0-rc6-kvm-00423-gea1908c252eb #3 > > > > > Hardware name: MSI MS-7798/B75MA-P45 (MS-7798), BIOS V1.9 09/30/2013 > > > > > Call Trace: > > > > > dump_stack+0x5c/0x86 > > > > > check_preemption_disabled+0xdd/0xe0 > > > > > native_flush_tlb_single+0x57/0xc0 > > > > > ? __set_pte_vaddr+0x2d/0x40 > > > > > __set_pte_vaddr+0x2d/0x40 > > > > > set_pte_vaddr+0x2f/0x40 > > > > > cea_set_pte+0x30/0x40 > > > > > ds_update_cea.constprop.4+0x4d/0x70 > > > > > reserve_ds_buffers+0x159/0x410 > > > > > ? wp_page_copy+0x370/0x6c0 > > > > > x86_reserve_hardware+0x150/0x160 > > > > > x86_pmu_event_init+0x3e/0x1f0 > > > > > perf_try_init_event+0x69/0x80 > > > > > perf_event_alloc+0x652/0x740 > > > > > SyS_perf_event_open+0x3f6/0xd60 > > > > > do_syscall_64+0x5c/0x190 > > > > > entry_SYSCALL64_slow_path+0x25/0x25 > > > > > RIP: 0033:0x72bff0a3c0b9 > > > > > RSP: 002b:00007ffed11c2f18 EFLAGS: 00000206 ORIG_RAX: 000000000000012a > > > > > RAX: ffffffffffffffda RBX: 00007ffed11c30f0 RCX: 000072bff0a3c0b9 > > > > > RDX: 00000000ffffffff RSI: 0000000000000000 RDI: 00007ffed11c2f20 > > > > > RBP: 0000000000000000 R08: 0000000000000000 R09: 0000007000000000 > > > > > R10: 00000000ffffffff R11: 0000000000000206 R12: 0000000000000008 > > > > > R13: 0000000000000000 R14: 00007ffed11c30d0 R15: 000060986ecfb600 > > > > > > Fun, so set_pte_vaddr() and the whole cpu_entry_area are supposed to be > > > per CPU. But the DS crud does cross CPU updates of those tables. > > > > > > So we need some additional fun and games.. > > > > > > How's the below? > > [...] > > > > Looks good - I have successfully tested it on top of 4.14.11 and > > 4.15-rc6. In both cases, the error message is gone when this patch is > > applied. > > While solving the previous problem, this patch also introduces new "fun > and games"... > > Now, terminating a systemd-nspawn container, reliably crashes the host > (so far tested only on Haswell, if that matters). Once, I was able to > capture the following trace: Is this also reproducable on Linus's tree right now? I've been running nspawn containers on it with no issues like this at all :( thanks, greg k-h