Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1848436imw; Sat, 16 Jul 2022 16:47:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t3Q5+2d6cVxbsLQnOHy6NV+9g4o/8J95TenH5W8L0+XFKV8JNS66k8XxPmN3D0yEVy63yV X-Received: by 2002:a17:907:1b06:b0:6fe:b48d:801f with SMTP id mp6-20020a1709071b0600b006feb48d801fmr19983070ejc.322.1658015271754; Sat, 16 Jul 2022 16:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658015271; cv=none; d=google.com; s=arc-20160816; b=GWyOuPz0P6mWyDq9wSrSrhps2KhQos7OghQHjyJTI28deLL/8LwDC7NlIqjVL8ErPF JuT1VgijiZtWyGysw/muGxPLPPTz7hphTbpnz6zcR1Ruw+9QO2PqsxLDsXQY4WFOMWyG G5YiO73ZCLwaZzM3ySyzfEAj+U+QZqDtDfUEKhCw/PpdQ/WgSMTT6dy2AaXRXX4bwr2Q fu63xLrHxLX0ES8ykVGd6zcwIhFvxDUrD1HfIOLuCoo6LOM7NpqLhpXoeCj3tf6U4kGT mCy7aXlizF73lnXyHfO0t7u27V9t+GHumRc4xLBQQAiOgIn/FTuk8BoZGlJ2PlCyPNXm dIbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=oPPu+jFTcgeESCfOqjttTTcYWEzNGD5UiaAKckbHmr0=; b=AaGdiX95NZQgHqjkQXIdna/xxiH31u37c7Xztj7RVUsYRLBaI5dfNpwqpx5uFIJS4B 679S6pGUvbpuQ2fGgITxibo3kL5ngun6vJGcbjuZM4VqMFDAMrru8XNSTP1NPYNNszUR S8ehqcL8WSEKV0VRwwDU75mNDAqI8KBa7f0RtCgxegNKM1PpFzTI6lx2J42i69KA9vau MUyx3Z/1PmEgc/HM20ZDhmCLQm8QnGaaFKErx58veLnDagGgXTifqeWlUv7FVwB+a6du 5lpoFN1k6Sp0kPkYt29zIUEvSFf9YlT3lXkPTf0S24WTxHDV8fxcamsxc51nUaJ5wGDG Aukg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=pIV9Yx9m; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="i/kNQGMQ"; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n4-20020a170906378400b00726c7fc61d6si9972434ejc.851.2022.07.16.16.47.27; Sat, 16 Jul 2022 16:47:51 -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=@linutronix.de header.s=2020 header.b=pIV9Yx9m; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="i/kNQGMQ"; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233221AbiGPXSy (ORCPT + 99 others); Sat, 16 Jul 2022 19:18:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233128AbiGPXSC (ORCPT ); Sat, 16 Jul 2022 19:18:02 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9762523BF1 for ; Sat, 16 Jul 2022 16:17:49 -0700 (PDT) Message-ID: <20220716230953.977047812@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1658013465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=oPPu+jFTcgeESCfOqjttTTcYWEzNGD5UiaAKckbHmr0=; b=pIV9Yx9mr7gx9fADTXXrnpkLGro7vX+pdJsuS/V4ImbfKmT/4IYDH0nMKD8EQsr3cyWByN nbGSlcu2S3JV7Z9Z2xq3EV16WiBKO9Tj0qT0hYqqQIgXLbSSqwFEf1JMiCUYBwB+v09Agr 53N6Kd094/Jw555/M/KAfP3BvkwaZUjq4mz4Q/fn+WrJnco8EMfMvHaNrOdlGMQeSDeXh2 oeZT4TUSAK9FYJ5093NRAMLHCf3v2toOlpQ54hC+Mp6IJXotQKHpcr4gHXXlS2qHAxoux1 EquiMkZ6DX8Xty2zX2YUXONfRy2JSatfpKmKpFqN7wduwZzNMrTQWWkTeJ3jmA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1658013465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=oPPu+jFTcgeESCfOqjttTTcYWEzNGD5UiaAKckbHmr0=; b=i/kNQGMQ1jH4nLjWWcOmPYC1HlRpD49P2EDwpgi0S2rlHT5JqmIlI5vVNR90A33ob7uFrq gVpEgyyvvchGY+Bw== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Linus Torvalds , Tim Chen , Josh Poimboeuf , Andrew Cooper , Pawan Gupta , Johannes Wikner , Alyssa Milburn , Jann Horn , "H.J. Lu" , Joao Moreira , Joseph Nuzman , Steven Rostedt Subject: [patch 22/38] x86/paravirt: Make struct paravirt_call_site unconditionally available References: <20220716230344.239749011@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Sun, 17 Jul 2022 01:17:45 +0200 (CEST) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 For the upcoming call thunk patching it's less ifdeffery when the data structure is unconditionally available. The code can then be trivially fenced off with IS_ENABLED(). Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/paravirt.h | 4 ++-- arch/x86/include/asm/paravirt_types.h | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -4,13 +4,13 @@ /* Various instructions on x86 need to be replaced for * para-virtualization: those hooks are defined here. */ +#include + #ifdef CONFIG_PARAVIRT #include #include #include -#include - #ifndef __ASSEMBLY__ #include #include --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -2,6 +2,17 @@ #ifndef _ASM_X86_PARAVIRT_TYPES_H #define _ASM_X86_PARAVIRT_TYPES_H +#ifndef __ASSEMBLY__ +/* These all sit in the .parainstructions section to tell us what to patch. */ +struct paravirt_patch_site { + u8 *instr; /* original instructions */ + u8 type; /* type of this instruction */ + u8 len; /* length of original instruction */ +}; +#endif + +#ifdef CONFIG_PARAVIRT + /* Bitmask of what can be clobbered: usually at least eax. */ #define CLBR_EAX (1 << 0) #define CLBR_ECX (1 << 1) @@ -584,16 +595,9 @@ unsigned long paravirt_ret0(void); #define paravirt_nop ((void *)_paravirt_nop) -/* These all sit in the .parainstructions section to tell us what to patch. */ -struct paravirt_patch_site { - u8 *instr; /* original instructions */ - u8 type; /* type of this instruction */ - u8 len; /* length of original instruction */ -}; - extern struct paravirt_patch_site __parainstructions[], __parainstructions_end[]; #endif /* __ASSEMBLY__ */ - +#endif /* CONFIG_PARAVIRT */ #endif /* _ASM_X86_PARAVIRT_TYPES_H */