tlb.c (1c506c9c104cf01d01a9633ad2e76f15f938c54c) tlb.c (824533ad169f8bafcafba385a428e5b680928411)
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * KVM/MIPS TLB handling, this file is part of the Linux host kernel so that
7 * TLB handlers run from KSEG0
8 *

--- 433 unchanged lines hidden (view full) ---

442void kvm_vz_local_flush_guesttlb_all(void)
443{
444 unsigned long flags;
445 unsigned long old_index;
446 unsigned long old_entryhi;
447 unsigned long old_entrylo[2];
448 unsigned long old_pagemask;
449 int entry;
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * KVM/MIPS TLB handling, this file is part of the Linux host kernel so that
7 * TLB handlers run from KSEG0
8 *

--- 433 unchanged lines hidden (view full) ---

442void kvm_vz_local_flush_guesttlb_all(void)
443{
444 unsigned long flags;
445 unsigned long old_index;
446 unsigned long old_entryhi;
447 unsigned long old_entrylo[2];
448 unsigned long old_pagemask;
449 int entry;
450 u64 cvmmemctl2 = 0;
450
451 local_irq_save(flags);
452
453 /* Preserve all clobbered guest registers */
454 old_index = read_gc0_index();
455 old_entryhi = read_gc0_entryhi();
456 old_entrylo[0] = read_gc0_entrylo0();
457 old_entrylo[1] = read_gc0_entrylo1();
458 old_pagemask = read_gc0_pagemask();
459
451
452 local_irq_save(flags);
453
454 /* Preserve all clobbered guest registers */
455 old_index = read_gc0_index();
456 old_entryhi = read_gc0_entryhi();
457 old_entrylo[0] = read_gc0_entrylo0();
458 old_entrylo[1] = read_gc0_entrylo1();
459 old_pagemask = read_gc0_pagemask();
460
461 switch (current_cpu_type()) {
462 case CPU_CAVIUM_OCTEON3:
463 /* Inhibit machine check due to multiple matching TLB entries */
464 cvmmemctl2 = read_c0_cvmmemctl2();
465 cvmmemctl2 |= CVMMEMCTL2_INHIBITTS;
466 write_c0_cvmmemctl2(cvmmemctl2);
467 break;
468 };
469
460 /* Invalidate guest entries in guest TLB */
461 write_gc0_entrylo0(0);
462 write_gc0_entrylo1(0);
463 write_gc0_pagemask(0);
464 for (entry = 0; entry < current_cpu_data.guest.tlbsize; entry++) {
465 /* Make sure all entries differ. */
466 write_gc0_index(entry);
467 write_gc0_entryhi(UNIQUE_GUEST_ENTRYHI(entry));
468 mtc0_tlbw_hazard();
469 guest_tlb_write_indexed();
470 }
470 /* Invalidate guest entries in guest TLB */
471 write_gc0_entrylo0(0);
472 write_gc0_entrylo1(0);
473 write_gc0_pagemask(0);
474 for (entry = 0; entry < current_cpu_data.guest.tlbsize; entry++) {
475 /* Make sure all entries differ. */
476 write_gc0_index(entry);
477 write_gc0_entryhi(UNIQUE_GUEST_ENTRYHI(entry));
478 mtc0_tlbw_hazard();
479 guest_tlb_write_indexed();
480 }
481
482 if (cvmmemctl2) {
483 cvmmemctl2 &= ~CVMMEMCTL2_INHIBITTS;
484 write_c0_cvmmemctl2(cvmmemctl2);
485 };
486
471 write_gc0_index(old_index);
472 write_gc0_entryhi(old_entryhi);
473 write_gc0_entrylo0(old_entrylo[0]);
474 write_gc0_entrylo1(old_entrylo[1]);
475 write_gc0_pagemask(old_pagemask);
476 tlbw_use_hazard();
477
478 local_irq_restore(flags);

--- 162 unchanged lines hidden ---
487 write_gc0_index(old_index);
488 write_gc0_entryhi(old_entryhi);
489 write_gc0_entrylo0(old_entrylo[0]);
490 write_gc0_entrylo1(old_entrylo[1]);
491 write_gc0_pagemask(old_pagemask);
492 tlbw_use_hazard();
493
494 local_irq_restore(flags);

--- 162 unchanged lines hidden ---