From nobody Sun Jan 25 12:00:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1769175465; cv=none; d=zohomail.com; s=zohoarc; b=b+TzelzER9kSQPP3UExc6X9SUeKy8i22h2leR2h9ClrD/ntsvynfeOHhMxVPPPXt/z73XJDAaDsWa8R1amN56chWzc9aeFRGOid5SWVBmlFkU0EKjru6LZZK/zkb1KwVbTl/D8YAa8ZVsXqE0X5eHmGtD92QQRk/j2Tpu0yv2ZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769175465; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=76owvlo0WqmUZv2nou+97DNHUd9qt6l006thFwPhK/M=; b=b/4XS4HHF4XpeBUQcdL/D4Yyt4l+jqkfiCBYlsIaStB3CODoBHJMEApcyB7nY7ao/qbrhDZhW+sFI8QMqXqK8r/+IdHkzYuXvq4tkHXNANTWV4fH5Gc+uhvxkFDGbxqNTXBUFffo19dUbu+xIyJWm/uoZ+TqC8w6cYAluYUv7DI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769175465017608.4317658795036; Fri, 23 Jan 2026 05:37:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vjHKm-0007rY-NT; Fri, 23 Jan 2026 08:36:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vjHKc-0007jV-Ni for qemu-devel@nongnu.org; Fri, 23 Jan 2026 08:36:11 -0500 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vjHKa-0004iM-Cc for qemu-devel@nongnu.org; Fri, 23 Jan 2026 08:36:10 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 9D6B3438D8; Fri, 23 Jan 2026 13:36:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D6A3C19423; Fri, 23 Jan 2026 13:36:06 +0000 (UTC) Received: from localhost ([::1]) by mail.kernel.org with esmtp (Exim 4.99.1) (envelope-from ) id 1vjHKV-000000063Kt-2Ax1; Fri, 23 Jan 2026 14:36:04 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769175366; bh=lxhwQKIzlrcBI4tFlx1FpaWq7baQO6Do2qGzPtxkNXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BP5DRs0IFROwchpOHK53AIvkYFlUugHqFfqJLpi4JcpO0doq0IoCqEeJZC8iknWWZ dxhI8m48qRw6hCabzV2bAk9U7rqoF6MP2pG/LAfEFtUn43XTXLiDPTAZbBkv0TQgyt 9ssnZgTFCLCgRpzGVWD8W1xdKRIIEHs+ciHhIM8qfOEohE+w8CAdeOPvYbjcxNvc3X sgFg3OOsl+Or2d6pdE+9YfRauI5Uh3Mo+0C9oFacuu1/xtWl82+A2zWvmPtWPIo74Q HPTSCsWHPNs9m7nYGz7bEhJF+ruSbM8bwAnyXM3nyhrz7oA5IOblq5oSIU67AUKM0A iQfIBfTRxzTQA== From: Mauro Carvalho Chehab To: "Michael S. Tsirkin" Cc: Mauro Carvalho Chehab , qemu-devel@nongnu.org, Cleber Rosa , John Snow , Jonathan Cameron Subject: [PATCH v2 13/13] scripts/ghes_inject: improve help message Date: Fri, 23 Jan 2026 14:35:27 +0100 Message-ID: <56c9b3c8010ecc446d2ed2fd9fd5b5337c1f89c3.1769175070.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2600:3c0a:e001:78e:0:1991:8:25; envelope-from=mchehab+huawei@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.079, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1769175466353158500 Add a one-liner help message for each type of error inject command, and use raw formatter to keep line breaks. While here, use a more uniform language. With that, "ghes_inject -h" will now show: usage: ghes_inject.py [options] Handles ACPI GHESv2 error injection via the QEMU QMP interface. It uses UEFI=E2=80=AFBIOS=E2=80=AFAPEI features to generate GHES records,= which helps to test CPER and GHES drivers on the guest OS and see how user=E2=80=91space applications on that guest handle such errors. positional arguments: {arm,pci-bus,fuzzy-test,fuzzy,raw-error,raw} arm Inject an ARM processor error CPER, compatible wi= th UEFI 2.9A Errata. pci-bus Inject a PCI/PCI-X bus error CPER fuzzy-test (fuzzy) Inject fuzzy test CPER packets raw-error (raw) Inject CPER records from previously recorded ones. options: -h, --help show this help message and exit QEMU QMP socket options: -H, --host HOST host name (default: localhost) -P, --port PORT TCP port number (default: 4445) -d, --debug enable debug output (default: False) Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- scripts/arm_processor_error.py | 6 ++++-- scripts/fuzzy_error.py | 4 +++- scripts/ghes_inject.py | 18 +++++++++--------- scripts/pci_bus_error.py | 4 +++- scripts/raw_error.py | 6 +++--- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/scripts/arm_processor_error.py b/scripts/arm_processor_error.py index d9845adb0c0a..597382031ab8 100644 --- a/scripts/arm_processor_error.py +++ b/scripts/arm_processor_error.py @@ -122,7 +122,7 @@ class ArmProcessorEinj: """ =20 DESC =3D """ - Generates an ARM processor error CPER, compatible with + Inject an ARM processor error CPER, compatible with UEFI 2.9A Errata. """ =20 @@ -169,7 +169,9 @@ def __init__(self, subparsers): =20 self.data =3D bytearray() =20 - parser =3D subparsers.add_parser("arm", description=3Dself.DESC) + parser =3D subparsers.add_parser("arm", + help=3Dself.DESC, + description=3Dself.DESC) =20 arm_valid_bits =3D ",".join(self.arm_valid_bits.keys()) flags =3D ",".join(self.pei_flags.keys()) diff --git a/scripts/fuzzy_error.py b/scripts/fuzzy_error.py index 9f80abb72319..3ddb90f743a1 100644 --- a/scripts/fuzzy_error.py +++ b/scripts/fuzzy_error.py @@ -121,8 +121,10 @@ def __init__(self, subparsers): }, } =20 + DESC =3D "Inject fuzzy test CPER packets" + parser =3D subparsers.add_parser("fuzzy-test", aliases=3D['fuzzy'], - description=3D"Inject a fuzzy test = CPER", + help=3DDESC, description=3DDESC, formatter_class=3Dargparse.RawTextH= elpFormatter) g_fuzzy =3D parser.add_argument_group("Fuzz testing error inject") =20 diff --git a/scripts/ghes_inject.py b/scripts/ghes_inject.py index dd2b34a64f15..21cdea774f17 100755 --- a/scripts/ghes_inject.py +++ b/scripts/ghes_inject.py @@ -17,28 +17,28 @@ from raw_error import RawError =20 EINJ_DESC =3D """ -Handle ACPI GHESv2 error injection logic QEMU QMP interface. +Handles ACPI GHESv2 error injection via the QEMU QMP interface. =20 -It allows using UEFI BIOS EINJ features to generate GHES records. - -It helps testing CPER and GHES drivers at the guest OS and how -userspace applications at the guest handle them. +It uses UEFI=E2=80=AFBIOS=E2=80=AFAPEI features to generate GHES records, = which helps to +test CPER and GHES drivers on the guest OS and see how user=E2=80=91space +applications on that guest handle such errors. """ =20 def main(): """Main program""" =20 # Main parser - handle generic args like QEMU QMP TCP socket options - parser =3D argparse.ArgumentParser(formatter_class=3Dargparse.Argument= DefaultsHelpFormatter, + parser =3D argparse.ArgumentParser(formatter_class=3Dargparse.RawDescr= iptionHelpFormatter, usage=3D"%(prog)s [options]", description=3DEINJ_DESC) =20 g_options =3D parser.add_argument_group("QEMU QMP socket options") g_options.add_argument("-H", "--host", default=3D"localhost", type=3Ds= tr, - help=3D"host name") + help=3D"host name (default: %(default)s)") g_options.add_argument("-P", "--port", default=3D4445, type=3Dint, - help=3D"TCP port number") - g_options.add_argument('-d', '--debug', action=3D'store_true') + help=3D"TCP port number (default: %(default)s)") + g_options.add_argument('-d', '--debug', action=3D'store_true', + help=3D"enable debug output (default: %(default= )s)") =20 subparsers =3D parser.add_subparsers() =20 diff --git a/scripts/pci_bus_error.py b/scripts/pci_bus_error.py index 5abfdf11c868..87d1f7c95dd2 100644 --- a/scripts/pci_bus_error.py +++ b/scripts/pci_bus_error.py @@ -35,8 +35,10 @@ def __init__(self, subparsers): =20 self.data =3D bytearray() =20 + DESC =3D "Inject a PCI/PCI-X bus error CPER" + parser =3D subparsers.add_parser("pci-bus", - description=3D"Generate PCI/PCI-X b= us error CPER") + help=3DDESC, description=3DDESC) g_pci =3D parser.add_argument_group("PCI/PCI-X bus error") =20 valid_bits =3D ",".join(self.valid_bits.keys()) diff --git a/scripts/raw_error.py b/scripts/raw_error.py index f5e77bdfcead..1e9eb1bcf15b 100644 --- a/scripts/raw_error.py +++ b/scripts/raw_error.py @@ -21,8 +21,8 @@ class RawError: =20 SCRIPT_NAME =3D sys.argv[0] =20 - HELP=3Df""" - Inject a CPER record from a previously recorded one. + HELP=3D"Inject CPER records from previously recorded ones." + DESC=3DHELP + f""" =20 One or more CPER records can be recorded. The records to be injected are read from an specified file or from stdin and should @@ -58,7 +58,7 @@ def __init__(self, subparsers): self.size =3D 0 =20 parser =3D subparsers.add_parser("raw-error", aliases=3D['raw'], - description=3Dself.HELP, + help=3Dself.HELP, description=3Dsel= f.DESC, formatter_class=3Dargparse.RawTextH= elpFormatter) =20 parser.add_argument("-f", "--file", --=20 2.52.0