[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v8 14/15] xen: make grant table limits boot parameters dom0 only
On 20/09/17 17:36, Jan Beulich wrote: >>>> On 20.09.17 at 14:48, <jgross@xxxxxxxx> wrote: >> On 20/09/17 14:07, Jan Beulich wrote: >>>>>> On 20.09.17 at 08:34, <jgross@xxxxxxxx> wrote: >>>> @@ -3469,14 +3460,17 @@ grant_table_create( >>>> /* Simple stuff. */ >>>> percpu_rwlock_resource_init(&t->lock, grant_rwlock); >>>> spin_lock_init(&t->maptrack_lock); >>>> - t->max_grant_frames = max_grant_frames; >>>> - t->max_maptrack_frames = max_maptrack_frames; >>>> >>>> /* Okay, install the structure. */ >>>> d->grant_table = t; >>>> >>>> if ( d->domain_id == 0 ) >>>> + { >>>> + t->max_grant_frames = max_grant_frames ? : >>>> DEFAULT_MAX_NR_GRANT_FRAMES; >>>> + t->max_maptrack_frames = >>>> + max_maptrack_frames ? : >>>> DEFAULT_MAX_MAPTRACK_FRAMES; >>>> return grant_table_init(t); >>>> + } >>> >>> The use here makes it that in effect the two variables could then >>> become __initdata. Maybe their definition should then even move >>> here (if the other proposal would be discarded). >> >> Is it possible in the hypervisor to access __initdata variables from non >> __init functions? In the Linux kernel this is forbidden. > > In Xen this is possible, and there are examples. Iirc in Linux this > breaking the build is also just optional. Yes, there you have the __ref annotation for __init stuff accessible from non-__init areas. IMHO it would be better to add: static int __init grant_table_init_dom0() hiding the two variables. This makes it more obvious that path is taken only at boot time. Juergen _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |