-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KVM: ppc: create struct kvm_vcpu_44x and introduce container_of() acc…
…essor This patch doesn't yet move all 44x-specific data into the new structure, but is the first step down that path. In the future we may also want to create a struct kvm_vcpu_booke. Based on patch from Liu Yu <yu.liu@freescale.com>. Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
- Loading branch information
Hollis Blanchard
authored and
Avi Kivity
committed
Dec 31, 2008
1 parent
5cbb510
commit db93f57
Showing
9 changed files
with
154 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License, version 2, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* Copyright IBM Corp. 2008 | ||
* | ||
* Authors: Hollis Blanchard <hollisb@us.ibm.com> | ||
*/ | ||
|
||
#ifndef __ASM_44X_H__ | ||
#define __ASM_44X_H__ | ||
|
||
#include <linux/kvm_host.h> | ||
|
||
/* XXX Can't include mmu-44x.h because it redefines struct mm_context. */ | ||
#define PPC44x_TLB_SIZE 64 | ||
|
||
struct kvmppc_vcpu_44x { | ||
/* Unmodified copy of the guest's TLB. */ | ||
struct kvmppc_44x_tlbe guest_tlb[PPC44x_TLB_SIZE]; | ||
/* TLB that's actually used when the guest is running. */ | ||
struct kvmppc_44x_tlbe shadow_tlb[PPC44x_TLB_SIZE]; | ||
/* Pages which are referenced in the shadow TLB. */ | ||
struct page *shadow_pages[PPC44x_TLB_SIZE]; | ||
|
||
/* Track which TLB entries we've modified in the current exit. */ | ||
u8 shadow_tlb_mod[PPC44x_TLB_SIZE]; | ||
|
||
struct kvm_vcpu vcpu; | ||
}; | ||
|
||
static inline struct kvmppc_vcpu_44x *to_44x(struct kvm_vcpu *vcpu) | ||
{ | ||
return container_of(vcpu, struct kvmppc_vcpu_44x, vcpu); | ||
} | ||
|
||
#endif /* __ASM_44X_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.