Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp141633pxb; Mon, 31 Jan 2022 17:37:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+N1MLXCQsebu3XJu7JrB2tVbrfUuAd2ty0ilLZZx+0RSaqTs511u/9NAC3Ud7VC6qhESL X-Received: by 2002:a17:90a:1950:: with SMTP id 16mr37816336pjh.28.1643679474229; Mon, 31 Jan 2022 17:37:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643679474; cv=none; d=google.com; s=arc-20160816; b=EVdRU0gdSLVpw04EK134N3Hi3toqXJK+LL+vh2pFeMXVZySvQP8tQiWrNdc1kse1MM JihnbanPnueZIuVJM5RFyIHCLgZds51D/40+548La8w6CZFPk9a+X97pqwLBBmDv0pKH 1PFEiL33WoWqFASunzdni9gJzElfV4EIBfF3d6n4FYOrN+sJK8Owh+UY5oyfBU3CGCdd g5/wmVFjXtZlsYkLFMN5x7mFYeVTIIxGhDtjPjNVQ9N05TCL3sG/J9OxXK8ZWo1+UDKl NDDhc5O2YzcGLP077OOENxjohNmYfsVA/hhFlETGFew6tdrHzGMlt08WvY9h0rIgEMRU mKPg== 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=AeMz8utJPjiFofsQ6mF6x/vbEjaSoinR7o1iyyLw8Cw=; b=yfUKSqJ7FIPX1H3iBFxP1xasdWovxeLhhQTHUmJ4FIGX6L7pTrUYQyPKDMu5BOofO2 nCLcCJUI8xMfp68LF4qrw87QEm9vUAiClS2Hm7tLxnu4hEF1h4AIs/buceoW+wlYkL0T a3o+ZBXo7hVljZEd2h/cNofmRzEPFl4uLfaQp43ddDf5BcTvFV4rSB5vGAKgF2o8VR2D l4s1g+HIE+wq0Pz7um6Kdg+nd1qKOPQKlIe9Ji72t97xLqMNxgMKza7h7ejsm8hm7Hsc Asbij3d4SH0hTtoVriBkCMX+9oap7wH20qiroil5xfXbcN0nWyogtugCZfWqrysy+Gbh ZH1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=SN18OmDj; 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 f184si14198894pgc.639.2022.01.31.17.37.42; Mon, 31 Jan 2022 17:37:54 -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=SN18OmDj; 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 S237016AbiA2K12 (ORCPT + 99 others); Sat, 29 Jan 2022 05:27:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229987AbiA2K1Z (ORCPT ); Sat, 29 Jan 2022 05:27:25 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F1AAC061714; Sat, 29 Jan 2022 02:27:25 -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 270DF1EC0501; Sat, 29 Jan 2022 11:27:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1643452037; 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=AeMz8utJPjiFofsQ6mF6x/vbEjaSoinR7o1iyyLw8Cw=; b=SN18OmDj+GbYBib29R2reyRvEyZD0+slBoHelzKf/froKnaX6ZCcfGVkGBJrjqgLwz7PKK BTkU9h2E5QWrnzUda8K2NSIGtBO1fxJ/zPknHWvAlj68G7ElCHoMv858/Hd86Toroe9NJD gLJAJH1HoQSqgywzuN4l/5QQnvvk8VY= Date: Sat, 29 Jan 2022 11:27:13 +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 36/40] x86/sev: Provide support for SNP guest request NAEs Message-ID: References: <20211210154332.11526-1-brijesh.singh@amd.com> <20211210154332.11526-37-brijesh.singh@amd.com> <87d4999a-14cc-5070-4f03-001dd5f1d2b1@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87d4999a-14cc-5070-4f03-001dd5f1d2b1@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 27, 2022 at 11:02:13AM -0600, Brijesh Singh wrote: > I am okay with using SZ_4G but per the spec they don't spell that its 4G > size. It says bit 32 will should be set on error. What does the speck call it exactly? Is it "length"? Because that's what confused me: SNP_GUEST_REQ_INVALID_LEN - that's a length and length you don't usually specify with a bit position... > Typically the sev_es_ghcb_hv_handler() is called from #VC handler, which > provides the context structure. But in this and PSC case, the caller is not > a #VC handler, so we don't have a context structure. But as you pointed, we > could allocate context structure on the stack and pass it down so that > verify_exception_info() does not cause a panic with NULL deference (when HV > violates the spec and inject exception while handling this NAE). Yap, exactly. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette