Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1425587lqd; Thu, 25 Apr 2024 15:37:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUXkN0uifbrmVQx4ZRbqjS6VI+YN5H6p/f3V2+s2iTMzy6sqHgKPdUcOQNSxLn5N+jE4o0t32VFMwSSgfFkIIPDa56lR+PraOYeX11/pg== X-Google-Smtp-Source: AGHT+IGDHQbtkeQ6G54JooZsSkFlfOofUeaj2txnulpMLetbowuu8BCFHmniKk3BsrkihBJrZrLK X-Received: by 2002:a05:6870:9347:b0:233:a2c:470e with SMTP id j7-20020a056870934700b002330a2c470emr893645oak.57.1714084648236; Thu, 25 Apr 2024 15:37:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714084648; cv=pass; d=google.com; s=arc-20160816; b=Xd6As6lYTwDCNGX8isOFHDAJEQd+fLAJ5h7X6gB4fCd5+SzW6sZ8wI30Mf1zOHA5dp d49K+7DMbAOhe+JeH+HQR1Q/ujd7XBLI0zWBHklOwszWQ3fyM19vtFFSTrMMp56ia1sF c+fNCX8t4e7Q859/OuTjtEI2LTfczkJk6nXwna8yYRbsMinLZhdjQZX/Pfpl6zAdT5/X LfeRC3JPWkZbcgqACfaLr0kiDAZOVQf5nxBFxT60ofUFv5o8Y6aDNveu5kCHo0kcvqIp 2W19vLvc7JRv1f+a4JD/rtLTVCc3j0gLHDEE7ur/wVW6p9sgqJWOvMmn2Vahvm2DRhwY Jtmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=FPif3mAhk2mjxY5/ADz9MWVNfAUOyxoP0nyi2kzmfeM=; fh=7DOggWqE+pzOUSm/VeSu+JCKLhAt+8JOdRnwQS6ijlg=; b=Oasxvq0klQoZ120IvDh9wIbjTNkh/GvU3caITZyD6tfPoBcBMetLSE1cp4dwNrsu6o P/slDZNBIQHJgMwqkrs7mTlgVWvQvdI3h2v4TUWOuEzAiPXMVUne98G4/QhHOlOvy2vL 6S5lMI1GSJtJWFaIJuB0JWkn/Il96YmhP1+0iJ4GpAxUSY19cpjtAOmnizmNLDIvcXSF kChtrVJQRPckZyvKx5xETqc4ruHr4SERZz+ocAhfNaiXCMBIpLn2V/0jzWlFHJqSDVNj 8Hfv3Ctp/OePIIs+gdptBoXFavgL34EXGpQBGMrEp/Q/faCamp48DoQdbKl86tFh6Qtb RQzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mJvzAyPr; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-159295-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159295-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bw10-20020a056a02048a00b005ff1b669fbfsi8959671pgb.584.2024.04.25.15.37.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 15:37:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159295-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mJvzAyPr; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-159295-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159295-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C339BB2800B for ; Thu, 25 Apr 2024 22:10:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7765417167D; Thu, 25 Apr 2024 22:03:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="mJvzAyPr" Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6986014A0A7 for ; Thu, 25 Apr 2024 22:03:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714082616; cv=none; b=KDS7a7CPlurDESNL78+K9MAsd6ne6c3iZsLT7M5lzjKNv8y++lyvsvzfcB0QBywd+FzfGMXeT2/HOV0FQh4rsdjB/sN3l8NF0RYnBaNArhbpdAkZb6NQhpOZnUxGOAhnxLILOLLyxVbHINHhu2J9ez20PieDP0P3iESUsPareF4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714082616; c=relaxed/simple; bh=L4HyJHm2zmRW8kG0EAfkWOdZb0hKun9yEy1bDfqB/kE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TkCiToqZcJMDtFcCE9Z84mXTj43/ZWvaP3hRhep8G97Q9koRrYKAt1BTk8mUz5/ueP4U22TsVV+nXqPZBCxveiEQqGSnMJJQpQKp7/ogHDlz4hNA8NsrLFCMAoe+pVS7/RHwl5wCdmfhELXFVrGmQf0rBfo5K26EsH9UH9/Q3iM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=mJvzAyPr; arc=none smtp.client-ip=209.85.216.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-2a564ca6f67so1362939a91.2 for ; Thu, 25 Apr 2024 15:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714082614; x=1714687414; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FPif3mAhk2mjxY5/ADz9MWVNfAUOyxoP0nyi2kzmfeM=; b=mJvzAyPrhtth2hq/O3F4I9vVcRpHB0vPAmq9nrkcMc1ACIN2jKsvKtWxr4BYNjeB9O HlaRbxKPGmv4IofjcryV8Npzcoso0t1UCdySSSf5BwXOEGfCNo2PqyUClQ2R1RbjODxe MhjXOE7OXBeyIIepQSuWLnCspCSXzPOdV1aoM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714082614; x=1714687414; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FPif3mAhk2mjxY5/ADz9MWVNfAUOyxoP0nyi2kzmfeM=; b=egx3PZaAa3FijzpAgXOcdt3/MMU7QAUeKTl1Zi9EtwWu5A/93IfQrGSz74z4CxpmcS FJGQ/+L71M3fpG8oSOdD7Ozcr3mwFTOoRzUgL3o1+6lOdgUS8DmJBTYnSTtJEgoTkjth 9NFPgr5xmnEqws+nZKZ2E8b/+G1oyFB3+nBmokfzdp3wUdSx0J01ERLNEOeae5PPxJGC EtKASGN9rbXDLb24Oaj6IsfwbiNP8m//kL1FTCfzYXD6k8Mj1vHud8nbreDg5Klf9AnX DDYLgr13VPoTN5FWXXlwi3GbNqXQXPbBQyiKADgmZWr62NC0iseCUoDPbzdbKR+0gua+ MbjA== X-Forwarded-Encrypted: i=1; AJvYcCWtF+aezpd0AzoQUTfAxZK25PVjRvCJdReUEyLswl3Bvim/p4vG3QOIqNxTR/XLbftmsGlbRQwSiZOD6pzoXqeyKKAbV77Uj2hrvTF2 X-Gm-Message-State: AOJu0YxSM5yQt5guhAyM4Cpfcf6+LoDFP3NRwkEk1rsTgUHqoS+fo6Kg gyOODeFveAFRUBD38rvQ/aKEYwbNmB1h56rQLQ67gJ8ueX7X58T3xLpGZmvMXAWSikhAR0NqbJc = X-Received: by 2002:a17:90a:eb03:b0:2a2:ba9:ba61 with SMTP id j3-20020a17090aeb0300b002a20ba9ba61mr1066092pjz.34.1714082614686; Thu, 25 Apr 2024 15:03:34 -0700 (PDT) Received: from localhost (238.76.127.34.bc.googleusercontent.com. [34.127.76.238]) by smtp.gmail.com with UTF8SMTPSA id l8-20020a170903244800b001ea9580e6a0sm2574036pls.20.2024.04.25.15.03.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Apr 2024 15:03:34 -0700 (PDT) From: jeffxu@chromium.org To: aruna.ramakrishna@oracle.com Cc: andrew.brownsword@oracle.com, dave.hansen@linux.intel.com, linux-kernel@vger.kernel.org, matthias.neugschwandtner@oracle.com, tglx@linutronix.de, jeffxu@chromium.org, jeffxu@google.com, jannh@google.com, sroettger@google.com, x86@kernel.org Subject: Re: [RFC PATCH v2 1/1] x86/pkeys: update PKRU to enable pkey 0 before XSAVE Date: Thu, 25 Apr 2024 22:03:32 +0000 Message-ID: <20240425220332.3277193-1-jeffxu@chromium.org> X-Mailer: git-send-email 2.45.0.rc0.197.gbae5840b3b-goog In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Jeff Xu Resend(previous email sent to the wrong thread) >The semantics you've implemented for sigaltstacks are not the only possible >ones. In principle, a signal handler with its own stack might want to have >its own key(s) enabled. In a way a Linux signal handler is a mini-thread >created on the fly, with its own stack and its own attributes. Some thought >& analysis should go into which way to go here, and the best path should be >chosen. Fixing the SIGSEGV you observed should be a happy side effect of >other worthwile improvements. > This is exactly right. we wants to use altstack with its own pkey. The pkey won't be writeable during thread's normal operation, only by signaling handling itself. Thanks -Jeff >Thanks, > > Ingo >