Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4903941rdh; Wed, 29 Nov 2023 14:18:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBpyDgYO3XFKVFsJtTAg/7bW42FZXIGh58qlgbjQMIeQ4dNRiw5tgCXmsuuT6QMUz7dl3Y X-Received: by 2002:a17:902:c60b:b0:1cf:5746:7ad0 with SMTP id r11-20020a170902c60b00b001cf57467ad0mr26179075plr.14.1701296298254; Wed, 29 Nov 2023 14:18:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701296298; cv=none; d=google.com; s=arc-20160816; b=bG8iONp74GaehcZLlvCrebFAeoBEYrimZ+1hsfLw8EkoexZ7qzLi+YLJ6seo48Yak4 d8j2Vc5Ci4Ib7rLr8zz8O41olDdgWRUKHZg9OQR/OoYZlC/jUg6SOmhjbQ3p3GseZmH1 Q6eqV7S+vrJt7iT8HB71iekkVdCjMnYw369XCyj0ltBdk9s2yj/sfrZ92A7gtog0WhJ0 wpnJI1Kuq9qzKP7XRwRzA7sgbWp0AuxQN4AUuueAT/SbgnuHSzUYoFJwyxHkzaX3+L+w zkgAha2OG31L79MleVEWmZk2sQkkwBGdMJk4GNE6POqPX+q2C1k5PhtctFNW0hkNzlrv Aj4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=qS8WYYQoHAQJ+YMZcvwyoswQZ0nC2UDe5gnqdRQ4Ezw=; fh=VuE012xvnkbmKdVz6qCJ/DYLIa42Cu/uD91abXTRPQU=; b=oGI2T2T4+WYSNlWssnHJYlvxJQYcib389vsjK4sQkYQhan5ZzgHeUHTi7zgr8dSmjO kfCVEctukrSF2r09xEHNJELRXO5Qsk5f8/eTQULWixCHzl4+HnZ1BPNGcYoyrPEuxPpJ L+N8o0hcvD7DLvId3gVCQ2Ae4LUaWk2B8cdDYE4YkwVeRtssXude92EESVBLa1ST0o7h kJgMcHUYjPg0rY6ihsGK5j79dIBQhaXUiSHti6xGdSLtOe9P/4PDLfOR/xS8STlIZ1PL fRG5nvBZE6oapm1P17u1cgFfZR96Wj2CxyZe5sai2IqrkdB6Di27Mqi+XpPrkK3BO/Eh xdvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nRDN1qEE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id q15-20020a170902788f00b001cf5cae80e5si14277613pll.114.2023.11.29.14.18.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 14:18:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nRDN1qEE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id E9747801B9A4; Wed, 29 Nov 2023 14:18:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234865AbjK2WR4 (ORCPT + 99 others); Wed, 29 Nov 2023 17:17:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234683AbjK2WRw (ORCPT ); Wed, 29 Nov 2023 17:17:52 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B18C3A8 for ; Wed, 29 Nov 2023 14:17:58 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADC07C433C7; Wed, 29 Nov 2023 22:17:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701296278; bh=KFgXr/RumUIJadwpEcu//GyTiF0kTEm+5XAlvLCCz7E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nRDN1qEEHl7dFz/5CrWxL+r3hOnCBzr4/9zCXF9X4gp74LrAI6/zTeROZM3mYs4ob c3g8vMdugy9aZ0I6f/XXFWt/W2NjaMbek0PPZM+B5TbXRz1dsMJVZgOdMh/QA9pCqN 6pHCSYKAy1aYymF/77P3siivTkUp3eO9fso96jF1l3WUnsCtYgBzPDBsiJ5+7iDk35 EpAfyCMtQJoBKiinmKJ8RM6BquawBzW5MHJSupZg0UwUH2ncH2KOlrZjjKrHmrdces /o/eamEOxhWJFEnzsz4l/bYJRuV/U/uZVuBTn4D0VawMwPDMjgaKFpjB37/us+1Zor Q1X241pIp8KqQ== From: Nathan Chancellor Date: Wed, 29 Nov 2023 15:17:41 -0700 Subject: [PATCH v3 1/3] x86/tools: objdump_reformat.awk: Ensure regex matches fwait MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231129-objdump-reformat-llvm-v3-1-0d855e79314d@kernel.org> References: <20231129-objdump-reformat-llvm-v3-0-0d855e79314d@kernel.org> In-Reply-To: <20231129-objdump-reformat-llvm-v3-0-0d855e79314d@kernel.org> To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Cc: x86@kernel.org, ndesaulniers@google.com, keescook@chromium.org, samuelzeter@gmail.com, mhiramat@kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, Nathan Chancellor X-Mailer: b4 0.13-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1649; i=nathan@kernel.org; h=from:subject:message-id; bh=zK2t0BsgpjdtAaQUa63zamoD0D6aFJDYhxA7YOLDI9o=; b=owGbwMvMwCUmm602sfCA1DTG02pJDKnpOyYzvbzN/zgk+u1Zk/hyKYOHB0yKlJ+VCJxWi392L G0al/2TjlIWBjEuBlkxRZbqx6rHDQ3nnGW8cWoSzBxWJpAhDFycAjCRFhOGn4yhgY//zFDyeqWV cvnjxocrhd8w+jYlmy3KNe6s3abjnMPI0L5a4L3cgZIp7BMfNBeXicsKPpVquS7dt+2I0LIN2mt WMQAA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 29 Nov 2023 14:18:16 -0800 (PST) From: Samuel Zeter If there is "wait" mnemonic in the line being parsed, it is incorrectly handled by the script, and an extra line of "fwait" in objdump_reformat's output is inserted. As insn_decoder_test relies upon the formatted output, the test fails. This is reproducible when disassembling with llvm-objdump: Pre-processed lines: ffffffff81033e72: 9b wait ffffffff81033e73: 48 c7 c7 89 50 42 82 movq After objdump_reformat.awk: ffffffff81033e72: 9b fwait ffffffff81033e72: wait ffffffff81033e73: 48 c7 c7 89 50 42 82 movq The regex match now accepts spaces or tabs, along with the "fwait" instruction. Closes: https://github.com/ClangBuiltLinux/linux/issues/1364 Acked-by: Masami Hiramatsu Tested-by: Nathan Chancellor Reviewed-by: Kees Cook Tested-by: Kees Cook Signed-off-by: Samuel Zeter Signed-off-by: Nathan Chancellor --- arch/x86/tools/objdump_reformat.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/tools/objdump_reformat.awk b/arch/x86/tools/objdump_reformat.awk index f418c91b71f0..276e572a6f60 100644 --- a/arch/x86/tools/objdump_reformat.awk +++ b/arch/x86/tools/objdump_reformat.awk @@ -12,7 +12,7 @@ BEGIN { prev_hex = "" prev_mnemonic = "" bad_expr = "(\\(bad\\)|^rex|^.byte|^rep(z|nz)$|^lock$|^es$|^cs$|^ss$|^ds$|^fs$|^gs$|^data(16|32)$|^addr(16|32|64))" - fwait_expr = "^9b " + fwait_expr = "^9b[ \t]*fwait" fwait_str="9b\tfwait" } -- 2.43.0