diff options
author | Alexander Graf <agraf@suse.de> | 2010-03-24 16:48:36 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 05:17:20 -0400 |
commit | 3ed9c6d2b5aa0ac365c52a2a3a370ac499f21e45 (patch) | |
tree | 2b2b946d76b9e1344f98dad5542d63971a3bd288 | |
parent | 5a1b419fc936af9f10766c889d83d80990ecd300 (diff) |
KVM: PPC: Make bools bitfields
Bool defaults to at least byte width. We usually only want to waste a single
bit on this. So let's move all the bool values to bitfields, potentially
saving memory.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r-- | arch/powerpc/include/asm/kvm_book3s.h | 28 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm_host.h | 6 |
2 files changed, 17 insertions, 17 deletions
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index 8a6b4c54086..ee7992189c6 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h | |||
@@ -29,40 +29,40 @@ struct kvmppc_slb { | |||
29 | u64 vsid; | 29 | u64 vsid; |
30 | u64 orige; | 30 | u64 orige; |
31 | u64 origv; | 31 | u64 origv; |
32 | bool valid; | 32 | bool valid : 1; |
33 | bool Ks; | 33 | bool Ks : 1; |
34 | bool Kp; | 34 | bool Kp : 1; |
35 | bool nx; | 35 | bool nx : 1; |
36 | bool large; /* PTEs are 16MB */ | 36 | bool large : 1; /* PTEs are 16MB */ |
37 | bool tb; /* 1TB segment */ | 37 | bool tb : 1; /* 1TB segment */ |
38 | bool class; | 38 | bool class : 1; |
39 | }; | 39 | }; |
40 | 40 | ||
41 | struct kvmppc_sr { | 41 | struct kvmppc_sr { |
42 | u32 raw; | 42 | u32 raw; |
43 | u32 vsid; | 43 | u32 vsid; |
44 | bool Ks; | 44 | bool Ks : 1; |
45 | bool Kp; | 45 | bool Kp : 1; |
46 | bool nx; | 46 | bool nx : 1; |
47 | bool valid; | 47 | bool valid : 1; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | struct kvmppc_bat { | 50 | struct kvmppc_bat { |
51 | u64 raw; | 51 | u64 raw; |
52 | u32 bepi; | 52 | u32 bepi; |
53 | u32 bepi_mask; | 53 | u32 bepi_mask; |
54 | bool vs; | ||
55 | bool vp; | ||
56 | u32 brpn; | 54 | u32 brpn; |
57 | u8 wimg; | 55 | u8 wimg; |
58 | u8 pp; | 56 | u8 pp; |
57 | bool vs : 1; | ||
58 | bool vp : 1; | ||
59 | }; | 59 | }; |
60 | 60 | ||
61 | struct kvmppc_sid_map { | 61 | struct kvmppc_sid_map { |
62 | u64 guest_vsid; | 62 | u64 guest_vsid; |
63 | u64 guest_esid; | 63 | u64 guest_esid; |
64 | u64 host_vsid; | 64 | u64 host_vsid; |
65 | bool valid; | 65 | bool valid : 1; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | #define SID_MAP_BITS 9 | 68 | #define SID_MAP_BITS 9 |
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index 486f1cafd5f..5869a487e2e 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h | |||
@@ -127,9 +127,9 @@ struct kvmppc_pte { | |||
127 | u64 eaddr; | 127 | u64 eaddr; |
128 | u64 vpage; | 128 | u64 vpage; |
129 | u64 raddr; | 129 | u64 raddr; |
130 | bool may_read; | 130 | bool may_read : 1; |
131 | bool may_write; | 131 | bool may_write : 1; |
132 | bool may_execute; | 132 | bool may_execute : 1; |
133 | }; | 133 | }; |
134 | 134 | ||
135 | struct kvmppc_mmu { | 135 | struct kvmppc_mmu { |