From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59A91C433F5 for ; Fri, 11 Mar 2022 17:06:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B7E098D0002; Fri, 11 Mar 2022 12:06:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B2C858D0001; Fri, 11 Mar 2022 12:06:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A6A08D0002; Fri, 11 Mar 2022 12:06:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0124.hostedemail.com [216.40.44.124]) by kanga.kvack.org (Postfix) with ESMTP id 87EDF8D0001 for ; Fri, 11 Mar 2022 12:06:53 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 47C8999E9D for ; Fri, 11 Mar 2022 17:06:53 +0000 (UTC) X-FDA: 79232735106.16.568A6D1 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf30.hostedemail.com (Postfix) with ESMTP id 8F07B8001A for ; Fri, 11 Mar 2022 17:06:52 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 200491F441; Fri, 11 Mar 2022 17:06:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1647018411; h=from:from:reply-to: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=JSXcqRdGy8e39Bfyh4bjxSE8ya8/hJV+iGXqtr1mwZU=; b=zQyt4+5n13hOeCa9xgCswD1KUwJoBAVHqClZsOVB/PC81hDRKVuQgH1NmYqJHrPtu7uSBy PhKQMACw5TXT3jEJnxs41RXUlcaW2trrHTw/O9jZxqtPwhLGzXcXKc1h5hTKvlf/IDc0dP 5Ixbw+BN/hU3tzWgbjphSRqoV6EI8m0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1647018411; h=from:from:reply-to: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=JSXcqRdGy8e39Bfyh4bjxSE8ya8/hJV+iGXqtr1mwZU=; b=QCVBTLAApqTWfX+QacBXJ4GMfGLfvOFCxwcaEUXx1xHk0oPnraa4sv0x634bkXioi9HjnJ 26OphLW7CWS9nCDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 05DD013A8E; Fri, 11 Mar 2022 17:06:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7gxNOqmBK2IROQAAMHmgww (envelope-from ); Fri, 11 Mar 2022 17:06:49 +0000 Date: Fri, 11 Mar 2022 18:06:49 +0100 From: Joerg Roedel To: Michael Roth Cc: Peter Gonda , Brijesh Singh , the arch/x86 maintainers , LKML , kvm list , linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, Thomas Gleixner , Ingo Molnar , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Borislav Petkov , Vlastimil Babka , "Kirill A . Shutemov" , Andi Kleen , "Dr . David Alan Gilbert" , brijesh.ksingh@gmail.com, Tony Luck , Marc Orr , Sathyanarayanan Kuppuswamy Subject: Re: [PATCH v12 32/46] x86/compressed/64: Add support for SEV-SNP CPUID table in #VC handlers Message-ID: References: <20220307213356.2797205-1-brijesh.singh@amd.com> <20220307213356.2797205-33-brijesh.singh@amd.com> <20220310212504.2kt6sidexljh2s6p@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20220310212504.2kt6sidexljh2s6p@amd.com> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8F07B8001A X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=zQyt4+5n; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=QCVBTLAA; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf30.hostedemail.com: domain of jroedel@suse.de designates 195.135.220.29 as permitted sender) smtp.mailfrom=jroedel@suse.de X-Stat-Signature: r1gxsw1xf41s441otcp85yo4akcxhhkj X-HE-Tag: 1647018412-116298 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Mar 10, 2022 at 03:25:04PM -0600, Michael Roth wrote: > Joerg, do you have more background on that? Would it make sense, outsid= e > of this series, to change it to a terminate? Maybe with a specific set > of error codes for ES_{OK,UNSUPPORTED,VMM_ERROR,DECODE_FAILED}? This seems to be a left over from development of the SEV-ES guest patch-set. I wanted to see whether the VM crashed due to a triple fault or an error in the #VC handler. The halt loop can be replaced by termination request now. > > I am still working on why the early_printk()s in that function are no= t > > working, it seems that they lead to a different halt. >=20 > I don't see a different halt. They just don't seem to print anything. > (keep in mind you still need to advance the IP or else the guest is > still gonna end up spinning here, even if you're removing the halt loop > for testing purposes) The early_printks() also cause #VC exceptions, and if that handling is broken for some reason nothing will be printed. >=20 > > working, it seems that they lead to a different halt. Have you tested > > any of those error paths manually? For example if you set your CPUID > > bits to explicitly fail here do you see the expected printks? >=20 > I think at that point in the code, when the XSAVE stuff is setup, the > console hasn't been enabled yet, so messages would get buffered until t= hey > get flushed later (which won't happen since there's halt loop after). I > know in some cases devs will dump the log buffer from memory instead to= get > at the error messages for early failures. (Maybe that's also why Joerg > decided to use a halt loop there instead of terminating?) It is hard to dump the log-buffer from encrypted memory :) But I remember having seen messages from these early_printks under SEV-ES for different bugs. Not sure why they don't appear in this situation. > So maybe reworking the error handling in handle_vc_boot_ghcb() to use > sev_es_terminate() might be warranted, but probably worth checking with > Joerg first, and should be done as a separate series since it is not > SNP-related. I am fine with this change. Regards, --=20 J=F6rg R=F6del jroedel@suse.de SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 N=FCrnberg Germany =20 (HRB 36809, AG N=FCrnberg) Gesch=E4ftsf=FChrer: Ivo Totev