Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4722618imm; Tue, 9 Oct 2018 04:22:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV63tao7b3SQg2b97VaAGn6yzlT1aH3oSdTXTAKrkb+Vy66yweqk371GInOvG4eVUkZ7nPh9b X-Received: by 2002:a63:d256:: with SMTP id t22-v6mr24929848pgi.335.1539084137937; Tue, 09 Oct 2018 04:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539084137; cv=none; d=google.com; s=arc-20160816; b=MKEgtqLfFzwjqdHh+MhOjbMkqSQgShEtUEsAoKGmPqyQvou06PilOvQ3YpmZkNsQTV VL53h3WCrN51atAPjKkRut8Wgf/88PiePsDtO53n1DNfagrUtJqwccsd/TOrAQ4Tdom2 l1jfCpf6MgAsIN8KHci1Uz/0hlWF9dsQ/dveoLyqJQYC7Q8/J2kZd0fdFm39lNoSWwB5 iiTkp1Mh18OlwKuAGJb/bH0q5yvklgjq+Ahq+J6NU7j8RxxDnJZlKBG8lemCppSfi2yr m4awM4MqRzaSOI8bte7AIXSjH7DNvNgy5CpAoTAkUKV38PccB/jgP1tAl4D7KDD59YTc najQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SK6y8mbEDUn37gsfEq2QEfc4KllYlfae2KjxIwGnhy0=; b=Q28q8wPZrimKvulEBtCIbGT+OKLUPmIlF5i/UXEzHKi+7K8g1pvrJ/GxMgNWYv1APO NowuyvY+38igV/nma7uhdX+R+pg/yyL0z9nP6QQIkibXCAC7PF3LQXLjG/Gimnx0sJIJ V7NYcFzVY6w2V9P7ehbS2JnDOiVAQUx7lKCEGlbsO7fWogsUR/ULuveE1EmplN36ZcH9 CjRq5HDfZ+vue9sqhF+DKx6o/rgH3Yniaflr8clqLJNoAFexjvSZQnZ2sAkkM+6XN9e5 Ez/CaKSpD7hywkxFph9BQV5hkqZtH2zZU5XjfzuX6oTfkIMoWvFid/0pORlqmNzsQ8Ci mg+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=cStqMdDy; 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 i5-v6si21764789pgn.314.2018.10.09.04.22.03; Tue, 09 Oct 2018 04:22:17 -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=cStqMdDy; 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 S1727697AbeJIShN (ORCPT + 99 others); Tue, 9 Oct 2018 14:37:13 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:42172 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727649AbeJIShM (ORCPT ); Tue, 9 Oct 2018 14:37:12 -0400 Received: by mail-ed1-f65.google.com with SMTP id b7-v6so1311364edd.9 for ; Tue, 09 Oct 2018 04:20:42 -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 :mime-version:content-transfer-encoding; bh=SK6y8mbEDUn37gsfEq2QEfc4KllYlfae2KjxIwGnhy0=; b=cStqMdDypl71roOta5TwnHB+sEF6cxua632QN2sO09wJsV0DO5aCkpcpKaHNijj6Kz BcvKdBHUnRz+vO2HwkNh5NKJgBbREWrPqCbHzJzzBvILqoem/eTXJ6/BEBtlZcJBtdWF Vyt/uVWAo91o9oeEMIQxyLeI96Lf45x/N87Zw= 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:mime-version:content-transfer-encoding; bh=SK6y8mbEDUn37gsfEq2QEfc4KllYlfae2KjxIwGnhy0=; b=bVwvWLjHv32znA0mEhYhtndfaoQtczp+WBVxcAL8GbpLd11Rlw0ftxiE+GeuprmSNT i0nF27vQBFFVcH72Xp1nBztEsBZbZ82QY1s1gSk7NnJ44nF/tr+oc6Z8MS1jCOyf/I3B tPgF9FArp0tF0NiYM985AONyxtr5CL1AxL6kYV+EfObFdLoHZG1rKVHO8WFfrKniNMZb DvqLYuGwtqxh4+rehHGzVY64Yd24sN0u8saBa4q0jz4pL5ZLqL756xRY+d6ZmlmVDrXA 9wjdQSLDoj98tt5C+lRhCTSv2qLbcmVhnjy5ucM/BLfN7/oZCF7tsMksS8aCxoob86mL xbJQ== X-Gm-Message-State: ABuFfojPYU5EVwVXdKa9+IfbhGmgnXiLMx2avwgjoGhJbhj67NjYMBzY /GCDKKsXeRUlUtJW9JSyrf4b1g== X-Received: by 2002:a17:906:2a88:: with SMTP id l8-v6mr27720938eje.236.1539084041780; Tue, 09 Oct 2018 04:20:41 -0700 (PDT) Received: from prevas-ravi.vestasvisitor.net ([193.47.71.171]) by smtp.gmail.com with ESMTPSA id n23-v6sm3595821eja.41.2018.10.09.04.20.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Oct 2018 04:20:41 -0700 (PDT) From: Rasmus Villemoes To: Jason Baron , Andrew Morton Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , x86@kernel.org, Ingo Molnar Subject: [PATCH v2 21/23] x86: jump_label: introduce ASM_STATIC_KEY_INIT_{TRUE,FALSE} Date: Tue, 9 Oct 2018 13:20:11 +0200 Message-Id: <20181009112013.14238-22-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.19.1.4.g721af0fda3 In-Reply-To: <20181009112013.14238-1-linux@rasmusvillemoes.dk> References: <20180919220444.23190-1-linux@rasmusvillemoes.dk> <20181009112013.14238-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ingo Molnar Acked-by: Jason Baron 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.19.1.3.g1d92a00e68