Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1296170pxa; Thu, 20 Aug 2020 07:46:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkqurGvCgoGFrq05mxulng1i4oHVEP0wLDIxvzAivhiTunqO3qYNOQhvI3tkKqIOS4TUbL X-Received: by 2002:a17:906:d92c:: with SMTP id rn12mr3505827ejb.187.1597934796929; Thu, 20 Aug 2020 07:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597934796; cv=none; d=google.com; s=arc-20160816; b=g+9Zv6BmZY5myLvuDXqbCsHCRksqz20dV7B5H0A7MbMU6OCG7rWvxZDMSQniGWeYTM 25uSurg/UG2fwPZ3Bs9MaUvxX85+BRpIq+3A42oYAQrrC1RebpoBXiCEtDbvtNgDWQKZ 0WNpclBdQcPqhiYaynMcQaV2qPTiA515Xnn0LUwEvXQanUsVgJ4GcP6v0m38EuJInQ/W eaTC2eJdHfWF7IKXUlpRvkUYj1M3nxSYYUk6jrhSAuasjOUw/ClJuhADSJT/hAe1TYcR O7uJ22/zZkXxUwLbuAguzBhuVWKGG7t/t7EkSlrXuKeT5lz6BzoJ8FSDcRxzJmtPygP5 KKDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tDfRK/hRb50SBa/YfwtS0QLSZRN8RYBkCqh1wYa24DE=; b=fIlfMcph3dWRx5JDtrDbxy05b/NGwhTIYX8quYzSMFXIP7vq4SdBWeJpKwz1ufcOkQ En2nVpLYR5svVaAqzAKBmNsLgrtT1eMAo9rGcW9l5oBjN+b4GQobZ2MbJHMRhNjjN+xt t3T3hu2rNff+OnJlcJ53nhstkqyVb4uqVk3c0MOA7kOGAv4IuvOqzbHgxDf7ybc0a0jm e91xyH6WLGACu9B5UxxuopR+MfTsrUIuopq6+60POOXQK93v78HFN1gPmuwzqAsmiGPk MDBynVerdGs2U2i9dHG82DCgPUoV8dXRR4eVS1lI4P5FAXVILZs9d1h1uVnyA6Ag4zjL Al8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DSu7JXl3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x16si666996edr.504.2020.08.20.07.46.13; Thu, 20 Aug 2020 07:46:36 -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=@gmail.com header.s=20161025 header.b=DSu7JXl3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727793AbgHTOpa (ORCPT + 99 others); Thu, 20 Aug 2020 10:45:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726852AbgHTOpZ (ORCPT ); Thu, 20 Aug 2020 10:45:25 -0400 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA385C061385 for ; Thu, 20 Aug 2020 07:45:24 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id c6so1810868ilo.13 for ; Thu, 20 Aug 2020 07:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tDfRK/hRb50SBa/YfwtS0QLSZRN8RYBkCqh1wYa24DE=; b=DSu7JXl3ojQR/Gb1WAviBwuEbFrWCclvIF09S10oTI8uKkqCXJx/DwZ7nFjbtUY52E 6x13uGTCMKmajploAewFnPq/7PoYOJLcnW5CXfHF7Nd1m45h4kJ8l2nvtjg0rVE3OFE0 9NV0oLGV+7a+OWlw5VMN7k4JiVmC5tCtRsKNiadxXPrmjid0Gn1/KaWdgrULzdHnX6lT Io4I7waHYhZobZhLatwhuEGaNoa6H0jQ9EWIpgZaHZiaYsLeVe4YjFaIQfc47VjgQcrY 3fZjgbMAd8PK3PN9Jg1UX5JtLMMfiMQttkxMNdCrqcSTshR17w9aoMdWiP7I9rIV5bn/ z5sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tDfRK/hRb50SBa/YfwtS0QLSZRN8RYBkCqh1wYa24DE=; b=CiWiJXtECFQWj5Tisu4LeXTPBy4HQPCj4AM+lkl4R/WOxmGBl0jPfFU92gqwmUNtV3 QOwjL0SIlWv8RBoIYFDj135KWyxK8YgGL57zpCJ8njK4JdV33Rp+JBGhvc6U6ob+y2oU raKVmdg115vXgvTUGP4/EsDAZZVAXnZxc/82lwmucuZAwfIVXIGJC0HDg8KsqbIDAKOT Oe8NtHzDn3RYtnMIYACQpcRovML1vxcAW3zBF+S89JHqJdg5CPoRN88h2+QbkqzaOo5T emndqpWSTaAVp5XoAXM/YBnwgeZUBF7eKdRi8GjJL5BIfpSOr/hE5BEEZPmZMZkg62+c h/Yw== X-Gm-Message-State: AOAM53095hfsbxghdsnAy6Xy5las4Hw2yCFSs+nuu5y+ELmVSUtCiz4B WU9y/0HCxYk8z/OO0ZqPX+Sgy4LhoThPWNcMDg== X-Received: by 2002:a92:b611:: with SMTP id s17mr2777377ili.191.1597934724050; Thu, 20 Aug 2020 07:45:24 -0700 (PDT) MIME-Version: 1.0 References: <20200820103832.486877479@infradead.org> <20200820104905.294802764@infradead.org> In-Reply-To: <20200820104905.294802764@infradead.org> From: Brian Gerst Date: Thu, 20 Aug 2020 10:45:12 -0400 Message-ID: Subject: Re: [RFC][PATCH 4/7] x86/debug: Move historical SYSENTER junk into exc_debug_kernel() To: Peter Zijlstra Cc: "the arch/x86 maintainers" , Linux Kernel Mailing List , Kyle Huey , Alexandre Chartre , "Robert O'Callahan" , "Paul E. McKenney" , Frederic Weisbecker , Paolo Bonzini , Sean Christopherson , Masami Hiramatsu , Petr Mladek , Steven Rostedt , Joel Fernandes , Boris Ostrovsky , Juergen Gross , Andy Lutomirski , Josh Poimboeuf Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 20, 2020 at 6:53 AM Peter Zijlstra wrote: > > > Signed-off-by: Peter Zijlstra (Intel) > --- > arch/x86/kernel/traps.c | 24 ++++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) > > --- a/arch/x86/kernel/traps.c > +++ b/arch/x86/kernel/traps.c > @@ -820,18 +820,6 @@ static void handle_debug(struct pt_regs > goto out; > } > > - if (WARN_ON_ONCE((dr6 & DR_STEP) && !user_mode(regs))) { > - /* > - * Historical junk that used to handle SYSENTER single-stepping. > - * This should be unreachable now. If we survive for a while > - * without anyone hitting this warning, we'll turn this into > - * an oops. > - */ > - tsk->thread.debugreg6 &= ~DR_STEP; > - set_tsk_thread_flag(tsk, TIF_SINGLESTEP); > - regs->flags &= ~X86_EFLAGS_TF; > - } > - > si_code = get_si_code(tsk->thread.debugreg6); > if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp) > send_sigtrap(regs, 0, si_code); > @@ -874,6 +862,18 @@ static __always_inline void exc_debug_ke > if (kprobe_debug_handler(regs)) > goto out; > > + if (WARN_ON_ONCE(dr6 & DR_STEP)) { > + /* > + * Historical junk that used to handle SYSENTER single-stepping. > + * This should be unreachable now. If we survive for a while > + * without anyone hitting this warning, we'll turn this into > + * an oops. > + */ > + dr6 &= ~DR_STEP; > + set_thread_flag(TIF_SINGLESTEP); > + regs->flags &= ~X86_EFLAGS_TF; > + } > + > handle_debug(regs, dr6, false); > > out: Can this be removed or changed to a BUG()? The warning has been there since 2016 and nobody has apparently complained about it. -- Brian Gerst