From nobody Sun Apr 12 02:49:35 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=1771847518; cv=none; d=zohomail.com; s=zohoarc; b=mco1C9te8Bw7caXXlGJN9mgkFWmW+SLI+C0a+YQHG5d8ACd9fwoeyQSwWhYbd/cMX3dvTM1UwNQyJMTlRMvwKrxyGeAlxIRuzBcaSz7Z6GHjkb1RtAW+W3jomeKA0pc50A4v9SKcC3/sFthWilHf9HIplJsd18bNOHePSQt5eeI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771847518; 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=nl5VP1LOJyoYPVbqzxTmFlZgOai4MYdnDAsStF+Lr0M=; b=h92cd4ci4sRdiV58UJK4+MEN+ueSvBe2FsMnYhjJi9rjw0s98DbQNCeuZ11Ne7F7EkdLYnRuCiPShCmdn7zi9sc+qk/aahZfhvgSekx8t1KthFTAngFpHajpuJ3vsreAAscr7ncLIhb2he0lzEYK8lKNqowWhDwJ4UDYreRKJ8Y= 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 1771847518579421.7235272287993; Mon, 23 Feb 2026 03:51:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuUSf-0004TV-Oj; Mon, 23 Feb 2026 06:50:49 -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 1vuUSb-0004RL-3Y for qemu-devel@nongnu.org; Mon, 23 Feb 2026 06:50:45 -0500 Received: from sea.source.kernel.org ([172.234.252.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vuUSV-0004rk-Vw for qemu-devel@nongnu.org; Mon, 23 Feb 2026 06:50:42 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 35D04444FB; Mon, 23 Feb 2026 11:50:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16094C2BCB2; Mon, 23 Feb 2026 11:50:34 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vuUSO-00000007Jp7-1FdH; Mon, 23 Feb 2026 12:50:32 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771847434; bh=Dth8Faoh0/dwBB7alZe7q4QU3faEttLYXD3JAhyjqac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eRH/4OrbENX6+uERKqgWfTB2TRc79O0DqVNAoxloL7yc52o85itua5sAtbTkFSBSl k3Z6AFiu7mAaXurM7M1Wc4NXr3viZQWU+xK1Rd74pAyAMDbR9L2KKz8P19JJIMzskP QoTkvzcmVMuk3NOwDRCrHz7LN11H9lc9kMduask98RYcP1UA6hTTjUOsV0eOkaYpWO b+O0LrG37O8ZBnTjbrkklbdEm3rENeIOTmRRCM4REbrq701f/l5TUCt0u7v8wzciC8 FH1HbijfbM/KI9DlC3iHIzf8NbRUcKQUuXpjZo3QIjlbgpT2lYu2dFnP0rz7gBMijO lkH9Xga38phig== From: Mauro Carvalho Chehab To: Michael S Tsirkin Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Igor Mammedov , Mauro Carvalho Chehab , Cleber Rosa , John Snow Subject: [PATCH v3 14/14] scripts/ghes_inject: improve help message Date: Mon, 23 Feb 2026 12:50:30 +0100 Message-ID: <7edd91c64294cafeb4e5d7e155233914df81aae8.1771847176.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.53.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=172.234.252.31; envelope-from=mchehab+huawei@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1.179, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.717, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: 1771847520239158500 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,pcie-bus,fuzzy-test,fuzzy,raw-error,raw} arm Inject an ARM processor error CPER, compatible wi= th UEFI 2.9A Errata. pcie-bus Inject a PCIe 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 --- scripts/arm_processor_error.py | 6 ++++-- scripts/fuzzy_error.py | 4 +++- scripts/ghes_inject.py | 18 +++++++++--------- scripts/pcie_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 f816e47a5af8..dc2b6bbe684d 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 4028fdb15582..488d10ffcafd 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/pcie_bus_error.py b/scripts/pcie_bus_error.py index 482b26db5e5f..9825e9bace21 100644 --- a/scripts/pcie_bus_error.py +++ b/scripts/pcie_bus_error.py @@ -35,8 +35,10 @@ def __init__(self, subparsers): =20 self.data =3D bytearray() =20 + DESC =3D "Inject a PCIe bus error CPER" + parser =3D subparsers.add_parser("pcie-bus", - description=3D"Generate PCIe bus er= ror CPER") + help=3DDESC, description=3DDESC) g_pcie =3D parser.add_argument_group("PCIe bus error") =20 valid_bits =3D ",".join(self.valid_bits.keys()) diff --git a/scripts/raw_error.py b/scripts/raw_error.py index 0490adb25042..ab522c4b4615 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.53.0