Hollis Blanchard | bc8080c | 2009-01-03 16:23:10 -0600 | [diff] [blame] | 1 | /* |
Liu Yu | dd9ebf1f | 2011-06-14 18:35:14 -0500 | [diff] [blame] | 2 | * Copyright (C) 2008-2011 Freescale Semiconductor, Inc. All rights reserved. |
Hollis Blanchard | bc8080c | 2009-01-03 16:23:10 -0600 | [diff] [blame] | 3 | * |
| 4 | * Author: Yu Liu, <yu.liu@freescale.com> |
| 5 | * |
| 6 | * Description: |
| 7 | * This file is derived from arch/powerpc/include/asm/kvm_44x.h, |
| 8 | * by Hollis Blanchard <hollisb@us.ibm.com>. |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License, version 2, as |
| 12 | * published by the Free Software Foundation. |
| 13 | */ |
| 14 | |
| 15 | #ifndef __ASM_KVM_E500_H__ |
| 16 | #define __ASM_KVM_E500_H__ |
| 17 | |
| 18 | #include <linux/kvm_host.h> |
| 19 | |
| 20 | #define BOOKE_INTERRUPT_SIZE 36 |
| 21 | |
| 22 | #define E500_PID_NUM 3 |
| 23 | #define E500_TLB_NUM 2 |
| 24 | |
| 25 | struct tlbe{ |
| 26 | u32 mas1; |
| 27 | u32 mas2; |
| 28 | u32 mas3; |
| 29 | u32 mas7; |
| 30 | }; |
| 31 | |
Liu Yu | 08b7fa9 | 2011-06-14 18:34:59 -0500 | [diff] [blame] | 32 | #define E500_TLB_VALID 1 |
| 33 | #define E500_TLB_DIRTY 2 |
| 34 | |
| 35 | struct tlbe_priv { |
| 36 | pfn_t pfn; |
| 37 | unsigned int flags; /* E500_TLB_* */ |
| 38 | }; |
| 39 | |
Liu Yu | dd9ebf1f | 2011-06-14 18:35:14 -0500 | [diff] [blame] | 40 | struct vcpu_id_table; |
| 41 | |
Hollis Blanchard | bc8080c | 2009-01-03 16:23:10 -0600 | [diff] [blame] | 42 | struct kvmppc_vcpu_e500 { |
| 43 | /* Unmodified copy of the guest's TLB. */ |
Liu Yu | 08b7fa9 | 2011-06-14 18:34:59 -0500 | [diff] [blame] | 44 | struct tlbe *gtlb_arch[E500_TLB_NUM]; |
Hollis Blanchard | bc8080c | 2009-01-03 16:23:10 -0600 | [diff] [blame] | 45 | |
Liu Yu | 08b7fa9 | 2011-06-14 18:34:59 -0500 | [diff] [blame] | 46 | /* KVM internal information associated with each guest TLB entry */ |
| 47 | struct tlbe_priv *gtlb_priv[E500_TLB_NUM]; |
| 48 | |
| 49 | unsigned int gtlb_size[E500_TLB_NUM]; |
| 50 | unsigned int gtlb_nv[E500_TLB_NUM]; |
Hollis Blanchard | bc8080c | 2009-01-03 16:23:10 -0600 | [diff] [blame] | 51 | |
| 52 | u32 host_pid[E500_PID_NUM]; |
| 53 | u32 pid[E500_PID_NUM]; |
Scott Wood | 90d34b0 | 2011-03-29 16:49:10 -0500 | [diff] [blame] | 54 | u32 svr; |
Hollis Blanchard | bc8080c | 2009-01-03 16:23:10 -0600 | [diff] [blame] | 55 | |
| 56 | u32 mas0; |
| 57 | u32 mas1; |
| 58 | u32 mas2; |
| 59 | u32 mas3; |
| 60 | u32 mas4; |
| 61 | u32 mas5; |
| 62 | u32 mas6; |
| 63 | u32 mas7; |
Liu Yu | dd9ebf1f | 2011-06-14 18:35:14 -0500 | [diff] [blame] | 64 | |
| 65 | /* vcpu id table */ |
| 66 | struct vcpu_id_table *idt; |
| 67 | |
Liu Yu | d86be07 | 2010-01-22 18:50:29 +0800 | [diff] [blame] | 68 | u32 l1csr0; |
Hollis Blanchard | bc8080c | 2009-01-03 16:23:10 -0600 | [diff] [blame] | 69 | u32 l1csr1; |
| 70 | u32 hid0; |
| 71 | u32 hid1; |
Liu Yu | da15bf4 | 2010-01-22 19:36:53 +0800 | [diff] [blame] | 72 | u32 tlb0cfg; |
| 73 | u32 tlb1cfg; |
Scott Wood | 5ce941e | 2011-04-27 17:24:21 -0500 | [diff] [blame] | 74 | u64 mcar; |
Hollis Blanchard | bc8080c | 2009-01-03 16:23:10 -0600 | [diff] [blame] | 75 | |
| 76 | struct kvm_vcpu vcpu; |
| 77 | }; |
| 78 | |
| 79 | static inline struct kvmppc_vcpu_e500 *to_e500(struct kvm_vcpu *vcpu) |
| 80 | { |
| 81 | return container_of(vcpu, struct kvmppc_vcpu_e500, vcpu); |
| 82 | } |
| 83 | |
| 84 | #endif /* __ASM_KVM_E500_H__ */ |