From patchwork Thu Feb 22 11:16:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 20785 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:aa16:b0:108:e6aa:91d0 with SMTP id by22csp181787dyb; Thu, 22 Feb 2024 03:17:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW5UkBllqnetnAnVppmw/VVOmn+Z41Lcs6mJYjWD3cK7YvlR/ez/MZWmduer+xUDqwTeDYmg1yohmNRrkBCGS17eTc9fQ== X-Google-Smtp-Source: AGHT+IFlft8Qyj6G8vmjvGWJaZyW45lOUm+7ht2dvbiqBwi/++SoQVX+nZv7G2QiJX3o5j8blP2x X-Received: by 2002:a17:906:fa0c:b0:a3e:998a:15a2 with SMTP id lo12-20020a170906fa0c00b00a3e998a15a2mr8157372ejb.54.1708600670882; Thu, 22 Feb 2024 03:17:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708600670; cv=pass; d=google.com; s=arc-20160816; b=C5m30X9zePuVxrjERrKmIwba2wIXV4zshilFJMzIWEhfNzBwzT0LUoZ55bcp+L4i+J 30oerwn82w/LPjTChIKPySay7w8ItpqHJK5o1FKiNBwF6aoKKV+/8WnR8KpZuitL9GDl o1PQLxv/DoNhM3rSLC7s8JKiXN8g+P6qJiWU172a/JXGM/5fyG9X92wnz/JfRKdAGtP1 L0G6SAyRX80Cb50aAS6Xrpa+7RkyzWah0l6OZgVWkK3Q73p0hCm9ePoRpb/s+cFy066n NvHFFrP7A92wohU9D75zUlj/77/rQhTVU7QfH2qa4gIF3zealnN7taKgAIa6dxrsFIeT m4uA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=f0WDjPpBEd8T8+uDymIvKTcUlaDMEk2bJipS39+mDFQ=; fh=Hu45STTqb7AiaRzx9E09MDox39bxU5VqqiroUJtANag=; b=nn18fGlxJL6Y24Ok7b1ZatBqbzpk9tghKXuQ3bR130YmkKzBcSUAB40fSEO/7UwDIs 25iX0icl3RfpguPz7SZJsexBu9lM3cnBbTGTl30skm7mA/40qQeu8l2d91A2joaO3FaT mUfmgaVg/Ox7+obsTjFSzw7q8RPl0Wz4BORUgrVHouncK29mOqL4aBX6Zr384ru0Kaux wdX+eNHO+FG8ayqAJ0MMyJNLSJzmPmrJnjQKqWmbtmvvpd9TSuSG0mOnuk7KNDkKiDZN Y9Ss8cngeP/lhLwRh0lApmT1wJFr2ZYbCSe8w2GNIZ/ynYcsp1M5XUP3lhL5JFeJnh6c DFvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=l+JLbPaq; dkim=pass header.i=@suse.com header.s=susede1 header.b=l+JLbPaq; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-76391-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76391-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ha26-20020a170906a89a00b00a3ec7e83b4asi3311436ejb.626.2024.02.22.03.17.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 03:17:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76391-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=l+JLbPaq; dkim=pass header.i=@suse.com header.s=susede1 header.b=l+JLbPaq; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-76391-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76391-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B18721F260EC for ; Thu, 22 Feb 2024 11:17:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3C614597F; Thu, 22 Feb 2024 11:16:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="l+JLbPaq"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="l+JLbPaq" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9AEC8208A2 for ; Thu, 22 Feb 2024 11:16:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708600613; cv=none; b=Ia6yN5VGozqaf7PNNwIorEO8PMMBsxlVWJEhOSZ3Pkr7Sy06YEVrUDQ8R6iGlZdk5i8tbOfwIJ2BCtOiP0NNB2Hlp1vT89F+4r8nizasd+BK1iXkIJIfAwOI95NOZ5oUwVEWd3ePaDBUdF/75eUHCwsTGZvC//dkJRW2NyYUNdU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708600613; c=relaxed/simple; bh=UudV8mpjkdJ5wQfiRKfqyLU7x/qxGZ9m5FYON9r4mo0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=qOY+RTt9JwqLtwZzXs5O+p/LwWDPb1qDX056SZtJ1HAw7NxKiPpR/PiEMX2p9MWB9chjeYqHPCrDYo42CpmswrrhjC2M9o7ASAUhUaSvZ3rL2KJGy6Rme23sScjtss5l/uCpH3BpnHDB09oMq8JELjiGp7eND6LAVGE72rN0CJ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=l+JLbPaq; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=l+JLbPaq; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E890C1F457; Thu, 22 Feb 2024 11:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1708600609; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=f0WDjPpBEd8T8+uDymIvKTcUlaDMEk2bJipS39+mDFQ=; b=l+JLbPaq25ao+vDyscSAN90wt2Aj42HDL+FaXFFMt4hW2273hPfd0iN73ptpstUP/cXm1c iLvx8Kz9gsDrAjp1DTbTI5CaQFWUOax43segG2JJYyQDsDQBzcpVWjrHNgLyZhRta6j05T nAC2Zz9Zc51CcZXPyLLKaYtyVpZ/RmI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1708600609; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=f0WDjPpBEd8T8+uDymIvKTcUlaDMEk2bJipS39+mDFQ=; b=l+JLbPaq25ao+vDyscSAN90wt2Aj42HDL+FaXFFMt4hW2273hPfd0iN73ptpstUP/cXm1c iLvx8Kz9gsDrAjp1DTbTI5CaQFWUOax43segG2JJYyQDsDQBzcpVWjrHNgLyZhRta6j05T nAC2Zz9Zc51CcZXPyLLKaYtyVpZ/RmI= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A174313A8C; Thu, 22 Feb 2024 11:16:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id pn8BJSEt12VrGgAAD6G6ig (envelope-from ); Thu, 22 Feb 2024 11:16:49 +0000 From: Nikolay Borisov To: bp@alien8.de Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Nikolay Borisov Subject: [PATCH 0/2] Cleanup x86 instruction decoder Date: Thu, 22 Feb 2024 13:16:34 +0200 Message-Id: <20240222111636.2214523-1-nik.borisov@suse.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.70 X-Spamd-Result: default: False [3.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_SPAM(0.00)[41.09%]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791597656993410704 X-GMAIL-MSGID: 1791597656993410704 First patch removes some duplicated checks in caller/callee second one is trivial to remove a check in init_ins() Nikolay Borisov (2): x86/insn: Remove superfluous checks from instruction decoding routines x86/insn: Directly assign x86_64 state in init_ins arch/x86/lib/insn.c | 58 +++++++++++++++------------------------ tools/arch/x86/lib/insn.c | 58 +++++++++++++++------------------------ 2 files changed, 44 insertions(+), 72 deletions(-) --- 2.34.1