Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7632324rwb; Tue, 15 Nov 2022 15:32:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf7MxwqsxGsGwdzvU7PUKe22a1kPjKDv8pnFb/zJQ4g+MdUthzidPotP0btCw2svAxsX+hCH X-Received: by 2002:a17:906:8316:b0:77f:9082:73c7 with SMTP id j22-20020a170906831600b0077f908273c7mr14965929ejx.517.1668555142478; Tue, 15 Nov 2022 15:32:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668555142; cv=pass; d=google.com; s=arc-20160816; b=CksX07JomsCuzdSxIEtSSmqdVSvALUOH4/HkZSRsA5weIA90VCT5iEo3aIHVxhmMqR kX+TaESSfhqzDW8V6bj+kRQB/HTrx5l7qhWaD0cAI/OegZ6odTdRmAWGbZlJyAiExZMb 8U+hOJb3Pwf51VA8J1ewMy/xlGLtXEfMdhwTvvZAowgdQ4n55EU1Lm9OQjo92JKeUTxy tV4kL/AexrfyzD75QMVAv47QHeugRdn/cwjVHylaO4AUGpq9MLpl3RO0AVvg2TcRBE0X XwmkYQMZ2ZUefaWbZyfuteU/GYOqOhZdQBX+xCkK2Bu6SV5B3fQRM+RsjYEB8sQ5N9hd QVzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:subject:from:content-language:references:cc:to :user-agent:date:message-id:dkim-signature; bh=Ju5/SFE+oKuPReCzkHUrn71D81lvbGjOsyrbiXPCsLU=; b=k8V8fmqP2fxC4l1+hbws5P/gFjQz5tkE/jWUwv7pN/3/wb3NvybvKi1i4R0zrN+5vF meQkY6RKOxv0LRU0w1g8IT/dNzkQjE/8B+vZX6Wn/jHFWG6dIxVP9G3cuh2cyN17ILqJ F5poooxR4U4hdcHBnf6R1GxeKBikfyUFKfze1tgESlGeYjH4/MJocwwSUWLY5KGhd9Ro apmFIltBQudABR45LWVHR3afbXesj7vHxe6Bh0pg26rX0qgkOxdMJHZ6EBVLr9CM2EZO 09dunseulmdsCyy7HUt2SOxIZl1fRwM5sAXxQbR2Fh2JCRzbq+5BJTiW9mmULK1XB0s0 mh1Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=dmZ1RlkV; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bt12-20020a170906b14c00b0078dc3be6508si10817825ejb.192.2022.11.15.15.31.59; Tue, 15 Nov 2022 15:32:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=dmZ1RlkV; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237845AbiKOXK7 (ORCPT + 91 others); Tue, 15 Nov 2022 18:10:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231931AbiKOXK4 (ORCPT ); Tue, 15 Nov 2022 18:10:56 -0500 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2072.outbound.protection.outlook.com [40.107.243.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8955A2DA9D; Tue, 15 Nov 2022 15:10:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B3HcQL2+oISd3Wz+gL+49MyZLtc0Ogcl6i5gq4cBdDN/abW2/YyP6ozXz1sPvsu17htXdRp+72aK03HHxti6oMM6XFDkGzljBV38FD/ebKMP+wcqPenbEQCLabMqy5Y0+c6wsWooTnCAWd3zxAmBjbxQQ6EQxahCQHsiAjO7icvtXJeaZz5MAQF3a4BgH1l+DjAEwNgFzRNyXU7JSfcaN55yURJDpLjIJQvJq3d3+oei2z6vNYFe01ONrbXoxY6GzK/0IHWmlom/R5L+IvwhWRhvrh9SOPMJt/NFOao1yvMMuhrWOSIAyM3hJ/USCs2nZ9ZCHN7o68FB6xMWWFgouQ== 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=Ju5/SFE+oKuPReCzkHUrn71D81lvbGjOsyrbiXPCsLU=; b=Jk6Go3TB/VMl+JEsjydtX9YB59CMghE0CfVnY5uElvoVn3ye+E1MyAVP1muiz2IncsnFeGrTUPjQ+PJWhGirDK8ALBrqMG/n0ynmLh2TrxA/WsYIrNT1oeA3z7hBM1ayxytbw69htjtE7gQdXkuqSE7IvnJdOpCDQTawK97cyp3JEBY6qc3I3seemPWwoaqaqJ2sNt+w7CxHFYpIEy5XbGvIf+G/1gZaDVfph3uAT4Chhl7csEcSOQNrx7Fl0aL/OpjmSs4pFG/qqE5PXAtyCDUfULSg/5hZy05Fyh9esw6f2Voh38qcUgA4Ua4DPATWLcWmIlik51NO6qOk/L0glA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ju5/SFE+oKuPReCzkHUrn71D81lvbGjOsyrbiXPCsLU=; b=dmZ1RlkVh4PT4ECUbQtDgnbyvRG3psFPpXCbRsierO+joipNXy1YEsG9DjptbLvFgM4PFWSW+mykXsfdhOrtzOd6PjolrjTj8O+wkW8iKiYQvxxcssjHYXKaueWkXBax5haFOS/BVtoAc0h1YoEMpvXnnQnfUHUDwYlWH6fY+u8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DS7PR12MB6263.namprd12.prod.outlook.com (2603:10b6:8:95::17) by LV2PR12MB5751.namprd12.prod.outlook.com (2603:10b6:408:17d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.17; Tue, 15 Nov 2022 23:10:53 +0000 Received: from DS7PR12MB6263.namprd12.prod.outlook.com ([fe80::818b:be51:fc53:5adc]) by DS7PR12MB6263.namprd12.prod.outlook.com ([fe80::818b:be51:fc53:5adc%6]) with mapi id 15.20.5813.017; Tue, 15 Nov 2022 23:10:53 +0000 Message-ID: Date: Tue, 15 Nov 2022 17:10:50 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 To: Borislav Petkov Cc: x86@kernel.org, Boris Ostrovsky , Dave Hansen , "H. Peter Anvin" , Ingo Molnar , Joao Martins , Jonathan Corbet , Konrad Rzeszutek Wilk , Paolo Bonzini , Sean Christopherson , Thomas Gleixner , David Woodhouse , Greg Kroah-Hartman , Juergen Gross , Peter Zijlstra , Tony Luck , Babu Moger , Tom Lendacky , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221104213651.141057-1-kim.phillips@amd.com> <20221104213651.141057-2-kim.phillips@amd.com> Content-Language: en-US From: Kim Phillips Subject: Re: [PATCH 1/3] x86/cpufeatures: Add support for cpuid leaf 80000021/EAX (FeatureExt2Eax) In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH0PR03CA0429.namprd03.prod.outlook.com (2603:10b6:610:10e::13) To DS7PR12MB6263.namprd12.prod.outlook.com (2603:10b6:8:95::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR12MB6263:EE_|LV2PR12MB5751:EE_ X-MS-Office365-Filtering-Correlation-Id: 89736896-56b4-468b-2649-08dac75ea4d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uLk2/LPppBRg6elZ0XVo7uLCPqLuMZ4QnFdGrdS9cJZApfz7LgjTWfP3NvVec9sMRPzrM+EOXZ+2wVgGYQ+Z+KUowaoctyAm1TNoq7zsQTfJfYoqWxIs9FTcDARBjtp58/LdtjgwKhzZideg18vw/cgi4CN4KH5lfGDslUbiHsUGt+ympANxw3Ez9UQTM7MEUpkzZD3JMegJqaOMOhvgZxG0Owq+CLCu982UE/UVQcxBzh7xPXFeDxA671htXmMsEM9lTG/yDjpgw7p9kQttf8PRlx0/bjqKn/dxTuCPQLQR3m1RuKw0oH9YwbJFYDTpHTZaH4YEHoIQ5iuT5fiWz2hKEjIEvD222FNMAJu5yp0d/bmKbdO/Wv792zh63ufn57XypL9hJt0htNo6Wi2nWaTuXptNs5rUKCGsHFpHWR/oUI+DyURltorgKI79m3H/2Ll/ZMu7GrVF7Fl+EIc+qLDyaLxhQqqHXl+n1hO08IdTplWxNh6zCOG7pwlSG3eUClsgltvbeswpVqc7OtvsawvgxSep9bKYzPHCW9VRjIHaAg9XqLfqtmaz7Cbby3CXKWQEYtTXR+6AzU3FmRtrOx2+qsG0Sf6em0FAFG4ihi66aljX5kf1uHsdkvX7lO3YeSQ08h8syXvWtBfErTmxP9iG1Ih8EN3DFiFfA03FhvoHdoGjRioNGkzhWUIYtN5S9HYllne21WjqGHMB8B9m9vNyw0/0XlZn6ifFi4b9AjG9wuaZXt1zDepGhsOkZnSuN4goMLapDEbYg66Udmu93n11fPgEJkJeuMjmwdKEzfI5fATfxF0Q8tid0TJNjDyp X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB6263.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(366004)(39860400002)(136003)(396003)(451199015)(54906003)(316002)(2616005)(6916009)(478600001)(36756003)(186003)(38100700002)(6486002)(26005)(53546011)(966005)(6512007)(6506007)(31696002)(86362001)(66946007)(66556008)(8936002)(5660300002)(4326008)(8676002)(7416002)(44832011)(2906002)(31686004)(4744005)(41300700001)(66476007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OVdEMGZMaGFCeWhnci9xa2lVT3NLS0VlcVVFWkwvaVIyQlFScUlUNVZsMlJS?= =?utf-8?B?M0YvR21YZmhRRi9MME9rN09KSVNTVE9yamJUWE5TUjVVbDduMmJocXpnd2VC?= =?utf-8?B?aDBZMjJSMUlpR1JJMVNrVEhLMm9GbThnMXdXNHdNNFpGdlJMOXJyZWpWWGJ6?= =?utf-8?B?N3oxdnFWNWFTbkFWcjU2bmg4VkFNYm1pUm1HM0ttWW5SZis2TUROM0VOVS9N?= =?utf-8?B?UDMxQ2dHUGdkTXR1RElIOTdVTVQ5UHkwcFhUdk5uajdaWm1HdFJsMjFLd3BD?= =?utf-8?B?dXJOb0d1ZGVhL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?Q?CTFtXvjkkijcN+5Cc0QeThxBi?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89736896-56b4-468b-2649-08dac75ea4d5 X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB6263.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2022 23:10:53.4496 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: e96L2rEEJhFzAbhbOygIbqADGi3fuoIRbVunHO+uT1IVF4feNk+4T3Ta3+cNFlPD9kvs0e51J3GTeEiGNjOsgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5751 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/4/22 4:48 PM, Borislav Petkov wrote: > On Fri, Nov 04, 2022 at 04:36:49PM -0500, Kim Phillips wrote: >> AMD Zen4 processors advertise features in this leaf. >> Add the leaf and its Automatic IBRS feature bit. >> >> Note: New whole leaf (vs a bit) due to propagation via KVM >> later in this series. > > No, not a separate leaf - use scattered.c > > For an example what to do for KVM, see > > https://lore.kernel.org/r/20221103025030.78371-1-jiaxi.chen@linux.intel.com That adds features that are mutually exclusive between kvm and the host kernel, unlike AUTOIBRS. When trying to wire up a scattered host AUTOIBRS version up to kvm, I couldn't get past all the reverse_cpuid_check() BUILD_BUGs demanding exclusivity between h/w and "Linux" (s/w) FEATUREs. Is there an example of a scattered feature that gets both its boot_cpu_has() and guest_cpuid_has() satisfied in the same build? If not, I'll resubmit like this original submission - AUTOIBRS in a separate h/w leaf. Thanks, Kim