Received: by 2002:ac2:48a3:0:0:0:0:0 with SMTP id u3csp563470lfg; Fri, 11 Mar 2022 13:24:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGqtYFBMcXeM2+As2n5RFE+4Kf7tmGPGfonOIRRLw9ZcNakt+Ds+xGqtVel6gm+6Buy3Ka X-Received: by 2002:a17:90a:fe14:b0:1bf:a3a0:d212 with SMTP id ck20-20020a17090afe1400b001bfa3a0d212mr12835914pjb.207.1647033840852; Fri, 11 Mar 2022 13:24:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647033840; cv=none; d=google.com; s=arc-20160816; b=iqstq04YuxrJoubM1vMtSC9iWxV9PA5A7sh639NhMHZlDqw39Ku1DNjJJ5g6zUcNNG KniWQvx5IMkYmUByDQYuDsI2P+6KsiFY0d7VM4GQ7fhuD1lycpcedYlWSv3bG09hiUkf vd7H/wc8hjd/7VX9PaqJhDQ3P+6p+uWWA0dKcgub4JykuokRxOjq/Tft+mGKl/6foqgy pwgEi+LImZnEMBqbW85+WW+aFuRFC40qMHFPa+5+vvGQFs8u+UKg+LZyKMOqvk0CPCbc uSjzCURtokRcNfpeGnqKgKxjZA7vSDIuWB+J4oo2kArN3jgn0Xryx3uPWvjRFRok2jXP gpSQ== 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:dkim-signature; bh=JSXcqRdGy8e39Bfyh4bjxSE8ya8/hJV+iGXqtr1mwZU=; b=zbiX/zitgr5a6NWrBMGYXtcIInl1HGPzn3hzBKcvURefjR3I0JYqJCcESWeuE9f8Z6 1Y24kLCpANQErbJy0KvOYq102Mq3sAO1ZOoFA9dAWulwRTKnWXfkXJr+AFe/16dg6CiV a/b16JgYYWeDG6//L5lmAp164A8FfEl8QAs85TtM4BZ+dRpKc2OcSZV2UXtvSl1QxT5A NEydNf1fP/UfPEoeD8W4J78rCLlZAe8Wq711evQ4bbyFFEK3zojI0WsgQtt7bLBjYSMs 4lT0QFx+qqkK/bw4UHxXOXQjGyVgZDfUFWxb+emPin5BaSItp2mczgS4wV8+XN16yB0d RRpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=zQyt4+5n; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m10-20020a63f60a000000b00378f2552951si8769363pgh.606.2022.03.11.13.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:24:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=zQyt4+5n; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 038EF21F9EA; Fri, 11 Mar 2022 12:59:18 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350658AbiCKRII (ORCPT + 99 others); Fri, 11 Mar 2022 12:08:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350607AbiCKRH4 (ORCPT ); Fri, 11 Mar 2022 12:07:56 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C08611D63A2; Fri, 11 Mar 2022 09:06:52 -0800 (PST) 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 Content-Transfer-Encoding: 8bit In-Reply-To: <20220310212504.2kt6sidexljh2s6p@amd.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, outside > 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 not > > working, it seems that they lead to a different halt. > > 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. > > > 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? > > 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 they > 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, -- J?rg R?del jroedel@suse.de SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 N?rnberg Germany (HRB 36809, AG N?rnberg) Gesch?ftsf?hrer: Ivo Totev