On 31/05/2019 02:35, Jan Beulich wrote: > A couple of adjustments are needed to code checking for dom_cow, but > since there are pretty few it is probably better to adjust those than > to set up and keep around a never used domain. > > Take the opportunity and tighten a BUG_ON() in emul-priv-op.c:read_cr(). > (Arguably this perhaps shouldn't be a BUG_ON() in the first place.)
Yes - it should be ASSERT_UNREACHABLE()/domain_crash() I'm not fussed if this done as part of this patch, or split out separately. It almost doesn't seem worth splitting out. > --- a/xen/include/xen/mm.h > +++ b/xen/include/xen/mm.h > @@ -644,6 +644,9 @@ static inline void filtered_flush_tlb_ma > > /* Private domain structs for DOMID_XEN, DOMID_IO, etc. */ > extern struct domain *dom_xen, *dom_io, *dom_cow; > +#ifndef CONFIG_HAS_MEM_SHARING > +# define dom_cow NULL > +#endif > > enum XENSHARE_flags { > SHARE_rw, > > > What is wrong with #ifdef CONFIG_HAS_MEM_SHARING extern struct domain *dom_cow; #else # define dom_cow NULL #endif which is how we usually express things like this? Sure, its a tiny bit longer to write, but it is easier to follow. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel