|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/5] xen: add tainted state and show warning is gcov is enabled
On Fri, Sep 02, 2016 at 05:56:49AM -0600, Jan Beulich wrote:
> >>> On 02.09.16 at 13:47, <wei.liu2@xxxxxxxxxx> wrote:
>
> Since this is a config option - why bother issuing a warning and
> tainting the hypervisor?
>
Because there isn't a clear indicator if gcov is enabled.
I think it would be valuable to just tell from the backtrace or console
log that gcov is enabled, then we can legitimately refuse to provide
(security) support for such builds.
> > --- a/xen/common/gcov/gcov.c
> > +++ b/xen/common/gcov/gcov.c
> > @@ -23,6 +23,11 @@
> > #include <public/xen.h>
> > #include <public/gcov.h>
> >
> > +const char __initconst warning_gcov[] =
> > + "WARNING: GCOV SUPPORT IS ENABLED\n"
> > + "This option is *ONLY* intended to aid testing of Xen.\n"
> > + "Please *DO NOT* use this in production.\n";
>
> Note the type (const) difference between this and ...
>
> > --- a/xen/drivers/char/console.c
> > +++ b/xen/drivers/char/console.c
> > @@ -792,6 +792,10 @@ void __init console_init_postirq(void)
> > console_init_ring();
> > }
> >
> > +#ifdef CONFIG_GCOV
> > +extern char warning_gcov[];
> > +#endif
>
> ... this. That's one of the reasons declarations of stuff defined in
> C sources should be put in a header, which then gets included by
> both producer and consumer(s). But ...
>
> > @@ -802,6 +806,11 @@ void __init console_endboot(void)
> > printk(" (Rate-limited: %s)",
> > loglvl_str(xenlog_guest_upper_thresh));
> > printk("\n");
> >
> > +#ifdef CONFIG_GCOV
> > + warning_add(warning_gcov);
> > + add_taint(TAINT_GCOV);
> > +#endif
>
> ... (if we want this in the first place) how about
>
> #ifdef CONFIG_GCOV
> {
> static const char __initconst warning_gcov[] = "...";
>
> warning_add(warning_gcov);
> add_taint(TAINT_GCOV);
> }
> #endif
>
Fine with me.
Wei.
> Jan
>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |