Lines Matching refs:map

174 static inline bool kvm_apic_map_get_logical_dest(struct kvm_apic_map *map,
176 switch (map->logical_mode) {
178 /* Arbitrarily use the flat map so that @cluster isn't NULL. */
179 *cluster = map->xapic_flat_map;
184 u32 max_apic_id = map->max_apic_id;
189 offset = array_index_nospec(offset, map->max_apic_id + 1);
190 *cluster = &map->phys_map[offset];
199 *cluster = map->xapic_flat_map;
203 *cluster = map->xapic_cluster_map[(dest_id >> 4) & 0xf];
216 struct kvm_apic_map *map = container_of(rcu, struct kvm_apic_map, rcu);
218 kvfree(map);
233 * without the optimized map.
240 * the map and doing the actual calculations for the map. Note, KVM
279 * Disable the optimized map if the physical APIC ID is already
281 * map requires a strict 1:1 mapping between IDs and vCPUs.
391 "Dirty APIC map without an in-kernel local APIC");
398 * or the APIC registers (if dirty). Note, on retry the map may have
400 * ID, i.e. the map may still show up as in-progress. In that case
405 /* Someone else has updated the map. */
453 * The optimized map is effectively KVM's internal version of APICv,
455 * map also applies to APICv.
835 static int __pv_send_ipi(unsigned long *ipi_bitmap, struct kvm_apic_map *map,
841 if (min > map->max_apic_id)
845 min((u32)BITS_PER_LONG, (map->max_apic_id - min + 1))) {
846 if (map->phys_map[min + i]) {
847 vcpu = map->phys_map[min + i]->vcpu;
859 struct kvm_apic_map *map;
873 map = rcu_dereference(kvm->arch.apic_map);
876 if (likely(map)) {
877 count = __pv_send_ipi(&ipi_bitmap_low, map, &irq, min);
879 count += __pv_send_ipi(&ipi_bitmap_high, map, &irq, min);
1120 struct kvm_lapic_irq *irq, struct kvm_apic_map *map)
1124 map->logical_mode != KVM_APIC_MODE_X2APIC))
1147 struct kvm_apic_map *map, struct kvm_lapic ***dst,
1159 if (!map || kvm_apic_is_broadcast_dest(kvm, src, irq, map))
1163 if (irq->dest_id > map->max_apic_id) {
1166 u32 dest_id = array_index_nospec(irq->dest_id, map->max_apic_id + 1);
1167 *dst = &map->phys_map[dest_id];
1174 if (!kvm_apic_map_get_logical_dest(map, irq->dest_id, dst,
1214 struct kvm_apic_map *map;
1232 map = rcu_dereference(kvm->arch.apic_map);
1234 ret = kvm_apic_map_get_dest_lapic(kvm, &src, irq, map, &dst, &bitmap);
1265 struct kvm_apic_map *map;
1274 map = rcu_dereference(kvm->arch.apic_map);
1276 if (kvm_apic_map_get_dest_lapic(kvm, NULL, irq, map, &dst, &bitmap) &&
1318 __set_bit(vcpu->vcpu_id, dest_map->map);
1402 struct kvm_apic_map *map;
1409 map = rcu_dereference(kvm->arch.apic_map);
1411 ret = kvm_apic_map_get_dest_lapic(kvm, &src, irq, map, &dest_vcpu,