Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3639693pxt; Tue, 10 Aug 2021 08:05:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBGxi8n6ZkIeQ//u8tGEE/tBK9sXZlbyDgYeZ1ETaQf/4sybaS7YICDZ2s+oJLYIB978c0 X-Received: by 2002:a02:cb4d:: with SMTP id k13mr27394566jap.31.1628607947494; Tue, 10 Aug 2021 08:05:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1628607947; cv=pass; d=google.com; s=arc-20160816; b=bWKQPvWNGjsTXugBJuz7T7Mtd87MlKFivnqzo7KmyBvtC02gjuzunIqoxlAemCfwUA 7fpxrKKiSoqYOmbZyha9RLzhBobPNVSuYuTFzvrZBfYLZFIKDqK1InRgtUvqdfaIM9Ht 9r8pXeaAdhGZgWoRahBgA3uljG6Ila9uZes9pLKQ72E2rooFiubK/Ayv7/4bEIHpC/4h 8ld4vrObSZM5DyywmHVF1LpH/5/QmRFsAxxhEMtXCgYAua5Xdgl+4MsCpd1PvUYxN1aB NDg8abY3oPLjrjlAUcZ4qdABpeDZb5DwjyIh93Habu78PRJ2J5Ft2vnUTWNKA1NGU5RB A6cQ== 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=GNoKh6Bqm9yYfCZF0XEf2JmeFAf97I2JcRU7XY2CDQc=; b=wOPWsxGBtrzoS7pzsFlcvOO/2yHxGaX/2QXBawkQgvQ9uwoxeIpLCJeOP1WcNobs8r FqSFpTPmcSRScxgAp2sD3YNsvdc1+ire3ZkF1XLdc7cyzyP7Xl2g0nXN1gKpdokogqWr 3PbqipZ9n3mlD9LvHD0bxBz4cnvVWrqYjVRul1kxI3AYOXsp91P99eMtEnQwKIXVpLm8 5YAAlrJvEUAH8Tyhwu4/XyGN1wnJ8uuFtVlYuJbH7pGPf/w2Es/muK6PUy2UkBgqg/sk wBnhDiQOiS5KhPbJHyBAHixr+6uWEDsIZnVYlFEse/NoYRRJ7TPcX4yZ0CIoCUA0pwyv Gt3w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=XE7+qfF7; 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-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 w15si28717813iov.42.2021.08.10.08.05.27; Tue, 10 Aug 2021 08:05:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=XE7+qfF7; 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-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 S240581AbhHJO6Q (ORCPT + 99 others); Tue, 10 Aug 2021 10:58:16 -0400 Received: from mail-bn8nam11on2079.outbound.protection.outlook.com ([40.107.236.79]:10624 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236686AbhHJO6Q (ORCPT ); Tue, 10 Aug 2021 10:58:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IjBgB/JzCiBSTmp/n1ExTeraaG45qgdAr4prJcif3Z6ZjWXuaT3bRmL44fa3lALZuDCGn3PnXHUhnZEm7eTo9g9J/9T5O6GULgUmub9cjrTK3RzYl34JIW/FhXzSS/LWeNSJor/ZZWeK5VnSIFxtMdotYCrkW1jjERBHCdJ273n2X1KXfaJtgF967bUsB9XH6ot+WvGR1Zgm3BHn+8v9HQTe5CF4xkao5pjbRqjfKIONO2egQ+nsSBhitLhhqp3167REOuvjjRcTvMDlBEyM40SWM+yoEaABJfZXsknku/4zXyoJNC4n1Dyqrd127c0l2/TCVkOMDacmzZM/UclmBw== 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-SenderADCheck; bh=GNoKh6Bqm9yYfCZF0XEf2JmeFAf97I2JcRU7XY2CDQc=; b=M4YOYMssKK2DwK+DSNiEZHWq8pkjUvfQ/zMQKg6MptKsMrCy2kXJMeZnD5WI7BnOEkdrbw8KjBoR7eSLY9D79CJJAqwQ1o8Ncb1QipNtwMgUZTbxlpTgS5hc0Jz6LefiXhFmeequUo6yAmXW+Ozun/278Sn0XrFqMqNGUEV4W055cNgsZCJqhzdwcKycLvv8rA9YiyEz/iEjsaXkPB2vjN/rLzFSl3mlsvKweSbhfPeTSk5/faaQDtgNn+Zw/Bi4e02D7YM/5dPo8zGN9ySXXxYO/YruA6tKNxMg6LCExOWKSmdEc+N7i0HRSCkN2xRa3EQj3VPH4OF0ibJoxKDtMQ== 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=GNoKh6Bqm9yYfCZF0XEf2JmeFAf97I2JcRU7XY2CDQc=; b=XE7+qfF7NgSQ+Sb0hwEab79FXLsWqk0+7jNLwuWvUhZyBSkAP0w4oMkJQf0849zqnbxoUiIp+GnG4MCmtYvP+ydUh+QzTNbsNMdY1PABG8cuwtTC/Ad3JpkkABAch2T4NAsHLCNT/lzIZhP9ifB2T7grViqqVpuphWUGIUrmLSU= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) by SA0PR12MB4495.namprd12.prod.outlook.com (2603:10b6:806:70::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Tue, 10 Aug 2021 14:57:42 +0000 Received: from SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::a8a9:2aac:4fd1:88fa]) by SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::a8a9:2aac:4fd1:88fa%3]) with mapi id 15.20.4394.023; Tue, 10 Aug 2021 14:57:42 +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, linux-crypto@vger.kernel.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 , tony.luck@intel.com, npmccallum@redhat.com, brijesh.ksingh@gmail.com Subject: Re: [PATCH Part1 RFC v4 04/36] x86/mm: Add sev_feature_enabled() helper To: Borislav Petkov References: <20210707181506.30489-1-brijesh.singh@amd.com> <20210707181506.30489-5-brijesh.singh@amd.com> From: Brijesh Singh Message-ID: Date: Tue, 10 Aug 2021 09:57:38 -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: SN6PR2101CA0020.namprd21.prod.outlook.com (2603:10b6:805:106::30) To SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.236.31.95] (165.204.77.1) by SN6PR2101CA0020.namprd21.prod.outlook.com (2603:10b6:805:106::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.4 via Frontend Transport; Tue, 10 Aug 2021 14:57:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9fcd8c81-68c4-4b2d-dbd8-08d95c0f340d X-MS-TrafficTypeDiagnostic: SA0PR12MB4495: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1227; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cEI8xuwz/IMYa+nc7BSh/ZgCEaTWWunUpHGFMtRbQAe/5GfqvADrORJQEXXxihd3CtOO232dFXvA5yVsUC+8CJpzDUG6+0zvWmKv3Isgv0zwrSqbrATzXDk1rxTb2lGCMVf9ZGow8E1Qyj6nma+r9l/cCv4zg+4JjHyDaxSpbym1DYZZ+xrMpXqu0v4z7hPZXoTi3ubmx9qDPNk+NMYNcEYhdKZx0RiNIFhQ+bSO4nW7Kl4ots2lPZMuAt6D1yvPXyp8hlOjRU7uT2QcXrCUyqcDdiXBytvzXleN/PLH2XMPSx8dtQtbZuadsvry360qZMw1Juu1nyBv163vJG755+Os5PxsgWcDac0JKC4x8WiEmHKEpge1za6o2syG2Qvz8qqhWUP/WzvwvsoaNCRAuPgVZE3X7brYVuB9lYTJE8oqxx6/YxyzFAvWEhyB0Ql3k7TgzZ6I3fRr3c3u0nZJzTvIodGGqVgj5MoWvkitlNmZgzhZsQgRpYyRJaHWSzpc7vqo8mqGu4XJpPBEAZvhMvitR1bkKBw6eloIHsm2CLRB0wJQwl0wTLzxin+cO9PT9X7svFy+CSyi6U5UJA2L4V3DfTGi0eL+kXJIa4EWe9EfTfjFmP8GwHhqiEgi/raFcbf9Kg17qZ3BrQchhIiWfxgW/v05e6/lwTfkfX/JcseqSCurst4+APtZAPXwKUwsXoKgJmS651lI1f3hGdWWVSpnhdkiq61p91T2gIwE3/ZaohU6nAd5u6boyoWtl0t3Qv+vXDISnNDwrD3oJdLmg9N/m0EF0mTtkhZCLh082VxeX0eSpG7ZcJhj6Z7JUV8CT+nFzhdCDhR1xC1a06eQgEqEK14/3TOYYAplAXaCrNA= 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)(39860400002)(366004)(376002)(396003)(136003)(346002)(966005)(6486002)(6916009)(66476007)(16576012)(8676002)(7416002)(5660300002)(66946007)(7406005)(66556008)(478600001)(316002)(54906003)(45080400002)(31686004)(52116002)(26005)(186003)(2616005)(8936002)(2906002)(4744005)(38350700002)(38100700002)(53546011)(4326008)(956004)(44832011)(36756003)(86362001)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aEp4NERVUlBHTlZ4TkxlR1BGNVdXRlFmb2laYk1NWCtTYjJxNFRLeXdKeWRH?= =?utf-8?B?UStSdFhjazM1OFBKYkZITkRobFNXN1NrZU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UVEUDViRGowMlg4UzZ2THNyU09LY2RiTHM0NktSVUE3bVcyZkZn?= =?utf-8?B?ZUd5dzQ2ajIvZzh6MGRIYm9yblhJZXVCQTF6aUlYTSt4R1o1dis4U2dFTzBk?= =?utf-8?B?RHNkRjlkdlBZc3BMM2g1WjVjNGJiam9lbnMwQjdYTklodmhoazdjcXBxekkr?= =?utf-8?B?SVl6OWt4NWF3RUJ6ZkQzTzZPdE5QT25sMTRvdzZ5eDZpaGp2c2tWN29wYm0w?= =?utf-8?B?aVJqRGlJdHR5K3BkMmszdUJuN0NnTVA2b3ZmcXFaOHIyOEFSK085NzV5N2d2?= =?utf-8?B?VXZoSW1xZXpTVi85SkN3T2ViblNKc0ExcmxaeHpvUDR2TFVOcHdHeVlKd3lZ?= =?utf-8?B?WU9NUUtnQjJtM0JnTWNML0tUNldpNENLSGFOUU1kMzlUNkxVWThZV2J2YXVN?= =?utf-8?B?NW5uV3ZKU0pDdGNaWnVWejNiQ1N0NWpVQjVrZzNhUDF1Z2h3alJjYjFuYmsx?= =?utf-8?B?R2duTnMxaStrajRWK2RidGwrTHJ2M2hQZHhqeklaZWY0OHIzTHJNaklFNEl0?= =?utf-8?B?UkFuS2ZyRHphc3dqNitJUkhBakQ3SUlxU3hCTkJxdXAwMGIyMmJXQlorNVE4?= =?utf-8?B?NzQxeERPN25adHYzdHA3RDd0b3BBQjBwQlRRZVlGSjUrR2VZUU0zZllHcFFq?= =?utf-8?B?MFlQNXNQNjFzZUpHenl4NlN1ZENIYUNMU1RDV0FESmt2NlhGU2JPUW44dXNl?= =?utf-8?B?Q2I2cy9KdjFHNjJEWStGVGUwc25hM1dWYVBzd1p2MmwxT3M2Vk1lYU5pNXB3?= =?utf-8?Q?VRPcV3H6fvRbsqx+6g2UiaLV7plRV/O8yeiD1el?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9fcd8c81-68c4-4b2d-dbd8-08d95c0f340d X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2718.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2021 14:57:41.9782 (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: GfQHxxv49vcvm/8NQ9fvIu87aADoq07m3m/mBTPZXNl9yE//rfBWS3T6RSzPwO/hRN5csDoUHVfK1pEXeYW48Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4495 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 8/10/21 6:25 AM, Borislav Petkov wrote: > On Wed, Jul 07, 2021 at 01:14:34PM -0500, Brijesh Singh wrote: >> The sev_feature_enabled() helper can be used by the guest to query whether >> the SNP - Secure Nested Paging feature is active. >> >> Signed-off-by: Brijesh Singh >> --- >> arch/x86/include/asm/mem_encrypt.h | 8 ++++++++ >> arch/x86/include/asm/msr-index.h | 2 ++ >> arch/x86/mm/mem_encrypt.c | 14 ++++++++++++++ >> 3 files changed, 24 insertions(+) > > This will get replaced by this I presume: > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flkml.kernel.org%2Fr%2Fcover.1627424773.git.thomas.lendacky%40amd.com&data=04%7C01%7Cbrijesh.singh%40amd.com%7C15d8b87644e148488da408d95bf16ae3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637641914718165877%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=UMRigkWSG2h%2BZ4L08AUlG0JeUiqMb9te52LprPrq51M%3D&reserved=0 > Yes. thanks