[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 3/7] xsm: refactor xsm_ops handling


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Fri, 27 Aug 2021 09:44:50 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630071893; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=E8x+9mrcYQkfmAkT5gadifYyKGEDWxuo1P25sCJqADo=; b=WhcHKjgcD185iUaRcVBWyG2p04zhDj9sjT9oTJPBJTwUo8hmc+LvhaIG5gZqughRD165xREQoP1BF7AGMe/TUIoblGeQ5hdUEaJ1xVvX3SD4ZKjk7pdZXSyH7fnraZWkEKoTMCIpRfWzDmofXaJJRqd7Y1f5FyVfHjc8BiqEC0w=
  • Arc-seal: i=1; a=rsa-sha256; t=1630071893; cv=none; d=zohomail.com; s=zohoarc; b=NWlQiF2m4rKpaMh/N6ktYW9fjck9MzkdvRT3Wun2rHe0WhdiVuHq33/OrVyXv6DUTLeR0lXN/CRS8fFrXJd4lvbtR6ai25ZJ3zRwtIpfQbfTtIxtB/gefZKk5HQO2jVolJjBVsZafnN50Y0OJbEua2q6vPfGh6jb25aqjXY6q0o=
  • Cc: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 27 Aug 2021 13:44:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 8/25/21 11:16 AM, Jan Beulich wrote:
> On 05.08.2021 16:06, Daniel P. Smith wrote:
>> @@ -747,16 +747,16 @@ extern int xsm_dt_policy_init(void **policy_buffer, 
>> size_t *policy_size);
>>  extern bool has_xsm_magic(paddr_t);
>>  #endif
>>  
>> -extern int register_xsm(struct xsm_operations *ops);
>> -
>> -extern struct xsm_operations dummy_xsm_ops;
>> -extern void xsm_fixup_ops(struct xsm_operations *ops);
>> +extern void xsm_fixup_ops(struct xsm_ops *ops);
>>  
>>  #ifdef CONFIG_XSM_FLASK
>> -extern void flask_init(const void *policy_buffer, size_t policy_size);
>> +extern const struct xsm_ops *flask_init(const void *policy_buffer,
>> +                                        size_t policy_size);
>>  #else
>> -static inline void flask_init(const void *policy_buffer, size_t policy_size)
>> +static inline struct xsm_ops *flask_init(const void *policy_buffer,
> 
> Please use const consistently between real function and stub.

Ack.

>> @@ -766,9 +766,12 @@ extern const unsigned int xsm_flask_init_policy_size;
>>  #endif
>>  
>>  #ifdef CONFIG_XSM_SILO
>> -extern void silo_init(void);
>> +extern const struct xsm_ops *silo_init(void);
>>  #else
>> -static inline void silo_init(void) {}
>> +static inline struct xsm_ops *silo_init(void)
> 
> Same here.

Ack.

>> --- a/xen/xsm/flask/hooks.c
>> +++ b/xen/xsm/flask/hooks.c
>> @@ -1745,7 +1745,7 @@ static int flask_argo_send(const struct domain *d, 
>> const struct domain *t)
>>  long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
>>  int compat_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
>>  
>> -static struct xsm_operations flask_ops = {
>> +static const struct xsm_ops __initconst flask_ops = {
> 
> __initconstrel please (I thought I had pointed out the difference
> already during earlier discussion). Same for SILO then of course.

Apologies, yes you did and that is my fault as I had only recorded the
__initconst suggestion in my checklist and did not update with your
__initconstrel suggestion.

>> --- a/xen/xsm/xsm_core.c
>> +++ b/xen/xsm/xsm_core.c
>> @@ -28,9 +28,17 @@
>>  #include <asm/setup.h>
>>  #endif
>>  
>> -#define XSM_FRAMEWORK_VERSION    "1.0.0"
>> +#define XSM_FRAMEWORK_VERSION    "1.0.1"
>>  
>> -struct xsm_operations *xsm_ops;
>> +struct xsm_ops xsm_ops;
> 
> __read_mostly?

Ack.

v/r,
dps




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.