Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4180284imm; Mon, 18 Jun 2018 10:25:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLqTEaT+J8hrUwGVXt1NcEz86Di10yVBFUru2Il8AZNKhFz4nANDXJRG5N9cakId+5lqcih X-Received: by 2002:a17:902:9a08:: with SMTP id v8-v6mr15190302plp.148.1529342704998; Mon, 18 Jun 2018 10:25:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529342704; cv=none; d=google.com; s=arc-20160816; b=rBGzB+Gym0bs6a01vLbqWJieCiWpiWPtiq4XX+POzMNUXvaSUNEagPeoiontolw2Q3 08VErtvDNkStxeuR5ktWU0qUMDG1qIwbeEFi2hcTIjXg+0wBVhfoUq8GRE+5WQznJZk8 /NWNWVR/O64Qnfa1Sf+GlX1kjZS/Y/EumnMCUQb2WqjGkF7+7p8fxb3K/Am5ww09BFj5 0TbvLbJOPcfil8EEnOpxAHkTHDS1AL0cy1FdIa5LYRXIxlaFlskjIr+BZOPxxPyDwSNg XhnDdrmd6joKqBI2580c56/TJXa8b0mzaKl1U/qfutdc9UIhJKEmgA2/CzrOIQchmUrR 3Nlg== 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=JxMigBDv9lQO5irQb/9jaXHS+W57w3021PS7U1jAHfk=; b=vZv8LtIrBLLBW1KkmztQKCEJUrEJ849NSCsD9SYQ6dw0pqMNz7ZhnXR9RFLOpW+2yn L0b5U6YmAiYnsmP+A4srydo+0vBCx6GocWNkM+SkzcIVCl5U2igIc6yR15zLNb8mqP/G c0bklJl2lY3yCnn/bt5yQ6ErY5uGlBxkLMlCQj5O8pVHTLpnxo8wyGJsMZ1iItAVcNHQ UqZd3yZ/M3mxtd+B6w8xn8WYvZho+tb2GVwb6Isr/f2l4cy4gl/mNU9z8FAcMJ5IPVWJ mI4zXOlnM7E3ftxfuCdnFFgfIdtAOtbLXAnzh1kZ0fBVrmDDDKKEjVUUedAfihUgSlhl WHLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@juliacomputing-com.20150623.gappssmtp.com header.s=20150623 header.b=i1zgfhjO; 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 b3-v6si12482470pgr.495.2018.06.18.10.24.51; Mon, 18 Jun 2018 10:25:04 -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=i1zgfhjO; 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 S935457AbeFRRXS (ORCPT + 99 others); Mon, 18 Jun 2018 13:23:18 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:35866 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934963AbeFRRXR (ORCPT ); Mon, 18 Jun 2018 13:23:17 -0400 Received: by mail-it0-f65.google.com with SMTP id j135-v6so13122036itj.1 for ; Mon, 18 Jun 2018 10:23:17 -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=JxMigBDv9lQO5irQb/9jaXHS+W57w3021PS7U1jAHfk=; b=i1zgfhjOG7Pq/KMRZTwsd/XCZBZk7koTAM66a9rItnidKCA8COe06zKve4XznmWTNR FnitkAunxF/DKIHWW5Wtt23xz92zDQvcTHD6JT3f/IVB2FwPkDYl1vNBja82Q+cE/Nu6 ALvteaeHJEfHMuUcmt0gb+o8wZbKt5Y6kzDR8r5Yp+h3BelTIPPFnWmRg7TNiJfjA0p0 HjSRUxolyc4mOsMsyUFFdK52K7mf/IRYMAqJF4sLH6DyNbmjge6bjYzCpi+/t9UTOn5Q 21uFZrkr3siZegesBkeEuQdNB7XaNQVac1pUAwiB3mpGHRvUCWhn8jXs/9IjZfd+2ywL HO1g== 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=JxMigBDv9lQO5irQb/9jaXHS+W57w3021PS7U1jAHfk=; b=SrfY0F9xvzJfmnXPN3A5Zn3cUAJr6/GylXRNNdNDIWxKgfqTetQvL1eTi0uknqHXJi PXz7tPympYJ4sA0OStiR2h+BDRLi/PtAKo3WQldqjdz5sqeDliSxZgTGJasTmweI5/G1 cE50KNgZVwJgWXkDqkyi2dSQ8S4ZJa/RhMAcncifz1wSBL1V4p1VG4Aq7jr9WvQyUWOB 5DS6rUjUZr1OUAQg2sDB0Av8iZGwvCoF9BiZK7wOpjvOKXhDWRczLN08Tyvbv9TFrYh3 TqG6b1NbuAexIccZCxf4xj970SmKanSWAedoyxNXyWPzHO64WafdKyZCAEl0snH0Mx/j naag== X-Gm-Message-State: APt69E1PoxL3ORRVbaNEaud0tL2bwkHsZOD4bTq35Bz66yJkViUWV7PW wSakeeZo6bC3b5EBiGu9Q/FDcygP1P4KPlUp11MGLg== X-Received: by 2002:a24:5ccb:: with SMTP id q194-v6mr9566337itb.133.1529342596500; Mon, 18 Jun 2018 10:23:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:494a:0:0:0:0:0 with HTTP; Mon, 18 Jun 2018 10:22:36 -0700 (PDT) In-Reply-To: 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 13:22:36 -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 On Mon, Jun 18, 2018 at 12:16 PM, Dave Hansen wrote: > On 06/18/2018 08:13 AM, Keno Fischer wrote: >>>> 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. > > No, I'm saying that depending on faults is not a viable solution. We > are not guaranteed to get faults in all the cases you would need to fix up. > > XSAVE*/XRSTOR* are not even *called* in some of those cases. Ah, my apologies, I was under the mistaken impression that xsaves also read xcomp_bv to inform the layout, rather than using the RFBM and then updating the xcomp_bv field. Let me think about this some more and see what I can come up with.