.. | .. |
---|
20 | 20 | |
---|
21 | 21 | #include <asm/cpu.h> |
---|
22 | 22 | #include <asm/bootinfo.h> |
---|
| 23 | +#include <asm/mipsregs.h> |
---|
23 | 24 | #include <asm/mmu_context.h> |
---|
24 | | -#include <asm/pgtable.h> |
---|
25 | 25 | #include <asm/cacheflush.h> |
---|
26 | 26 | #include <asm/tlb.h> |
---|
27 | 27 | #include <asm/tlbdebug.h> |
---|
.. | .. |
---|
469 | 469 | cvmmemctl2 |= CVMMEMCTL2_INHIBITTS; |
---|
470 | 470 | write_c0_cvmmemctl2(cvmmemctl2); |
---|
471 | 471 | break; |
---|
472 | | - }; |
---|
| 472 | + } |
---|
473 | 473 | |
---|
474 | 474 | /* Invalidate guest entries in guest TLB */ |
---|
475 | 475 | write_gc0_entrylo0(0); |
---|
.. | .. |
---|
486 | 486 | if (cvmmemctl2) { |
---|
487 | 487 | cvmmemctl2 &= ~CVMMEMCTL2_INHIBITTS; |
---|
488 | 488 | write_c0_cvmmemctl2(cvmmemctl2); |
---|
489 | | - }; |
---|
| 489 | + } |
---|
490 | 490 | |
---|
491 | 491 | write_gc0_index(old_index); |
---|
492 | 492 | write_gc0_entryhi(old_entryhi); |
---|
.. | .. |
---|
622 | 622 | } |
---|
623 | 623 | EXPORT_SYMBOL_GPL(kvm_vz_load_guesttlb); |
---|
624 | 624 | |
---|
| 625 | +#ifdef CONFIG_CPU_LOONGSON64 |
---|
| 626 | +void kvm_loongson_clear_guest_vtlb(void) |
---|
| 627 | +{ |
---|
| 628 | + int idx = read_gc0_index(); |
---|
| 629 | + |
---|
| 630 | + /* Set root GuestID for root probe and write of guest TLB entry */ |
---|
| 631 | + set_root_gid_to_guest_gid(); |
---|
| 632 | + |
---|
| 633 | + write_gc0_index(0); |
---|
| 634 | + guest_tlbinvf(); |
---|
| 635 | + write_gc0_index(idx); |
---|
| 636 | + |
---|
| 637 | + clear_root_gid(); |
---|
| 638 | + set_c0_diag(LOONGSON_DIAG_ITLB | LOONGSON_DIAG_DTLB); |
---|
| 639 | +} |
---|
| 640 | +EXPORT_SYMBOL_GPL(kvm_loongson_clear_guest_vtlb); |
---|
| 641 | + |
---|
| 642 | +void kvm_loongson_clear_guest_ftlb(void) |
---|
| 643 | +{ |
---|
| 644 | + int i; |
---|
| 645 | + int idx = read_gc0_index(); |
---|
| 646 | + |
---|
| 647 | + /* Set root GuestID for root probe and write of guest TLB entry */ |
---|
| 648 | + set_root_gid_to_guest_gid(); |
---|
| 649 | + |
---|
| 650 | + for (i = current_cpu_data.tlbsizevtlb; |
---|
| 651 | + i < (current_cpu_data.tlbsizevtlb + |
---|
| 652 | + current_cpu_data.tlbsizeftlbsets); |
---|
| 653 | + i++) { |
---|
| 654 | + write_gc0_index(i); |
---|
| 655 | + guest_tlbinvf(); |
---|
| 656 | + } |
---|
| 657 | + write_gc0_index(idx); |
---|
| 658 | + |
---|
| 659 | + clear_root_gid(); |
---|
| 660 | + set_c0_diag(LOONGSON_DIAG_ITLB | LOONGSON_DIAG_DTLB); |
---|
| 661 | +} |
---|
| 662 | +EXPORT_SYMBOL_GPL(kvm_loongson_clear_guest_ftlb); |
---|
| 663 | +#endif |
---|
| 664 | + |
---|
625 | 665 | #endif |
---|
626 | 666 | |
---|
627 | 667 | /** |
---|