Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4044763imm; Mon, 18 Jun 2018 08:16:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLIqqqLH2TFxON3UtrgYmKY92EjsyydPDgB6FXIpB/CS9zcOhs5cmmcBk4sC8Fden/hf3EJ X-Received: by 2002:a17:902:8a8c:: with SMTP id p12-v6mr2167239plo.212.1529334975676; Mon, 18 Jun 2018 08:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529334975; cv=none; d=google.com; s=arc-20160816; b=E9b9M7QyEqYPm0KccaPcdERSosnpxzUnW/0WpPFTNaVPPLY7PwGxhrWpvOtVXOTjCc 0pT3eOUU41cBLehippXTp/3BMCZw6NN8Y45u2URTngNNCXGFLrScUDm3X939tb8qUNpL V+6WAZZHHTuarXl56kig2Y3q05q/zgyG5Okq5lliBUprMb1jj1q7u9Utqe4XHhrwzZ96 H7Os7qKdOYiOpQy+pN9EbYOZss8De0iyAkLr5DARgZifZV2oopThETgXmN9G2GYRiTwk juG2JErag88lXaHSxerHeX4f9LYuNypsxBZ/W1vpmFyD2mGmBQFnI6KAJz4ofVdg9HmB dJpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=CftzRDh9vXJ+cSm8zI0N/aOokJQ87m0Io5qxvP7s/2o=; b=iLanlVdcyP5eKcmJsouc9HKim1R9jIHv+71JmTxYBiX1b+vUVxz/8BRtmdIDriM7qn ObtGFaiIcX83Mc8rTQvLYrMYX015N70oGipaViAV45TjfXH3jLkSyCkBuay6h62PSQdV 7QL5sYuqG5cA5CcfwIWb7ofMwLTx1iAsjM07UFGoMf9+/uGY0nkrT3I0UAXqUzxQ9Plh 5AkRxWJ0V/hR5uB9cUosxoIW5kM5GK+AhnfJKyPH2QPRZuokWvv4uTlUqa5aIAWJuZxl ZhMCYfEkCvK7WU6bKabOl3ux4+l82G+mOjBoz/bEoW5ivSHTEH25pT9PAAYCs60VmvBR hMig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@juliacomputing-com.20150623.gappssmtp.com header.s=20150623 header.b=W9EY6qqa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7-v6si14147126pfn.16.2018.06.18.08.16.01; Mon, 18 Jun 2018 08:16:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@juliacomputing-com.20150623.gappssmtp.com header.s=20150623 header.b=W9EY6qqa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755212AbeFRPOO (ORCPT + 99 others); Mon, 18 Jun 2018 11:14:14 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:52273 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755176AbeFRPOL (ORCPT ); Mon, 18 Jun 2018 11:14:11 -0400 Received: by mail-it0-f68.google.com with SMTP id m194-v6so12533331itg.2 for ; Mon, 18 Jun 2018 08:14:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juliacomputing-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CftzRDh9vXJ+cSm8zI0N/aOokJQ87m0Io5qxvP7s/2o=; b=W9EY6qqa7Lyfl9cbMuE+x2tbxPoBQZecVZs5XOBLqQ5U3I9HyGWd3nVB6hu/cve3th JsYIAvupzNPAOzIWHXgeS7ZsLwzj/gRWryagrs5AKjzA+rdVhHY+8pvYhBn6f7Mwv5JK bMMY8kRZrGh3jXyhG0Tb2SGeNncoOZ7+C8hL//GaoHYA5tKQRnWJnnVm48WrWmIW5lnx 3bbUP0dTkLThp5uYbq0e/uM7E7VF1BnY7COkBzyCvPjRa4LxU72IU696VyrImTl/l/5B odx/GggGRUDWZRzIwbkSsH0EdrpKqcrlrPjxDCGkk+ZrBBSnoj5EWOcYEM5qyGbDSHC9 eU/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CftzRDh9vXJ+cSm8zI0N/aOokJQ87m0Io5qxvP7s/2o=; b=X11Uxe7Rp2zOv8BAM6bccwfyVA9uxGSyQeRWblWpSN/eJmODDMIJZu0NwH1Rd+C+fJ dvlmZ/t/L7BGKXZ6sLq90mh9nxm30vVOJ9ukQ7WGf+ujve+I9plJ9Nz8jdikH46acMpy 2ZmQ0Tb9Kis4snrpOcVz+Vz7y4Y2ZTm7IS/RkIWVQGzpo0m8fog4vu0CJK2jnhqUejs8 VbZcjk61EhxmAiMqfoZ76NGqleLuAPcSrzAOdsEVH5ci92IcaWfCxYUVU6XqRJiae0eA O5BsbhKtFxhCtaOtqv4qvn9aT3F7KfKq9sv8XwrDTCmI2UtDulRQ9vjg20hBvMgSomw8 SZ2A== X-Gm-Message-State: APt69E1QoHRuSJcAcRPhuxk6/jeyU4DekbFT/RiWXtjwZ/meOiRGs1TB Hm/g3hauVOzhSAUpR1ASRKfeqKTUzGQv3UGnjW7uGw== X-Received: by 2002:a24:5ccb:: with SMTP id q194-v6mr9200259itb.133.1529334850625; Mon, 18 Jun 2018 08:14:10 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:494a:0:0:0:0:0 with HTTP; Mon, 18 Jun 2018 08:13:29 -0700 (PDT) In-Reply-To: <11347d3a-8491-1545-d47d-a1cb2fb9b410@linux.intel.com> References: <1529195582-64207-1-git-send-email-keno@alumni.harvard.edu> <11347d3a-8491-1545-d47d-a1cb2fb9b410@linux.intel.com> From: Keno Fischer Date: Mon, 18 Jun 2018 11:13:29 -0400 Message-ID: Subject: Re: [RFC PATCH] x86/arch_prctl: Add ARCH_SET_XCR0 to mask XCR0 per-thread To: Dave Hansen Cc: Linux Kernel Mailing List , Thomas Gleixner , Ingo Molnar , x86@kernel.org, "H. Peter Anvin" , Borislav Petkov , Andi Kleen , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Kyle Huey , "Robert O'Callahan" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> 4) Catch the fault thrown by xsaves/xrestors in this situation, update >> XCR0, redo the xsaves/restores, put XCR0 back and continue >> execution after the faulting instruction. > > I'm worried about the kernel pieces that go digging in the XSAVE data > getting confused more than the hardware getting confused. So you prefer this option? If so, I can try to have a go at implementing it this way and seeing if I run into any trouble. >> At least currently, it is my understanding that `xfeatures_mask` only has >> user features, am I mistaken about that? > > We're slowing adding supervisor support. I think accounting for > supervisor features is a requirement for any new XSAVE code. Sure, I don't think this is in any way incompatible with that (though probably also informs that we want to keep the memory layout the same if possible).