xen/xsm: Introduce new boot parameter xsm
PATCH 1/2 xen/xsm: Introduce new boot parameter xsm
Introduce new boot parameter xsm to choose which xsm module is enabled, and set default to dummy.
---
CC: Daniel De Graaf <[email protected]>
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Konrad Rzeszutek Wilk <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Tim Deegan <[email protected]>
CC: Wei Liu <[email protected]>
CC: Sergey Dyasli <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Ming Lu <[email protected]>
v2
To further discuss:
1) is "dummy" a good command line option? other choices: basic", "trivial", or "simple"
--- docs/misc/xen-command-line.markdown | 13 ++++++++++ xen/xsm/xsm_core.c | 39 ++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-)
docs/misc/xen-command-line.markdown +13 -0
@@ -865,6 +865,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. No special restriction will be applied. + it's also used when XSM is compiled out. +* `flask`: this is the policy based access control. To choose this, the + separated option in kconfig must also be enabled. + ### flask > `= permissive | enforcing | late | disabled`
xen/xsm/xsm_core.c +38 -1
@@ -31,6 +31,30 @@struct xsm_operations *xsm_ops; +enum xsm_bootparam { +XSM_BOOTPARAM_DUMMY , +XSM_BOOTPARAM_FLASK , +}; + +static enum xsm_bootparam __initdata xsm_bootparam =XSM_BOOTPARAM_DUMMY ; +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 + rc = -EINVAL ; + +return rc; +} + +custom_param ("xsm" , parse_xsm_param); +static inline int verify (struct xsm_operations *ops) {/* verify the security_operations structure exists */
@@ -57,7 +81,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 ; + }return 0 ; }
Signature · 7 lines
2.18.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 2/2 xen/xsm: Add new SILO mode for XSM
When SILO is enabled, there would be no page-sharing or event notifications between unprivileged VMs (no grant tables or event channels).
---
CC: Daniel De Graaf <[email protected]>
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Konrad Rzeszutek Wilk <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Tim Deegan <[email protected]>
CC: Wei Liu <[email protected]>
CC: Sergey Dyasli <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Ming Lu <[email protected]>
v2
To further discuss:
1) is the new Kconfig option XSM_SILO necessary?
we can handle SILO similar as DUMMY, using exsting CONFIG_XSM.
2) explain "unmediated communication channel"
3) is it OK to use the indirect call dummy_xsm_ops.evtchn_unbound?
--- docs/misc/xen-command-line.markdown | 5 +- xen/common/Kconfig | 12 ++++ xen/include/xsm/xsm.h | 6 ++ xen/xsm/Makefile | 1 + xen/xsm/silo.c | 102 ++++++++++++++++++++++++++++ xen/xsm/xsm_core.c | 9 +++ 6 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 xen/xsm/silo.c
docs/misc/xen-command-line.markdown +4 -1
@@ -866,7 +866,7 @@ Note that specifying zero as domU value means zero, while for dom0 it means to use the default. ### xsm -> `= dummy | flask` +> `= dummy | flask | silo` > Default: `dummy`
@@ -877,6 +877,9 @@ the hypervisor was compiled with XSM support. it's also used when XSM is compiled out. * `flask`: this is the policy based access control. To choose this, the separated option in kconfig must also be enabled. +* `silo`: this will deny any unmediated communication channels between + unprivileged VMs. To choose this, the separated option in kconfig must also + be enabled. ### flask > `= permissive | enforcing | late | disabled`
xen/common/Kconfig +12 -0
@@ -143,6 +143,18 @@ config XSM_FLASK_POLICY If unsure, say Y. +config XSM_SILO + def_bool y + prompt "SILO support" + depends on XSM + ---help--- + Enables SILO as the access control mechanism used by the XSM framework. + This is not the default module, add boot parameter xsm=silo to choose + it. This will deny any unmediated communication channels (grant tables + and event channels) between unprivileged VMs. + + If unsure, say Y. + config LATE_HWDOM bool "Dedicated hardware domain" default n
xen/include/xsm/xsm.h +6 -0
@@ -733,6 +733,12 @@ extern const unsigned char xsm_init_flask_policy[];extern const unsigned int xsm_init_flask_policy_size;#endif +#ifdef CONFIG_XSM_SILO +extern void silo_init (void ); +#else +static inline void silo_init (void ) {} +#endif +#else /* CONFIG_XSM */ #include <xsm/dummy.h>
xen/xsm/Makefile +1 -0
@@ -1,5 +1,6 @@ obj-y += xsm_core.o obj-$(CONFIG_XSM) += xsm_policy.o obj-$(CONFIG_XSM) += dummy.o +obj-$(CONFIG_XSM_SILO) += silo.o subdir-$(CONFIG_XSM_FLASK) += flask
xen/xsm/silo.c new file +102 -0
102 lines not on this page · raw message
xen/xsm/xsm_core.c +9 -0
@@ -34,6 +34,7 @@ struct xsm_operations *xsm_ops;enum xsm_bootparam {XSM_BOOTPARAM_DUMMY ,XSM_BOOTPARAM_FLASK , +XSM_BOOTPARAM_SILO , };static enum xsm_bootparam __initdata xsm_bootparam =XSM_BOOTPARAM_DUMMY ;
@@ -46,6 +47,10 @@ static int __init parse_xsm_param(const char *s)#ifdef CONFIG_XSM_FLASK else if ( !strcmp(s, "flask") ) xsm_bootparam =XSM_BOOTPARAM_FLASK ; +#endif +#ifdef CONFIG_XSM_SILO + else if ( !strcmp(s, "silo") ) + xsm_bootparam =XSM_BOOTPARAM_SILO ;#endif else rc = -EINVAL ;
@@ -91,6 +96,10 @@ static int __init xsm_core_init(const void *policy_buffer, size_t policy_size)flask_init (policy_buffer, policy_size);break ; +case XSM_BOOTPARAM_SILO : +silo_init (); +break ; +default :printk ("XSM: Invalid value for xsm= boot parameter.\n" );break ;
Signature · 7 lines
2.18.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 71 lines
-----Original Message-----
From: Xin Li [mailto:[email protected]]
Sent: Tuesday, July 3, 2018 9:26 AM
To: [email protected]
Cc: Xin Li (Talons) <[email protected]>; Daniel De Graaf <[email protected]>; George Dunlap <[email protected]>; Jan Beulich <[email protected]>; Konrad Rzeszutek Wilk <[email protected]>; Stefano Stabellini <[email protected]>; Tim (Xen.org) <[email protected]>; Wei Liu <[email protected]>; Sergey Dyasli <[email protected]>; Andrew Cooper <[email protected]>; Ming Lu <[email protected]>
Subject: [PATCH 1/2] xen/xsm: Introduce new boot parameter xsmIntroduce new boot parameter xsm to choose which xsm module is enabled, and set default to dummy.
Signed-off-by Xin Li <[email protected]>---
CC: Daniel De Graaf <[email protected]>
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Konrad Rzeszutek Wilk <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Tim Deegan <[email protected]>
CC: Wei Liu <[email protected]>
CC: Sergey Dyasli <[email protected]>
CC: Andrew Cooper <[email protected]>
CC: Ming Lu <[email protected]>v2
To further discuss:
1) is "dummy" a good command line option? other choices: basic", "trivial", or "simple"--- docs/misc/xen-command-line.markdown | 13 ++++++++++ xen/xsm/xsm_core.c | 39 ++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-)docs/misc/xen- renamed from docs/misc/xen-command-line.markdown +0
-0command-line.markdown
index075e5ea159..7ca34aa273100644docs/misc/xen-command-line.markdown +0
-0@@ -865,6 +865,19 @@ hardware domain is architecture dependent. Note that specifying zero as domU value means zero, while for dom0 it meansto use the default.
docs/misc/xen-command-line.markdown +14
-0+### 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. No special restriction will be applied. + it's also used when XSM is compiled out. +* `flask`: this is the policy based access control. To choose this, +the + separated option in kconfig must also be enabled. + ### flask > `= permissive | enforcing | late | disabled`xen/xsm/xsm_core.c index renamed from xen/xsm/xsm_core.c +0
-0
cddcf7aa51..d4668edad7100644
xen/xsm/xsm_core.c line 39
Quoted 9 lines
xen/xsm/xsm_core.c +6
-0@@ -31,6 +31,30 @@struct xsm_operations *xsm_ops; +enum xsm_bootparam { +XSM_BOOTPARAM_DUMMY , +XSM_BOOTPARAM_FLASK , +}; + +static enum xsm_bootparam __initdata xsm_bootparam =XSM_BOOTPARAM_DUMMY ;
New line here.
Quoted 7 lines
xen/xsm/xsm_core.c +5
-0+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
xen/xsm/xsm_core.c line 54
Quoted 7 lines
xen/xsm/xsm_core.c +7
-0+else if ( !strcmp (s,"flask" ) ) + xsm_bootparam =XSM_BOOTPARAM_FLASK ;#endif + else + rc = -EINVAL ; + +return rc; +}
No new line here.
Quoted 27 lines
xen/xsm/xsm_core.c +2
-0+custom_param ("xsm" , parse_xsm_param); +static inline int verify (struct xsm_operations *ops) { /* verify the security_operations structure exists */ @@ -57,7 +81,20 @@static int
__initxsm_core_init(const void *policy_buffer, size_t policy_size)} xsm_ops = &dummy_xsm_ops;xen/xsm/xsm_core.c +14
-2-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 ; + }return 0 ; } --
Quoted 1 line
2.18.0
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
First of all - please indicate the version also in the subject, i.e. here [PATCH v2 1/2] or some such.
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 03.07.18 at 03:26, <[email protected]> wrote:
v2
To further discuss:
1) is "dummy" a good command line option?
other choices: basic", "trivial", or "simple"
Indeed, but not limited to the named set.
Additionally, please have a brief summary of changes from the prior version here.
xen/xsm/xsm_core.c static int __init xsm_core_init(const void *policy_buffer, size_t policy_size) · line 95
Quoted 11 lines
xen/xsm/xsm_core.c +11
-0+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" );
As I think I've said before - generally no full stop at the end of log messages please. I also think that in error messages like this the offending string should be logged as well. Which points out an issue with the change: Without CONFIG_XSM_FLASK (under the current naming as proposed by Andrew; you should btw continue to name the dependency of your series on his one until that prereq has landed in staging, which you'd ideally do in a 0/2 cover letter) would perhaps better result in this error message to be issued, in favor of or in addition to the command line parsing one.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [PATCH 2/2] xen/xsm: Add new SILO mode for XSM
In reply to Xin LiQuoted 7 lines
Quoted 1 line
Quoted 1 line · On 03.07.18 at 03:26, <[email protected]> wrote:
v2
To further discuss:
1) is the newKconfigoptionXSM_SILOnecessary?
we can handle SILO similar as DUMMY, using exstingCONFIG_XSM.2) explain "unmediated communication channel"
I'm confused: As said in the reply to patch 1, this section is generally expected to contain information on what has changed from the prior version. I take it the above item instead related to the "To further discuss" sub-heading.
Quoted 1 line
3) is it OK to use the indirect call dummy_xsm_ops.evtchn_unbound?
I'm not convinced it was worthwhile to send v2 with all of these still open.
xen/xsm/silo.c line 32
Quoted 7 lines
xen/xsm/silo.c new file +7
-0+/* +* Check if inter-domain communication is allowed. +* Return true when pass check. +*/ +static bool silo_mode_dom_check (struct domain *ldom,struct domain *rdom) +{ +struct domain *cur_dom = current->domain;
const (three times altogether)
xen/xsm/silo.c line 43
Quoted 10 lines
xen/xsm/silo.c new file +10
-0+return (is_control_domain (cur_dom) ||is_control_domain (ldom) || +is_control_domain (rdom) || ldom == rdom); +} + +static int silo_evtchn_unbound (struct domain *d1,struct evtchn *chn, +domid_t id2) +{ +int rc = -EPERM ; +struct domain *d2 =rcu_lock_domain_by_id (id2); +if ( d2 !=NULL &&silo_mode_dom_check (d1, d2) )
Blank line please between declaration(s) and statement(s). And const on the local variable declaration again.
Also, is DOMID_SELF really not allowed here for id2? I don't think so, looking at e.g. evtchn_alloc_unbound().
xen/xsm/silo.c line 77
Quoted 6 lines
xen/xsm/silo.c new file +6
-0+static int silo_grant_copy (struct domain *d1,struct domain *d2) +{ +if (silo_mode_dom_check (d1, d2) ) +return dummy_xsm_ops.grant_copy (d1, d2); +return -EPERM ; +}
I know transitive grants are a bad child, but they shouldn't be left out altogether in deciding what SILO mode is going to mean. In fact it looks to me as if there was no XSM check at all for the second half of a transitive grant copy's domain handling (the recursive acquire_grant_for_copy() call), which would mean that the fencing SILO mode looks to mean to establish wouldn't be complete. Daniel?
Speaking of completeness: What about TMEM? Isn't one of the two pool types also meant to allow page sharing between domains?
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 38 lines
-----Original Message-----
From: Jan Beulich [mailto:[email protected]]
Sent: Tuesday, July 3, 2018 3:12 PM
To: Xin Li <[email protected]>
Cc: Andrew Cooper <[email protected]>; Ming Lu <[email protected]>; Sergey Dyasli <[email protected]>; Wei Liu <[email protected]>; Xin Li (Talons) <[email protected]>; George Dunlap <[email protected]>; Stefano Stabellini <[email protected]>; xen- [email protected]; Konrad Rzeszutek Wilk <[email protected]>; Daniel de Graaf <[email protected]>; Tim (Xen.org) <[email protected]>
Subject: Re: [PATCH 1/2] xen/xsm: Introduce new boot parameter xsmFirst of all - please indicate the version also in the subject, i.e. here [PATCH v2 1/2] or some such.
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 03.07.18 at 03:26, <[email protected]> wrote:
v2
To further discuss:
1) is "dummy" a good command line option?
other choices: basic", "trivial", or "simple"Indeed, but not limited to the named set.
Additionally, please have a brief summary of changes from the prior version here.
xen/xsm/xsm_core.c static int __init xsm_core_init(const void *policy_buffer, size_t policy_size) · line 95
Quoted 11 lines
xen/xsm/xsm_core.c +11
-0+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" );
Quoted 8 lines
As I think I've said before - generally no full stop at the end of log messages please. I also think that in error messages like this the offending string should be logged as well. Which points out an issue with the change: Without
CONFIG_XSM_FLASK(under the current naming as proposed by Andrew; you should btw continue to name the dependency of your series on his one until that prereq has landed in staging, which you'd ideally do in a 0/2 cover letter) would perhaps better result in this error message to be issued, in favor of or in addition to the command line parsing one.
OK.
Remove this ".",
And in parse_xsm_param, add:
else {
printk("XSM: can't parse boot parameter xsm=%s\n", s);
rc = -EINVAL;
}Quoted 3 lines
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [PATCH 2/2] xen/xsm: Add new SILO mode for XSM
In reply to Jan BeulichHello Jan,
Quoted 20 lines
-----Original Message-----
From: Jan Beulich [mailto:[email protected]]
Sent: Tuesday, July 3, 2018 3:34 PM
To: Xin Li <[email protected]>; Daniel de Graaf <[email protected]>
Cc: Andrew Cooper <[email protected]>; Ming Lu <[email protected]>; Sergey Dyasli <[email protected]>; Wei Liu <[email protected]>; Xin Li (Talons) <[email protected]>; George Dunlap <[email protected]>; Stefano Stabellini <[email protected]>; xen- [email protected]; Konrad Rzeszutek Wilk <[email protected]>; Tim (Xen.org) <[email protected]>
Subject: Re: [PATCH 2/2] xen/xsm: Add new SILO mode for XSMQuoted 7 lines
Quoted 1 line
Quoted 1 line · On 03.07.18 at 03:26, <[email protected]> wrote:
v2
To further discuss:
1) is the newKconfigoptionXSM_SILOnecessary?
we can handle SILO similar as DUMMY, using exstingCONFIG_XSM.2) explain "unmediated communication channel"
Quoted 7 lines
I'm confused: As said in the reply to patch 1, this section is generally expected to contain information on what has changed from the prior version. I take it the above item instead related to the "To further discuss" sub-heading.
Quoted 1 line
3) is it OK to use the indirect call dummy_xsm_ops.evtchn_unbound?
I'm not convinced it was worthwhile to send v2 with all of these still open.
OK.
Quoted 10 lines
xen/xsm/silo.c line 32
Quoted 8 lines
xen/xsm/silo.c new file +7
-0+/* +* Check if inter-domain communication is allowed. +* Return true when pass check. +*/ +static bool silo_mode_dom_check (struct domain *ldom,struct domain +*rdom) { +struct domain *cur_dom = current->domain;const (three times altogether)
OK.
static bool silo_mode_dom_check(const struct domain *ldom,
const struct domain *rdom)
{
const struct domain *cur_dom = current->domain;
return (is_control_domain(cur_dom) || is_control_domain(ldom) ||
is_control_domain(rdom) || ldom == rdom);
}Quoted 13 lines
xen/xsm/silo.c line 43
Quoted 9 lines
xen/xsm/silo.c new file +8
-0+return (is_control_domain (cur_dom) ||is_control_domain (ldom) || +is_control_domain (rdom) || ldom == rdom); } + +static int silo_evtchn_unbound (struct domain *d1,struct evtchn *chn, +domid_t id2) { +int rc = -EPERM ; +struct domain *d2 =rcu_lock_domain_by_id (id2); +if ( d2 !=NULL &&silo_mode_dom_check (d1, d2) )Blank line please between declaration(s) and statement(s). And const on the local variable declaration again.
Quoted 2 lines
Also, is
DOMID_SELFreally not allowed here for id2? I don't think so, looking at e.g.evtchn_alloc_unbound().
static int silo_evtchn_unbound(struct domain *d1, struct evtchn *chn,
domid_t id2)
{
int rc = -EPERM;
struct domain *d2;
if ( id2 == DOMID_SELF )
id2 = current->domain->domain_id;
d2 = rcu_lock_domain_by_id(id2);
if ( d2 != NULL && silo_mode_dom_check(d1, d2) )
rc = dummy_xsm_ops.evtchn_unbound(d1, chn, id2);
rcu_unlock_domain(d2);
return rc;
}Quoted 14 lines
xen/xsm/silo.c line 77
Quoted 6 lines
xen/xsm/silo.c new file +5
-0+static int silo_grant_copy (struct domain *d1,struct domain *d2) { +if (silo_mode_dom_check (d1, d2) ) +return dummy_xsm_ops.grant_copy (d1, d2); +return -EPERM ; +}I know transitive grants are a bad child, but they shouldn't be left out altogether in deciding what SILO mode is going to mean. In fact it looks to me as if there was no XSM check at all for the second half of a transitive grant copy's domain handling (the recursive
acquire_grant_for_copy()call), which would mean that the fencing SILO mode looks to mean to establish wouldn't be complete. Daniel?
Quoted 5 lines
Speaking of completeness: What about TMEM? Isn't one of the two pool types also meant to allow page sharing between domains?
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [PATCH 2/2] xen/xsm: Add new SILO mode for XSM
Quoted 21 lines
Quoted 16 lines
Quoted 1 line · On 03.07.18 at 11:07, <[email protected]> wrote:
From: Jan Beulich [mailto:[email protected]]
Sent: Tuesday, July 3, 2018 3:34 PMxen/xsm/silo.c line 43
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 03.07.18 at 03:26, <[email protected]> wrote:
xen/xsm/silo.c new file +8
-0+return (is_control_domain (cur_dom) ||is_control_domain (ldom) || +is_control_domain (rdom) || ldom == rdom); } + +static int silo_evtchn_unbound (struct domain *d1,struct evtchn *chn, +domid_t id2) { +int rc = -EPERM ; +struct domain *d2 =rcu_lock_domain_by_id (id2); +if ( d2 !=NULL &&silo_mode_dom_check (d1, d2) )Blank line please between declaration(s) and statement(s). And const on the local variable declaration again.
Quoted 2 lines
Also, is
DOMID_SELFreally not allowed here for id2? I don't think so, looking at e.g.evtchn_alloc_unbound().static int silo_evtchn_unbound(struct domain *d1, struct evtchn *chn,
domid_tid2)
Quoted 7 lines
{
int rc = -EPERM;
struct domain *d2;
if ( id2 == DOMID_SELF )
id2 = current->domain->domain_id;
d2 = rcu_lock_domain_by_id(id2);No - simply call rcu_lock_domain_by_any_id().
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [PATCH 2/2] xen/xsm: Add new SILO mode for XSM
Quoted 37 lines
-----Original Message-----
From: Jan Beulich [mailto:[email protected]]
Sent: Tuesday, July 3, 2018 6:16 PM
To: Xin Li (Talons) <[email protected]>; Xin Li <[email protected]>
Cc: Andrew Cooper <[email protected]>; George Dunlap <[email protected]>; Ming Lu <[email protected]>; Sergey Dyasli <[email protected]>; Wei Liu <[email protected]>; Stefano Stabellini <[email protected]>; [email protected]; Konrad Rzeszutek Wilk <[email protected]>; Daniel de Graaf <[email protected]>; Tim (Xen.org) <[email protected]>
Subject: RE: [PATCH 2/2] xen/xsm: Add new SILO mode for XSMQuoted 25 lines
Quoted 16 lines
Quoted 1 line · On 03.07.18 at 11:07, <[email protected]> wrote:
From: Jan Beulich [mailto:[email protected]]
Sent: Tuesday, July 3, 2018 3:34 PMxen/xsm/silo.c line 43
Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 03.07.18 at 03:26, <[email protected]> wrote:
xen/xsm/silo.c new file +8
-0+return (is_control_domain (cur_dom) ||is_control_domain (ldom) || +is_control_domain (rdom) || ldom == rdom); } + +static int silo_evtchn_unbound (struct domain *d1,struct evtchn *chn, +domid_t id2) { +int rc = -EPERM ; +struct domain *d2 =rcu_lock_domain_by_id (id2); +if ( d2 !=NULL &&silo_mode_dom_check (d1, d2) )Blank line please between declaration(s) and statement(s). And const on the local variable declaration again.
Quoted 2 lines
Also, is
DOMID_SELFreally not allowed here for id2? I don't think so, looking at e.g.evtchn_alloc_unbound().static int silo_evtchn_unbound(struct domain *d1, struct evtchn *chn,
domid_tid2){ int rc = -EPERM; struct domain *d2;
Quoted 5 lines
Quoted 3 lines
if ( id2 == DOMID_SELF ) id2 = current->domain->domain_id; d2 = rcu_lock_domain_by_id(id2);No - simply call
rcu_lock_domain_by_any_id().
Sure.
+ int rc = -EPERM;
+ struct domain *d2 = rcu_lock_domain_by_any_id(id2);
+
+ if ( d2 != NULL && silo_mode_dom_check(d1, d2) )
Quoted 3 lines
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 7 lines · Jan Beulich
First of all - please indicate the version also in the subject, i.e. here [PATCH v2 1/2] or some such.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 03.07.18 at 03:26, <[email protected]> wrote:
v2
To further discuss:
1) is "dummy" a good command line option?
other choices: basic", "trivial", or "simple"Indeed, but not limited to the named set.
I think I’d go with “standard” or “default”. The “default” restrictions are by no means “dummy”, “trivial”, or “simple” — they’re carefully thought out for the most common Xen deployment.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 26 lines
-----Original Message-----
From: George Dunlap
Sent: Thursday, July 5, 2018 12:55 AM
To: Jan Beulich <[email protected]>
Cc: Xin Li <[email protected]>; Andrew Cooper <[email protected]>; Ming Lu <[email protected]>; Sergey Dyasli <[email protected]>; Wei Liu <[email protected]>; Xin Li (Talons) <[email protected]>; George Dunlap <[email protected]>; Stefano Stabellini <[email protected]>; xen-devel <[email protected]>; Konrad Rzeszutek Wilk <[email protected]>; Daniel de Graaf <[email protected]>; Tim (Xen.org) <[email protected]>
Subject: Re: [PATCH 1/2] xen/xsm: Introduce new boot parameter xsmQuoted 11 lines · Jan Beulich
First of all - please indicate the version also in the subject, i.e. here [PATCH v2 1/2] or some such.
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 03.07.18 at 03:26, <[email protected]> wrote:
v2
To further discuss:
1) is "dummy" a good command line option?
other choices: basic", "trivial", or "simple"
Quoted 5 lines
Quoted 1 line
Indeed, but not limited to the named set.
I think I’d go with “standard” or “default”. The “default” restrictions are by no means “dummy”, “trivial”, or “simple” — they’re carefully thought out for the most common Xen deployment.
"default" seems to be a good choice.
It matches the code logic.
if ( !strcmp(s, "default") )
xsm_bootparam = XSM_BOOTPARAM_DUMMY;also update " docs/misc/xen-command-line.markdown"
Quoted 2 lines
-George
Best regards
Xin(Talons) Li
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 4 lines · Xin Li
Introduce new boot parameter xsm to choose which xsm module is enabled, and set default to dummy.
Signed-off-by Xin Li <[email protected]>
This is a change in defaults for the command line: previously, if you compiled Xen with FLASK support, Xen defaulted to using it unless you specified "flask=disabled" on the command line. If we want to model the interface after Linux, there would be a KConfig choice of the default which can be overridden by the command line, so distributions can keep current behavior (including making the default dummy while enabling the other XSM modules).
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel