Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp137529rdb; Wed, 1 Nov 2023 21:05:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGcWApmBUesLefKQ3ts8lBvMvYyBM2f0AzXnvZDpkWYyRr/hf6QHOBlMvu8XkUKmIuhDJRC X-Received: by 2002:aa7:d392:0:b0:53e:6013:7fe8 with SMTP id x18-20020aa7d392000000b0053e60137fe8mr14598663edq.22.1698897914776; Wed, 01 Nov 2023 21:05:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698897914; cv=pass; d=google.com; s=arc-20160816; b=agmtMC0ArIAu+2vI+UkM0eX7oMOnDaBAqLe4DTFQGRXuukIuvMxwXxRGgZ1MEoRLRl 4EuxL76fr4JN07kllXDQ7BNsEi1QIP2kAf0d/qltkcDjjximCKLPMHHfyPZRecnm9Ka4 8rr9jNQg4fXYkJkqTpMHsZ8olJuut2/iDH2hY9vGjQiiq4BydC3y+I2okUvlwnHF4Mcw ZnATQg7BqoDAqp23jwev5y/8KW4GSx9u43C/5EavvL64MAgkeT+SBd2H36W1q6WhCFMj QG1NlaAXXs6vvX0dVylDMPQVXl0OZg/yDjPKDRlrqpokPpbO4Ch7cilHSoOnnPXvnIzd cjmQ== 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:reply-to :user-agent:date:message-id:dkim-signature; bh=g/JFLHYdc4VTMc8d71TEizYAARPKPZGYGo6DDT0AViM=; fh=OezF8hsrquKBgjjX3j9T/2174w78RYWnqFzllCDP3bE=; b=Ba+9lLI6v725jvjfPHDOEo6Z61Fwr6NjFhQJk+EH4HBTByGeyZJ2gRkb9UmRXzz71F LZK3uBpF5zbzewROoom7OFunnpberArno5oBZD29A0snEWza6IcwDG/KOkGVJH/uj6jM VXDbd597M6+7pyPXLZhBM5Jj6k+MKLG0FaaRkQ1RqhOnPYjifhX2CPpOwMhVBeKxRuxj 2tHyYz4Vw6WAHBMJRd/Nem5ZcLfvVf7sGeymBAik36/Ll2rSKmOWJdvoYyPDwRRmcts+ /3OrQOW08zQwcLB6JlGCkrWitNRpXvROn1EcHMIvWD/gBJ9F3CqcRIQyrm2tTf3p9WVS DWNA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=e8pXpnOQ; 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 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id k29-20020a508add000000b0053e112200c6si1289079edk.610.2023.11.01.21.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 21:05:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=e8pXpnOQ; 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 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 32E7A801C617; Wed, 1 Nov 2023 21:05:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348268AbjKBEEQ (ORCPT + 99 others); Thu, 2 Nov 2023 00:04:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348393AbjKBEEN (ORCPT ); Thu, 2 Nov 2023 00:04:13 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2066.outbound.protection.outlook.com [40.107.93.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14BED187; Wed, 1 Nov 2023 21:03:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yj2o1f+uLCjl9ph8PZUjmabjoTT8gHmodZoOJM1RHGmU3TsRg9HQW7gHWGmVmskUYsHXwLN9QeCXdxKbB1pE/x0s6xfBOeRHueouVM57F4mRFWTgJ8WmyS9PN6YHdPeplMmDGV3YhiX0vghs29aTuvPnrlFiZFYnq3kIBpG2qhWgsI5FUqhS82FgGIfvd2ABRkXb9Z2zMc+2meWUfRJPDiv1kQZamIbWud1TpC1KhNyLbxJvzsvmzeuGg6FGaamh5uOete0wIil9wD2sCoUvxwIqW0w0E3uwEA0wgMgXmYIFM6jzab1psJt3+3vg1XQulK1aVOEalhR9q/K6j4ABbQ== 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=g/JFLHYdc4VTMc8d71TEizYAARPKPZGYGo6DDT0AViM=; b=C4Z2TiJpd6Ccgy5jZ08szjZ5timbIJnmdKUcOPMxR3U4gJKjciMFg1IHOKW25HA5Aw42yfGXBVTooxnEKd07ZKivxUn1k6Ze02EXKPyjox/g3lyV8KjY3N+Hz+qJ0yw2SLFqBoqS0ucqZdfKBRVTzRF1K947Ll5KZfzXibao9VqTP/7Olm7xeyN4uzIh17x6B3Hfc1+iU0FTyA9oBK0UQIwtYVghhfOthNRFRtx/+Qxio2eLP2wiTvK/HCnCrQzkU8p928tVaVCw+TJjXO5zFhJk5rWLovIL+wB53Du5h8BSVdyQr3xN1wtAl02Ojfk4VLY065YKs/KdWCGfckPEsw== 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=g/JFLHYdc4VTMc8d71TEizYAARPKPZGYGo6DDT0AViM=; b=e8pXpnOQsXiw3AuUWyS0B1n+kfa3l71RN/Jl04rIlJozyAvxD9zE6wpWpwMuVJ4PMsTRK1DgUlNEKT8ucZfd0Ymsj04ZaiDYnIPpAVZ0GEtALwqAghObRUs/HUwltuj1P2mEvhRz58a8Os5GqD+OMEH+ZJ7NpLdsTKMzkpel+0Y= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DS7PR12MB6309.namprd12.prod.outlook.com (2603:10b6:8:96::19) by CH2PR12MB5514.namprd12.prod.outlook.com (2603:10b6:610:62::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Thu, 2 Nov 2023 04:03:54 +0000 Received: from DS7PR12MB6309.namprd12.prod.outlook.com ([fe80::93cc:c27:4af6:b78c]) by DS7PR12MB6309.namprd12.prod.outlook.com ([fe80::93cc:c27:4af6:b78c%2]) with mapi id 15.20.6954.019; Thu, 2 Nov 2023 04:03:54 +0000 Message-ID: <5b005b81-792a-4338-8085-e064c273f887@amd.com> Date: Thu, 2 Nov 2023 09:33:44 +0530 User-Agent: Mozilla Thunderbird Reply-To: nikunj@amd.com Subject: Re: [PATCH v5 05/14] virt: sev-guest: Add vmpck_id to snp_guest_dev struct Content-Language: en-US To: Tom Lendacky , Dionna Amalie Glaze Cc: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org, bp@alien8.de, mingo@redhat.com, tglx@linutronix.de, dave.hansen@linux.intel.com, pgonda@google.com, seanjc@google.com, pbonzini@redhat.com References: <20231030063652.68675-1-nikunj@amd.com> <20231030063652.68675-6-nikunj@amd.com> <57b904e1-9a17-9203-e275-4b5a31ca8a71@amd.com> From: "Nikunj A. Dadhania" In-Reply-To: <57b904e1-9a17-9203-e275-4b5a31ca8a71@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PN3PR01CA0082.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:9a::17) To DS7PR12MB6309.namprd12.prod.outlook.com (2603:10b6:8:96::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR12MB6309:EE_|CH2PR12MB5514:EE_ X-MS-Office365-Filtering-Correlation-Id: bc6a22aa-9f55-445e-e22a-08dbdb58baf7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QWWycnkiBQgvC88kHqaMV6Lt35muatJ9HKnpnJ9L5Efxc7yXtgqz5sU72Gcwu1Q4PztlCOIyA1gW8Ui2vkhzJd2+Rd7YH6Lx63ni7j/Or25lRaUftRMpqxpGgTryCzoTYiQ2T9nqJnZ5f1oxbpgOlkTlPTq7g/mZD1KvKSqYo7QpGTUvhzRuVd3L9KExBsNztxMoBrnDPAGE+NoP4UMjPwjWh1Tja1KgQExgofrXuxsPZWvH6TlyfO3XPaJUrn5ppLO9NgNRaadnOymEq5mexKMSIgF/M8j+8pwKi5YVmxTCGW6vSw/+PMNfSnAiQetMFvdyJrFfQHIF6+ulKLweJFxDJHr4VW/RQjdiTmZkb9wdgyt2Bd9wtgGJ9LqE1t0Z8E/mZqP4CJNb0rq0dMkl0HvPIITTgejqFe8nYtwb5cfeTVRnUKlJ/kv5riG1TrDHhTpJKEWANKzj9Ni3YZXgfqwIJJ8ZGU5jlBMy/tHWaxURuDzOevzauI1yK3K+c/Y90cJFFx/UpXP9LRuzLWvNADZtjZ60Xe54igkqHSYiqm7ZHMbI6F19yAYFLVonz7LnNbQnJfNHPfxQVPr8WY23qSy5Pmz79sFT5bd58C+PR0KGBKDhGTsz1zanf3qgYp/15NyZX9dt1HLI7ySFx3PaYg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB6309.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(376002)(346002)(396003)(366004)(136003)(230922051799003)(451199024)(1800799009)(64100799003)(186009)(6506007)(31686004)(8676002)(2906002)(8936002)(4326008)(4744005)(3450700001)(6666004)(478600001)(41300700001)(6486002)(66476007)(66556008)(110136005)(7416002)(66946007)(316002)(5660300002)(53546011)(2616005)(26005)(83380400001)(6512007)(31696002)(36756003)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eGpHbmd2a2YreGdYalhYRmNmd2hESERxRVlCMkg2MGc1aE44MFAvV2FqNSt1?= =?utf-8?B?QmJIK0lZN1M4Ymhqd0xwSFJlRC9lbkVTb1lnU3ZvT3llVkRQNEhhWmFGbFZ3?= =?utf-8?B?R3pjNlMzamd3UGk2QnhuRFBFeEdHVUsySnBrTzlMTjFrRGl3TzdnTGhobFhY?= =?utf-8?B?aTBvNEk0UkE5NGJzRlo3a0xNRmtJM25NZVZyVmNqK1loaWF3Z2lOUmY5MitN?= =?utf-8?B?dEgrekgvaEhhZ2d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kwWjhxVXoxbkZmNGtoK2ZMWkor?= =?utf-8?B?Vzl0ZG9seXc0ZG9ZeTJmcEEzVDJRNnpuaWFOWFFSNCsxZ0hnYi9LQytzcnN3?= =?utf-8?Q?1ou2mVcf54tFcNdXQKS3QN3pR?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc6a22aa-9f55-445e-e22a-08dbdb58baf7 X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB6309.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2023 04:03:54.6878 (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: 6UkLklcAiw0Hf1rXlwXgWNx2yVC+ujoSSbz9pZs9zKWQ6eWQCdMXa/Ycqfu9KnAqyJm8vtAMGASEnXeLZ4c5wg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB5514 X-Spam-Status: No, score=-1.3 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, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 01 Nov 2023 21:05:09 -0700 (PDT) On 10/30/2023 10:42 PM, Tom Lendacky wrote: > On 10/30/23 11:16, Dionna Amalie Glaze wrote: >> On Sun, Oct 29, 2023 at 11:38 PM Nikunj A Dadhania wrote: >>> @@ -656,32 +674,14 @@ static const struct file_operations snp_guest_fops = { >>>          .unlocked_ioctl = snp_guest_ioctl, >>>   }; >>> >>> -static u8 *get_vmpck(int id, struct snp_secrets_page_layout *layout, u32 **seqno) >>> +bool snp_assign_vmpck(struct snp_guest_dev *dev, int vmpck_id) >>>   { >>> -       u8 *key = NULL; >>> +       if (WARN_ON(vmpck_id > 3)) >>> +               return false; >> >> The vmpck_id is an int for some reason, so < 0 is also a problem. Can >> we not use unsigned int? Yes, I will update that in my next revision, Thanks Nikunj