From patchwork Mon Dec 12 19:15:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Hansen X-Patchwork-Id: 32515 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2426462wrr; Mon, 12 Dec 2022 11:30:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Si//kurQaS9JZ7icLmHdMTeRq10rvwWc0TKPeRP3ER6um6p/xJsF1HNTgHKblAWygCzmA X-Received: by 2002:a17:907:c08d:b0:7c1:7c38:f079 with SMTP id st13-20020a170907c08d00b007c17c38f079mr3683254ejc.71.1670873440591; Mon, 12 Dec 2022 11:30:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670873440; cv=none; d=google.com; s=arc-20160816; b=OLnfyLhPdcG+85ztU/EOnDUtCSh7bhD/DcNFnvE9Fm+WHnxHG7BdALRw579O1EzVDP O1yN++8PvnfEknNhZHS6WhacbrcigcFttseqz07qGJQXW3D3eIRD92RLF0EmGu92sgqu CgMmh3H/pkDqeanFulqjmgAYVvIZ80KpqouyQvbpdF0Sc+h8bRQ2cRgOMnmyK5APZN8B dJimlXgU0Pgky4tHuF2NbdtybASxT0ZxMw4YxrNe6RQQLozrshwKsbB9pXQ0rmLOGJgd xs1tv4dby70fFR4ebnTBrFnBcEBYmy5XrucUuGSFhZRFOZgj7o6kraqPH5a3rNWcMaN9 Lc9w== 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:subject:cc:to:from:dkim-signature; bh=v93HiRt6VB6uojTSG3+KiFDCS+zcqaSJM3FTS1Cu/k0=; b=b2F6W2peZnvRgCoLG0A4qYN7RW6gHKwENkOWFVsaEkP7yXi379JEH3ARYB26ug/Udd 0BOgzCYVqdeJS0jX8u03Phs0mYWnA0qHZ6NomD8UGprGJNSWeEnoPCHqsI/3083NjATz t23PGnqPI2SK+YQ0VrtlkKsnaAMEBEAn6PPa4ooyOOSe+z8HZ0KInBLTAzS17QWo+sEa Yl38z5Mb5MbzRMT9IEnc5VkqQcJitKbCnetnlbN+/Pu+661CmEonNXsTcOW1Ik8d4gKW dMEmJhuwtGDf0KKjveXOrqSr8n4jrco+YxJrtOrLgm1xYhD51RxqkQPuMZBj3k5c86Mh +joQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="MqRc4a/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd16-20020a170907969000b007c14e6f3ad4si5678612ejc.99.2022.12.12.11.30.16; Mon, 12 Dec 2022 11:30:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="MqRc4a/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233293AbiLLTQG (ORCPT + 99 others); Mon, 12 Dec 2022 14:16:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233034AbiLLTPw (ORCPT ); Mon, 12 Dec 2022 14:15:52 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0473714037 for ; Mon, 12 Dec 2022 11:15:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670872543; x=1702408543; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yEHR0I6eITON7CTY8pY+SLLOzeWsZG+6wjqUP2S+NJQ=; b=MqRc4a/zfj/I/XqlOm2cRYrgM5HMJMmvz+Rb/HDiwBQwafh4c9f43Xab vcU3nRIPtVHqFlbBgjAzTklf4UEFlqJg/V1kFT2c+BeicmdkNJ6li0xYr t6C9JXeYSbDzzsQcSCU/pIcLbO/iR/8mcVL+JxeMM7TxFy8nfrkfHNhMr 0Nr7gsURpTuvER3uRkdQb8CSr9jrX0i0pHoZXPVK23VblMJuYbph0/4Qa qb0SjyeKZiT6+kG4ejsh+2bN5lIbgDcZnOLLx/tufdTl59o9LCT06IdcW qYOP0lXmfk8HKuvBgcWWZfVa+GV5lPqPwe2z6vhQXnqxnL4+0PDGGX8OK g==; X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="317973436" X-IronPort-AV: E=Sophos;i="5.96,239,1665471600"; d="scan'208";a="317973436" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2022 11:15:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="716911546" X-IronPort-AV: E=Sophos;i="5.96,239,1665471600"; d="scan'208";a="716911546" Received: from viggo.jf.intel.com (HELO ray2.sr71.net) ([10.54.77.144]) by fmsmga004.fm.intel.com with ESMTP; 12 Dec 2022 11:15:24 -0800 From: Dave Hansen To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT PULL] x86/fpu for 6.2 Date: Mon, 12 Dec 2022 11:15:24 -0800 Message-Id: <20221212191524.553255-1-dave.hansen@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752037788778940207?= X-GMAIL-MSGID: =?utf-8?q?1752037788778940207?= Hi Linus, Please pull some x86/fpu changes for v6.2. There are two little fixes in here, one to give better XSAVE warnings and another to address some undefined behavior in offsetof(). There is also a collection of patches to fix some issues with ptrace and the protection keys register (PKRU). PKRU is a real oddity because it is exposed in the XSAVE-related ABIs, but it is generally managed without using XSAVE in the kernel. This fix thankfully came with a selftest to ward off future regressions. --- The following changes since commit f0c4d9fc9cc9462659728d168387191387e903cc: Linux 6.1-rc4 (2022-11-06 15:07:11 -0800) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git tags/x86_fpu_for_6.2 for you to fetch changes up to 55228db2697c09abddcb9487c3d9fa5854a932cd: x86/fpu: Use _Alignof to avoid undefined behavior in TYPE_ALIGN (2022-11-22 17:13:03 +0100) ---------------------------------------------------------------- * Clarify XSAVE consistency warnings * Fix up ptrace interface to protection keys register (PKRU) * Avoid undefined compiler behavior with TYPE_ALIGN ---------------------------------------------------------------- Andrew Cooper (1): x86/fpu/xstate: Fix XSTATE_WARN_ON() to emit relevant diagnostics Kyle Huey (6): x86/fpu: Take task_struct* in copy_sigframe_from_user_to_xstate() x86/fpu: Add a pkru argument to copy_uabi_from_kernel_to_xstate(). x86/fpu: Add a pkru argument to copy_uabi_to_xstate() x86/fpu: Allow PKRU to be (once again) written by ptrace. x86/fpu: Emulate XRSTOR's behavior if the xfeatures PKRU bit is not set selftests/vm/pkeys: Add a regression test for setting PKRU through ptrace YingChi Long (1): x86/fpu: Use _Alignof to avoid undefined behavior in TYPE_ALIGN arch/x86/kernel/fpu/core.c | 19 ++-- arch/x86/kernel/fpu/init.c | 7 +- arch/x86/kernel/fpu/regset.c | 2 +- arch/x86/kernel/fpu/signal.c | 2 +- arch/x86/kernel/fpu/xstate.c | 64 ++++++++++--- arch/x86/kernel/fpu/xstate.h | 4 +- tools/testing/selftests/vm/pkey-x86.h | 12 +++ tools/testing/selftests/vm/protection_keys.c | 131 ++++++++++++++++++++++++++- 8 files changed, 208 insertions(+), 33 deletions(-)