Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3003288pxj; Mon, 14 Jun 2021 12:03:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgEZNNCb7CATFq+1HbEtfGEmUy5oBy3MRk5IpUZEQzYyVRDNiwjEW2CdGU4hQTs4Yv1QqV X-Received: by 2002:a17:907:2bf9:: with SMTP id gv57mr16571110ejc.189.1623697433039; Mon, 14 Jun 2021 12:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623697433; cv=none; d=google.com; s=arc-20160816; b=ytlaiJR6lfcmStvlJVqnv3cqb1x8w5DzP7cKwiVFpyCY8k/saacyWR6vx3YFssRMIQ TB0TBXNgYhJ2sN92WleTYo6+AZGjvCW9IVns1bLCmwFjYrJATIW83t0LY9tBl3wz1TPm CyMarxf+VqPuSiDZf+CviiHnjLcVahT7cpL6DcOuj84+uwWeuEz4AtFWWCcJCKxU5Krb DmaeR3h2jZlQ1fA+zf/iQxiRK1mB9x/rDpIERvCe+bljRPWRUn1OBO3vFwJfZbPm9PwI AfMw5fwtwHHvkwNPz/N3edH0EL7KBd63wixb6cCVb+qqULmYiz8JJ4IjWMLxrVURNI/e NzgA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/3kMPVen/9z57u2UbxMExDvEmMgUhoVDDFZvPh6gxAo=; b=HU7/dBZ6BJDV7UfxnulGPYftfZ0+vltTcQEladgiaPhjxrJnLLHhGQXTUX8Hu6IOq5 UEeGgrDAsCf/anJVqudX17lk0DeR2qaPUi+xw1GLWxBtg9RXe8du7k6INSojdXcvGWZu c2QHJknevWLbTQ/oGWuy4eCxx8ihU/MP4LfrtNbY4UjAPTflonVwOXfN1hZRLLUrgx0G 0+SBprRBXWKwSQEHcLT2ZcQ1JvWn7/fHJU1cx2egUUeBkFShCpkXueNDx6Shu42OdZDS 0jf/AQA6Izfv/GiclSZtZOQVjsLT26vdn005V2FNvin3lkMY74vPlfFaxinE+MWfFO8T 0V6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=XuoyLLRb; 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 jz26si11778925ejc.61.2021.06.14.12.03.21; Mon, 14 Jun 2021 12:03:53 -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=XuoyLLRb; 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 S233479AbhFNTFP (ORCPT + 99 others); Mon, 14 Jun 2021 15:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233387AbhFNTFP (ORCPT ); Mon, 14 Jun 2021 15:05:15 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62AE8C061574; Mon, 14 Jun 2021 12:03:12 -0700 (PDT) Received: from zn.tnic (p200300ec2f09b9000b7fffe760596043.dip0.t-ipconnect.de [IPv6:2003:ec:2f09:b900:b7f:ffe7:6059:6043]) (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 A45541EC036C; Mon, 14 Jun 2021 21:03:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1623697390; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/3kMPVen/9z57u2UbxMExDvEmMgUhoVDDFZvPh6gxAo=; b=XuoyLLRbZevtMCxqnibgVla732fFMZoVlK33TxMxxQUlxz3GPgAFbXE3jlB7UUUjg6h99/ IW7ku0XcDx5s+rQByrGWw/+wnwKTUcUOpIc/hNQClxs8DtchLYYBiXCS9e+kBMK2z47Q4/ 1uleZYgfef/L0DIl2EU1wsc7OXHxoMw= Date: Mon, 14 Jun 2021 21:03:03 +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 11/22] x86/sev: Add helper for validating pages in early enc attribute changes Message-ID: References: <20210602140416.23573-1-brijesh.singh@amd.com> <20210602140416.23573-12-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, Jun 14, 2021 at 07:45:11AM -0500, Brijesh Singh wrote: > IMO, there is no need to add a warning. This case should happen if its > either a hypervisor bug or hypervisor does not follow the GHCB > specification. I followed the SEV-ES vmgexit handling  and it does not > warn if the hypervisor returns a wrong response code. We simply > terminate the guest. This brings my regular user-friendliness question: will the guest user know what happened or will the guest simply disappear/freeze without any hint as to what has happened so that a post-mortem analysis would turn out hard to decipher? > I did thought about reusing the VMGEXIT defined macro > SNP_PAGE_STATE_{PRIVATE, SHARED} but I was not sure if you will be okay > with that. Yeah, I think that makes stuff simpler. Unless there's something speaking against it which we both are not thinking of right now. > Additionally now both the function name and macro name will > include the "SNP". The call will look like this: > > snp_prep_memory(paddr, SNP_PAGE_STATE_PRIVATE) Yap, looks ok to me. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette