[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 2/2] x86/shadow: Move shadow pagetable fields into struct shadow_vcpu
At 17:26 +0000 on 30 Jan (1485797162), Andrew Cooper wrote: > The vTLB and last_write* booleans are used exclusively by the shadow pagetable > code. Move them from paging_vcpu to shadow_vcpu, which causes them to be > entirely omitted on a build without shadow paging support. > > While changing the qualified names of these variables, drop an unnessary NULL > check before freeing the vTLB, and move allocation of the vTLB from > sh_update_paging_modes() to shadow_vcpu_init() where it more logically > belongs. In future, can you please separate incidental cleanups from the mechanical renaming parts? It makes patch review much easier. > +#if (SHADOW_OPTIMIZATIONS & SHOPT_VIRTUAL_TLB) > + /* Allocate a virtual TLB for this vcpu. */ > + v->arch.paging.shadow.vtlb = xzalloc_array(struct shadow_vtlb, > VTLB_ENTRIES); > + if ( !v->arch.paging.shadow.vtlb ) > + return -ENOMEM; > + spin_lock_init(&v->arch.paging.shadow.vtlb_lock); > +#endif /* (SHADOW_OPTIMIZATIONS & SHOPT_VIRTUAL_TLB) */ As Jan points out, the higher-level error path can now leak this array. Apart from that, this looks good to me. Cheers, Tim. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |