Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1119303pxj; Thu, 17 Jun 2021 23:20:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHtU+wnmI7eTxdfPbL4YmqiwNyAsFqUsZGZDQe4WbCTe7d35PaaEE52ysEQCArhrBdQ3oX X-Received: by 2002:a17:906:6c88:: with SMTP id s8mr9311624ejr.129.1623997200766; Thu, 17 Jun 2021 23:20:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623997200; cv=none; d=google.com; s=arc-20160816; b=kBoQiR+UZb+0K3qKBz4rpJ0FXi+qv4K5SF91EHJbPL2lBB+GPZvmdeXHc4XmVlAOCk MS3vmXK7MtuJM7iPpjPgPN61WHblEpckebfDbWn4c21bupwVkLYeEIqKerwFjNA8t/vH KwXtnpnCSsWvuW7xThYfSdvkUuaboAh388+0AOs7+CgCSraXgT3nnV8DSZ0ETc7QdLUM tX5dWKVXGLDIKKictiAlDIUGGt1ZmQ6Od3GX6NQSpUe5ceP8/Q2NBa/rw0WlA0KJ4xrV 7858JWhfEfusK9ryLhkjou5wQFEzFgWSbsiPTvay17LLD7e4R2xFV2ozsKxZwF0KiqEv gtzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Z2NcsQEXbnE2U0G6jQczPtJMf0zCLQ336536FRXg81M=; b=eXlNMfsDSiIG3SEUweCc369KXC1PyXAFHNqXFciJ8PluA7KExAsAIpVxIKoYzr5nnz wbcrxskTUUe3lcuIrscF23n0wyo/ggYZhvCmtFuDWXmizfeBzLmUNHfB8VHO1mZ/ktmD SlsQrlF2BswFNwzP2xndHko+dq4y/KMYGc00uEd1Qp+JX7l2mDWDMSSsGhrbJRxXsg4D gORntbfLJ9f+Zx2oODlrdQkiP04wSM8D7k7iKr1p2BfKNuYJdWsQnwMH9djEk/eVlT6i gFOEVqV8u3Dg77X0tKeozEs+WSliBkugI3O7zUnrN8cIn7I4sxmDJgyhbCCvc6THUUiY r5iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=gf8n4odD; 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=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hg13si1477617ejc.98.2021.06.17.23.19.29; Thu, 17 Jun 2021 23:20:00 -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=@alien8.de header.s=dkim header.b=gf8n4odD; 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=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232274AbhFRFs7 (ORCPT + 99 others); Fri, 18 Jun 2021 01:48:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbhFRFs7 (ORCPT ); Fri, 18 Jun 2021 01:48:59 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEF98C061574; Thu, 17 Jun 2021 22:46:50 -0700 (PDT) Received: from zn.tnic (p200300ec2f0dd800c1c0f109d0ca36f4.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:d800:c1c0:f109:d0ca:36f4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 739671EC054F; Fri, 18 Jun 2021 07:46:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1623995209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=Z2NcsQEXbnE2U0G6jQczPtJMf0zCLQ336536FRXg81M=; b=gf8n4odDGWXwGJEBtSR/Ph2wRe/dCxc/qC6TznTV/wZrAPIanM6DBG6ZnaRQcHTW2w7jNL 7X76OBMJf6LrsqYa+IVNSsAA0wJdWACrEla2WhdlZQLbax/a9Joo5Vv5xqQ+MarhLrZCi2 E5aBSMueO9iMceLUivF9j6PX26bQGqo= Date: Fri, 18 Jun 2021 07:46:38 +0200 From: Borislav Petkov To: Brijesh Singh Cc: 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 , tony.luck@intel.com, npmccallum@redhat.com Subject: Re: [PATCH Part1 RFC v3 06/22] x86/sev: check SEV-SNP features support Message-ID: References: <20210602140416.23573-1-brijesh.singh@amd.com> <20210602140416.23573-7-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Jun 17, 2021 at 01:46:08PM -0500, Brijesh Singh wrote: > Based on your feedback on AP creation patch to not use the accessors, I am inclined to > remove this helper and have the caller directly check the feature bit, is that okay ? > > something like: > > if (sev_snp_enabled() && !(hv_features & GHCB_HV_FT_SNP)) > sev_es_terminate(GHCB_SNP_UNSUPPORTED); > > Let me know if you think I should still keep the accessors. Yeah, looks about right. Let's keep hv_features in a sev-specific header so that there are no name clashes. Or maybe we should call it sev_hv_features since it is going to be read-only anyway. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette