From patchwork Wed Jul 13 08:52:50 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: 647779 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 3rqCMS2yzpz9t0Z for ; Wed, 13 Jul 2016 18:55:00 +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=v4OD+1Nq; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753224AbcGMIyK (ORCPT ); Wed, 13 Jul 2016 04:54:10 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35468 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753187AbcGMIxh (ORCPT ); Wed, 13 Jul 2016 04:53:37 -0400 Received: by mail-pf0-f195.google.com with SMTP id t190so2764586pfb.2 for ; Wed, 13 Jul 2016 01:53:37 -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=j/luOUYb1C2P2sDziJC5l4szKV0QeGAJwh++hN+upTg=; b=v4OD+1NqNeQ91A7wJ0z7oGbjayb/Rmy+t5uubOV2nm4upjDqtXkXkXgrc/zlBXGlag Pa2zs7d94YIaLj5vpxNIS0kfWPA3csAPIbHFtPtjsdB6tqHjXNnFdzpAmAu8epdsZj1u JxE9NCudqs3An7jssKGUVPKZ4NCvQtg+mRK9j57X5lqWPosDHJ1RKtKdK196k8yWoo4x jhn3TkEpFf+rO7d4WIeIJC7yYuaKNbehPTLmZ1yhaCjn0uw1oJ87UDOhiNoORjZtsv6y 0r9S0HIp5Ss+y3KIZ8ojwrCViGfcl64Psz+Wgw06ewmf8fDgIt9YqYchliOimL9K3rOR j6+Q== 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=j/luOUYb1C2P2sDziJC5l4szKV0QeGAJwh++hN+upTg=; b=Ij5rLE3d26WyEsmb3KW3Ibz+GqA9hcNVF+Z7vJzjWVgfjNnRY9FpvwXNz851gPdHK0 4M4T0MtmYimRw4qeHMwNCAvNn35W+wxncL/X33Vh4dsR3+2l5LA6g4ixUfR5wvWayYZD 7NsyBIuBPLFOCZLZUP4JMePFWJ9ETXZXWHzNn8mMoc+8P85gcMmkGolm/XNQ8OCdBtKh maOp9ht1rsJiNj6H/ynKNQM8GBvlDcnVaXttmgpIALOFRZSvWBohh2p4xNFhwfUPOiLd VzsQXcz/L/OAGSJ478hmJYy/srn670ACIBMT/usZSLyhIrOD+3fcM2oapsW+KcwNjJGE r/3g== X-Gm-Message-State: ALyK8tIi9CEXzt7sbEkCifDY2xGKRSo06pX/meNmrrbXccQ8gcFFi/S46SyTqWLvp4s1qw== X-Received: by 10.98.18.221 with SMTP id 90mr1515163pfs.3.1468399997215; Wed, 13 Jul 2016 01:53:17 -0700 (PDT) Received: from dyn253.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id ql1sm3180806pac.2.2016.07.13.01.53.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 01:53:16 -0700 (PDT) From: Suraj Jitindar Singh To: linuxppc-dev@lists.ozlabs.org Cc: sjitindarsingh@gmail.com, pbonzini@redhat.com, rkrcmar@redhat.com, agraf@suse.com, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, kvm-ppc@vger.kernel.org Subject: [PATCH V3 1/5] kvm/ppc/book3s: Move struct kvmppc_vcore from kvm_host.h to kvm_book3s.h Date: Wed, 13 Jul 2016 18:52:50 +1000 Message-Id: <1468399972-4558-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. --- Change Log: V1 -> V2: - Added patch to series V2 -> V3: - Nothing Signed-off-by: Suraj Jitindar Singh --- 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)