From patchwork Wed Mar 22 04:00:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Poimboeuf X-Patchwork-Id: 73183 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2153351wrt; Tue, 21 Mar 2023 21:20:58 -0700 (PDT) X-Google-Smtp-Source: AK7set/O5MIDAlbUTfIbo+8k74AL7r21SFkc/tGRYLtGzazOkyeV1wJKddc8+ONdkAa4N1j/EGEM X-Received: by 2002:a05:6402:64e:b0:4af:63a7:7474 with SMTP id u14-20020a056402064e00b004af63a77474mr4876701edx.17.1679458858159; Tue, 21 Mar 2023 21:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679458858; cv=none; d=google.com; s=arc-20160816; b=AbmG5kIa3L+W+oPlhM72PSVNKTzRg2hP9WYmW04zhdTrUesZWlkFjDXggSB7rRq32Q ojNWoZaBVtP88OCISArpTk0DScDGxoXON10yR6n1iDgtRNkOWkkC+mObxQ/MNj/QBe8i +5TCNwH5IcEp5KqWlIR3GM/MKllLrFkgQJjnpSi+FuDq9xW8jfjn+Cf9VNzd+B9lNImH um8J/yRnKu8IP0b3f5XypM2TMiCxvBqx0GNJoy1n+xJj75+WTgvaRVheFN7xjz/0LXPX mhbM2O0jzbMk7wy+YBlK0gxmsaS8WDRL/ftqTx5R9UqjVaUDazLlHkXX/fapEHU2JJOw vWQQ== 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 :dkim-signature; bh=mF+L6rNCsqPnrw6hbBGOnm0FrOQ+aPm9HOjmW4cE8Ms=; b=XzVLlelN5VzItep+Oh7HJbzFspAS4X0sv7iLCoTxkQVLJcjYOL/VunOXLf+7JgRwaK 7Rx+uTExHpum+I5rynrZHktk9CMyKg5knCyiFc7ZYHgp+sSVvwYAN5FtNrjMKXZPXtP4 NZbvX9FZzQbZ8hoytKsl3A4i9opZ3iNXcoQNi43K82tuM6+mKyGyOhc8nhjhvlqcvu0s C1IN/JH6yDzAdVf5E6Ldw9MUDJH7gVu182pmuZOlLYynYgF/u8RbujgfOqGThpmQ3P9P x1C+q6NefpCT0fX9T9E+IbWEyYB+sTbDGwpmh+2G24GbB3vgE24j3yt95oB65Yip0nVt ZISQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LhGzl+6t; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f11-20020a05640214cb00b004fc7cbc9c09si14860607edx.551.2023.03.21.21.20.33; Tue, 21 Mar 2023 21:20:58 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LhGzl+6t; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230311AbjCVEAf (ORCPT + 99 others); Wed, 22 Mar 2023 00:00:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230016AbjCVEAZ (ORCPT ); Wed, 22 Mar 2023 00:00:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7839047816 for ; Tue, 21 Mar 2023 21:00:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0E2FD61F34 for ; Wed, 22 Mar 2023 04:00:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2833C433D2; Wed, 22 Mar 2023 04:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679457623; bh=/ZLm+wrxs/+a1i9Qeb7J2lVK+Z8NtDgtRnyNWD9EKik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LhGzl+6tp6p2aIHnYK6VuYlsZHXLK2dZkWI2BXJoYnVP75G2Z+CueGy7ydubG4iMP bS7L3DdGct2/BXryFCIUDHFL3OGlhwMmLKZ69nBm8kN45PBzmphOSExrZyxVQ4ReXL GhG1BnZlHj312ZUYnEQ29g+5rwOuJkSTUmvt4Z0vfKNpgSMPMjMCP9FLAxjfqZJKE+ 5od/w9oWaqkegqfv6h6kQRTcyMljerNSWk989DL2pQ2vWR0gS+WUzQOZcU5tmJZ+Lv tlxGFsu4Ci7j8vQLQpjiOND2gMaJaL2gF0q/LbUGrY9ydPWvk66IW+lVICtmxyPixb 91wRAm4clwOtQ== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Mark Rutland , Jason Baron , Steven Rostedt , Ard Biesheuvel , Christophe Leroy , Paolo Bonzini , Sean Christopherson , Sami Tolvanen , Nick Desaulniers , Will McVicker , Kees Cook , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 02/11] static_call: Flip key type union bit Date: Tue, 21 Mar 2023 21:00:08 -0700 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-type: text/plain X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761040251931557653?= X-GMAIL-MSGID: =?utf-8?q?1761040251931557653?= Flip the meaning of the key->type union field. This will make it easier to converge some of the DECLARE_STATIC_CALL() macros. Signed-off-by: Josh Poimboeuf --- include/linux/static_call.h | 3 --- include/linux/static_call_types.h | 4 ++-- tools/include/linux/static_call_types.h | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/linux/static_call.h b/include/linux/static_call.h index 141e6b176a1b..f984b8f6d974 100644 --- a/include/linux/static_call.h +++ b/include/linux/static_call.h @@ -186,7 +186,6 @@ extern long __static_call_return0(void); DECLARE_STATIC_CALL(name, _func); \ struct static_call_key STATIC_CALL_KEY(name) = { \ .func = _func, \ - .type = 1, \ }; \ ARCH_DEFINE_STATIC_CALL_TRAMP(name, _func) @@ -194,7 +193,6 @@ extern long __static_call_return0(void); DECLARE_STATIC_CALL(name, _func); \ struct static_call_key STATIC_CALL_KEY(name) = { \ .func = NULL, \ - .type = 1, \ }; \ ARCH_DEFINE_STATIC_CALL_NULL_TRAMP(name) @@ -202,7 +200,6 @@ extern long __static_call_return0(void); DECLARE_STATIC_CALL(name, _func); \ struct static_call_key STATIC_CALL_KEY(name) = { \ .func = __static_call_return0, \ - .type = 1, \ }; \ ARCH_DEFINE_STATIC_CALL_RET0_TRAMP(name) diff --git a/include/linux/static_call_types.h b/include/linux/static_call_types.h index 87c3598609e8..c4c4efb6f6fa 100644 --- a/include/linux/static_call_types.h +++ b/include/linux/static_call_types.h @@ -61,10 +61,10 @@ struct static_call_site { struct static_call_key { void *func; union { - /* bit 0: 0 = mods, 1 = sites */ + /* bit 0: 0 = sites, 1 = mods */ unsigned long type; - struct static_call_mod *_mods; struct static_call_site *_sites; + struct static_call_mod *_mods; }; }; diff --git a/tools/include/linux/static_call_types.h b/tools/include/linux/static_call_types.h index 87c3598609e8..c4c4efb6f6fa 100644 --- a/tools/include/linux/static_call_types.h +++ b/tools/include/linux/static_call_types.h @@ -61,10 +61,10 @@ struct static_call_site { struct static_call_key { void *func; union { - /* bit 0: 0 = mods, 1 = sites */ + /* bit 0: 0 = sites, 1 = mods */ unsigned long type; - struct static_call_mod *_mods; struct static_call_site *_sites; + struct static_call_mod *_mods; }; };