On 02/08/2023 3:38 pm, Nicola Vetrini wrote: > diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c > index 5f66c2ae33..015f7b14ab 100644 > --- a/xen/arch/x86/domain.c > +++ b/xen/arch/x86/domain.c > @@ -2268,6 +2268,17 @@ int domain_relinquish_resources(struct domain *d) > { > int ret; > struct vcpu *v; > + enum { > + PROG_iommu_pagetables = 1, > + PROG_shared, > + PROG_paging, > + PROG_vcpu_pagetables, > + PROG_xen, > + PROG_l4, > + PROG_l3, > + PROG_l2, > + PROG_done, > + }; > > BUG_ON(!cpumask_empty(d->dirty_cpumask)); > > @@ -2291,18 +2302,6 @@ int domain_relinquish_resources(struct domain *d) > #define PROGRESS(x) \ > d->arch.rel_priv = PROG_ ## x; /* Fallthrough */ case PROG_ ## x > > - enum { > - PROG_iommu_pagetables = 1, > - PROG_shared, > - PROG_paging, > - PROG_vcpu_pagetables, > - PROG_xen, > - PROG_l4, > - PROG_l3, > - PROG_l2, > - PROG_done, > - }; > - > case 0: > ret = pci_release_devices(d); > if ( ret )
Why does this get moved? There's no code (reachable or unreachable) in there. This is very subtle logic to start with, and you're moving one part of it away from the comment explaining how the magic works. ~Andrew