Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp786903ybm; Fri, 29 May 2020 12:07:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQ4LFpbrc8eqZtHtA0MH2j3Giu+hpMKhrUAijXPhRtLnWzF9lLSzFmpyeWfLVS28LpPRZd X-Received: by 2002:a17:906:4c42:: with SMTP id d2mr9266711ejw.474.1590779264900; Fri, 29 May 2020 12:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590779264; cv=none; d=google.com; s=arc-20160816; b=YyeB0gzyRFOJID4E7UCuJ/KXKCPikTuwPqgBIwl/sZWwF1y5e3Ph3hlM7d40VMAnv4 16gC4qDRqr42mtfNmE8qog0CsDABxyxFSBsxbBcxUSY0iDV9+iaWBPrwX0Bid13vHoi9 7QCPDyCHbvvLQEkN6FcJ8a3E4KOIOtBg+aAMn43UtlPa4PAS+fTgDopoqXrdFaby1WGl lnkBN0ga37SvPm95r7Jpp1g1HJHw/JvgTVZaezKAdC58o81TRclJX9Qz6TtznU5GTR2A XewwRQKAI6oHdCbraTfjPQVbvMJhiyl0sDbyiAwmoA+m/2Ct9PDoZDPNLzZRZOcGO0pj PwOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=thn7TMkwb5FVZbIobG9IjrSgpGicxOEnfAegFwtUQ9Q=; b=SRF5224QSgNovyLzK36yBUnkCrDHYOhmQqUT/8wDmAupjz0wjr63Cmk1jnYKpCAL0v QGgGX6OdNb41CMrzLGqtJ4zt+seVyNCxMaSO1HF0Zwhc1jR+hPiE/eiuXqYu6XybgsA+ PnhYaaunUFanwzgcxfXe/4Bg9XlI4kVBeHQW6/dUn8QDiqQ52gjP97kJpm+lSv4bYhs+ MywAHAFOxEMupfTVViQyiF1cBNyuk1pJmFGBg0Hj9nypuAA4e6m39McPcJZcJQslARlt N3UbW0NMpQpHT9ORl6/cbj/CE2uvw+m4mLvADdVXNAi5ZyHMMGq+fPD/eLIZP6oYg9RQ KPug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=OJyHQWJ0; 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 f26si6431912ejb.74.2020.05.29.12.07.21; Fri, 29 May 2020 12:07:44 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=OJyHQWJ0; 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 S1727957AbgE2TFP (ORCPT + 99 others); Fri, 29 May 2020 15:05:15 -0400 Received: from merlin.infradead.org ([205.233.59.134]:43564 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726829AbgE2TFP (ORCPT ); Fri, 29 May 2020 15:05:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=thn7TMkwb5FVZbIobG9IjrSgpGicxOEnfAegFwtUQ9Q=; b=OJyHQWJ025zNOPknTYZbwW+IcS 6qmc1yzs5g43hxKLNNudj30TImVKiIVvVB/vUfz87vN8Umc0VR459hh+55Uffdh86hqTxh+Q4csvW xEvZKBtS6hSqG4dJTyPy8q2a7ZPya33yiaY5mWarfF+8XwfhQgylaUYH3axPlQiwMxMY99S51hLTT gW1/OWLUVBF4ikyzoSWHqnjQhJLq33ZK5QYT9ygTyinoxe2gXVTEXzdjtMBPGBY3XZzCQLLpDfTq+ nFqGP9kx8s3V70F+EiHN3vMNQE8TUnYA7SOrgSv8ohurUxxY8nOYM/dPbO1AiZ+bgZcH6ahDxszkK xxiGkoZA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jekGy-0003zK-5w; Fri, 29 May 2020 19:02:28 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0F21530047A; Fri, 29 May 2020 21:02:19 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E8B562021AF65; Fri, 29 May 2020 21:02:18 +0200 (CEST) Date: Fri, 29 May 2020 21:02:18 +0200 From: Peter Zijlstra To: Andy Lutomirski Cc: Andrew Cooper , tglx@linutronix.de, linux-kernel@vger.kernel.org, x86@kernel.org, Lai Jiangshan , sean.j.christopherson@intel.com, daniel.thompson@linaro.org Subject: Re: [PATCH 1/6] x86/entry: Introduce local_db_{save,restore}() Message-ID: <20200529190218.GP706495@hirez.programming.kicks-ass.net> References: <20200528213352.GC4496@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 29, 2020 at 10:28:33AM -0700, Andy Lutomirski wrote: > > +static __always_inline unsigned long local_db_save(void) > > +{ > > + unsigned long dr7; > > + > > + get_debugreg(&dr7, 7); > > + dr7 ^= 0x400; > > Why xor? This seems extra confusing. I'll do the normal mask thing ..