Hi Andrew, On 10/04/2024 20:42, Andrew Cooper wrote: > > > Given 3 statically initialised objects, its easy to link the list at build > time. There's no need to do it during runtime at boot (and with IRQs-off, > even). > > As a consequence, register_virtual_region() can now move inside ifdef > CONFIG_LIVEPATCH like unregister_virtual_region(). > > Signed-off-by: Andrew Cooper <[email protected]> Reviewed-by: Michal Orzel <[email protected]>
Maybe with ... > --- > CC: Jan Beulich <[email protected]> > CC: Roger Pau Monné <[email protected]> > CC: Wei Liu <[email protected]> > CC: Stefano Stabellini <[email protected]> > CC: Julien Grall <[email protected]> > CC: Volodymyr Babchuk <[email protected]> > CC: Bertrand Marquis <[email protected]> > CC: Michal Orzel <[email protected]> > CC: Oleksii Kurochko <[email protected]> > CC: Shawn Anastasio <[email protected]> > CC: Konrad Rzeszutek Wilk <[email protected]> > CC: Ross Lagerwall <[email protected]> > > v2: > * Collect the initialisers togoether too. > --- > xen/common/virtual_region.c | 37 ++++++++++++++++++++++--------------- > 1 file changed, 22 insertions(+), 15 deletions(-) > > diff --git a/xen/common/virtual_region.c b/xen/common/virtual_region.c > index 7d8bdeb61282..db3e0dc9fe74 100644 > --- a/xen/common/virtual_region.c > +++ b/xen/common/virtual_region.c > @@ -15,8 +15,18 @@ extern const struct bug_frame > __start_bug_frames_2[], __stop_bug_frames_2[], > __start_bug_frames_3[], __stop_bug_frames_3[]; > > +/* > + * For the built-in regions, the double linked list can be constructed at > + * build time. Forward-declare the elements and their initialisers. > + */ > +static struct list_head virtual_region_list; > +static struct virtual_region core, core_init; ... empty line here for better readability > +#define LIST_ENTRY_HEAD() { .next = &core.list, .prev = > &core_init.list } > +#define LIST_ENTRY_CORE() { .next = &core_init.list, .prev = > &virtual_region_list } > +#define LIST_ENTRY_INIT() { .next = &virtual_region_list, .prev = &core.list > } ~Michal
