File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1387,8 +1387,6 @@ struct kvm_arch {
13871387
13881388#define __KVM_HAVE_ARCH_NONCOHERENT_DMA
13891389 atomic_t noncoherent_dma_count ;
1390- #define __KVM_HAVE_ARCH_ASSIGNED_DEVICE
1391- atomic_t assigned_device_count ;
13921390 unsigned long nr_possible_bypass_irqs ;
13931391
13941392#ifdef CONFIG_KVM_IOAPIC
Original file line number Diff line number Diff line change @@ -565,8 +565,6 @@ int kvm_arch_irq_bypass_add_producer(struct irq_bypass_consumer *cons,
565565 struct kvm * kvm = irqfd -> kvm ;
566566 int ret = 0 ;
567567
568- kvm_arch_start_assignment (irqfd -> kvm );
569-
570568 spin_lock_irq (& kvm -> irqfds .lock );
571569 irqfd -> producer = prod ;
572570
@@ -575,10 +573,8 @@ int kvm_arch_irq_bypass_add_producer(struct irq_bypass_consumer *cons,
575573
576574 if (irqfd -> irq_entry .type == KVM_IRQ_ROUTING_MSI ) {
577575 ret = kvm_pi_update_irte (irqfd , & irqfd -> irq_entry );
578- if (ret ) {
576+ if (ret )
579577 kvm -> arch .nr_possible_bypass_irqs -- ;
580- kvm_arch_end_assignment (irqfd -> kvm );
581- }
582578 }
583579 spin_unlock_irq (& kvm -> irqfds .lock );
584580
@@ -614,9 +610,6 @@ void kvm_arch_irq_bypass_del_producer(struct irq_bypass_consumer *cons,
614610 kvm -> arch .nr_possible_bypass_irqs -- ;
615611
616612 spin_unlock_irq (& kvm -> irqfds .lock );
617-
618-
619- kvm_arch_end_assignment (irqfd -> kvm );
620613}
621614
622615void kvm_arch_update_irqfd_routing (struct kvm_kernel_irqfd * irqfd ,
Original file line number Diff line number Diff line change @@ -13444,24 +13444,6 @@ bool kvm_arch_can_dequeue_async_page_present(struct kvm_vcpu *vcpu)
1344413444 return kvm_lapic_enabled (vcpu ) && apf_pageready_slot_free (vcpu );
1344513445}
1344613446
13447- void kvm_arch_start_assignment (struct kvm * kvm )
13448- {
13449- atomic_inc (& kvm -> arch .assigned_device_count );
13450- }
13451- EXPORT_SYMBOL_GPL (kvm_arch_start_assignment );
13452-
13453- void kvm_arch_end_assignment (struct kvm * kvm )
13454- {
13455- atomic_dec (& kvm -> arch .assigned_device_count );
13456- }
13457- EXPORT_SYMBOL_GPL (kvm_arch_end_assignment );
13458-
13459- bool noinstr kvm_arch_has_assigned_device (struct kvm * kvm )
13460- {
13461- return raw_atomic_read (& kvm -> arch .assigned_device_count );
13462- }
13463- EXPORT_SYMBOL_GPL (kvm_arch_has_assigned_device );
13464-
1346513447static void kvm_noncoherent_dma_assignment_start_or_stop (struct kvm * kvm )
1346613448{
1346713449 /*
Original file line number Diff line number Diff line change @@ -1690,24 +1690,6 @@ static inline bool kvm_arch_has_noncoherent_dma(struct kvm *kvm)
16901690 return false;
16911691}
16921692#endif
1693- #ifdef __KVM_HAVE_ARCH_ASSIGNED_DEVICE
1694- void kvm_arch_start_assignment (struct kvm * kvm );
1695- void kvm_arch_end_assignment (struct kvm * kvm );
1696- bool kvm_arch_has_assigned_device (struct kvm * kvm );
1697- #else
1698- static inline void kvm_arch_start_assignment (struct kvm * kvm )
1699- {
1700- }
1701-
1702- static inline void kvm_arch_end_assignment (struct kvm * kvm )
1703- {
1704- }
1705-
1706- static __always_inline bool kvm_arch_has_assigned_device (struct kvm * kvm )
1707- {
1708- return false;
1709- }
1710- #endif
17111693
17121694static inline struct rcuwait * kvm_arch_vcpu_get_wait (struct kvm_vcpu * vcpu )
17131695{
Original file line number Diff line number Diff line change @@ -175,7 +175,6 @@ static int kvm_vfio_file_add(struct kvm_device *dev, unsigned int fd)
175175 kvf -> file = get_file (filp );
176176 list_add_tail (& kvf -> node , & kv -> file_list );
177177
178- kvm_arch_start_assignment (dev -> kvm );
179178 kvm_vfio_file_set_kvm (kvf -> file , dev -> kvm );
180179 kvm_vfio_update_coherency (dev );
181180
@@ -205,7 +204,6 @@ static int kvm_vfio_file_del(struct kvm_device *dev, unsigned int fd)
205204 continue ;
206205
207206 list_del (& kvf -> node );
208- kvm_arch_end_assignment (dev -> kvm );
209207#ifdef CONFIG_SPAPR_TCE_IOMMU
210208 kvm_spapr_tce_release_vfio_group (dev -> kvm , kvf );
211209#endif
@@ -336,7 +334,6 @@ static void kvm_vfio_release(struct kvm_device *dev)
336334 fput (kvf -> file );
337335 list_del (& kvf -> node );
338336 kfree (kvf );
339- kvm_arch_end_assignment (dev -> kvm );
340337 }
341338
342339 kvm_vfio_update_coherency (dev );
You can’t perform that action at this time.
0 commit comments