Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4578391pxb; Thu, 14 Oct 2021 07:58:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygH1tdRDnHdIC/Y0yPXRXH4Q4kcvsGIVfJ4KdfxrHnuuPgCp6ZFCVqQOpfhAIciMxrAoU1 X-Received: by 2002:a17:906:a08d:: with SMTP id q13mr4336988ejy.465.1634223529830; Thu, 14 Oct 2021 07:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634223529; cv=none; d=google.com; s=arc-20160816; b=OQa/xY0yEdkQdCkAUuyrgtwQbycviK+e52NwszTn/rEAqwKE8ATcPUKtpZbEpn84iy 2hrAwQ9WLcD2ugvSl49c5UsPVGeJWnZ86ZoecItj5GBaYE2Yl8v1ow3MSYFIB8xiq3Iw QJJb5w6B5qxCe3G+24K0Msa5wl0N8eB50/3sh7+f+loe/mGagrAJ0q6DrDYifvMysFc+ x45yIqfp5WcUwauV/J6mqWNToy3r3xtzC5rVUb30tapH0xgjPFmcz00hG/XQQOZalepf jG4iyOjq+SnKO00qVJXpksrcBPMsswz9FFguy8vL1/R2pnyCxdQmfYcxwFLGmDeE+Ntw Z8FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=p+nJrEG4PcleBtVRR25FuZrlO9AVg9SUVua2dfzwMis=; b=Yc1CDROVXCnv5rUE/czN7Kmkb8t1JKIIHgp8WCxOOqOpdoZNFDg19aKrcPXCHfRslc J61w7LRGidZctftkasTLYz7nQ9fNqoq6URUnKS/V8RWFJu+SOC/IBHJ/QD0y9JlgQp4c DokwtchdxqwQEHzfpeoG2KRLXNGcIaNWjJLdVxi7f4TQhExM5zoYg0DK2CBrwdR1uzJ+ 5tiVm+gMiHD8ghn7PW01DxiZheaAQc9KIAYk20chY9Ml0zphriNau6xYLBsU25OP6EWZ i+LMTUctaxnBIzra100t/JI9V6CR2BhMuc/uoeAK3NTF5F8jcTdfqd7p5gN02BJiL7xb AbPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Z6ghuxRy; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 w20si2155204edc.168.2021.10.14.07.58.26; Thu, 14 Oct 2021 07:58:49 -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=Z6ghuxRy; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S231611AbhJNOjU (ORCPT + 99 others); Thu, 14 Oct 2021 10:39:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231361AbhJNOjO (ORCPT ); Thu, 14 Oct 2021 10:39:14 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA7D7C061753; Thu, 14 Oct 2021 07:37:09 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1634222228; 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: in-reply-to:in-reply-to:references:references; bh=p+nJrEG4PcleBtVRR25FuZrlO9AVg9SUVua2dfzwMis=; b=Z6ghuxRyh4SUmWyR5e7Yfp7QU6Joy2YiYhUMVduVVKtCljp4JfhaJhEey5rIKBYZHo+cjJ jqfEr+g0Qiqc/Yovd4FtPkjjzYsYXChBVRu/AcGNFd4X5STa5rRiSpNDLxqm+df4MlnfAO kv7YXc/hyzkGDwWQMhUxwBtTCrxzZ/rjzeXpBewtMjnP0G3xndJwlT5zDgpEOf6dM33cs5 jIQOaDTq42vJbyEzMv0vED1aCryDlxzmS1mfrWfVNy7VWVAWJ4+wG31qSGht4xn6ZnTWD8 who7zJ4XSrnlUzpcFWVLA7RnGlMSGyQbop7okOq4hyVWdiEGQKMxHtaUvliANQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1634222228; 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: in-reply-to:in-reply-to:references:references; bh=p+nJrEG4PcleBtVRR25FuZrlO9AVg9SUVua2dfzwMis=; b=/+rBl5UYDgSGFSh7tJfNhGlgZUvEkJO+++CqBqRn25D7pjASlPxgFaby7Sw11UVyvXHOMI 9L/Nt//47/l3CkCQ== To: Paolo Bonzini , "Liu, Jing2" , LKML Cc: "x86@kernel.org" , "Bae, Chang Seok" , Dave Hansen , Arjan van de Ven , "kvm@vger.kernel.org" , "Nakajima, Jun" , Jing Liu , "seanjc@google.com" , "Cooper, Andrew" Subject: Re: [patch 13/31] x86/fpu: Move KVMs FPU swapping to FPU core In-Reply-To: <87wnmf66m5.ffs@tglx> References: <871r4p9fyh.ffs@tglx> <6bbc5184-a675-1937-eb98-639906a9cf15@redhat.com> <87wnmf66m5.ffs@tglx> Date: Thu, 14 Oct 2021 16:37:07 +0200 Message-ID: <87o87r65bg.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 14 2021 at 16:09, Thomas Gleixner wrote: > On Thu, Oct 14 2021 at 11:01, Paolo Bonzini wrote: > > Also you really should not wait until _all_ dynamic states are cleared > in guest XFD. Because a guest which has bit 18 and 19 available but only > uses one of them is going to trap on every other context switch due to > XFD writes. > > So you check for > > (guest_xfd & guest_perm) != guest_perm) > > and > > (guest_xr0 & guest_perm) != 0 > > If both are true, then you reallocate the buffers for _all_ permitted > states _and_ set XFD to pass through. And for that to work we must write XFD _before_ XSETBV in the guest boot phase. Thanks, tglx