From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>, Jan Beulich <JBeulich@suse.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [PATCH v3 3/3] xen: make available hvm_fep to non-debug build as well
Date: Thu, 23 Jun 2016 13:48:35 +0100 [thread overview]
Message-ID: <68b15ad0-af0d-3d0c-47d6-2d51ddd8956a@citrix.com> (raw)
In-Reply-To: <20160623124408.GB13180@citrix.com>
On 23/06/16 13:44, Wei Liu wrote:
> On Thu, Jun 23, 2016 at 06:20:38AM -0600, Jan Beulich wrote:
>>>>> On 23.06.16 at 12:50, <wei.liu2@citrix.com> wrote:
>>> On Wed, Jun 22, 2016 at 09:42:38AM -0600, Jan Beulich wrote:
>>>>>>> On 20.06.16 at 18:30, <wei.liu2@citrix.com> wrote:
>>>>> @@ -97,9 +98,17 @@ boolean_param("hap", opt_hap_enabled);
>>>>>
>>>>> #ifndef opt_hvm_fep
>>>>> /* Permit use of the Forced Emulation Prefix in HVM guests */
>>>>> -bool_t opt_hvm_fep;
>>>>> +bool_t __read_mostly opt_hvm_fep;
>>>>> boolean_param("hvm_fep", opt_hvm_fep);
>>>>> #endif
>>>>> +static const char __initconst *warning_hvm_fep =
>>>>> + "**********************************************\n"
>>>>> + "******* WARNING: HVM FORCED EMULATION PREFIX IS AVAILABLE\n"
>>>>> + "******* This option is *ONLY* intended to aid testing of Xen.\n"
>>>>> + "******* It has implications on the security of the system.\n"
>>>>> + "******* Please *DO NOT* use this in production.\n"
>>>>> + "**********************************************\n";
>>>>> +
>>>>>
>>>> Along with the same comment as on patch 2, here even more than
>>>> there I wonder whether this string wouldn't better be a static local
>>>> in hvm_enable() (or even the scope therein where warning_add()
>>>> gets invoked).
>>> I would rather the text stays next to where the option is defined so
>>> it is obvious to anyone who touches this area of code.
>> Makes sense. But then - shouldn't it move inside the #ifndef?
>>
> That would then require the warning_add() call to be wrapped in ifdef,
> too. That looks a bit cumbersome to me.
You can do something like:
#ifndef $FOO
#define warning_text NULL
#else
const static __initdata warning_text[] = "BAR";
#endif
This works in the same way as the current opt_hvm_fep define.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-06-23 12:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-20 16:30 [PATCH v3 0/3] Make hvm_fep available to non-debug build Wei Liu
2016-06-20 16:30 ` [PATCH v3 1/3] xen: add warning infrastructure Wei Liu
2016-06-22 15:35 ` Jan Beulich
2016-06-23 10:37 ` Wei Liu
2016-06-23 11:17 ` Wei Liu
2016-06-23 11:21 ` Andrew Cooper
2016-06-23 12:18 ` Jan Beulich
2016-06-20 16:30 ` [PATCH v3 2/3] console: use warning infrastructure for sync console warning Wei Liu
2016-06-22 15:37 ` Jan Beulich
2016-06-23 10:45 ` Wei Liu
2016-06-20 16:30 ` [PATCH v3 3/3] xen: make available hvm_fep to non-debug build as well Wei Liu
2016-06-22 15:42 ` Jan Beulich
2016-06-23 10:50 ` Wei Liu
2016-06-23 12:20 ` Jan Beulich
2016-06-23 12:44 ` Wei Liu
2016-06-23 12:48 ` Andrew Cooper [this message]
2016-06-23 12:50 ` Wei Liu
2016-06-23 13:05 ` Jan Beulich
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=68b15ad0-af0d-3d0c-47d6-2d51ddd8956a@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=cardoe@cardoe.com \
--cc=wei.liu2@citrix.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).