All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 1/5] xen: add tainted state and show warning is gcov is enabled
Date: Fri, 2 Sep 2016 13:01:05 +0100	[thread overview]
Message-ID: <20160902120105.GP21282@citrix.com> (raw)
In-Reply-To: <57C98521020000780010B45B@prv-mh.provo.novell.com>

On Fri, Sep 02, 2016 at 05:56:49AM -0600, Jan Beulich wrote:
> >>> On 02.09.16 at 13:47, <wei.liu2@citrix.com> 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@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-09-02 12:01 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02 11:47 [PATCH 0/5] gcov: more cleanup Wei Liu
2016-09-02 11:47 ` [PATCH 1/5] xen: add tainted state and show warning is gcov is enabled Wei Liu
2016-09-02 11:56   ` Jan Beulich
2016-09-02 12:01     ` Wei Liu [this message]
2016-09-02 12:06       ` Jan Beulich
2016-09-02 12:13         ` Andrew Cooper
2016-09-02 12:26           ` Jan Beulich
2016-09-02 12:30             ` Andrew Cooper
2016-09-02 13:34               ` Wei Liu
2016-09-02 13:21       ` Julien Grall
2016-09-02 13:34         ` Wei Liu
2016-09-02 11:47 ` [PATCH 2/5] gcov: collect more sections to constructor list Wei Liu
2016-09-02 11:58   ` Jan Beulich
2016-09-02 12:12     ` Wei Liu
2016-09-05 10:10   ` Julien Grall
2016-09-02 11:47 ` [PATCH 3/5] xen: replace TEST_COVERAGE with CONFIG_GCOV Wei Liu
2016-09-02 11:59   ` Jan Beulich
2016-09-19 14:30   ` Ian Jackson
2016-09-02 11:47 ` [PATCH 4/5] gcov: add option to determine gcov format Wei Liu
2016-09-02 12:01   ` Jan Beulich
2016-09-02 12:08     ` Wei Liu
2016-09-02 15:43       ` Wei Liu
2016-09-06  8:34   ` Wei Liu
2016-09-02 11:47 ` [PATCH 5/5] gcov: split out gcc version specific stuff Wei Liu
2016-09-02 12:04 ` [PATCH 0/5] gcov: more cleanup Andrew Cooper
2016-09-02 12:06   ` Wei Liu
2016-09-02 12:15     ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160902120105.GP21282@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.