Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2588923rwb; Mon, 7 Nov 2022 15:23:13 -0800 (PST) X-Google-Smtp-Source: AMsMyM7BxuQ5EFXowUi7B1NHGjDS87wyGYbwqnxSN36Ai4f8lnQbbMS5Ql1gLMnkZddy7OuDpWMG X-Received: by 2002:a17:902:8212:b0:186:a260:50a0 with SMTP id x18-20020a170902821200b00186a26050a0mr52790598pln.157.1667863393089; Mon, 07 Nov 2022 15:23:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1667863393; cv=pass; d=google.com; s=arc-20160816; b=iJfp6CrO71g0uT4QOfPOLNT3oI/8yvrwQFKlbIfsCvXhJEChCpZPqinvPJFb/2JLxQ fUp8+LTxxj/lKKD35cuPHp6AMOI0sdydbEsB7C9Nv23vR+FeHAznG1gQ8x+Z7b2CjPku NwMFIPpxz/Zh6ITU5fORUh/n7H1H3CkLJvMjXgDH2Z8+wxMOjbM4jk/hJouxqKlsbgbb 4TazDjR9Bzt9T3slIiFWdZ/c+BP+q4DfgJ27B/+S/qBPrwZVp7vA9LYbU3GKzSTiNwwj 9gFa1Tn8HLzjFUySSO760z6hWzD4GPTbym/mznNVtA9XrP33x5bGUWxUAP7tDy+WDIWd 46Xg== 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:references:cc:to:content-language :user-agent:date:message-id:dkim-signature; bh=7ArxOFkThkHfZmBWpZw6BYm8M8+yyWp4h9yqawg9fxo=; b=w+QsbPVs57FlgPYRrtcNGiGBT3qWH8zcgYdnUUnOnQ1m48NETL+OhuDXgUABkiQtAS swjVuv2I5Oq0PcHkxJuMmckW0BhfoGBGkvooDMKxYEEPwaKRTwgGQiUXCvMzuBhdtZO1 V+MlZO0/1OG8YRRqopyKz1EgmfAGjk73C06Ffz8dd3At5jk5MiyMZ60ueA6ROQyuXD8x 32/RxsVk3Z5LCDfhlKtMU/oKLa/PzJHCSY3kxjBUWU6vSRxCni1kFXdUTm5JHYNAs147 OO5DhwkW+XWW8vKVHR/AEg7sxWRivYA1jPQep1DZnrf7U1wGESA12CPkpuJ3pH/XqMTh WCDA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=MrJPuV5i; 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 iw5-20020a170903044500b001865c1ecf30si11256646plb.176.2022.11.07.15.23.01; Mon, 07 Nov 2022 15:23:13 -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=MrJPuV5i; 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 S232553AbiKGWnl (ORCPT + 92 others); Mon, 7 Nov 2022 17:43:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232517AbiKGWnk (ORCPT ); Mon, 7 Nov 2022 17:43:40 -0500 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2069.outbound.protection.outlook.com [40.107.101.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60872B1CC; Mon, 7 Nov 2022 14:43:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SBsikbk268LGHSqvW2qc4Wk353vgrXATzpmqtCh1YGyAEtbzFD8cFdmBqfIfBaTKH+muQJODqla/449+JGgN5Qbt8hZEQIh5qxztkLaCdbWEOMh/IaP9ZC61hrPj5fbRBo0UZPLA0+xYGzBVdYZZGv5CvSBVpvwXnptlPmFCJzPxNt97392N7vz8rfBFl/Q7oWTCshq05mfPezwmru+vSsVwo1J1rhoqJtQzX/gH00gXDs2rXRHk43QMqL4t7zy48grJ1dV5G4n9xuMx2TeebHLwFs5dv/Rc1PWjtgbSqgy4hTqHmGWHT6NSw4OGQbS8YVJYW9VGA4a6s9Cn2iENOQ== 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=7ArxOFkThkHfZmBWpZw6BYm8M8+yyWp4h9yqawg9fxo=; b=Hb/ej/FKZ16CKIgfzPZTMRO1OmtqWFXJ93bVV7INQ7xogtZise4gV7wdM39xqLBV5TzIuozUjxW5xHqnFzblwlbi2SaZg0vahUTphkEhjqLWtyduYcxfoqp0OZ5laClqXm51LcsKD7d4mFgH1EMMFU4QzhzJSgVo2LYKTreuN+f8gZTK3vaViCxAIxkMSd36hbbBnyFxObR27OdRR7K3BT40Gwato3cSF0FwTz6ES0kyWoDa6oKR/lh+pejmTPa1qCVHI4YLTfpnPvGeGZb6cPXPJRile2cpsXkspONxh2qpS8miPr9KsfV+NnrzvxlC5YJ1aq36Q/BjqDU7jXGKUQ== 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=7ArxOFkThkHfZmBWpZw6BYm8M8+yyWp4h9yqawg9fxo=; b=MrJPuV5ijAJLEkli3216/1WcHlmwfD5hBoeOzMxzbU93H/4Rs46lI/hKNNfA1Iz69Z3/9Aehd8mZatLTi/uzqiiraRyPFtgXy3ChHQ9fM9fA7I9MNP6luk+Qe8SpbFD6M32aLWYCEJC+StrucEEyrhnMRUZUTG9qJF2uS3MLIXQ= 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 SA0PR12MB4352.namprd12.prod.outlook.com (2603:10b6:806:9c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.27; Mon, 7 Nov 2022 22:43:36 +0000 Received: from DS7PR12MB6263.namprd12.prod.outlook.com ([fe80::6f5:7c8f:32d9:e72c]) by DS7PR12MB6263.namprd12.prod.outlook.com ([fe80::6f5:7c8f:32d9:e72c%3]) with mapi id 15.20.5791.026; Mon, 7 Nov 2022 22:43:36 +0000 Message-ID: Date: Mon, 7 Nov 2022 16:43:32 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US To: Dave Hansen , x86@kernel.org Cc: Borislav Petkov , 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> From: Kim Phillips Subject: Re: [PATCH 0/3] x86/speculation: Support Automatic IBRS In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH2PR16CA0028.namprd16.prod.outlook.com (2603:10b6:610:50::38) To DS7PR12MB6263.namprd12.prod.outlook.com (2603:10b6:8:95::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR12MB6263:EE_|SA0PR12MB4352:EE_ X-MS-Office365-Filtering-Correlation-Id: 68e3b62b-f9ad-419b-db93-08dac11181c0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XEoODuevAHvXDFkcnFg1nnlqItQjM9o9qLwCH83PYM0ZG1P3JpXgen7yRF49FZlpe5jXH3fWWPbNKLyzECfQ9LBsjGOpb4RQiY5Lcp2FxhkFqW0rhE4i3tLyeQXUNJBuxe3p7ygs8q2tc2be8cBTjP5821vqogQGtjTfazbFgooTYUQFo7pRHxv2uTdm9mKZutZIL+edw9u61UBsCqGbn/Lj5j1ZFZTA6gRGkdOpHCZHinf/CaWpMdtmOPCN78cDFi1aCJ6t/BtBMDrxxRRlXiHmXcwPWEVnq0lFPQa4LQJqYz0gaf5iFze07hVOJKLCUKzWwfXgvrkXgUw/IRDUn9DZHERJRRL5cmmsBNhPY+HOevWBY9HGXCKvCitZLsvCxoa6j2SAMzfJ2uZZYsZF0VK80PUtes33Y+KFt3qZjtvESFwTHVYGeJvYm3QqJtmpLyB/83JWzl/BS4GD/Yx2bmm5M3mXubqT2CHckxNdwtZTX4jFbz5PPYIUv+K46XoafYPzjsY5ia8/o78W3MV/L4+eBv9CITjo+KRP7E82I9JhETKmKmfkdpiMT8tb/fKCXq8q2FvcToiETk4U+CXnRafQk5dXgzzSimS8awTkIW7NFen9JffYPXLx+uTvzCXyJvThaVGDHZZo+tdgCbTRWK+cDTZBHqCWLrRQiRF+PXPHYz+7/HFH9m5FQvI2WFvOO9JjDM9Igc/Z7VLuwQsgUFJlYaj8cXL/KD1o/JlOVzuq5+exZcK19lySFBrQdaT1UNbAOp5N7VW575oX1wf6XGDNZzhhXJPlwabeGQ0RDKk/R8T4ClxmaodsgRpTGxGpkhZWEfJi59a9gJ+5anxUOJcQlCvELoS0Av9UC/j0xMA= 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)(136003)(376002)(39860400002)(366004)(396003)(451199015)(6506007)(6666004)(53546011)(2616005)(186003)(26005)(6512007)(38100700002)(7416002)(5660300002)(2906002)(44832011)(478600001)(54906003)(6486002)(316002)(966005)(41300700001)(8936002)(4326008)(66556008)(8676002)(66476007)(66946007)(36756003)(86362001)(31696002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SW1FV1FHc2d2emd5NEZrZzNYQzVlNzJGTlQ5VjgzYU9QZ1FCakZYMklpM1B1?= =?utf-8?B?c3VBM3NULzUwQjBZYWFTcWRxT1YvZHc1TTI3ZHlqazJzaFI4S3doSmRaaXF6?= =?utf-8?B?QVpEai9yZUc5QWd2RHR6RUJSVUxyV05yMXJNRjNIekJKN1JtMzRHN1RCL1Zj?= =?utf-8?B?SFFXOEExRDlmSnA4dDZ5Y1BYbWdXT1pLVTJiNWxLQmRDcDRIeEpYVnEwekFK?= =?utf-8?B?SEhYVFU5bHBkN0pOUU4yZG1ERkwwSmQrZDgwbWZ5djhaK3hyWkNQNkNzazJl?= =?utf-8?B?Mz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Qjcw?= =?utf-8?Q?bQKnTeV9vaRhJDNRyYIW932r3?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68e3b62b-f9ad-419b-db93-08dac11181c0 X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB6263.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2022 22:43:36.2788 (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: UhVfT+QsLivKaCmiERAeFKC2ida+wMPQ17ggnkWZF4PHNiOEDYDwqj6z3eh9dwXvhamSMht6Ry2x1RX3CQ0uig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4352 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 5:06 PM, Dave Hansen wrote: > On 11/4/22 14:36, Kim Phillips wrote: >> The AMD Zen4 core supports a new feature called Automatic IBRS. >> (Indirect Branch Restricted Speculation). >> >> Enable Automatic IBRS by default if the CPU feature is present. >> It typically provides greater performance over the incumbent >> generic retpolines mitigation. > > Could you also share some information on how this differs from EIBRS and Some differences are: 1. Unlike EIBRS, AutoIBRS needs STIBP always-on 2. Unlike EIBRS, AutoIBRS doesn't need to clear the RSB on VMEXIT 3. Unlike EIBRS, no AutoIBRS processors are vulnerable to RETBLEED 4. Unlike EIBRS, AutoIBRS doesn't need 4. eIBRS also considers user/supervisor as well as host/guest modes when determining its 'predictor mode', whereas AutoIBRS only affects CPL0. 5. eIBRS also groups CPL0/1/2 together, vs. just CPL0 for AutoIBRS. > why it needs to exist in parallel to EBIRS? If by 'in parallel' you mean why do these patches not tack AutoIBRS onto the SPECTRE_V2_EIBRS enum, there's no big reason, other than now that I've tried to implement it that way, the number of changes to bugs.c goes from 34 lines changed to 58, mostly due to exceptions caused by items such as #3 above, and ignoring EIBRS_RETPOLINE and EIBRS_LFENCE. I've posted the diff to the 2/3 patch thread, please take a look: https://lkml.org/lkml/2022/11/7/1462 https://lore.kernel.org/lkml/20221104213651.141057-1-kim.phillips@amd.com/T/#m78ef9bf6a38db8348e0adde3f5ac8b4953200b41 Thanks, Kim