Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp177464pxb; Fri, 15 Oct 2021 03:20:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7cXJHJniXLhg0hTnriZvyznmMNqNMKP2dbAMPUYpjUAAsL7P4+0Bdn3FHLrcIfDGM6e6W X-Received: by 2002:aa7:8010:0:b0:44c:9d9:ecc with SMTP id j16-20020aa78010000000b0044c09d90eccmr10825438pfi.39.1634293252195; Fri, 15 Oct 2021 03:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634293252; cv=none; d=google.com; s=arc-20160816; b=pt+tJ2rYjtujPIxB5uaDcltzEwrv9xJR7nxoZR2bYQym/kP7wSAVoyf4kRzwttmQ3O BWzKm/pWQmidzhTyFUkdpBBH4GL5NVPxbyr1G8jhx3EOb/mePYlCjyem8WWGsvIEVaBB 7FnByv5zSYYSTM75SlufGh1bj0sU4ezkS1Jh52XNL5/+NIyGE6xizVqOXBzPfNJsUQBx 2JZ2S+mKou8z5g3O4nG15BnYcN7EtpvU0FLqOdRw7JHsTPPzDbIoDJqxn7gJ5BfTMbZA m31iGG+cfnmDaV33V6Vm1tT/FSkpG1KzbSX2B/BO1Z+4uZy4Vuk+dcooDnyf/MP8wij7 nqgQ== 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=hx/pIt3bXp8CbN6mt/mxogSML+lH+MiBhjTh9wH9cQs=; b=iGJzcmTmtjoQVp9ejTNrzU1VcntT4+fjcEBhqwTaY2u0i6es0gMVI0L6RY3kMjMBSp gieTdBosyF9uuifQllS3cOEuxe3vNCqzJtCm0gTMQjKsMK+BtwYitdVeWvRWGfVMVquJ 3IkH13PLeLYixOm+sCoEl36yibUKdnfjHIbC10XsweTf88Ktd0Gm9p8eC1pAQcE6owiN pnUwLOHhJRz0iqrHYC5GC53M4RHN7ZcnHXxJDoquzWMlPFWleu1p/ZOCuVlgwpLjpMDP AtfcC2GMWLRAKPe0s31JmzIAnN1dUsbxTRcc/Ee3IN+dn3JMPlCVIcGmqFAZ++DvDqN8 KXag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SscN3BvH; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="9jUf8OC/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si8160060plz.416.2021.10.15.03.20.38; Fri, 15 Oct 2021 03:20:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SscN3BvH; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="9jUf8OC/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S235123AbhJOBTe (ORCPT + 99 others); Thu, 14 Oct 2021 21:19:34 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:46628 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230080AbhJOBSp (ORCPT ); Thu, 14 Oct 2021 21:18:45 -0400 Message-ID: <20211015011539.948837194@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1634260598; 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=hx/pIt3bXp8CbN6mt/mxogSML+lH+MiBhjTh9wH9cQs=; b=SscN3BvHGQfZMD3X2uDjNaaZKCjeIbOn5kV7SigkTf0a6v3nFjliDSekMvuSQRNAlaAKfz EYamYkrCrhRPJ+7DnisXL/IIUu/3txP8S5/cT+Kd1xuG+PtJDG/+cJDGT8XrZhF6/LepA4 zxy5uUAewVP8IXB5FVELG7arGjWCkYF39EV9c33HDVCC8enFn/3ahbH04Se6itqXyRXICU +89mX4bjMXCWr1hIZGw4f+6doyof1iE/juZsEjG+QFxVz3ty2iHHsFegR43JWjQ+5cwYC8 ieJtzT5OkN4OMFeiYF7UIV2U6XZcCMooB1F1XqZL9MxpvLzSr+McxZQzrd/LOg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1634260598; 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=hx/pIt3bXp8CbN6mt/mxogSML+lH+MiBhjTh9wH9cQs=; b=9jUf8OC/+VdtIJJJVDZ1pEAIOFtRedrJQcb4R+NxQjK7VsjVejqiKfvgFzyzvkM88KXJUF jQetQhX3Lm8RvhAg== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, "Chang S. Bae" , Dave Hansen , Arjan van de Ven , kvm@vger.kernel.org, Paolo Bonzini , "Liu, Jing2" , Sean Christopherson , Xiaoyao Li Subject: [patch V2 28/30] x86/fpu: Mop up the internal.h leftovers References: <20211015011411.304289784@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Fri, 15 Oct 2021 03:16:38 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the global interfaces to api.h and the rest into the core. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/fpu/api.h | 10 ++++++++++ arch/x86/include/asm/fpu/internal.h | 18 ------------------ arch/x86/kernel/fpu/init.c | 1 + arch/x86/kernel/fpu/xstate.h | 3 +++ 4 files changed, 14 insertions(+), 18 deletions(-) --- diff --git a/arch/x86/include/asm/fpu/api.h b/arch/x86/include/asm/fpu/api.h index 764f3ae028c1..b68d8ce599e4 100644 --- a/arch/x86/include/asm/fpu/api.h +++ b/arch/x86/include/asm/fpu/api.h @@ -110,6 +110,16 @@ extern int cpu_has_xfeatures(u64 xfeatures_mask, const char **feature_name); static inline void update_pasid(void) { } +/* Trap handling */ +extern int fpu__exception_code(struct fpu *fpu, int trap_nr); +extern void fpu_sync_fpstate(struct fpu *fpu); + +/* Boot, hotplug and resume */ +extern void fpu__init_cpu(void); +extern void fpu__init_system(struct cpuinfo_x86 *c); +extern void fpu__init_check_bugs(void); +extern void fpu__resume_cpu(void); + #ifdef CONFIG_MATH_EMULATION extern void fpstate_init_soft(struct swregs_state *soft); #else diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h index 8f97d3e375de..8df83e887ff6 100644 --- a/arch/x86/include/asm/fpu/internal.h +++ b/arch/x86/include/asm/fpu/internal.h @@ -23,22 +23,4 @@ #include #include -/* - * High level FPU state handling functions: - */ -extern void fpu__clear_user_states(struct fpu *fpu); -extern int fpu__exception_code(struct fpu *fpu, int trap_nr); - -extern void fpu_sync_fpstate(struct fpu *fpu); - -/* - * Boot time FPU initialization functions: - */ -extern void fpu__init_cpu(void); -extern void fpu__init_system_xstate(void); -extern void fpu__init_cpu_xstate(void); -extern void fpu__init_system(struct cpuinfo_x86 *c); -extern void fpu__init_check_bugs(void); -extern void fpu__resume_cpu(void); - #endif /* _ASM_X86_FPU_INTERNAL_H */ diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c index e77084a6ae7c..d420d29e58be 100644 --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -12,6 +12,7 @@ #include "internal.h" #include "legacy.h" +#include "xstate.h" /* * Initialize the registers found in all CPUs, CR0 and CR4: diff --git a/arch/x86/kernel/fpu/xstate.h b/arch/x86/kernel/fpu/xstate.h index ae61baa97682..bb6d7d298d2a 100644 --- a/arch/x86/kernel/fpu/xstate.h +++ b/arch/x86/kernel/fpu/xstate.h @@ -18,6 +18,9 @@ static inline void xstate_init_xcomp_bv(struct xregs_state *xsave, u64 mask) extern void __copy_xstate_to_uabi_buf(struct membuf to, struct xregs_state *xsave, u32 pkru_val, enum xstate_copy_mode copy_mode); +extern void fpu__init_cpu_xstate(void); +extern void fpu__init_system_xstate(void); + /* XSAVE/XRSTOR wrapper functions */ #ifdef CONFIG_X86_64