From patchwork Wed Aug 3 11:36:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 655366 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3s4BKf232Mz9t1d for ; Wed, 3 Aug 2016 21:53:26 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=lZGhRYS2; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753185AbcHCLxZ (ORCPT ); Wed, 3 Aug 2016 07:53:25 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34507 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753044AbcHCLxX (ORCPT ); Wed, 3 Aug 2016 07:53:23 -0400 Received: by mail-wm0-f68.google.com with SMTP id q128so35945827wma.1; Wed, 03 Aug 2016 04:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=InKo71/fVjRrRIh+vUZcBH/DajZ2o8gfnFfGh/NbMak=; b=lZGhRYS2IbQQbOjs85d7UsukSRtw+vu034G3cPGCgwVT2eIwZiYvNZq9Tu3Cog1T8A 7VPPleAD45S2dF3BHw/Pmf8l6rdgmJSia98GkIi34wR32smrx1O1hsswa8qmmOTcUD62 hQaFghbg/sT0gMbRDmaxDkoC4duc2zUCp/cCewbwNeAF0W3ZzWW4OcRmdRunhtuMDGMQ DyZcXhu8GVaZS7CI4HMd7n/hrzigId0eaFrKM4tZD86IYuo3tD/8tkVh94oxNIZhoWqo IcOjIhC0DIC2KTolW2adW9hMYKICPSCoySIWkg7mZOH/5NVWgfpZKL/Aa+8jDep/dfOU FBNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=InKo71/fVjRrRIh+vUZcBH/DajZ2o8gfnFfGh/NbMak=; b=A6DbO2OHKGcnyzOGuBcGF3ZUs9fUkSnWVQZ8X2g0c3cHNRlxZcL2YfLH1m4m4Isjlh TufioX12K8xfrtwac2BCew8/KypLD5y1CIXth1uxtAYDISt5aK35/xaLNQdb0qTl4LrI INT+Ig4ZvcD8wTftH1HWXlPxTPemK6mxcbTp/yducsBxDEoy1GaTA4YYrfBuCKlMEHfE 4kyNY42zcVvtk4Za2MzU9EpGElpcKqHyGPslKhYdkFP4PS4ZbZV3nKaSAIr4OsMj45iP fTbH8Yhhb2pSMyGem8nSo2uGL48Fp5MzKUG015sh/BE561jFgmVTw4sdySkciJrOfPWP ZxFg== X-Gm-Message-State: AEkoousoOuJZq4HHajBM+hZBxGQtrbExmG/tMXPlmLAibkYNSpQ2xvZN5tlnKwkQClOWaA== X-Received: by 10.194.133.200 with SMTP id pe8mr59117578wjb.14.1470224198662; Wed, 03 Aug 2016 04:36:38 -0700 (PDT) Received: from donizetti.lan (94-39-152-88.adsl-ull.clienti.tiscali.it. [94.39.152.88]) by smtp.gmail.com with ESMTPSA id d80sm26794677wmd.14.2016.08.03.04.36.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Aug 2016 04:36:37 -0700 (PDT) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paul Mackerras , Michael Ellerman , Mahesh Salgaonkar , linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org Subject: [PATCH] powerpc: move hmi.c to arch/powerpc/kvm/ Date: Wed, 3 Aug 2016 13:36:34 +0200 Message-Id: <1470224194-15412-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 2.7.4 Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org hmi.c functions are unused unless sibling_subcore_state is nonzero, and that in turn happens only if KVM is in use. So move the code to arch/powerpc/kvm/, putting it under CONFIG_KVM_BOOK3S_64_HANDLER rather than CONFIG_PPC_BOOK3S_64. The sibling_subcore_state is also included in struct paca_struct only if KVM is supported by the kernel. Cc: Paul Mackerras Cc: Michael Ellerman Cc: Mahesh Salgaonkar Cc: linuxppc-dev@lists.ozlabs.org Cc: kvm-ppc@vger.kernel.org Cc: kvm@vger.kernel.org Signed-off-by: Paolo Bonzini Reviewed-by: Daniel Axtens --- It would be nice to have this in 4.8, to minimize any 4.9 conflicts. Build-tested only, with and without KVM enabled. arch/powerpc/include/asm/hmi.h | 2 +- arch/powerpc/include/asm/paca.h | 10 +++++----- arch/powerpc/kernel/Makefile | 2 +- arch/powerpc/kvm/Makefile | 1 + arch/powerpc/{kernel/hmi.c => kvm/book3s_hv_hmi.c} | 0 5 files changed, 8 insertions(+), 7 deletions(-) rename arch/powerpc/{kernel/hmi.c => kvm/book3s_hv_hmi.c} (100%) diff --git a/arch/powerpc/include/asm/hmi.h b/arch/powerpc/include/asm/hmi.h index 88b4901ac4ee..d3b6ad6e137c 100644 --- a/arch/powerpc/include/asm/hmi.h +++ b/arch/powerpc/include/asm/hmi.h @@ -21,7 +21,7 @@ #ifndef __ASM_PPC64_HMI_H__ #define __ASM_PPC64_HMI_H__ -#ifdef CONFIG_PPC_BOOK3S_64 +#ifdef CONFIG_KVM_BOOK3S_64_HANDLER #define CORE_TB_RESYNC_REQ_BIT 63 #define MAX_SUBCORE_PER_CORE 4 diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h index 148303e7771f..625321e7e581 100644 --- a/arch/powerpc/include/asm/paca.h +++ b/arch/powerpc/include/asm/paca.h @@ -183,11 +183,6 @@ struct paca_struct { */ u16 in_mce; u8 hmi_event_available; /* HMI event is available */ - /* - * Bitmap for sibling subcore status. See kvm/book3s_hv_ras.c for - * more details - */ - struct sibling_subcore_state *sibling_subcore_state; #endif /* Stuff for accurate time accounting */ @@ -202,6 +197,11 @@ struct paca_struct { struct kvmppc_book3s_shadow_vcpu shadow_vcpu; #endif struct kvmppc_host_state kvm_hstate; + /* + * Bitmap for sibling subcore status. See kvm/book3s_hv_ras.c for + * more details + */ + struct sibling_subcore_state *sibling_subcore_state; #endif }; diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index b2027a5cf508..fe4c075bcf50 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -41,7 +41,7 @@ obj-$(CONFIG_VDSO32) += vdso32/ obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_ppc970.o cpu_setup_pa6t.o obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_power.o -obj-$(CONFIG_PPC_BOOK3S_64) += mce.o mce_power.o hmi.o +obj-$(CONFIG_PPC_BOOK3S_64) += mce.o mce_power.o obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o idle_book3e.o obj-$(CONFIG_PPC64) += vdso64/ obj-$(CONFIG_ALTIVEC) += vecemu.o diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile index 1f9e5529e692..855d4b95d752 100644 --- a/arch/powerpc/kvm/Makefile +++ b/arch/powerpc/kvm/Makefile @@ -78,6 +78,7 @@ kvm-book3s_64-builtin-xics-objs-$(CONFIG_KVM_XICS) := \ ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \ + book3s_hv_hmi.o \ book3s_hv_rmhandlers.o \ book3s_hv_rm_mmu.o \ book3s_hv_ras.o \ diff --git a/arch/powerpc/kernel/hmi.c b/arch/powerpc/kvm/book3s_hv_hmi.c similarity index 100% rename from arch/powerpc/kernel/hmi.c rename to arch/powerpc/kvm/book3s_hv_hmi.c