Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp630254ybr; Fri, 22 May 2020 15:18:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN7xRtsOGL9wBWXC63C/2Tfn1KlwEjwFQQqfzhFexobddJNWnYYVVkbecCxJ35yTTuFrpK X-Received: by 2002:a17:906:aecc:: with SMTP id me12mr10792510ejb.525.1590185888068; Fri, 22 May 2020 15:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590185888; cv=none; d=google.com; s=arc-20160816; b=xf6S1xij9o7nxsDU0r/fitN37Bg/mHX0zZ6ySa/SLRKptpoFjqFOVqxGhYsLQ4EC6E OaP0LzhGijE/SBmqZa1LNxi8CgSQCW2+LlhvozooE3x1WM/6ZRWo3UlCIAmyL6GrTwrs JgR3BDnUyqwEGBcypft5qHfmL5EnMjkNo8rZ7v16meqzyzJKOYP7tPI1lHe3roJ/1Cg0 PZeXkBkerxCm6NUqpV9DNEo3FNTrYUWRIFjJ59pJshMQE4oZRd4P1R5O+33OlcOZ3SAq Kluzby+sjnvHXWX6gc1qMXjlYARH/fPPF8p0HYzx0quPkm4VENPtxj7i1lSg6bp+McuN QEYw== 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=R9RThh/5bG4FxbJeVBvmfLOxXVcH8xPqE14puu/uSzA=; b=yJ//aJyMRC9LhcNSJgjeDWiG8NocRm3IKnHn2JmLi/prD8iFpZKas9CNi9M/O4HOQ7 FmU9j09cz4CcykWiBYbF0MUOUzA9ds0tFi4kC6GKUY8BY715zmXpv0i+wxDmTI9VGZIS PfWiJuREzuFdo9fMZtB5JRDJKOF3S5ztDe6IvNEknk4+QTu71USatLQ5c6sXzHkaY74z YOBTQTqZZ0VH++JFem15n3+ZdqzxTrjQj3f40iBkTtT8PdTAQJ9Ay+u9dw+CVO9bt6JN sTtY6eQIbbiQwCfiBoZGIv6dOAAqvOiKT0KSHk9qPOAatm8YQH96zLalCEF7dLrHj7VA ebeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Uxg2at5J; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c1si5398443edj.326.2020.05.22.15.17.45; Fri, 22 May 2020 15:18:08 -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=@kernel.org header.s=default header.b=Uxg2at5J; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731125AbgEVWOL (ORCPT + 99 others); Fri, 22 May 2020 18:14:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:44430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731069AbgEVWOK (ORCPT ); Fri, 22 May 2020 18:14:10 -0400 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3CC5720757 for ; Fri, 22 May 2020 22:14:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590185650; bh=dZ2ofCb1NwJTEisd3Gt+KD09zvkyEqg1+EsbaKVb+bo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Uxg2at5JwYa8vu1eMsU0iU8rLuHwvV0N4Pvq1l7oUVsM/cxge4KV3pNuiIdd5lt8+ JfIfY+LfvzNehIYCo2iTWYBpyIf5bimfINcSeHCQ7s6qIiZnHjPIm+vWuwTd9xhCeI 5Tr8Ae+CYInRZ/W0EpluUmFv7uVYkfQw3hKRefJI= Received: by mail-wr1-f45.google.com with SMTP id s8so11650956wrt.9 for ; Fri, 22 May 2020 15:14:10 -0700 (PDT) X-Gm-Message-State: AOAM530/kjH4L7GAiTP/HNm/k4ldD/332uVEd9axoSvqFOoKvT8nv0gc dyRTOkHJ5XEIlxKEZOpf2ZWr9MMbpx5g6d0ZSgK3ZQ== X-Received: by 2002:adf:fe45:: with SMTP id m5mr4813269wrs.257.1590185648719; Fri, 22 May 2020 15:14:08 -0700 (PDT) MIME-Version: 1.0 References: <20200522204738.645043059@infradead.org> In-Reply-To: <20200522204738.645043059@infradead.org> From: Andy Lutomirski Date: Fri, 22 May 2020 15:13:57 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH 0/4] x86/entry: disallow #DB more To: Peter Zijlstra Cc: Thomas Gleixner , LKML , X86 ML 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 Fri, May 22, 2020 at 1:49 PM Peter Zijlstra wrote: > > Hai, this kills #DB during NMI/#MC and with that allows removing all the nasty > IST rewrite crud. > This is great, except that the unconditional DR7 write is going to seriously hurt perf performance. Fortunately, no one cares about perf, right? :) Even just reading first won't help enough because DR7 reads are likely to be VM exits. Can we have a percpu dr7 shadow (with careful ordering) or even just a percpu count of dr7 users so we can skip this if there are no breakpoints? We have cpu_dr7, and some minor changes would make this work. Maybe replace all the direct cpu_dr7 access with helpers like dr7_set_bits() and dr7_clear_bits()? Also, I like raving at DR7 :)