Lines Matching refs:idx
127 unsigned int idx = seg; in hvm_get_seg_reg() local
130 if ( idx >= ARRAY_SIZE(sh_ctxt->seg_reg) ) in hvm_get_seg_reg()
133 seg_reg = &sh_ctxt->seg_reg[idx]; in hvm_get_seg_reg()
134 if ( !__test_and_set_bit(idx, &sh_ctxt->valid_seg_regs) ) in hvm_get_seg_reg()
135 hvm_get_segment_register(current, idx, seg_reg); in hvm_get_seg_reg()
438 int idx, expected_idx, expected_idx_alt; in sh_oos_audit() local
444 for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ ) in sh_oos_audit()
447 if ( !mfn_valid(oos[idx]) ) in sh_oos_audit()
450 expected_idx = mfn_x(oos[idx]) % SHADOW_OOS_PAGES; in sh_oos_audit()
452 if ( idx != expected_idx && idx != expected_idx_alt ) in sh_oos_audit()
455 __func__, idx, mfn_x(oos[idx]), in sh_oos_audit()
459 pg = mfn_to_page(oos[idx]); in sh_oos_audit()
463 __func__, idx, mfn_x(oos[idx]), pg->count_info); in sh_oos_audit()
469 __func__, idx, mfn_x(oos[idx]), pg->shadow_flags); in sh_oos_audit()
475 __func__, idx, mfn_x(oos[idx]), pg->shadow_flags); in sh_oos_audit()
486 int idx; in oos_audit_hash_is_present() local
495 idx = mfn_x(gmfn) % SHADOW_OOS_PAGES; in oos_audit_hash_is_present()
496 if ( mfn_x(oos[idx]) != mfn_x(gmfn) ) in oos_audit_hash_is_present()
497 idx = (idx + 1) % SHADOW_OOS_PAGES; in oos_audit_hash_is_present()
499 if ( mfn_x(oos[idx]) == mfn_x(gmfn) ) in oos_audit_hash_is_present()
555 int idx, next; in oos_fixup_add() local
566 idx = mfn_x(gmfn) % SHADOW_OOS_PAGES; in oos_fixup_add()
567 if ( mfn_x(oos[idx]) != mfn_x(gmfn) ) in oos_fixup_add()
568 idx = (idx + 1) % SHADOW_OOS_PAGES; in oos_fixup_add()
569 if ( mfn_x(oos[idx]) == mfn_x(gmfn) ) in oos_fixup_add()
574 if ( mfn_valid(oos_fixup[idx].smfn[i]) in oos_fixup_add()
575 && (mfn_x(oos_fixup[idx].smfn[i]) == mfn_x(smfn)) in oos_fixup_add()
576 && (oos_fixup[idx].off[i] == off) ) in oos_fixup_add()
580 next = oos_fixup[idx].next; in oos_fixup_add()
582 if ( !mfn_eq(oos_fixup[idx].smfn[next], INVALID_MFN) ) in oos_fixup_add()
588 oos_fixup[idx].smfn[next], in oos_fixup_add()
589 oos_fixup[idx].off[next]); in oos_fixup_add()
598 oos_fixup[idx].smfn[next] = smfn; in oos_fixup_add()
599 oos_fixup[idx].off[next] = off; in oos_fixup_add()
600 oos_fixup[idx].next = (next + 1) % SHADOW_OOS_FIXUPS; in oos_fixup_add()
694 int i, idx, oidx, swap = 0; in oos_hash_add() local
704 idx = mfn_x(gmfn) % SHADOW_OOS_PAGES; in oos_hash_add()
705 oidx = idx; in oos_hash_add()
707 if ( mfn_valid(oos[idx]) in oos_hash_add()
708 && (mfn_x(oos[idx]) % SHADOW_OOS_PAGES) == idx ) in oos_hash_add()
711 SWAP(oos[idx], gmfn); in oos_hash_add()
712 SWAP(oos_fixup[idx], fixup); in oos_hash_add()
714 idx = (idx + 1) % SHADOW_OOS_PAGES; in oos_hash_add()
716 if ( mfn_valid(oos[idx]) ) in oos_hash_add()
719 _sh_resync(v, oos[idx], &oos_fixup[idx], oos_snapshot[idx]); in oos_hash_add()
722 oos[idx] = gmfn; in oos_hash_add()
723 oos_fixup[idx] = fixup; in oos_hash_add()
726 SWAP(oos_snapshot[idx], oos_snapshot[oidx]); in oos_hash_add()
738 int idx; in oos_hash_remove() local
747 idx = mfn_x(gmfn) % SHADOW_OOS_PAGES; in oos_hash_remove()
748 if ( mfn_x(oos[idx]) != mfn_x(gmfn) ) in oos_hash_remove()
749 idx = (idx + 1) % SHADOW_OOS_PAGES; in oos_hash_remove()
750 if ( mfn_x(oos[idx]) == mfn_x(gmfn) ) in oos_hash_remove()
752 oos[idx] = INVALID_MFN; in oos_hash_remove()
763 int idx; in oos_snapshot_lookup() local
772 idx = mfn_x(gmfn) % SHADOW_OOS_PAGES; in oos_snapshot_lookup()
773 if ( mfn_x(oos[idx]) != mfn_x(gmfn) ) in oos_snapshot_lookup()
774 idx = (idx + 1) % SHADOW_OOS_PAGES; in oos_snapshot_lookup()
775 if ( mfn_x(oos[idx]) == mfn_x(gmfn) ) in oos_snapshot_lookup()
777 return oos_snapshot[idx]; in oos_snapshot_lookup()
788 int idx; in sh_resync() local
799 idx = mfn_x(gmfn) % SHADOW_OOS_PAGES; in sh_resync()
800 if ( mfn_x(oos[idx]) != mfn_x(gmfn) ) in sh_resync()
801 idx = (idx + 1) % SHADOW_OOS_PAGES; in sh_resync()
803 if ( mfn_x(oos[idx]) == mfn_x(gmfn) ) in sh_resync()
805 _sh_resync(v, gmfn, &oos_fixup[idx], oos_snapshot[idx]); in sh_resync()
806 oos[idx] = INVALID_MFN; in sh_resync()
839 int idx; in sh_resync_all() local
853 for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ ) in sh_resync_all()
854 if ( mfn_valid(oos[idx]) ) in sh_resync_all()
857 _sh_resync(v, oos[idx], &oos_fixup[idx], oos_snapshot[idx]); in sh_resync_all()
858 oos[idx] = INVALID_MFN; in sh_resync_all()
875 for ( idx = 0; idx < SHADOW_OOS_PAGES; idx++ ) in sh_resync_all()
877 if ( !mfn_valid(oos[idx]) ) in sh_resync_all()
883 if ( sh_skip_sync(v, oos[idx]) ) in sh_resync_all()
885 trace_resync(TRC_SHADOW_RESYNC_ONLY, oos[idx]); in sh_resync_all()
886 _sh_resync_l1(other, oos[idx], oos_snapshot[idx]); in sh_resync_all()
891 _sh_resync(other, oos[idx], &oos_fixup[idx], oos_snapshot[idx]); in sh_resync_all()
892 oos[idx] = INVALID_MFN; in sh_resync_all()