Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp318856ybg; Fri, 12 Jun 2020 02:20:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1UdQrkjc/7AWdNrIv+lY9HflKAL7Fs9B5VnLEfoMfNuFUO4MFT+IKTZW45plA6fbCUjRy X-Received: by 2002:a50:8467:: with SMTP id 94mr10622871edp.249.1591953624114; Fri, 12 Jun 2020 02:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591953624; cv=none; d=google.com; s=arc-20160816; b=L3+eXAA2KlJkH0214mhYbqoghQ0TyHtC6Ukmgdq1tlBl/7NEXyiQPNh5DZRCV7hPwf 2ZGJEiz2Se8niShhbRYHslmJPYn43i4XUNzFQN5C3V1cHFtDsMKVU6CgkFmqlbQsF1U7 DxMbIcJwuLRx20DR2FIJW7+YOblw6P4G7MvWEqC+4KOclpLG+iUIa4iCIDteBEFppE29 LW4hB3JCd7VmF4KuMdHJtiyZUmuhiFc/0xbdge0wBQ/QuCxMjc0Phm1HTtarKnHZGuwY li/xIN5HNjxBXtseO+Dc2SZFdf87jdMN9wlu4A3OaVQb6BOXYvCoBG8N92lsyKmgo4Od 1xuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=ea05IbzOsFLNzK/q1opdgiePX7/yQgXvQW1ZI8l1OV0=; b=iNKrX7YjIfM8CwIUUYpO0xwXKp43mGaSG7GeuwgVs+7DssDtmmjjSzuypwofl6qSY+ RqHIS2o9BMqKPzSOOfb/H0a3L1VO36J8qCaGR6QxszkS7+jjRaGirCahpIkWlHNjahRF 8YrbrhlTkEBFrnbmqRHqGSTWE55yj7lLuFryTeqGF9Dp5GYbRBFu3ooDie31jvqb4gbc hk1C4utXFN9Ve89TroR4pIcuubIZ47zRx5uIdAu1AJ+PGJ30qK0nTWBrOQO14zN3zp1j cYki5Udu2ZVpIxbD9l+MG25sVthvMTVqGbdhPjEyG0cnI/7RmrLSzsQtB9AJYnc5un5y lodA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b="YcJ5J/GM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i9si3697620edn.437.2020.06.12.02.20.00; Fri, 12 Jun 2020 02:20:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b="YcJ5J/GM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726362AbgFLJSM (ORCPT + 99 others); Fri, 12 Jun 2020 05:18:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726302AbgFLJSM (ORCPT ); Fri, 12 Jun 2020 05:18:12 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58911C03E96F for ; Fri, 12 Jun 2020 02:18:12 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id h10so124061pgq.10 for ; Fri, 12 Jun 2020 02:18:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=ea05IbzOsFLNzK/q1opdgiePX7/yQgXvQW1ZI8l1OV0=; b=YcJ5J/GME/6OIE7GKIsIYPbJBOn9vMjQq8TeEYfj+ViczSLokFiKbgVemPZrSLwG1+ SpS5qfEwaxNM0Y+lPV07VdRyLVZPHocM9UZJHHd6kphl1408svBB5mjw9x7oCL+PcN0U 4Qpvt+A/mWF1Wj42xgr26GGYHU/L18VliNyE2dSThiCQMQfsJwo0JvKeQGH2xifET/GT 9j2hDlj6/dUCz6Y4vLL8ZHieO4OQE8kWIRfn0KaMWhA0poUc2jDmkNtok/gjVkr1TXF2 u5xEcVwlZP2qdWlVF97oQyTnrVQhgZGyZGI2ADU16rEDbrOOnUm8on20kp2uMOHIukTw VgGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=ea05IbzOsFLNzK/q1opdgiePX7/yQgXvQW1ZI8l1OV0=; b=WEUi7ITphvH2URJR0qsloA7A5m4CjTwO7M6VIJbOERqPn0PkrZurgY1KE0VkyVno9C TWADPG5dWHuHn9Ji/3OLp36H9KSHAlfTEmOOBsSkj76Sg3z8Y9ZSagkYSk73s4E4WSUm 3A3YrMdNfStBNKcOhBWwqT0BhL94FZp/AEOHIEJnvK6LUwIY+LR6IrMX73Uk3E5OjR5p UuLsWuw84tZJoc1G66Gxzram76VSm8CSeM3FT1yXho/y3olgMaOS8daIxwLo+cg1M7Kq d4eEakVyTfYQ2iGZnI8qEXMr6l4wAMSTaOHlVXSpMZt8KKutwV65gFdSQtmKeoZpOuzt ugoA== X-Gm-Message-State: AOAM532j2NGEl/1lmCDDruCB/EnzuhG/T88zCQ0hBMlvPdih8jtAQORV LSwIXBnqADGx+ioxZsnNJiaSUw== X-Received: by 2002:aa7:9537:: with SMTP id c23mr10802234pfp.149.1591953491704; Fri, 12 Jun 2020 02:18:11 -0700 (PDT) Received: from ?IPv6:2601:646:c200:1ef2:c0da:d349:5a19:d9c1? ([2601:646:c200:1ef2:c0da:d349:5a19:d9c1]) by smtp.gmail.com with ESMTPSA id m9sm5530035pfo.200.2020.06.12.02.18.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Jun 2020 02:18:10 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: Perf: WARNING: arch/x86/entry/common.c:624 idtentry_exit_cond_rcu+0x92/0xc0 Date: Fri, 12 Jun 2020 02:18:07 -0700 Message-Id: <8DD3180E-0E69-4FD6-92C3-311AAB3F688F@amacapital.net> References: <87imfwd5f6.fsf@nanos.tec.linutronix.de> Cc: Andy Lutomirski , Peter Zijlstra , Naresh Kamboju , open list , X86 ML , cj.chengjian@huawei.com, Arnaldo Carvalho de Melo , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Minchan Kim , Andrew Morton , Michel Lespinasse , lkft-triage@lists.linaro.org, Dave Hansen In-Reply-To: <87imfwd5f6.fsf@nanos.tec.linutronix.de> To: Thomas Gleixner X-Mailer: iPhone Mail (17F80) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jun 12, 2020, at 2:01 AM, Thomas Gleixner wrote: >=20 > =EF=BB=BFAndy Lutomirski writes: >> On Thu, Jun 11, 2020 at 4:22 PM Andy Lutomirski wrote: >>=20 >> Two bugs here. >>=20 >> 1. We had an issue with WARN. Patch sent. >=20 > Grabbed it >=20 >> 2. idtentry.h has, for x86_32: >>=20 >> # define DEFINE_IDTENTRY_IST DEFINE_IDTENTRY >>=20 >> This is nonsense. It's getting late over here and I'd rather focus on >> the more interesting RCU issue, so that's all from me today. >=20 > Well, this might be nonsense, but it's exactly matching the current code > in mainline which, e.g. for #DB does: >=20 > SYM_CODE_START(debug) > /* > * Entry from sysenter is now handled in common_exception > */ > ASM_CLAC > pushl $0 > pushl $do_debug > jmp common_exception > SYM_CODE_END(debug) >=20 > There is no IST on 32bit, never was. We do software stack switching for > device interrupts, but that's a different story. >=20 DEFINE_IDTENTRY does the idtentry_enter_cond_rcu() dance, which isn=E2=80=99= t intended to be safe from NMI context. It should probably map to DEFINE_ID= TENTRY_RAW() instead. The specific issue is that NMI ends up there, and at l= east DEFINE_IDTENTRY_NMI should be raw. I haven=E2=80=99t tried this at all, nor have I dug through all the users of= these macros to check what they expect. Perhaps we should not have the _IS= T one defined at all on 32 bit and rename it to DEFINE_IDTENTRY_IST_RAW on 6= 4 bit to make it more clear what=E2=80=99s going on when reading the C code.= Or maybe I=E2=80=99m too sleepy and I=E2=80=99m nuts. But I don=E2=80=99t th= ink I am. > Thanks, >=20 > tglx