Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3588290pxb; Mon, 4 Oct 2021 05:40:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0bIFnv4xLnlIL5+Rm8O1UX4bb/2GEGgMFta+vL/qhqiLDV3+JxiOicMk/mVXTGPGk0aeD X-Received: by 2002:a17:907:e91:: with SMTP id ho17mr17482102ejc.287.1633351210168; Mon, 04 Oct 2021 05:40:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633351210; cv=none; d=google.com; s=arc-20160816; b=dqd+JDASxNVvBkSQou2Su3hGncjaLT80aF0JBg6GfdEsa6RGLKQwe7eTgdjHE7nH2+ 9FMCyMNNFdN5GHWGuU+APGcxw2TbCP2QQC37rwpBh5w+g9JJXNwPmbApf7rvVSFXi96R P7bgNFkGPvQIqsBWbW8BjBRyIm24Hd1KLkYTtMpNkdUAhSB7cMl5TktJoArxaip5KjX4 E/69vyG39YuzjPtm8cMX7f11aB7UfFnMh2iLB9I56LR1ptr8Lf2fo/b63bSiy/5Ee9Pd MBbot/Di+nUoyjPpq+dDDtjiDmpNzOSHCn9IUuQ4SmVzHk9BTdBE5vaATrtsu9c6fXwf kRug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=5vLixdfDE0S5zHZr8cD6szxBdMNIIaIc2M+ATobHZdI=; b=N1RNfE9KK0MET0wRsNaPHzUkLnongqA0gc5jeDII0kkWMJLYUPACK/liHu9laRtFBd uyb35FtDxTRdq84Tztg8q9sfIlkkxMjDekiew0Dgf8oTJCA+jgNIHF58RjpWbvt1G3f+ pNXW+CaJ9OXkcsNFj9Y9N0FGLN8MK99vMI75Ox4OZbGtuCTsvIqzlXVzBrbYMBHHOzkQ Gs73TtSRnYW1DBtQRoyAsJ3jCz1rtnfrPuXz70ehi5bPH0PauCFsLF49A8dNRGuDF1jH a53CtHp6SKwBaNTVNDRI2Oe+twZiUf9CIgdYhqgX9ECzFl1kT+HSl/RjwdF7owICFwQ2 rzhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=o8sGjw9U; dkim=neutral (no key) header.i=@linutronix.de; 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=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy12si13724031edb.199.2021.10.04.05.39.45; Mon, 04 Oct 2021 05:40: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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=o8sGjw9U; dkim=neutral (no key) header.i=@linutronix.de; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229981AbhJDMhK (ORCPT + 99 others); Mon, 4 Oct 2021 08:37:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbhJDMhJ (ORCPT ); Mon, 4 Oct 2021 08:37:09 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2930C061745 for ; Mon, 4 Oct 2021 05:35:20 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1633350919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5vLixdfDE0S5zHZr8cD6szxBdMNIIaIc2M+ATobHZdI=; b=o8sGjw9UUpIPLZUOzbgCh63dWmFvuhWekxFKrnZkiiqipuW0ZPSi2pC/oeEgiGF1Ka9Wav bh17hvhP6ZmNhkxRuCrR0qHA75k8mRNG87j98sm6QuRWTA0TKeTksCdlR/2r11u9kKAdFk 6/KoiV7Y7kvT6qrjq+KtYlMKlw05gtL/cIJ6Yz/7bcdeZcJNDGwrsRklC8C7Q0ChE9dNHQ TyvaqlCaPqSb+tC7ZPGyS6MO2L8jdFK0Ug1I9s6PwCnEIx/vG4yrpaln0QNa3MiEGLSeJN f62pQlpv6a9CCYKMQ/Og8Hr76DxFWie8HsfmaqTjWIaIO5hx85Ww3rp31awaUw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1633350919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5vLixdfDE0S5zHZr8cD6szxBdMNIIaIc2M+ATobHZdI=; b=Jux+IFsAh0/0WHKPrecjVRV8bLUb01mZG0w2QLVdsFeR92PWRpQNGu95o6fVl5GYL7ebnm wvAnJOAFg9L0KUDQ== To: "Bae, Chang Seok" Cc: "bp@suse.de" , "Lutomirski, Andy" , "mingo@kernel.org" , "x86@kernel.org" , "Brown, Len" , "lenb@kernel.org" , "Hansen, Dave" , "Macieira, Thiago" , "Liu, Jing2" , "Shankar, Ravi V" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v10 13/28] x86/fpu/xstate: Use feature disable (XFD) to protect dynamic user state In-Reply-To: References: <20210825155413.19673-1-chang.seok.bae@intel.com> <20210825155413.19673-14-chang.seok.bae@intel.com> <871r546b52.ffs@tglx> <87wnmw4w80.ffs@tglx> Date: Mon, 04 Oct 2021 14:35:18 +0200 Message-ID: <87bl45ge7t.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 03 2021 at 22:38, Chang Seok Bae wrote: > On Oct 1, 2021, at 08:10, Thomas Gleixner wrote: >> local_irq_enable(); > > v1 had some similar ones (not the same though) [1]. FWIW, I think Andy=E2= =80=99s point > is worth to be noted here: > > First, you can't just enable IRQs here. If IRQs are off, they're off = for a > reason. Secondly, if they're *on*, you just forgot that fact. The #NM comes from user space where interrupts are always enabled. So we can enable interrupts _after_ doing the sanity checks. Also we reenable interrupts in various other trap handlers when the trap comes from user space as well. That's perfectly fine and required. How would e.g. fault handling or single stepping ever work otherwise? I have no idea where you had places the local_irq_enable(), but the code I outlined is correct. Thanks, tglx