All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Xin Li (Talons)" <xin.li@citrix.com>
To: Jan Beulich <JBeulich@suse.com>, Xin Li <talons.lee@gmail.com>
Cc: Sergey Dyasli <sergey.dyasli@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"Tim (Xen.org)" <tim@xen.org>,
	George Dunlap <George.Dunlap@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Ming Lu <ming.lu@citrix.com>,
	Daniel de Graaf <dgdegra@tycho.nsa.gov>
Subject: Re: [PATCH 1/2] xen/xsm: Introduce new boot parameter xsm
Date: Mon, 8 Oct 2018 06:30:53 +0000	[thread overview]
Message-ID: <d39a46304ed640fdb1b4211209f75291@SINPEX02CL01.citrite.net> (raw)
In-Reply-To: <5BB3365902000078001ED963@prv1-mh.provo.novell.com>

Thanks Jan.

> >>> On 29.09.18 at 11:22, <talons.lee@gmail.com> wrote:
> > --- a/docs/misc/xen-command-line.markdown
> > +++ b/docs/misc/xen-command-line.markdown
> > @@ -899,6 +899,19 @@ hardware domain is architecture dependent.
> >  Note that specifying zero as domU value means zero, while for dom0 it
> > means  to use the default.
> >
> > +### xsm
> > +> `= dummy | flask`
> > +
> > +> Default: `dummy`
> > +
> > +Specify which XSM module should be enabled.  This option is only
> > +available if the hypervisor was compiled with XSM support.
> > +
> > +* `dummy`: this is the default choice.  Basic restriction for common
> > +deployment
> > +  (the dummy module) will be applied.  it's also used when XSM is compiled
> out.
> 
> "It's" (upper case I).
> 
OK. Done.

> > +* `flask`: this is the policy based access control.  To choose this,
> > +the
> > +  separated option in kconfig must also be enabled.
> 
> Perhaps better "separate" (but I'm not a native speaker)?
> 
I prefer separated, as I checked here: https://english.stackexchange.com/questions/13144/separated-versus-separate
But generally both are OK I think.

> > @@ -154,6 +154,17 @@ config XSM_FLASK_POLICY
> >
> >  	  If unsure, say Y.
> >
> > +choice
> > +	prompt "Default XSM implementation"
> > +	depends on XSM
> > +	default XSM_FLASK_DEFAULT if XSM_FLASK
> > +	default XSM_DUMMY_DEFAULT
> > +	config XSM_DUMMY_DEFAULT
> > +		bool "Match non-XSM behavior"
> > +	config XSM_FLASK_DEFAULT
> > +		bool "FLux Advanced Security Kernel" if XSM_FLASK endchoice
> 
> Personally I'd prefer XSM_DEFAULT_*; not sure what others think.
> 
I would like to keep this style, because I see
"
        default "credit" if SCHED_CREDIT_DEFAULT
        default "credit2" if SCHED_CREDIT2_DEFAULT
" in config file.

> > --- a/xen/xsm/xsm_core.c
> > +++ b/xen/xsm/xsm_core.c
> > @@ -31,6 +31,37 @@
> >
> >  struct xsm_operations *xsm_ops;
> >
> > +enum xsm_bootparam {
> > +    XSM_BOOTPARAM_DUMMY,
> > +    XSM_BOOTPARAM_FLASK,
> 
> Considering the #ifdef-s further down, should this perhaps also be put in "#ifdef
> CONFIG_XSM_FLASK", to avoid it mistakenly getting used when the code was
> compiled out?
> 
I would like to avoid #ifdef here, because I prefer the same enum value in different config.

> > +};
> > +
> > +static enum xsm_bootparam __initdata xsm_bootparam = #ifdef
> > +CONFIG_XSM_FLASK_DEFAULT
> > +    XSM_BOOTPARAM_FLASK;
> > +#else
> > +    XSM_BOOTPARAM_DUMMY;
> > +#endif
> > +
> > +static int __init parse_xsm_param(const char *s) {
> > +    int rc = 0;
> > +
> > +    if ( !strcmp(s, "dummy") )
> > +        xsm_bootparam = XSM_BOOTPARAM_DUMMY; #ifdef
> CONFIG_XSM_FLASK
> > +    else if ( !strcmp(s, "flask") )
> > +        xsm_bootparam = XSM_BOOTPARAM_FLASK; #endif
> > +    else {
> 
> Style (brace goes on its own line).

OK. Done.

> 
> > +        printk("XSM: can't parse boot parameter xsm=%s\n", s);
> 
> Again, not being a native speaker, "can't parse" sounds odd. Why not just
> "unknown" or "unknown or unsupported"?

OK. Done.

> 
> > @@ -57,7 +88,20 @@ static int __init xsm_core_init(const void
> *policy_buffer, size_t policy_size)
> >      }
> >
> >      xsm_ops = &dummy_xsm_ops;
> > -    flask_init(policy_buffer, policy_size);
> > +
> > +    switch ( xsm_bootparam )
> > +    {
> > +    case XSM_BOOTPARAM_DUMMY:
> > +        break;
> > +
> > +    case XSM_BOOTPARAM_FLASK:
> > +        flask_init(policy_buffer, policy_size);
> > +        break;
> > +
> > +    default:
> > +        printk("XSM: Invalid value for xsm= boot parameter\n");
> > +        break;
> 
> What situation is this covering, when all enumerators already have their case
> label? Simply ASSERT_UNREACHABLE()?
> 

OK. Done.

> Jan
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-10-08  6:30 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-29  9:22 [PATCH 1/2] xen/xsm: Introduce new boot parameter xsm Xin Li
2018-09-29  9:22 ` [PATCH 2/2] xen/xsm: Add new SILO mode for XSM Xin Li
2018-10-01 15:21   ` [Non-DoD Source] " DeGraaf, Daniel G
2018-10-02  9:33   ` Jan Beulich
2018-10-08  7:49     ` Xin Li (Talons)
2018-10-08  8:28       ` Jan Beulich
2018-10-01 15:17 ` [Non-DoD Source] [PATCH 1/2] xen/xsm: Introduce new boot parameter xsm DeGraaf, Daniel G
2018-10-08  6:32   ` Xin Li (Talons)
2018-10-02  9:11 ` Jan Beulich
2018-10-08  6:30   ` Xin Li (Talons) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-28  8:18 Xin Li
2018-09-28 17:15 ` Daniel De Graaf
2018-07-03  1:26 Xin Li
2018-07-03  6:10 ` Xin Li (Talons)
2018-07-03  7:12 ` Jan Beulich
2018-07-03  8:58   ` Xin Li (Talons)
2018-07-04 16:54   ` George Dunlap
2018-07-05  1:38     ` Xin Li (Talons)
2018-08-17 19:11 ` Daniel De Graaf
2018-06-29  9:28 Xin Li
2018-06-29  9:47 ` Andrew Cooper
2018-06-29 10:04   ` Jan Beulich
2018-07-02  7:34     ` Xin Li (Talons)
2018-07-02  8:24       ` Jan Beulich
2018-07-02  8:39         ` Xin Li (Talons)
2018-07-02  9:04           ` Jan Beulich
2018-07-02  7:21   ` Xin Li (Talons)

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=d39a46304ed640fdb1b4211209f75291@SINPEX02CL01.citrite.net \
    --to=xin.li@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=George.Dunlap@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=konrad.wilk@oracle.com \
    --cc=ming.lu@citrix.com \
    --cc=sergey.dyasli@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=talons.lee@gmail.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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.