Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3570132ybk; Tue, 19 May 2020 07:51:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybDn4rrvUq7P5F29jXaRBhNrrBarfN7RG2K0bmiJwvWTVb8bm6Hz6/qg23DuFNbl31bckP X-Received: by 2002:a17:906:f6c7:: with SMTP id jo7mr10600974ejb.364.1589899870707; Tue, 19 May 2020 07:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589899870; cv=none; d=google.com; s=arc-20160816; b=G2p6NF8C9w/XRt6ZNf2zdJp0L1XYrDNFgW5hn2Aisq1Y9tJwFfrXaaDcwOiolsPC9O VMd6x8MXQFGUSAGLKn010ISPr8X6AaRrCoJ9mQZocbWlfH1yIQtD3pxaf+r7427rm3NH eYeh4UJR8OtttnJ5BjcZIp8/ZO+CVNVRuSt6xrVz3njzilz7h4IU+HmRjJYhoL04Kijj pmZHkuWTraT2xBElJmrrMmE6JoqLwhfqGwFrxn41ZrBrkIEMGRqKU8VW/U89v2c50l16 BinjUxprdF5tj840rpa4BbtCMqzPbrbb43867ISrIZJHurXwQ9bjCKctflR9APdzW1CD sQAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=SAU1Y1FPOVNXg1UErSF0Yi3HK9/QUmKfKhyfXbkup3o=; b=MdZx2yB9ZyxPUwJObPN8opnbVajkQR4P9K5QNSWeg4aXRomRcGJsNa13BOH+Np8VE0 pLOXurQcz3upS2b8quLwSafJQSs2mJamYCH8bw0Rb6vS+Hr7iiEF5SsN6sBFRpGGL5Ga hbPPNnbnX58cXQnJlqIit8UyUvy9TpAHqSj/+K5BUVIFBEoifmuMQdFu+5UGxQvwA66l tKy06SN1GgIW3E7K1+q39Em+pkz0z9o2gwUdj25SE+6y8fs6ZFq+IT4K5ziV+uZWjMYN aw8WIBfHxvK0BBn8y7unpQaK+T04QmSaTbfHJlLi7x6ZG6TasbjMNP5wKn3GATRpkKLU seIA== ARC-Authentication-Results: i=1; mx.google.com; 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 i23si5097067edx.80.2020.05.19.07.50.47; Tue, 19 May 2020 07:51:10 -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; 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 S1729022AbgESOsR (ORCPT + 99 others); Tue, 19 May 2020 10:48:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727910AbgESOsR (ORCPT ); Tue, 19 May 2020 10:48:17 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1C0EC08C5C0 for ; Tue, 19 May 2020 07:48:16 -0700 (PDT) Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jb3XK-0002vY-Jc; Tue, 19 May 2020 16:48:06 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id C35C9100D01; Tue, 19 May 2020 16:48:05 +0200 (CEST) From: Thomas Gleixner To: David Laight , 'Sasha Levin' Cc: "linux-kernel\@vger.kernel.org" , "bp\@alien8.de" , "luto\@kernel.org" , "hpa\@zytor.com" , "dave.hansen\@intel.com" , "tony.luck\@intel.com" , "ak\@linux.intel.com" , "ravi.v.shankar\@intel.com" , "chang.seok.bae\@intel.com" , Andrew Cooper , "x86\@kernel.org" Subject: RE: [PATCH v12 10/18] x86/fsgsbase/64: Enable FSGSBASE instructions in helper functions In-Reply-To: <238a6e2609eb4e0497b13fbe5f531917@AcuMS.aculab.com> References: <20200511045311.4785-11-sashal@kernel.org> <87v9ktw1ev.fsf@nanos.tec.linutronix.de> <20200518202435.GD33628@sasha-vm> <238a6e2609eb4e0497b13fbe5f531917@AcuMS.aculab.com> Date: Tue, 19 May 2020 16:48:05 +0200 Message-ID: <87r1vg6kwq.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Laight writes: > From: Sasha Levin >> >> + native_swapgs(); >> >> + gsbase = rdgsbase(); >> >> + native_swapgs(); > > Does local_irq_save() even do anything useful here. > You need to actually execute CLI, not just set a > flag that indicates interrupts shouldn't happen. > (Which is what I think local_irq_save() might do.) local_irq_save() raw_local_irq_save() arch_local_irq_save() arch_local_irq_disable() native_irq_disable() asm("CLI") > You also (probably) need to disable NMIs. The NMI entry can deal with that obviously. Thanks, tglx