Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4869452pxb; Tue, 25 Jan 2022 22:33:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHV7WUGg9rhcI/u4bUtnGADSI3GOgDXwkHV0d9ZarLPZNRkweeY4dsD4c4ZPNWG481UfmB X-Received: by 2002:a05:6a00:1687:b0:4c7:5fbb:bb13 with SMTP id k7-20020a056a00168700b004c75fbbbb13mr19527080pfc.36.1643178820846; Tue, 25 Jan 2022 22:33:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643178820; cv=none; d=google.com; s=arc-20160816; b=Wu7tSghWMlVEU+jNrWYbqfouSh4v/1C0pdDB64WAE2JoGNY4YeXV6Z0q+vTiOuXLsv W+PJR8LauxYX/OH4+j+tj8dF53DmNgLdWkpRMNFl/t80S7k4HUrf8zuHmQwvFuyCtcef no7KHM6qBpbeB7N4jubhJ5jUqbj+kdQ51c8iDKoKB1gHbyJABtHU2M5E7VNsmtQcVavl Z93Ebdl/PESniRhi4Kt0dtD0grzRUQz05gJbjJkQcxofJZe8vTIRaFvchToJQvvh5/VH TSoQAIU1U9sLymfOlqv0UlQSi3Hn2/M4mJjxf9s8roqSEq1PLXhByvtfhjLgxZWXdAyS Zsvg== 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=wvIvlS2dO1ThS+LV2yQ6h0qiGd4NN+hsLFVW5buEbs0=; b=xVe+fxBBqV4q0TKIK7PXVMd5IJRS8VmliUk/4Cxcsg59RAlOP36dIv0+nKei3rc2m9 pvLU7kDVVda9txuloR0yhGV0sVeQzgVLanfQkVrQzHpdSI7dgMuS6CJaQDlaYb3DZF4J pNa4xyGdSZ7SciY9cOF+lVFfx4g+qOkbLTtNS5sWGPmWTowTyrO1xV0vX0aYEuM44ZBT TnH0wOCzYNdhxrzmaF8DGtAXK4t6frGegPgYRVuFlazOrUm05C07xYLAC9/PlIuJBm/2 vXJKyuDKTu8MkGyJS7anAFuwKV5ElWJ0zwhVLyn8RYC/b6UaMU940YchYJtDMz376boq cghA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ejvEMtrV; 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=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 u21si943494pfk.181.2022.01.25.22.33.14; Tue, 25 Jan 2022 22:33:40 -0800 (PST) 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=@alien8.de header.s=dkim header.b=ejvEMtrV; 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=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233411AbiAYSos (ORCPT + 99 others); Tue, 25 Jan 2022 13:44:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233409AbiAYSoD (ORCPT ); Tue, 25 Jan 2022 13:44:03 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 258E5C061770; Tue, 25 Jan 2022 10:43:34 -0800 (PST) Received: from zn.tnic (dslb-088-067-221-104.088.067.pools.vodafone-ip.de [88.67.221.104]) (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 760941EC052A; Tue, 25 Jan 2022 19:43:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1643136208; 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=wvIvlS2dO1ThS+LV2yQ6h0qiGd4NN+hsLFVW5buEbs0=; b=ejvEMtrV/x1ErR80f7OgCzdqcxU5KzdO9+Ac3btdyfg/CxP+qm/1swhS/pWjt0C92J8iC5 uHKxx/bZxLwSU3b8spXf5TW0DlCut6rOPx7VoczJgu0PwancC+Xu1O4NzkoZ9SPpd/thwA 1SN8jQOFx0HVOzq0CPayGnJz5UBxBoc= Date: Tue, 25 Jan 2022 19:43:23 +0100 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, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , 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 , "Dr . David Alan Gilbert" , tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: Re: [PATCH v8 34/40] x86/sev: add SEV-SNP feature detection/setup Message-ID: References: <20211210154332.11526-1-brijesh.singh@amd.com> <20211210154332.11526-35-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211210154332.11526-35-brijesh.singh@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 10, 2021 at 09:43:26AM -0600, Brijesh Singh wrote: > +static struct cc_blob_sev_info *snp_find_cc_blob(struct boot_params *bp) > +{ > + struct cc_blob_sev_info *cc_info; > + > + /* Boot kernel would have passed the CC blob via boot_params. */ > + if (bp->cc_blob_address) { > + cc_info = (struct cc_blob_sev_info *) > + (unsigned long)bp->cc_blob_address; No need to break that line. > + goto found_cc_info; > + } > + > + /* > + * If kernel was booted directly, without the use of the > + * boot/decompression kernel, the CC blob may have been passed via > + * setup_data instead. > + */ > + cc_info = snp_find_cc_blob_setup_data(bp); > + if (!cc_info) > + return NULL; > + > +found_cc_info: > + if (cc_info->magic != CC_BLOB_SEV_HDR_MAGIC) > + sev_es_terminate(1, GHCB_SNP_UNSUPPORTED); snp_abort() if you're gonna call it that. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette