Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp772466rwb; Tue, 4 Oct 2022 10:23:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5bY9SdD9WT7HS56gnvcHrAoNQfWepsop0E37RfaZ+zxqZl7ZeEjlY94cBlK3R58W1OIUOX X-Received: by 2002:a17:902:a9c6:b0:178:b2d4:f8b2 with SMTP id b6-20020a170902a9c600b00178b2d4f8b2mr27600483plr.79.1664904194973; Tue, 04 Oct 2022 10:23:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664904194; cv=pass; d=google.com; s=arc-20160816; b=FeECDS5vTUbDvQ03AIk3+EcinKDwjnbfSMgHfbgrDd7bE72dXjMGUgJSw1Gi6khx1R 3+h/ZkC5lqp0KGr9373/5ZDLxb7I7FmNb6YpMofkYvpF/M4VY/T1/d2oPDnavbXGSqSJ cViB4PkoCphiKokkiAK/xJ5peT8EexmgYLnfFEEAGbT4vKcgccyC19oQpt+e+7v/EcM5 /T62o63xoHkJ6R05yo1T506rpkeDa54WBfNcOwe9vT7M2eSoEBcfnYX8pCpqL+szdJEL W28ERr+BDuHGr1r5I/dTlUXs2vtMXQhSu8GqaapTouJtJWnEhFR+n9e5yruHqFMlE9AZ 4gvA== 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:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=pdVdUYQguczGIuPQx/0Pr0fXAwVGSXntNZ68ZaAul6Y=; b=UXIBOcvG6Jf/k8jrUDx38LQXIakoURD9TXde3tTJa3IE+88lIDoHZOELRtNG9Ik2+t xKOm4SvcnFi1FG2evyfo2zewx7woNjtliwDtd07YIMRl7bwsZqeCGLhsyawmSNc1I1AP DP5zx4GypI8sYpEKAcZjDLrr1EsgBjs3rOvmosUrnYnFb/xx3a7TX58R2IwB1nPqs0fv aQX1C2JzsFVkW3xzx5stlDsXQv6CBoVfnoKFDbkUMW0OjSr8/ha6hTJHoDCAM1siakTA 7VNICtenDYeRmcms7F78LmaJpi/SOif9piSyVvf9zlI5i/7KYHQu9qoRzyUekzRHpKK5 u3+Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=ajozF4No; 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 m10-20020a638c0a000000b0044cf4082645si8612082pgd.28.2022.10.04.10.23.01; Tue, 04 Oct 2022 10:23:14 -0700 (PDT) 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=ajozF4No; 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 S229917AbiJDRMT (ORCPT + 99 others); Tue, 4 Oct 2022 13:12:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbiJDRMS (ORCPT ); Tue, 4 Oct 2022 13:12:18 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2083.outbound.protection.outlook.com [40.107.244.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CABC5C968; Tue, 4 Oct 2022 10:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V4iamDXCmtFxKzqCJU3XUWOCbBAuQBx4tWXQEKsnSpPHgcoy0zQEW8qgft1OdF6i++alUGi6uHCfKGID/dxaX5tCv028daqNjqzKrngw40+hREdGvgbKOdQ3CaGhDoQR7oJluA8z9inQfiD1Ix6s52NuFRt9IzzTvK6KTWZk/iDNAMSZDpzkCjrZihhg8d+Np0mgw5DHYh9sPlkzr9LWAkta4Ep0Yb3I9M82ymPmuWLSRDEZp+TCGAdegrhtDVlSocW6UIIKhycG3wKGi1/cc8MYLcsH1aSWMZU21aXWd9g99FiMLBtbQGItwuya4ZlnXKObcbfmJpz0IjbGoJkAIA== 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=pdVdUYQguczGIuPQx/0Pr0fXAwVGSXntNZ68ZaAul6Y=; b=oNX41FWve+Rv8aLyu8vqVOFwyBHuqDCKGyBnL3JuXYYp9yt3Ga28AwyscmHtd6aOxLhHbattI15odhByLOiKlhRlgILP6LcB0kyUx8erXVlOWSjgdsip56tbbT9L/9LqQTNaR5xg/GRy1CmtDhPC3fjzYADdjhcnmRqAjvqjnQqnxpNpS7wuZjKvz9/1emgEXgKotVou6N9G7jMQv0HUIYQGoHxUHRQA9PRpWLZED6dzxnWYossoRBXgINM5ZjqELwSnYAa/FhjvoRnfRszMYotoa3E7Y0CXHFUTBGX6ZRugui2NT/LaM26K3eDuEPpbqDjN5tTU5pGSG4nMMbuehQ== 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=pdVdUYQguczGIuPQx/0Pr0fXAwVGSXntNZ68ZaAul6Y=; b=ajozF4NobhvlACX1gtFYERrqOA2/N92iZclNXFj3WvOowVdyNGFmD+/ZGeThHfjFjKcfosBirpkxT6C5pzXzum+APcll8ebdTq7FxvwiskT4wu0QDyVT4nx2tw1Rcdf98FR5vfTWdHpDCIaXFxT18L/fxUGq2TQJ90dtJ3D5rr4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BL1PR12MB5874.namprd12.prod.outlook.com (2603:10b6:208:396::17) by IA1PR12MB6212.namprd12.prod.outlook.com (2603:10b6:208:3e4::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Tue, 4 Oct 2022 17:12:14 +0000 Received: from BL1PR12MB5874.namprd12.prod.outlook.com ([fe80::ea28:b6e6:143c:8649]) by BL1PR12MB5874.namprd12.prod.outlook.com ([fe80::ea28:b6e6:143c:8649%6]) with mapi id 15.20.5676.019; Tue, 4 Oct 2022 17:12:14 +0000 Message-ID: <49227bcd-3e54-4a4d-5416-dcb9315a1802@amd.com> Date: Tue, 4 Oct 2022 12:12:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] KVM: SVM: Fix reserved fields of struct sev_es_save_area Content-Language: en-US To: Sean Christopherson Cc: tglx@linutronix.de, bp@alien8.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, venu.busireddy@oracle.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, "Lendacky, Thomas" , bilbao@vt.edu References: <986a5886-4ddc-aa88-db52-e8781ec95aed@amd.com> From: Carlos Bilbao In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: CH2PR07CA0057.namprd07.prod.outlook.com (2603:10b6:610:5b::31) To BL1PR12MB5874.namprd12.prod.outlook.com (2603:10b6:208:396::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL1PR12MB5874:EE_|IA1PR12MB6212:EE_ X-MS-Office365-Filtering-Correlation-Id: 7853656a-8188-4aa4-0d43-08daa62b94e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: afK/Oihq7c7aDxYWP92+7njBcP/xVrwmZ2xVxi0Rnx/8Klu2FbZUnXfdPOEQFxKiFk5nl/iRcxf7dMBCYL4EQO6KC9QHIazGAk3xDhfhZMtLxx1hvmLIbjdRLsvFu44tuqHgh0nVc5Kakscfl/1HzCG7MLNOdKaCWnXzC+rksfy8iULWsGuXz0c5ZdLD0kkuIiqzkhje18uPWOjLD4WyTM6yYk6A3id2YH6RFbUMcMFxX1hIBFrcvPXoRQ4YE2O7mUpvnHqKIV5/Y5Mm9GfMdB8TDmtnQi4bGe5mahbuKmVQvtM220x8KcZL8aNFOWKrYgE+3Q3btBiIJwyW7QNXZ5e3isD7x7ktk7SM+TMgYaleTnaPOsA+wLClF5IqezEkwmZEoqJvk2nvskCs2bJluyONhVwDCcoBYeTRYB+U96uAih8mHDdy/hqM97IsBdk4AFRtm6BrRNrFbQCpenJivpoXBNkU5uUrcVjIokNkG/08rElHkeBB0OJLNWodkPIsHtQHYfVWFrm/bh6xjIMZyl52EHtBOlZF+UO22LkkOLiT4mjFpX8ypcWElEQKs/m5esEo+uLLvhkylwp9J8RRAQXI+XJgtdiGcO+Sx3NkmljWD9e2WF/bwJccez4hQWjODFeXlowob2aJuIFSERH4R98rEYYRVQKOm2sl6TINnOYz92048gja9rGfoy70TPfeg88xittrWS++og6fCPwD/WyNStWTnIvQwpZZsHfLUVOI6h8tPGpqBGoI9CXEd8tw1Wu1hkKx+1t/FOVMNghF5+j8FGGNPhRKVgaU0bGoHTc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5874.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(39860400002)(376002)(366004)(136003)(396003)(451199015)(36756003)(44832011)(53546011)(2906002)(6666004)(41300700001)(31696002)(6512007)(5660300002)(2616005)(26005)(186003)(38100700002)(6506007)(83380400001)(86362001)(8936002)(7416002)(478600001)(31686004)(4326008)(316002)(6916009)(66476007)(6486002)(66556008)(8676002)(66946007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UWpSbWEzdFJyK2xWRm9GWmkzZ1lHT2pOazNyVGFxbTJ2SVFjOVFhTFVtWTBX?= =?utf-8?B?Y2MzdGF6bjhnMjRxSkRjakc3eExlYjQvc1BHL0hURmRqWmV3WERUdDdZWGNL?= =?utf-8?B?R2owZ0tOODRTWm9sdm1xZDUvMjdIb1pxMFF0ZFJ5K0VTck8zNVZyMER5Yk90?= =?utf-8?B?UUFESnZMTDR5dHM3cm13cE5Xb0R3RVU5Y1g2aEJJUFlFT0VyNGZ5OTU5MFpD?= =?utf-8?B?eVU2VnFNUkN6YUJ4NVl2ZGlHWmNXTmJwQUNFbVA1K21SY3RTSk5PSVZmVE13?= =?utf-8?B?eGJUVG1OZ3gxbUVvLzIzcVk1Zk85OVZtcTdubVVCUjdBcW5PTHNYaEJOdDlu?= =?utf-8?B?d3BRRHRGRnR4SXpOUldoQVJjemJTd2NxUzdRQitBdUNudzRCTzA4WHVvMlU0?= =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exchange-CrossTenant-AuthSource: BL1PR12MB5874.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2022 17:12:13.9530 (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: AcLX/V5hR7QiOLIE5SOUzpnhNvdSiiHV5QvtU1qDDA/cRALIw4QDUirvdMJ32bT/bVF6nzInhLI9dgOFHbefiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6212 X-Spam-Status: No, score=-4.6 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 10/4/22 11:29, Sean Christopherson wrote: > On Tue, Oct 04, 2022, Carlos Bilbao wrote: >> On 10/4/22 09:05, Carlos Bilbao wrote: >> >>> Reserved fields of struct sev_es_save_area are named by their order of >>> appearance, but right now they jump from reserved_5 to reserved_7. Rename >>> them with the correct order. >>> >>> Fixes: 6d3b3d34e39eb ("KVM: SVM: Update the SEV-ES save area mapping") >> Actually, there is no bug, so this Fix tag could go. Thanks!! > Fixes: is appropriate, if we think it's worth fixing. Personally, I don't think > it's worth the churn/effort to keep the reserved numbers accurate, e.g. if the > two bytes in reserved_1 are used, then every other field will need to be updated > just to accomodate a tiny change. We'll find ourselves in a similar situation if > field is added in the middle of reserved_3, > > If we really want to the number to have any kind of meaning without needing a pile > of churn for every update, the best idea I can think of is to name them reserved_. > That way only the affected reserved field needs to be modified when adding new > legal fields. But that has it's own flavor of maintenance burden as calculating > and verifying the offset is a waste of everyone's time. > > TL;DR: I vote to sweep this under the rug and live with arbitrary/bad numbers. Well, the discussion on what is the most appropriate way to name reserved fields is orthogonal to this patch, IMO. This change just follows the prior approach (reserved_x), but correctly. Keep in mind that the existence of reserved_{1,5} and reserved_{7,11} implies there's a reserved_6 (there isn't). Why knowingly keep something that's wrong, even if small? If the maintainers think this is worth changing, I will submit a new patch without the "Fix" tag (nothing was broken) and with a new subject line (instead of "Fix reserved fields" I will use "Order correctly reserved fields"). Thanks, Carlos