Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp493456rdb; Thu, 30 Nov 2023 09:58:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHkBYqI9O1GOx41aPS73IrJIpFoKx5bd7eXCvqmwyXr/xyUG+8WmQOqZphCj6vOAZ8nuxL4 X-Received: by 2002:a05:6a00:e0f:b0:6cb:a653:d927 with SMTP id bq15-20020a056a000e0f00b006cba653d927mr20968801pfb.3.1701367114853; Thu, 30 Nov 2023 09:58:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701367114; cv=none; d=google.com; s=arc-20160816; b=B34CDW6k/IhDlWis+u5Ygwnm0n0GyorePHDZwSS3rep3gOO5uRJI6tV4qXz7reQLAU /YmodeCVkUCpb1nroJbBSyFq5ZoFxJO4R+juKUFsUsv1bq5Y0eGjjJNbcS+SzxL2LJZe acsQ+gWzMmJZ2w0afZtX8VCIr37dbhMbqUCynAgYXY1b0VsdTSGhJ73v+1MTo0wwLkeY RxQDzf1V3YYMAdFmCX2Za5eVA873UsDaOF85NMH7sgFkbaM3iykNg81lYDH9evsYtt8f m4+lmttKQgBYMq7fJ1MQgvGWt4wbSowOkP4wI6Z3GAo8vc8lBmcCPVpNtkbTeNWpaGBq 9DTw== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=EXAA0SWAfHXtZ1ioopeEEFz3kDipZ0RHppWNUXlv9bg=; fh=2Ntm85R8MyrD9M+p8iukXVd16fsFddd2mTmUNlS3AFo=; b=WJOWwCV8QDAnLNW7neX7zkT/8c2qUXRAX42wnJPl5LHFVdK9C7qvKBhNn6ypb75Blp uSGh2s2aS9lPkR9P3OdTI02VhVGF/g2zsfnA/s76UzDWlAhWKzdZnxYdEi0bp6ya0Ewa geI1TPrPEOW4VPheWZVq7NCPjBy2On428VVjlpUXCyhSxQfvIZFc6K/YO2wyy31NKiqW o3vmDQV6BMEVfti2yjKfJ834Y55BRcaDf5FGIUtOMWemrfFlPUiDLrZAsmip/l5fp7K0 VKlx/s+WL1WSeZFYZNQsBxidhQChUl195GQ0U9LAIYbyM2kBMNLz0CBdiU9gP7gO4k9e iAXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fORwbM0H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id f7-20020a056a00228700b006cdef1e9ab8si1226238pfe.245.2023.11.30.09.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 09:58:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fORwbM0H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C94C982A5172; Thu, 30 Nov 2023 09:58:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231837AbjK3R6T (ORCPT + 99 others); Thu, 30 Nov 2023 12:58:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231330AbjK3R6S (ORCPT ); Thu, 30 Nov 2023 12:58:18 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98E2C10EA for ; Thu, 30 Nov 2023 09:58:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701367103; 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=EXAA0SWAfHXtZ1ioopeEEFz3kDipZ0RHppWNUXlv9bg=; b=fORwbM0HueohgOdFEbaJ/RVT94i7qxH0UbXhUfd7753Lq1X1l9yT3yYZkQ71Z1DnsAamdB RnSX6cIyY2JAF903+B6oVxT0r+MvOJcyGfO+m54Hb01hAeA6QlrWYtBVpGE7f+2m+xzSN4 zRedEbwf5Ws1MlUKUx3srPPunW47LHI= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-593-TNDzuNigMxyj1XuQfguGWQ-1; Thu, 30 Nov 2023 12:58:22 -0500 X-MC-Unique: TNDzuNigMxyj1XuQfguGWQ-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-333120f8976so1012029f8f.3 for ; Thu, 30 Nov 2023 09:58:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701367101; x=1701971901; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=EXAA0SWAfHXtZ1ioopeEEFz3kDipZ0RHppWNUXlv9bg=; b=P0vtpxbSchYgg84kv07rxajtzaCY6WB6xl0pajzHAXqxcdS3NKKuHYoDQmSiDB1LPl JYdirhgrMvHT+NzDQvGArdtbtclalcyfzipSiLryUFw6JqkN+DpMGC+wsWNOmHy1tPmb XFbOV7rBBwdEySO1AKHpw0ycLZjx5KWmwOlb2aQoCLEaSHulUe12X20kcDySw5pSqUXL lmh4vj7hJUOwTwfyO8m5ePFjGOBhsvuafCxvX69Ryjcx07M8OGAQ7QDvMd6wrr5O4P0F QGxY4uNSmmBczZ+HRNwFz0dzEaWGhbLPHss/VK48jMeqiIjxOICqyLgeHAHpy+RMqZL6 F+5g== X-Gm-Message-State: AOJu0YyEXWe8MNnnrsfgsn4CeGosn7laBkpXP1Na6o+X9mXa4hllZa5H zuk0i4iYHP2CGAKoKbzmiqb71EfIdvfjvrvr0NRj4MLYeFGpCgb0jrRm5LW2HNdoi4CLQOIUezX yH5oCFKQZ733XDx+k9mt4LuGWFmct2cWH X-Received: by 2002:a17:906:2c0c:b0:a03:d8ea:a263 with SMTP id e12-20020a1709062c0c00b00a03d8eaa263mr10894ejh.16.1701366694858; Thu, 30 Nov 2023 09:51:34 -0800 (PST) X-Received: by 2002:adf:f148:0:b0:332:c9c3:2cd3 with SMTP id y8-20020adff148000000b00332c9c32cd3mr4045wro.47.1701365355975; Thu, 30 Nov 2023 09:29:15 -0800 (PST) Received: from starship ([5.28.147.32]) by smtp.gmail.com with ESMTPSA id h1-20020a2eb0e1000000b002c9c0a59627sm190249ljl.41.2023.11.30.09.29.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 09:29:15 -0800 (PST) Message-ID: <90cb8be18da40c62f6acbf2bee19ec046e122e49.camel@redhat.com> Subject: Re: [PATCH v7 05/26] x86/fpu/xstate: Introduce fpu_guest_cfg for guest FPU configuration From: Maxim Levitsky To: "Edgecombe, Rick P" , "kvm@vger.kernel.org" , "Yang, Weijiang" , "pbonzini@redhat.com" , "seanjc@google.com" , "linux-kernel@vger.kernel.org" , "Hansen, Dave" Cc: "john.allen@amd.com" , "peterz@infradead.org" , "Gao, Chao" Date: Thu, 30 Nov 2023 19:29:13 +0200 In-Reply-To: <742a95cece1998673aa360be10036c82c0c535ec.camel@intel.com> References: <20231124055330.138870-1-weijiang.yang@intel.com> <20231124055330.138870-6-weijiang.yang@intel.com> <742a95cece1998673aa360be10036c82c0c535ec.camel@intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 30 Nov 2023 09:58:31 -0800 (PST) On Tue, 2023-11-28 at 14:58 +0000, Edgecombe, Rick P wrote: > On Fri, 2023-11-24 at 00:53 -0500, Yang Weijiang wrote: > > + /* > > + * Set guest's __user_state_size to fpu_user_cfg.default_size > > so that > > + * existing uAPIs can still work. > > + */ > > + fpu->guest_perm.__user_state_size = > > fpu_user_cfg.default_size; > > It seems like an appropriate value, but where does this come into play > exactly for guest FPUs? It is used because permission API is used for guest fpu state as well (for user features), and it affects two things: 1. If permission is not asked, then KVM will fail to resize the FPU state to match guest CPUID. 2. It will affect output size of the KVM_GET_XSAVE2 ioctl, which outputs buffer similar to other FPU state buffers exposed to userspace (like one saved on signal stack, or one obtained via ptrace). Best regards, Maxim Levitsky