diff options
author | Deng-Cheng Zhu <dengcheng.zhu@imgtec.com> | 2014-06-26 15:11:34 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-06-30 10:52:01 -0400 |
commit | d116e812f9026e3cca46ce1009e577afec62916d (patch) | |
tree | 2a8f60c6beb6c5489d777cb0e2b8a92cf42127b0 /arch/mips/include/asm/kvm_host.h | |
parent | 85949977a5b499efca661fb80993693acbfac64d (diff) |
MIPS: KVM: Reformat code and comments
No logic changes inside.
Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/mips/include/asm/kvm_host.h')
-rw-r--r-- | arch/mips/include/asm/kvm_host.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/mips/include/asm/kvm_host.h b/arch/mips/include/asm/kvm_host.h index b0aa95565752..3f813f295134 100644 --- a/arch/mips/include/asm/kvm_host.h +++ b/arch/mips/include/asm/kvm_host.h | |||
@@ -359,13 +359,17 @@ enum emulation_result { | |||
359 | #define MIPS3_PG_FRAME 0x3fffffc0 | 359 | #define MIPS3_PG_FRAME 0x3fffffc0 |
360 | 360 | ||
361 | #define VPN2_MASK 0xffffe000 | 361 | #define VPN2_MASK 0xffffe000 |
362 | #define TLB_IS_GLOBAL(x) (((x).tlb_lo0 & MIPS3_PG_G) && \ | 362 | #define TLB_IS_GLOBAL(x) (((x).tlb_lo0 & MIPS3_PG_G) && \ |
363 | ((x).tlb_lo1 & MIPS3_PG_G)) | 363 | ((x).tlb_lo1 & MIPS3_PG_G)) |
364 | #define TLB_VPN2(x) ((x).tlb_hi & VPN2_MASK) | 364 | #define TLB_VPN2(x) ((x).tlb_hi & VPN2_MASK) |
365 | #define TLB_ASID(x) ((x).tlb_hi & ASID_MASK) | 365 | #define TLB_ASID(x) ((x).tlb_hi & ASID_MASK) |
366 | #define TLB_IS_VALID(x, va) (((va) & (1 << PAGE_SHIFT)) \ | 366 | #define TLB_IS_VALID(x, va) (((va) & (1 << PAGE_SHIFT)) \ |
367 | ? ((x).tlb_lo1 & MIPS3_PG_V) \ | 367 | ? ((x).tlb_lo1 & MIPS3_PG_V) \ |
368 | : ((x).tlb_lo0 & MIPS3_PG_V)) | 368 | : ((x).tlb_lo0 & MIPS3_PG_V)) |
369 | #define TLB_HI_VPN2_HIT(x, y) ((TLB_VPN2(x) & ~(x).tlb_mask) == \ | ||
370 | ((y) & VPN2_MASK & ~(x).tlb_mask)) | ||
371 | #define TLB_HI_ASID_HIT(x, y) (TLB_IS_GLOBAL(x) || \ | ||
372 | TLB_ASID(x) == ((y) & ASID_MASK)) | ||
369 | 373 | ||
370 | struct kvm_mips_tlb { | 374 | struct kvm_mips_tlb { |
371 | long tlb_mask; | 375 | long tlb_mask; |