Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4606413rdh; Wed, 29 Nov 2023 06:13:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjP70iSa1I538DQgDmt/nRCNhq5dJCagt5mHhYDdk7xK7j73kySxHCkUcn1uN80EVAakVo X-Received: by 2002:a05:6808:b01:b0:3a7:1b28:4bc9 with SMTP id s1-20020a0568080b0100b003a71b284bc9mr16395670oij.54.1701267212716; Wed, 29 Nov 2023 06:13:32 -0800 (PST) Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id r14-20020a63514e000000b005b909e93e2dsi14642045pgl.522.2023.11.29.06.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 06:13:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="d6m/+nIh"; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 4820780AF260; Wed, 29 Nov 2023 06:13:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230490AbjK2ONN (ORCPT + 99 others); Wed, 29 Nov 2023 09:13:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230446AbjK2ONL (ORCPT ); Wed, 29 Nov 2023 09:13:11 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE19CA2; Wed, 29 Nov 2023 06:13:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701267196; x=1732803196; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=0DH5UH5DBZXJ2utKvvIDBd+JXJbeL2uy/mkveTJDAn0=; b=d6m/+nIhLmadrzPe/LDiCzKIycGb0nJ1BuypBcsJiM+0finOwiTDa8Sf vzEeXd8b+r4VNzX9NgTg3p8TTyQOQIalzZWzQCppYPCrNU6XWfUHhg9um FIenN1yqAzGMsOBYA243aNmVr2abbKcFkmzkPlJnoos7B0nKbe6/8IuX7 fxkgDD4H6R0e+jsOTbI8wqf1yYLFP0Q7Jmsyi8BhmOZH4+R2/II3euL0i tB8nqAoSOJl167vnQKiZjcrfptpD64weZC6IRxBvbnA1PHAITyTo2A5eV EpvxhT+PjkL+UrhwM1BCJefat2j+XsPWjFr/8N1mEZgAT4LNAS+GoPdmG g==; X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="392032328" X-IronPort-AV: E=Sophos;i="6.04,235,1695711600"; d="scan'208";a="392032328" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 06:13:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="892462446" X-IronPort-AV: E=Sophos;i="6.04,235,1695711600"; d="scan'208";a="892462446" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga004.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 29 Nov 2023 06:13:15 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 29 Nov 2023 06:13:15 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 29 Nov 2023 06:13:14 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Wed, 29 Nov 2023 06:13:14 -0800 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.41) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Wed, 29 Nov 2023 06:13:14 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZznBxjEUQ6b9xHQfHUN+F+1mG7EXda7dxr3be0oPKmdAK4faK8x7EyB9V2YNnTBIlCagjmcCZb7EG3/j1x2Kn1RMYALfhc98vacYXRFzgcC5fc4x6QRXhFZ4dWUxI5pVbsLEA5L+hIcNKOuwlJwz8PZJJ+V20lEsq2S4Ann1nCEaI+oE2egL7iWfCubtXtNX72Diagb9K6ttK2jiTMhBNddxirmBSvJF37vpkDJ+TNMz65z2W/He1XDVPl8B2GFyp6bBe1+BWEwOra38SvkTMmy9AKzXfheYWayW6OD75V0tMnxq3TspVfMirBd6H/QYQ9pYroTRCaKtZ9HMXSEVQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0DH5UH5DBZXJ2utKvvIDBd+JXJbeL2uy/mkveTJDAn0=; b=I4AGdU03ZM6mbXk2PWIwDemRdLCbq/SMTGjpe7iZkhcQGhDOxEcbjzpflldNXPHe9z9d2+6VTJxjD9Ftl1N2F82Bu/vphfeuLT6sEffHigfEg76u4nWJkC4soHfzfWcbk9FtVoMn37nYRXRPlLpt7r/mFyS2YW97PqfGfQxUFAjLMwowtq75zj1NRN9oD3dPQSrKkNwjkFnptl9SVtkvvZBELJWS3slbH1RxD8hDnr6rSSuW/AgKbTbqQ5F0OvN0yTCdW0hUv66VmAOlJbXmVcsTiTNA3lv7TzIGvlMC+k91+zF0SNopFA+AspsZnRjkQBzpIqH+853e0ySi+O3cgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB4965.namprd11.prod.outlook.com (2603:10b6:510:34::7) by CH0PR11MB8167.namprd11.prod.outlook.com (2603:10b6:610:192::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.23; Wed, 29 Nov 2023 14:13:11 +0000 Received: from PH0PR11MB4965.namprd11.prod.outlook.com ([fe80::ea04:122f:f20c:94e8]) by PH0PR11MB4965.namprd11.prod.outlook.com ([fe80::ea04:122f:f20c:94e8%2]) with mapi id 15.20.7046.015; Wed, 29 Nov 2023 14:13:09 +0000 Message-ID: Date: Wed, 29 Nov 2023 22:12:59 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 05/26] x86/fpu/xstate: Introduce fpu_guest_cfg for guest FPU configuration To: "Edgecombe, Rick P" CC: "Hansen, Dave" , "seanjc@google.com" , "pbonzini@redhat.com" , "kvm@vger.kernel.org" , "john.allen@amd.com" , "peterz@infradead.org" , "Gao, Chao" , "mlevitsk@redhat.com" , "linux-kernel@vger.kernel.org" References: <20231124055330.138870-1-weijiang.yang@intel.com> <20231124055330.138870-6-weijiang.yang@intel.com> <742a95cece1998673aa360be10036c82c0c535ec.camel@intel.com> Content-Language: en-US From: "Yang, Weijiang" In-Reply-To: <742a95cece1998673aa360be10036c82c0c535ec.camel@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2P153CA0041.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::10) To PH0PR11MB4965.namprd11.prod.outlook.com (2603:10b6:510:34::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR11MB4965:EE_|CH0PR11MB8167:EE_ X-MS-Office365-Filtering-Correlation-Id: c7d5ea84-5936-4e84-00b3-08dbf0e5503f X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a2oo9w8GmTFFxjh3U/eUOEXcC+C2lV3DNqLm+4sBP+Ael0dQBypFtHZOecL3wR/e785AfpbdI5nAQ1hc1OionXK3alhRR5079O2j1MwknbDTdtjC7knfv05YgDk3uhG8kZUpyg9+z/T4hwWws9e6mGVKXiPwUhZnM3rS5gS/KgoSGO74iVzSJrilfuzfvuBHrw/1dm2RANDcvDyjxoHSjhYxBKeWQ1Q/64YFSV2XTx3NqMWebZO8PJOq3NopfcrXY5lVsDzLCsb6kG/rIoX0PWj7bNK/SnoHKDyY2kUE0Vq2GfwJU61VdzG6bAmlAxV09OrkERa6xbS/FQOgVOi9Z2tWypklGuhBB4RU1tusrW5+6TDydbnQJWfe2fwzl58RIT4/gkBY+oEgQVU2PvOfMRRjth32VctoRfgEnTjHKKeWkXuvnj7zs2d3nFiYFi7YPI/8fxzOM5E0dKMIESXECf4SUZTN5rxhoPlsnbuvIf0nsMfP4IlQ/uf4reQUYn2NPk+dU3muUx/ObwslwAw0RxplJuGmlEUtF0gH5KzBlJXjmrhzfJb6pyKFcGnCqeKM/JyeatcuT2UIgfmgLqS3fFO9d4f3cSBmIQ8qQ7+8XWI1t3OO2n+dh9sYQN3MWnoozWcfBAf5+EXbh1YOb6dIqw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB4965.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(366004)(346002)(39860400002)(376002)(136003)(230922051799003)(186009)(451199024)(1800799012)(64100799003)(31686004)(478600001)(2616005)(26005)(6486002)(6666004)(53546011)(6512007)(6506007)(82960400001)(38100700002)(31696002)(86362001)(36756003)(41300700001)(5660300002)(54906003)(66946007)(66556008)(66476007)(6636002)(2906002)(4744005)(4001150100001)(8936002)(6862004)(4326008)(8676002)(316002)(37006003)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?N0Vkbm1wTUV3M0IyakhzQnJNUmRVYlkzRm5QczdReDV1c0ZOWm1tMjFkYU1x?= =?utf-8?B?VTZxMm5aQmZVelBBYldPYUxGeE5URkg1cmNTWVhSNC9KMjFuaVdXZ09kUFBV?= =?utf-8?B?OXc1ZGxlSWJNTmZyQjlaRTJsVjlwdFFTb3JqTzdmZUNCQURYMDR0dmlwU3lp?= =?utf-8?B?UzV3dURwTndTbElwQXVsS2J6RFNaYVFTSndmYUtqdjJQajluU0EweWYyQjVC?= =?utf-8?B?S1NaTFk1ZEdtMFJTajVTRyt6WFFhRSs2ZkFsQzJQZG9JZ3RzVmRSNTB5dVoy?= =?utf-8?B?V2I2LzE5cnJ1Qmd2eWtRZjNNOTEyTk4zaEF6V214eWtZdGZqMC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XTUpCR0QralBrZk9oTTlwYnpwWFdqZDVQaXkyaFM0Smg3cXZ0?= =?utf-8?B?UUE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: c7d5ea84-5936-4e84-00b3-08dbf0e5503f X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB4965.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2023 14:13:09.2358 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wp5HgZp4bV4bo4lav2+d0P6LSEyIqjWnDjuZBZPxxVEx3e4DpAMuQ/O2KrpEd2G3NrcQBN89rMJ7GVovIWUEmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB8167 X-OriginatorOrg: intel.com 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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 29 Nov 2023 06:13:30 -0800 (PST) On 11/28/2023 10:58 PM, 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? I don't see there's special usage of this field for vCPU in VMM userspace(QEMU). Maybe it's mainly for AMX resulted usespace fault handling? For vCPU thread, it's only  referenced when AMX is enabled via __xfd_enable_feature() .