From patchwork Tue Aug 2 04:03:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Jitindar Singh X-Patchwork-Id: 654492 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 3s3My32RgNz9t2m for ; Tue, 2 Aug 2016 14:03:39 +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=tNULs2xE; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751121AbcHBEDi (ORCPT ); Tue, 2 Aug 2016 00:03:38 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:36610 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750705AbcHBEDh (ORCPT ); Tue, 2 Aug 2016 00:03:37 -0400 Received: by mail-pa0-f67.google.com with SMTP id ez1so11069181pab.3; Mon, 01 Aug 2016 21:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Wc/pewYCa6nWhh5Bqu5OM3a8AcypMCMkN2qpRuKwSn0=; b=tNULs2xEhQ6V/7m7dJOAKM9E+7iuZ6u/7K/nV2gmxkdyf4xgkEByQ6HjDjl0K8tb08 w+yfQB5VVp49Bn3rL+sEdyxm2l7bw/vRniCTw/4pr8g1Y2e3zkK9zbLatL3thJRmaqtt Tweq5fRnlrPj1gDd2ZiuB2fBJJcNNPUNH90YpyHrEZtiIm5DDd3haFiDEBbzC9Apod/l cWIA8YMaltfjQa5dGu8N4PMtLoqiRsOlBw7mL2pCtncSWDYt6s4Fo43xw3gq9ZwGIG8U 0Bk3B7ijic/D31JunLjc5RqecKNxDqFP8k9V6lMJfRHcpD9coPewyybkNHZyHE95mVte rDIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Wc/pewYCa6nWhh5Bqu5OM3a8AcypMCMkN2qpRuKwSn0=; b=UkzY5c4wa1WTHk8XQOlnzyLIR6i3H3MGsznxoBB9ijKVoHVEyfWV2oAXSZNbQFw7sb gUr5IhkXc0/URDdkjbK7hcMhVEBzsjgGDHSIKFjMdSWVUGEOrsFVu4HWempLT18NkuGd EUqVDQmhVqBOzcg1vn6hbBdwsJjnjC2RC/GQ2s9oBDUjLBXlwW+rGuz+DqdoSCWrQb53 LyLWQDU2Af17EKREptB/om44Z1DG3sxLkqi6lj8710moIStoQ+ARTj26SSbl+UW9q6ZK vmd7xV2fRqYsVBlSCDqxjg9u9GSgIKpyenZj2qfzEIOk5twgLnikLkwFSHjgi00Y+q62 wXvQ== X-Gm-Message-State: AEkoousJb41mGp54b2oVmcW1BtO9b/zqCxRlF+OkqVe2SJaBB2uB1cfiwWOu6+zywSS9oA== X-Received: by 10.66.43.164 with SMTP id x4mr2647535pal.11.1470110616077; Mon, 01 Aug 2016 21:03:36 -0700 (PDT) Received: from dyn253.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id e2sm578351pfd.45.2016.08.01.21.03.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Aug 2016 21:03:35 -0700 (PDT) From: Suraj Jitindar Singh To: linuxppc-dev@lists.ozlabs.org Cc: sjitindarsingh@gmail.com, kvm-ppc@vger.kernel.org, mpe@ellerman.id.au, paulus@samba.org, benh@kernel.crashing.org, pbonzini@redhat.com, agraf@suse.com, rkrcmar@redhat.com, dmatlack@google.com, borntraeger@de.ibm.com, kvm@vger.kernel.org Subject: [RESEND] [PATCH V5 1/5] kvm/ppc/book3s: Move struct kvmppc_vcore from kvm_host.h to kvm_book3s.h Date: Tue, 2 Aug 2016 14:03:19 +1000 Message-Id: <1470110603-20695-1-git-send-email-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.5.5 Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org The next commit will introduce a member to the kvmppc_vcore struct which references MAX_SMT_THREADS which is defined in kvm_book3s_asm.h, however this file isn't included in kvm_host.h directly. Thus compiling for certain platforms such as pmac32_defconfig and ppc64e_defconfig with KVM fails due to MAX_SMT_THREADS not being defined. Move the struct kvmppc_vcore definition to kvm_book3s.h which explicitly includes kvm_book3s_asm.h. Signed-off-by: Suraj Jitindar Singh --- Change Log: V1 -> V2: - Added patch to series --- arch/powerpc/include/asm/kvm_book3s.h | 35 +++++++++++++++++++++++++++++++++++ arch/powerpc/include/asm/kvm_host.h | 35 ----------------------------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index 8f39796..a50c5fe 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h @@ -69,6 +69,41 @@ struct hpte_cache { int pagesize; }; +/* + * Struct for a virtual core. + * Note: entry_exit_map combines a bitmap of threads that have entered + * in the bottom 8 bits and a bitmap of threads that have exited in the + * next 8 bits. This is so that we can atomically set the entry bit + * iff the exit map is 0 without taking a lock. + */ +struct kvmppc_vcore { + int n_runnable; + int num_threads; + int entry_exit_map; + int napping_threads; + int first_vcpuid; + u16 pcpu; + u16 last_cpu; + u8 vcore_state; + u8 in_guest; + struct kvmppc_vcore *master_vcore; + struct list_head runnable_threads; + struct list_head preempt_list; + spinlock_t lock; + struct swait_queue_head wq; + spinlock_t stoltb_lock; /* protects stolen_tb and preempt_tb */ + u64 stolen_tb; + u64 preempt_tb; + struct kvm_vcpu *runner; + struct kvm *kvm; + u64 tb_offset; /* guest timebase - host timebase */ + ulong lpcr; + u32 arch_compat; + ulong pcr; + ulong dpdes; /* doorbell state (POWER8) */ + ulong conferring_threads; +}; + struct kvmppc_vcpu_book3s { struct kvmppc_sid_map sid_map[SID_MAP_NUM]; struct { diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index ec35af3..19c6731 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h @@ -275,41 +275,6 @@ struct kvm_arch { #endif }; -/* - * Struct for a virtual core. - * Note: entry_exit_map combines a bitmap of threads that have entered - * in the bottom 8 bits and a bitmap of threads that have exited in the - * next 8 bits. This is so that we can atomically set the entry bit - * iff the exit map is 0 without taking a lock. - */ -struct kvmppc_vcore { - int n_runnable; - int num_threads; - int entry_exit_map; - int napping_threads; - int first_vcpuid; - u16 pcpu; - u16 last_cpu; - u8 vcore_state; - u8 in_guest; - struct kvmppc_vcore *master_vcore; - struct list_head runnable_threads; - struct list_head preempt_list; - spinlock_t lock; - struct swait_queue_head wq; - spinlock_t stoltb_lock; /* protects stolen_tb and preempt_tb */ - u64 stolen_tb; - u64 preempt_tb; - struct kvm_vcpu *runner; - struct kvm *kvm; - u64 tb_offset; /* guest timebase - host timebase */ - ulong lpcr; - u32 arch_compat; - ulong pcr; - ulong dpdes; /* doorbell state (POWER8) */ - ulong conferring_threads; -}; - #define VCORE_ENTRY_MAP(vc) ((vc)->entry_exit_map & 0xff) #define VCORE_EXIT_MAP(vc) ((vc)->entry_exit_map >> 8) #define VCORE_IS_EXITING(vc) (VCORE_EXIT_MAP(vc) != 0)