Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3739489pxb; Tue, 7 Sep 2021 06:39:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVMJcXE/du5dnhP3dLEqUs52NAXJyz+LFEMLBlpSEk3bp0X2NsJ4jY79f2zMC0Juk1zaa+ X-Received: by 2002:a05:6402:5108:: with SMTP id m8mr19037596edd.367.1631021959126; Tue, 07 Sep 2021 06:39:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1631021959; cv=pass; d=google.com; s=arc-20160816; b=U5D/+h2d67FbxY+9k7+0X30Ec4cgpyku28xe+P/CHJf+tqR4uryc0PzRi1jJXkN6oL /y+vOtQoiAvyi5UhEgZZfl7/pSnsLXfuQhRuyQ276BSIfrxzzrfe4Lv9P0IIrSRu7e1Y j0XY46LFhCyI7JhYPlqMkOdSI3nGImMf+/ovysyVdMlqWlRZM1Kav0tMHhKEB8NQckWJ I3v7BvGxy9yKKyP95shFI+xTZ/bCPsIYY0JNTuf9/oG7zi0QGUeV4LdiIynHPKogFALD k7/Ya/iSMvagLC58Z/p4QquWx88fu+Xy9pOPTYOWnqGh8PFpH6WQk0j0TUn8ku+ROwb9 eEaw== 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 :content-language:in-reply-to:user-agent:date:message-id:from :references:to:subject:cc:dkim-signature; bh=O9tMxmG5CV8CDnk6qhKVe397KJrFl96yY+YUW4LTQZA=; b=Rlf+1BNOBqiKMz++8QCrOqmmWIvIUAxJrysNwDWOSALJUFj3I66ccB0Pmbseb6I8C7 EXMV0lYWOgRNzz+b+KvDT7no+iHQl0ygxb5iEnujAi/XOzmH7E4dTdhy3YCz3XY3Oo9a ZuOqA99nUEBqmFOzWREMk1FdBVPCV7ZJTQXuSN/Hu/qwLn1L7Fb44PMhtSjfNB+oaD+4 bY7j91VZSiefM0acH01P3jI5HyDYZZxsl9CGn3oU2hJOFdopWiJVi+HrjmWwOr+yumb0 Lujz611hba0boTJd/ntmvTvXFPT+7gwPJcrsccGan7Gi/GKIbITdOlTRXz8uS71+Ye8c E6/w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=tqlGI6Eq; 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.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v1si10938602edc.180.2021.09.07.06.38.54; Tue, 07 Sep 2021 06:39:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=tqlGI6Eq; 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.18 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 S1344513AbhIGNgZ (ORCPT + 99 others); Tue, 7 Sep 2021 09:36:25 -0400 Received: from mail-dm6nam11on2048.outbound.protection.outlook.com ([40.107.223.48]:51105 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234489AbhIGNgY (ORCPT ); Tue, 7 Sep 2021 09:36:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uw8M303kuHk/KU2Rbo2sZYXbBlf4ITFV5h8ymmN6z53V94c1jo9VryxNJKE2afxTKDakfJbzH6cdFGpqdvw/N7yYBTpw0mHvVhlmqYq5fKb3bOyrVDCrtv4G5fqkMaXVBPe+0OpRq237+Otg3BReIItTUvfdzeay0UBhQ7U/kWDliVXoa/YxcjaBSlOF3Os1s+qWx4ENmRkttx4XlBEKMB7i27ckJVqLT7Kvyh642YSFXpAQbqY9ZlTxzTBMT+nDw4Fu1t9WJo+01nOpBnYv6VITCuaqH6MSDDy1/isoZYGLmil9M7uN2tJIKRlXck4w19KvOmdOTz9jpEFnb+qxmw== 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; bh=O9tMxmG5CV8CDnk6qhKVe397KJrFl96yY+YUW4LTQZA=; b=c6bEWdk5ofyb7QNA/H6CZphX0dqZAUU9tot1n5g3KnWHfjwjMETFInSp/Rs4abksiKo8XsYZti9gfeS4IGXC5/bvqKFXNUj0nDojz0K4OV+DeAncmc3eEwLb2Fr4a0P22dmUQ6xu1r8TdgzIoJigkC1nmm28TEeKh9kfvmVgbsOMsdxsDdxerajvnSLRs1+Or+0S+yvostkuQHSKxy395aQf9XX10wCmRM+d+pDHwQN3l9wr1e6r8tXKrTfzzu/YVD9Ng45DHZCZHBmrUIFUA6Dmomc9rTz1NoAEqJktuDpZauzflvlsFM0ejEgKB9iDFFZyvCZAROVw1kFbRyKL5Q== 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=O9tMxmG5CV8CDnk6qhKVe397KJrFl96yY+YUW4LTQZA=; b=tqlGI6Eqnkp0XXr1ywyun6+ztF2iivSrAVEezx0X9tlopIqXm3M0wVHsRwG/eqbFzgIRkxcfZPLOC8VbXAkhJn7u2RMPcV1wnIq9gYaus6g2K6RBxWE/2XDOtDSF1F7vhsTcTnPJNeAKn0dJm3OkZFWxF/Qp5Bssg889HY78RTc= Authentication-Results: linux.intel.com; dkim=none (message not signed) header.d=none;linux.intel.com; dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) by SN6PR12MB2717.namprd12.prod.outlook.com (2603:10b6:805:68::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19; Tue, 7 Sep 2021 13:35:15 +0000 Received: from SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::78b7:7336:d363:9be3]) by SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::78b7:7336:d363:9be3%6]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 13:35:15 +0000 Cc: brijesh.singh@amd.com, x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Michael Roth , Vlastimil Babka , "Kirill A . Shutemov" , Andi Kleen , tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: Re: [PATCH Part1 v5 36/38] virt: Add SEV-SNP guest driver To: Borislav Petkov References: <20210820151933.22401-1-brijesh.singh@amd.com> <20210820151933.22401-37-brijesh.singh@amd.com> From: Brijesh Singh Message-ID: Date: Tue, 7 Sep 2021 08:35:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SN6PR01CA0008.prod.exchangelabs.com (2603:10b6:805:b6::21) To SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) MIME-Version: 1.0 Received: from [10.236.31.95] (165.204.77.1) by SN6PR01CA0008.prod.exchangelabs.com (2603:10b6:805:b6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.25 via Frontend Transport; Tue, 7 Sep 2021 13:35:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ac7b708-e2f3-4181-935b-08d97204535c X-MS-TrafficTypeDiagnostic: SN6PR12MB2717: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oYA/5IJLFExkPSqT1IfnInye0TAVC25gY8PPNtYuWNL1mM/akeUnErq5KXN39DrCGPYm4EpozGoHWoHmNcmrOFTWJK4S2GYPUcuPyHdqA2ynfwWfHmVBmD3sIWhhBuoEhQ2FROdE5bP4ajIHCYhZZr4BjopcBxEf+QgX+fKJ/E+RKkyFTbMmJPFCE/BSbpexKDYfxwLn99zqfjcpzvELQCW4xEeIW7qCo10Sp4mZq9nz9dq8xu3ql8UsbB++dfCc5VzQwQLXemisIvvwXlAzrl9XcBUGdK/tx+thBTwlfbUmNB+IQg1x0mr2lGqWqhAsc7DIJVRp/Q+/QCpQ87Aip92RyjDE8s/AlWlvarBS+w+nkkzfrT5y5Q7JTil5zk9KS3k/G8kcsvT9CgW3cRp/AUxUQZKplwEwj/y5m8YGU4vgz4HXtsohL5PRzTe0gN4dlyk0vvWwuzmiYUShd5HH3GvjjCutCtprnNAndo6maVuqA0gI3a/EdCLX35wksiIXWOjkczXm8kN9cdRNlg32tYFiOtWkcWsNhY4jfEP7SK4Ykwqf1kD4AeEhj2/hNT6ut/SGHmv82uKwNdjNU0Cpa9xrGP4Nkcn41Dgl1NgerXdczt0I8jCKFJy83bkCNCHjNtXN+G46ByTWIQGNqaYYCYY8+vx7GEfcSrAsHgc/L4oq0lX/HGXFu+fb5aXiqceKz5AUKT0MTlVv+H5sjM7SAEzlDEi7ERBGtB9iHP26ReRZgJZuAftynGrwKz8JJEV18ZLezo9m9N5Tm9KcE7eY/fKeYZ6zkotG1puTx6t5ZjRLdiuhU/csb+hy3jU+JH1s X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2718.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(396003)(136003)(366004)(376002)(39860400002)(956004)(2616005)(966005)(36756003)(44832011)(83380400001)(54906003)(16576012)(6916009)(186003)(38350700002)(31686004)(316002)(7406005)(8936002)(86362001)(7416002)(38100700002)(26005)(6486002)(2906002)(66946007)(66556008)(8676002)(66476007)(31696002)(478600001)(53546011)(52116002)(5660300002)(45080400002)(4326008)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YW94RCtBUkxXMlNLK05pNHR4NVN5L0o0RE1QS2U0VDhyWGY2VWdycTkrK0Iy?= =?utf-8?B?MEFhUTdCU3VFVHZESUd5cStocWRzZDdBZnZsSWkyQnNGUm5KanFsRU5sUzFG?= =?utf-8?B?QlRjSktxM0k2WlRZRWtxd3ZqWGhqVHpraGxKaGZSbDQ4WW1XRnMxelR0OTJz?= =?utf-8?B?WmhUSmtT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NjMnNNUzMw?= =?utf-8?B?Y2NuUVhoZTVKS3lCcmh0NGhJKzNLTlRaYkxXa3Q3Z0pVYXYwcFVSb1NOL2x0?= =?utf-8?B?ZTEvdVluek1tTnRWaGtTVyt0Nzd4VUh3WHhIUStPazgxWDVub3FOeGZ0TEhh?= =?utf-8?B?clI2QnJsMHZNM245bEhyRThZQW15bk93Z0lvSkdZQURsS0FOYSsrY0N3M1Rz?= =?utf-8?B?WCtBcDRjbENZV1pEU1JYMldCNTRTRFc0SE5uenQ3WHlteG5uZXIvQS92bmdK?= =?utf-8?B?Q3FaekhNYkRQazcrQUQ4aWJDMHZQVHdCTnY1YVAvOEJUL1lmVmtCRzZENHR4?= =?utf-8?B?RmxUY1l1eUtKNVg3VzQ3aGV2K3daTzRTNis1T3dDTkx1ek9GektjSUZiLzlj?= =?utf-8?B?NEN3ZTc1L01QbXBkSUZXVU1KUm5RVkExeWZNaXFtOS9TRVpRckZnU0p6aC9C?= =?utf-8?B?ZjJCZHB2NXRvS3Z3RGNvUkdkYWhmVW80ZW5JV1pPSTF1K1I2Z0J1aFZJUDg5?= =?utf-8?B?UUpsMGV5ZW5tY2VUSUpZRkpSOG01UDVpd2tCT3o3aFJzUjNUakhWSitzVXJo?= =?utf-8?B?Y0NrSy9yMWEvRkF2TFMyRjBlei9mMGlhYnp0SFRsektsZmFQNGNYNnY1SUJp?= =?utf-8?B?a1RHNSt3aEMxQlMvOTc3TDE5M3loeHgxN05YajdjYTZzVTlTeTM5Z0lUV3J0?= =?utf-8?Q?SjdnlJYAN9gq85MKkSJahr9IWIP6pki1BNMigBo?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ac7b708-e2f3-4181-935b-08d97204535c X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2718.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 13:35:15.6735 (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: 8uy4tuWi10V/6MV7kboEPJHs10sr6E+HPuvHd9YKBlkpFs/3WdxNNlogepfnNc8U7UNnJSqpabY4X5BmIGq6oA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB2717 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, I will update doc and commit per your feedback. On 9/6/21 12:38 PM, Borislav Petkov wrote: > > So you said earlier: > >> I followed the naming convension you recommended during the initial SEV driver >> developement. IIRC, the main reason for us having to add "user" in it because >> we wanted to distinguious that this structure is not exactly same as the what >> is defined in the SEV-SNP firmware spec. > > but looking at the current variant in the code, the structure in the SNP spec is > > Table 91. Layout of the CMDBUF_SNP_GUEST_REQUEST Structure > > which corresponds to struct snp_guest_request_data so you can call this one: > > struct snp_guest_request_ioctl > > and then it is perfectly clear what is what. Noted. > > > "... which can be found at https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.amd.com%2Fsev%2F&data=04%7C01%7Cbrijesh.singh%40amd.com%7C9bc8f642dbad48a2a78008d9715d1edd%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637665467074351191%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Iiz3emjR%2Blx8H73g2N0bOfPHeXXv%2FhLtlljOWNoD2mQ%3D&reserved=0." > > assuming that URL will keep its validity in the foreseeable future. Unfortunately, the doc folks are replacing the current spec with the new, and previous URLs are no longer valid. I will spell out the spec version number so that anyone downloading the spec from bugzilla will able to locate it. thanks Brijesh