Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1253931imm; Wed, 19 Sep 2018 15:06:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZnqSg7IQ3iDAX1ykjpCddrQcS1Z/hVjU7khmgrTRySVvNiqucAEMB5jj7ViaRSLlE5ZaXt X-Received: by 2002:a17:902:988a:: with SMTP id s10-v6mr35392652plp.200.1537394794207; Wed, 19 Sep 2018 15:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537394794; cv=none; d=google.com; s=arc-20160816; b=D+OStkG+BeJTVr1VkY1S4y2gFcPaJSRYkVOkAffZefCEH+VtCnePOIH/HtcGbVCQo3 ryqHfC5/+m/9ZpSyl8nZq1EWwte9JqCYyt3IamIr0EQ15YfFgla46jCDkPk/IhFgyGWT gxDA1hAxfGNKk2ew25OCfXE+W+FLmkxMFILJ5gLMIDbeaC3X27SNZwYHf0LkbDIdQO+j fMoLa5Km7jov4wZDei5WDsRTzX3kcrOPT5FBVijeqzBtLHYuFmjpK1tAvS05DRllYXP4 bHG7QYix6vuTYBJ13//neJsx3MsAjet7QJDqUIDPoDzVlyyIno6JW4vsIiWujghBPq6H zy1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=HfAsVEQefeGww9i9tpc6vNdlydvyaI4WH6N+VrkhAI0=; b=VDa3/4CtSX5k75LgWlf+ifDHNk1fKWeq7Z3stn94+S+NFnwLH1NLRQDyDl3VuBuo72 IPADOvXZTtJ4KfGAwWBF+hQIV3JjXfjUrpGK4VEL/Ctzx47X4G8vkcOp6o/UgprFeIUm X1JZbSU8QiGgtrwfoGVYMpJlPFNIr6if/1r3c2ZM64iYyqrlaYkVf/gKvsUfLiijolrh pxoW7PxKApAnwfJio5TmiiQWgmkBtnVbIYXp+u7jWPuxdufLI8kGTYc6KFBr/OcuO26B 6vxKZENG3g4hBsjl4v4J3b6314X9OZcRGT8PRe2uYJzYxj3jDnB7RAqTemuhxSwyH0MH Uvdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Cz644Ua1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q197-v6si20822864pgq.526.2018.09.19.15.06.17; Wed, 19 Sep 2018 15:06:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Cz644Ua1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387614AbeITDpp (ORCPT + 99 others); Wed, 19 Sep 2018 23:45:45 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:43241 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733235AbeITDpf (ORCPT ); Wed, 19 Sep 2018 23:45:35 -0400 Received: by mail-ed1-f68.google.com with SMTP id z27-v6so6148413edb.10 for ; Wed, 19 Sep 2018 15:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HfAsVEQefeGww9i9tpc6vNdlydvyaI4WH6N+VrkhAI0=; b=Cz644Ua18OnCyh0OmOHrltrTwSyr50atmmxthXFUlNSkUMnACWPcoyyL8fq1e/zIpP CHGtqkfBbUXA3WkLKw3OM+tbrCwGxmi2AhMUoPmMhkcTDcHLsoJVQcD1WXEjPetfwT7L 0ZcwEFaXXRyA51Un6VcO/ufBG5Qv/klrWU+Ao= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HfAsVEQefeGww9i9tpc6vNdlydvyaI4WH6N+VrkhAI0=; b=AKA5MUVd8Z9zpVasZx+N1RrO0H0DzQRbX9DfzJXkGaWn73W2WpwySIlsDJyRRl/rYj xMKAkDiMwC4zz6r9+qiUhV3DDMLDbbgIBGzYpD9WJBcdOLt1uaUwrp2WkRiTegNitpen KYmDseBv7RgeicBySGAbTs6FJwPTPnKhTZuD2vUmagz8tcmo5F0Psu5OZF1Qd0l1r9gF SrNyXS34dIgrrmVom1/g7ObLbvhyrH6RNEvfjrx3zLRShr3k4dAZ3LJh/MbCok6j8Kiu njKoiTLFaAFQF7NZx5ttQOJkKGYL1GqAEalJYL6E48OiDxMKNX4an/o5nrfQFgHOTG6I TT5g== X-Gm-Message-State: APzg51AEcbmi+6bsICXI0+2PrTfuWPdgjH0U63kHJeeuV3rMo+T7Ybrv dPstGD0NaHCXQOuJ+xEMMXTwiw== X-Received: by 2002:a50:cd58:: with SMTP id d24-v6mr62278074edj.1.1537394737024; Wed, 19 Sep 2018 15:05:37 -0700 (PDT) Received: from prevas-ravi.waoo.dk (dhcp-5-186-115-161.cgn.ip.fibianet.dk. [5.186.115.161]) by smtp.gmail.com with ESMTPSA id a9-v6sm2798edi.26.2018.09.19.15.05.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Sep 2018 15:05:36 -0700 (PDT) From: Rasmus Villemoes To: Jason Baron , Andrew Morton Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , x86@kernel.org Subject: [PATCH 21/22] x86: jump_label: introduce ASM_STATIC_KEY_INIT_{TRUE,FALSE} Date: Thu, 20 Sep 2018 00:04:43 +0200 Message-Id: <20180919220444.23190-22-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180919220444.23190-1-linux@rasmusvillemoes.dk> References: <20180919220444.23190-1-linux@rasmusvillemoes.dk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These will be useful when defining the contents of (a struct containing) a static key in inline assembly. Cc: x86@kernel.org Signed-off-by: Rasmus Villemoes --- arch/x86/include/asm/jump_label.h | 18 ++++++++++++++++++ include/linux/jump_label.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h index 8c0de4282659..2736f7ff6806 100644 --- a/arch/x86/include/asm/jump_label.h +++ b/arch/x86/include/asm/jump_label.h @@ -110,4 +110,22 @@ struct jump_entry { #endif /* __ASSEMBLY__ */ +#ifdef CONFIG_X86_64 +#define ASM_STATIC_KEY_INIT_TRUE \ + "\t.long 1 \t# .enabled\n" \ + "\t.long 0 \t# \n" \ + "\t.quad "__stringify(__JUMP_TYPE_TRUE)"\t# .type\n" +#define ASM_STATIC_KEY_INIT_FALSE \ + "\t.long 0 \t# .enabled\n" \ + "\t.long 0 \t# \n" \ + "\t.quad "__stringify(__JUMP_TYPE_FALSE)"\t# .type\n" +#else +#define ASM_STATIC_KEY_INIT_TRUE \ + "\t.long 1 \t# .enabled\n" \ + "\t.long "__stringify(__JUMP_TYPE_TRUE)"\t# .type\n" +#define ASM_STATIC_KEY_INIT_FALSE \ + "\t.long 0 \t# .enabled\n" \ + "\t.long "__stringify(__JUMP_TYPE_FALSE)"\t# .type\n" +#endif + #endif diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 1a0b6f17a5d6..6e98193ae708 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h @@ -132,6 +132,8 @@ struct module; #ifdef HAVE_JUMP_LABEL +#define __JUMP_TYPE_FALSE 0 +#define __JUMP_TYPE_TRUE 1 #define JUMP_TYPE_FALSE 0UL #define JUMP_TYPE_TRUE 1UL #define JUMP_TYPE_LINKED 2UL -- 2.16.4