From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26BD0C433F5 for ; Thu, 14 Oct 2021 11:39:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF1D76101A for ; Thu, 14 Oct 2021 11:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231182AbhJNLlk (ORCPT ); Thu, 14 Oct 2021 07:41:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47247 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230454AbhJNLli (ORCPT ); Thu, 14 Oct 2021 07:41:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634211573; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zUt09S4csvlYuawOC+3Rd0m1qDOaKGhw9lW/9LXEe7k=; b=Dcigtc7iDHs0LTJbwI6ykop9wCyRSgRhmuvaCaacFji5MJcErtJX6prhZFskOJKDtRRTSb a6MMnFCDvQJS6sOzLuzozTZ/BYZfsc0oxFwl89cHGOwDrlo++hCrlUjFZesBnspEvkLacR XNY6/UzDgdqAekW2Fvu5ZLgDVWwKWS0= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-329-oE-pULkvPOKle6q30TJ79Q-1; Thu, 14 Oct 2021 07:39:32 -0400 X-MC-Unique: oE-pULkvPOKle6q30TJ79Q-1 Received: by mail-ed1-f69.google.com with SMTP id d11-20020a50cd4b000000b003da63711a8aso4859436edj.20 for ; Thu, 14 Oct 2021 04:39:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=zUt09S4csvlYuawOC+3Rd0m1qDOaKGhw9lW/9LXEe7k=; b=G1mqhOFsnNJF9GavM1QwLXu3SXzSju4KR5Fw+Msd1cYUQfEeJbgd7UvgD54v+lpNOd G97VUUAXKEInAuGexpm0DiDo3WWa60/CwHSQD9AebEW7gYyXSLpWpb0BbaLa54As/w6s dpckId5tCWqhAmxWEdqph5oTdc5zMmRdyBZqBF19HV1PtGpOnMX14HKlWxsP9mRFF9Lp V7dCwDYn7ePFgSgB2w8Y9z5S6/ezGtZ6kFO6VjG2uqGUlJP3dgJhnpSLSK9gi5TLpUGF VKvGWGy/Z2SewocDvK3o6m9K7AoMkwwclhCwNhjjaLsYqaXoiz2zuoKcRRWddx/amwvw Dtzw== X-Gm-Message-State: AOAM5315zlfCjVYz7M46NFTGgPp8EGnY7PGrojSl2KxkTFT4O36i8yDv 0B/llVlorGgOTZ9XUNNNCvWeuJ0Q9G1bcI+N4B80G2P9OU+I7enJdA/oKO/NSuDN9TntdmP+Hxe a5DcVqQ4I+iuCiNP2MT4MwJzN X-Received: by 2002:a17:906:5f8e:: with SMTP id a14mr3187483eju.155.1634211571567; Thu, 14 Oct 2021 04:39:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyShlU79JrsHL4kA6p6xoWiNJO7pml0YFLFUDMjqsmGyUAf3uRy/R8wnMS4pDLr590B/MN1eg== X-Received: by 2002:a17:906:5f8e:: with SMTP id a14mr3187458eju.155.1634211571367; Thu, 14 Oct 2021 04:39:31 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id o12sm1986907edw.84.2021.10.14.04.39.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Oct 2021 04:39:30 -0700 (PDT) Message-ID: <9c2e202b-4e15-2728-4c61-a2f74adac444@redhat.com> Date: Thu, 14 Oct 2021 13:39:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [patch 13/31] x86/fpu: Move KVMs FPU swapping to FPU core Content-Language: en-US To: "Liu, Jing2" , Thomas Gleixner , 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" References: <871r4p9fyh.ffs@tglx> <6bbc5184-a675-1937-eb98-639906a9cf15@redhat.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/10/21 13:30, Liu, Jing2 wrote: > I guess we're worrying about is when KVM is sched_out, a nonzero XFD_ERR > can be lost by other host thread. We can save guest XFD_ERR in sched_out > and restore before next vmenter. Kernel is assumed not using AMX thus > softirq won't make it lost. > I think this solves the problem. So we can directly passthrough RW of it, > and no need to rdmsr(XFD_ERR) in vmexit. Correct; you can also use the "user-return MSRs" machinery (until Linux starts using AMX in the kernel, but that shouldn't happen too soon). Paolo