Message ID | 20230127113932.166089-5-suzuki.poulose@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp787231wrn; Fri, 27 Jan 2023 03:43:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXs0mFY//C46bsvUFgClnXCYc8rQcQa2RcW15TYTD6HeI2hP1aZEnSYiKG7w9rAiMWx+Jue+ X-Received: by 2002:a05:6a20:8e03:b0:b8:a19f:4f6c with SMTP id y3-20020a056a208e0300b000b8a19f4f6cmr56050531pzj.62.1674819829511; Fri, 27 Jan 2023 03:43:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674819829; cv=none; d=google.com; s=arc-20160816; b=uARcrTv6jfPbg2N4Z14ULQKFbe8IHNGy8Bc1g3ETPfKSr7MphZYT0pt6+HzFFg7/05 6yaq2XMR3L0ceLP/D7OIUfzTj2pCTbr217rCiLlIxQ/oGm/apwDQn1peFqR2GV8E7zJE //bpkfmMIHk4pOlur+ynftGdJ9AVRh60K95Oo0/KZjfgR43ABQM+KXAqDu/SixR6SMK3 8ZGsV7Hno+60cO9um2K7wuvSEg3fMwYZSWirvDNbhbqtV3DXTlRh/Fiy7Z8VYidgddfy 5MFsxe447oBuDDLkUHkiPmM5a1PjOYD4F6Rv2tIcYzAqqN9EhGL5UsJli32L2gr1fIlX nIBw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=mlBzns4MOFzSwChaRLYDR7Xi0+DbmuSihTx+TZLNWRw=; b=vUxB6wpmMHr+C29RM0Y2dfYTCpTNJkMs9//YkcvwChleF/1ASLVpi4p9E2JSkENytO flpDiKj0fl2ZEiTLwEfm5I26mIC3YEmtRRWFWi0KW5RWafOLg10vTVGK3gzdzmOSsSFa nVUEa9HoeteawufaW+j4fqyjEEtjrG3XNH7DjUp/FSY0Plb8OzT4ehw5raPC8JT+GNjq tJ378+EjwIPpzg2RJcebr6EJ3hZofHm6JZcDL2Nc9yA00WoYEN6zmAY5PnzQlihY0G/B MvkhfXz8hPl0WohZnC8/Egr7e80tQrQE+sZWU7TgIYeOSgWxVsh7mFOIW949KQunY+dz N0Iw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a633c44000000b00478831d07f9si3967362pgn.312.2023.01.27.03.43.37; Fri, 27 Jan 2023 03:43:49 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233643AbjA0Lko (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Fri, 27 Jan 2023 06:40:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234219AbjA0Lkk (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 27 Jan 2023 06:40:40 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0BE7024CB3; Fri, 27 Jan 2023 03:40:22 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 415CD1650; Fri, 27 Jan 2023 03:40:42 -0800 (PST) Received: from ewhatever.cambridge.arm.com (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B89653F64C; Fri, 27 Jan 2023 03:39:57 -0800 (PST) From: Suzuki K Poulose <suzuki.poulose@arm.com> To: kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: suzuki.poulose@arm.com, Alexandru Elisei <alexandru.elisei@arm.com>, Andrew Jones <andrew.jones@linux.dev>, Christoffer Dall <christoffer.dall@arm.com>, Fuad Tabba <tabba@google.com>, Jean-Philippe Brucker <jean-philippe@linaro.org>, Joey Gouly <Joey.Gouly@arm.com>, Marc Zyngier <maz@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Oliver Upton <oliver.upton@linux.dev>, Paolo Bonzini <pbonzini@redhat.com>, Quentin Perret <qperret@google.com>, Steven Price <steven.price@arm.com>, Thomas Huth <thuth@redhat.com>, Will Deacon <will@kernel.org>, Zenghui Yu <yuzenghui@huawei.com>, linux-coco@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC kvmtool 04/31] Add --nocompat option to disable compat warnings Date: Fri, 27 Jan 2023 11:39:05 +0000 Message-Id: <20230127113932.166089-5-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230127113932.166089-1-suzuki.poulose@arm.com> References: <20230127112248.136810-1-suzuki.poulose@arm.com> <20230127113932.166089-1-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756175877746281226?= X-GMAIL-MSGID: =?utf-8?q?1756175877746281226?= |
Series |
arm64: Support for Arm Confidential Compute Architecture
|
|
Commit Message
Suzuki K Poulose
Jan. 27, 2023, 11:39 a.m. UTC
From: Alexandru Elisei <alexandru.elisei@arm.com> Commit e66942073035 ("kvm tools: Guest kernel compatability") added the functionality that enables devices to print a warning message if the device hasn't been initialized by the time the VM is destroyed. The purpose of these messages is to let the user know if the kernel hasn't been built with the correct Kconfig options to take advantage of the said devices (all using virtio). Since then, kvmtool has evolved and now supports loading different payloads (like firmware images), and having those warnings even when it is entirely intentional for the payload not to touch the devices can be confusing for the user and makes the output unnecessarily verbose in those cases. Add the --nocompat option to disable the warnings; the warnings are still enabled by default. Reported-by: Christoffer Dall <christoffer.dall@arm.com> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> --- builtin-run.c | 5 ++++- guest_compat.c | 1 + include/kvm/kvm-config.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-)
Comments
Hi, On Fri, Jan 27, 2023 at 11:39:05AM +0000, Suzuki K Poulose wrote: > From: Alexandru Elisei <alexandru.elisei@arm.com> > > Commit e66942073035 ("kvm tools: Guest kernel compatability") added the > functionality that enables devices to print a warning message if the device > hasn't been initialized by the time the VM is destroyed. The purpose of > these messages is to let the user know if the kernel hasn't been built with > the correct Kconfig options to take advantage of the said devices (all > using virtio). > > Since then, kvmtool has evolved and now supports loading different payloads > (like firmware images), and having those warnings even when it is entirely > intentional for the payload not to touch the devices can be confusing for > the user and makes the output unnecessarily verbose in those cases. > > Add the --nocompat option to disable the warnings; the warnings are still > enabled by default. I had a conversation with Will regarding this some time ago, we settled on a different approach, by using --loglevel=<level>, similar to what Linux does. I'll put that on my TODO list and try to send patches soon-ish. Thanks, Alex > > Reported-by: Christoffer Dall <christoffer.dall@arm.com> > Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> > Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> > --- > builtin-run.c | 5 ++++- > guest_compat.c | 1 + > include/kvm/kvm-config.h | 1 + > 3 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/builtin-run.c b/builtin-run.c > index bb7e6e8d..f8edfb3f 100644 > --- a/builtin-run.c > +++ b/builtin-run.c > @@ -183,6 +183,8 @@ static int mem_parser(const struct option *opt, const char *arg, int unset) > OPT_BOOLEAN('\0', "nodefaults", &(cfg)->nodefaults, "Disable" \ > " implicit configuration that cannot be" \ > " disabled otherwise"), \ > + OPT_BOOLEAN('\0', "nocompat", &(cfg)->nocompat, "Disable" \ > + " compat warnings"), \ > OPT_CALLBACK('\0', "9p", NULL, "dir_to_share,tag_name", \ > "Enable virtio 9p to share files between host and" \ > " guest", virtio_9p_rootdir_parser, kvm), \ > @@ -797,7 +799,8 @@ static int kvm_cmd_run_work(struct kvm *kvm) > > static void kvm_cmd_run_exit(struct kvm *kvm, int guest_ret) > { > - compat__print_all_messages(); > + if (!kvm->cfg.nocompat) > + compat__print_all_messages(); > > init_list__exit(kvm); > > diff --git a/guest_compat.c b/guest_compat.c > index fd4704b2..a413c12c 100644 > --- a/guest_compat.c > +++ b/guest_compat.c > @@ -88,6 +88,7 @@ int compat__print_all_messages(void) > > printf("\n # KVM compatibility warning.\n\t%s\n\t%s\n", > msg->title, msg->desc); > + printf("\tTo stop seeing this warning, use the --nocompat option.\n"); > > list_del(&msg->list); > compat__free(msg); > diff --git a/include/kvm/kvm-config.h b/include/kvm/kvm-config.h > index 368e6c7d..88df7cc2 100644 > --- a/include/kvm/kvm-config.h > +++ b/include/kvm/kvm-config.h > @@ -30,6 +30,7 @@ struct kvm_config { > u64 vsock_cid; > bool virtio_rng; > bool nodefaults; > + bool nocompat; > int active_console; > int debug_iodelay; > int nrcpus; > -- > 2.34.1 >
diff --git a/builtin-run.c b/builtin-run.c index bb7e6e8d..f8edfb3f 100644 --- a/builtin-run.c +++ b/builtin-run.c @@ -183,6 +183,8 @@ static int mem_parser(const struct option *opt, const char *arg, int unset) OPT_BOOLEAN('\0', "nodefaults", &(cfg)->nodefaults, "Disable" \ " implicit configuration that cannot be" \ " disabled otherwise"), \ + OPT_BOOLEAN('\0', "nocompat", &(cfg)->nocompat, "Disable" \ + " compat warnings"), \ OPT_CALLBACK('\0', "9p", NULL, "dir_to_share,tag_name", \ "Enable virtio 9p to share files between host and" \ " guest", virtio_9p_rootdir_parser, kvm), \ @@ -797,7 +799,8 @@ static int kvm_cmd_run_work(struct kvm *kvm) static void kvm_cmd_run_exit(struct kvm *kvm, int guest_ret) { - compat__print_all_messages(); + if (!kvm->cfg.nocompat) + compat__print_all_messages(); init_list__exit(kvm); diff --git a/guest_compat.c b/guest_compat.c index fd4704b2..a413c12c 100644 --- a/guest_compat.c +++ b/guest_compat.c @@ -88,6 +88,7 @@ int compat__print_all_messages(void) printf("\n # KVM compatibility warning.\n\t%s\n\t%s\n", msg->title, msg->desc); + printf("\tTo stop seeing this warning, use the --nocompat option.\n"); list_del(&msg->list); compat__free(msg); diff --git a/include/kvm/kvm-config.h b/include/kvm/kvm-config.h index 368e6c7d..88df7cc2 100644 --- a/include/kvm/kvm-config.h +++ b/include/kvm/kvm-config.h @@ -30,6 +30,7 @@ struct kvm_config { u64 vsock_cid; bool virtio_rng; bool nodefaults; + bool nocompat; int active_console; int debug_iodelay; int nrcpus;