Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5483267rwb; Mon, 14 Nov 2022 05:27:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf5oYeITDJ32KzjOqsNe3a9Rcd1/HlFeYsQD0ioJLaZmi+sFVanLcC9+lut8Sft4n/I21cfU X-Received: by 2002:a17:90a:e392:b0:213:b349:143e with SMTP id b18-20020a17090ae39200b00213b349143emr13861448pjz.114.1668432450713; Mon, 14 Nov 2022 05:27:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668432450; cv=none; d=google.com; s=arc-20160816; b=bGZyx6YuBKRl9xEPBe+kSqtcsiQeU8a7oYyjYmC11ls8W7kKYxEVJlMMfwWR8Lfs/L 6ZjyX7rRPtaT9YEDxtZ+7bPXNnUgoK8EKkR+ZjJwYGvHFsniUevmMBQY6FkAMmiI1Tam wLwbhZCVseizqEx/EDsY8cSthgJuscNeFA/q4v7511bklA7fd3rVgqoYQlVeKzetF44+ 8PMDfSWQXmqkMmPjvha4/aQOQSZiTWQvulSEQuL3uQvXrtdaowKIqdsn+mTTeGRqOdze /kNKCQ2iQAu5IT/AvEZ8luf9gtyazOLDUSfHnhraY3+H6jdTZyhoVwEfagxYCPzcd/Xw Mdcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=e1MdFu9iKyp69AVuxxovzHguSO6GV8OI/gZKxt1C7kU=; b=Ig0HPgecNSM7j6olyeoHZmYr0mq+1PoOWEE0bpicYZCyF/GcwZG6Gw65KZxQoduE3k nLnkLpyIBoDgYI2wpzWJyMwIiQlcpVxxxN560Nmv961LqilY5Mxi2Bg6Us71VvnNERWw 1R/fl2fJ3DYFOj4N+PLGuasVELAznAurGRVCm9dCbpOkjmDwR/e1gmYSX1e4f6ggvBpw Ai/vtO68i6WwWgmncrPveuenVmGkbHehGzYZgBFTw/NcOtvvSe/ZIdwNMv3uGBiMCWN5 rcRUzkJMH+gxKPFndjoYizv4wU1HzO0FZU7w7SRKSBvHZC+q65uKYmdI6BSBeUZNMYQp 2Lbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cwpVmJb5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z20-20020a631914000000b004473c654f95si10037520pgl.653.2022.11.14.05.27.10; Mon, 14 Nov 2022 05:27:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cwpVmJb5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237529AbiKNNJC (ORCPT + 87 others); Mon, 14 Nov 2022 08:09:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237877AbiKNNJA (ORCPT ); Mon, 14 Nov 2022 08:09:00 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F67923BDD; Mon, 14 Nov 2022 05:08:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 58BB0B80EB9; Mon, 14 Nov 2022 13:08:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FFB0C433C1; Mon, 14 Nov 2022 13:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1668431335; bh=FnfRTOhpDMPdMpibKZbXNzOt6gJVf8lagElMLa9mf90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cwpVmJb5bO3thJ3lMoRPWjpLiZSCj3CsCq7DPa9qjI0O1+1X5OZGUdTOiz5WwWAEe DP9QWTUg9VjrMxDrK0ouSEz9d1n58ahCP7vH9KqkrgCZ4Cmty34W8Gltkx5LMbBMUl 9YRdQEdSfhTTv+Iw8sLhQKpuBeFnqwc7s2Lnv8oY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Peter Gonda , Sean Christopherson , Jarkko Sakkinen , Harald Hoyer , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6.0 170/190] KVM: SVM: Only dump VMSA to klog at KERN_DEBUG level Date: Mon, 14 Nov 2022 13:46:34 +0100 Message-Id: <20221114124506.283051703@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114124458.806324402@linuxfoundation.org> References: <20221114124458.806324402@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 From: Peter Gonda commit 0bd8bd2f7a789fe1dcb21ad148199d2f62d79873 upstream. Explicitly print the VMSA dump at KERN_DEBUG log level, KERN_CONT uses KERNEL_DEFAULT if the previous log line has a newline, i.e. if there's nothing to continuing, and as a result the VMSA gets dumped when it shouldn't. The KERN_CONT documentation says it defaults back to KERNL_DEFAULT if the previous log line has a newline. So switch from KERN_CONT to print_hex_dump_debug(). Jarkko pointed this out in reference to the original patch. See: https://lore.kernel.org/all/YuPMeWX4uuR1Tz3M@kernel.org/ print_hex_dump(KERN_DEBUG, ...) was pointed out there, but print_hex_dump_debug() should similar. Fixes: 6fac42f127b8 ("KVM: SVM: Dump Virtual Machine Save Area (VMSA) to klog") Signed-off-by: Peter Gonda Reviewed-by: Sean Christopherson Cc: Jarkko Sakkinen Cc: Harald Hoyer Cc: Paolo Bonzini Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Message-Id: <20221104142220.469452-1-pgonda@google.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/svm/sev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -605,7 +605,7 @@ static int sev_es_sync_vmsa(struct vcpu_ save->dr6 = svm->vcpu.arch.dr6; pr_debug("Virtual Machine Save Area (VMSA):\n"); - print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, save, sizeof(*save), false); + print_hex_dump_debug("", DUMP_PREFIX_NONE, 16, 1, save, sizeof(*save), false); return 0; }