Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3158482imm; Fri, 10 Aug 2018 04:54:49 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzRbHl45uPNnzxLHAe1dXTGvZjUgb5j2fW2EHDdbyni4xzNwd64Wr/O9lH6bZRhh+X9YMFy X-Received: by 2002:a63:d244:: with SMTP id t4-v6mr6268412pgi.335.1533902089122; Fri, 10 Aug 2018 04:54:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533902089; cv=none; d=google.com; s=arc-20160816; b=YOU6ppRpqnfO4gPepAzsApmba//EtZDcPJHvwQArY1I887/P7JNYSbUw6EofUFhc/n E2ADDefHasoop4iMgokuXIOfIYEXJQiUmhBRsVUGylxPBX8rNlmrTIeUkM/WVn7/Yjzu BKruqm1SsAfdW3fRO7MKHgJuruYqNC0FNv4zQ1Jzd0cQAihaEcpYCgdxBjOfwt3r8K+O uM0FGWK5frXmDLqhETRrnVgC7CcDrlb1l4rrjlqH+174ljab7RPvBejQnfhXjdLsAbt5 ku6WIO4i82fehvx1EJU9PQML8xKAJlLtKvHAl7k1AFm02CSoDIoSRO9rVOCdaRooSFqt GhSw== 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:arc-authentication-results; bh=U4G5Jxiqq75Ss0PSMCgE44wXpSwTZoJJRKtTbgK8RR0=; b=NhQ4EIjHALjne9m5joBimRAz5SIKbUU+Eoj9q4EDAgLf7g1wAh8rfHaKnFQjQZApBV vW+cFk7nsCK9XOiwN4bxEo+nGzQB2ek9+4ZkDQiA+SJVtsEWhVNxhKOdsk7ZNK4lTpwh ug9ZmHjU+WSEU6PZVajdES9Bhz2wXZnq/NPBlSsy7G6YOJbgXVVEbVN3tVbBqqPgAo2R ok6rdfM+rH/5B0e57kfsSThjPvi9zfrdQ0WDRi7wupTCqmpqjdMefcv9QGmCe+/mqpwF nq6xvZ0KuxdNeb1ngfkPrszesIvP+Bj4rJ2cookkJBf5rSWz5lzeHkSCxZMkVORwJlE9 3Kaw== ARC-Authentication-Results: i=1; mx.google.com; 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 s10-v6si9578369pgm.501.2018.08.10.04.54.34; Fri, 10 Aug 2018 04:54:49 -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; 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 S1728059AbeHJOWi (ORCPT + 99 others); Fri, 10 Aug 2018 10:22:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:38772 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727666AbeHJOWh (ORCPT ); Fri, 10 Aug 2018 10:22:37 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2B83CAECD; Fri, 10 Aug 2018 11:52:59 +0000 (UTC) From: Juergen Gross To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org, virtualization@lists.linux-foundation.org Cc: akataria@vmware.com, rusty@rustcorp.com.au, boris.ostrovsky@oracle.com, hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com, Juergen Gross Subject: [PATCH 09/10] x86/paravirt: move the Xen-only pv_irq_ops under the PARAVIRT_XXL umbrella Date: Fri, 10 Aug 2018 13:52:51 +0200 Message-Id: <20180810115252.18213-10-jgross@suse.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20180810115252.18213-1-jgross@suse.com> References: <20180810115252.18213-1-jgross@suse.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some of the paravirt ops defined in pv_irq_ops are for Xen PV guests only. Define them only if CONFIG_PARAVIRT_XXL is set. Signed-off-by: Juergen Gross --- arch/x86/include/asm/irqflags.h | 38 ++++++++++++++++++----------------- arch/x86/include/asm/paravirt.h | 2 -- arch/x86/include/asm/paravirt_types.h | 2 ++ arch/x86/kernel/paravirt.c | 2 ++ 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h index 03bb451e4e6b..205e43e55144 100644 --- a/arch/x86/include/asm/irqflags.h +++ b/arch/x86/include/asm/irqflags.h @@ -88,24 +88,6 @@ static inline notrace void arch_local_irq_enable(void) } /* - * Used in the idle loop; sti takes one instruction cycle - * to complete: - */ -static inline __cpuidle void arch_safe_halt(void) -{ - native_safe_halt(); -} - -/* - * Used when interrupts are already enabled or to - * shutdown the processor: - */ -static inline __cpuidle void halt(void) -{ - native_halt(); -} - -/* * For spinlocks, etc: */ static inline notrace unsigned long arch_local_irq_save(void) @@ -154,6 +136,26 @@ static inline notrace unsigned long arch_local_irq_save(void) #define INTERRUPT_RETURN iret #endif +#else + +/* + * Used in the idle loop; sti takes one instruction cycle + * to complete: + */ +static inline __cpuidle void arch_safe_halt(void) +{ + native_safe_halt(); +} + +/* + * Used when interrupts are already enabled or to + * shutdown the processor: + */ +static inline __cpuidle void halt(void) +{ + native_halt(); +} + #endif /* __ASSEMBLY__ */ #endif /* CONFIG_PARAVIRT_XXL */ diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index bc9a72a767c8..220c13d7e846 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -91,7 +91,6 @@ static inline void write_cr8(unsigned long x) PVOP_VCALL1(pv_cpu_ops.write_cr8, x); } #endif -#endif static inline void arch_safe_halt(void) { @@ -103,7 +102,6 @@ static inline void halt(void) PVOP_VCALL0(pv_irq_ops.halt); } -#ifdef CONFIG_PARAVIRT_XXL static inline void wbinvd(void) { PVOP_VCALL0(pv_cpu_ops.wbinvd); diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h index be356aacc82c..938ac2bece81 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -197,8 +197,10 @@ struct pv_irq_ops { struct paravirt_callee_save irq_disable; struct paravirt_callee_save irq_enable; +#ifdef CONFIG_PARAVIRT_XXL void (*safe_halt)(void); void (*halt)(void); +#endif } __no_randomize_layout; diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 437be9454cab..19bfb3d2083f 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -379,8 +379,10 @@ struct paravirt_patch_template pv_ops = { .pv_irq_ops.restore_fl = __PV_IS_CALLEE_SAVE(native_restore_fl), .pv_irq_ops.irq_disable = __PV_IS_CALLEE_SAVE(native_irq_disable), .pv_irq_ops.irq_enable = __PV_IS_CALLEE_SAVE(native_irq_enable), +#ifdef CONFIG_PARAVIRT_XXL .pv_irq_ops.safe_halt = native_safe_halt, .pv_irq_ops.halt = native_halt, +#endif /* Mmu ops. */ .pv_mmu_ops.read_cr2 = native_read_cr2, -- 2.13.7