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

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


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 25 Aug 2021 17:16:32 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+8tyB8WblkCc2TfmASl9M6/QXpNZ5gexPCeAFiF8rHo=; b=St6X+tT715luZ9tcgCe30RE2rxbJIz6lZaAGb449HNvkPUx31ksljf2VhaSi/QQquYTvZg1Dsrd8whzz7puggCtcdM3g9Rxx0neg3YVDIPR1g2CEFIDHjVHcvh3upH+aNgY3wG86msSiB877PK79J//WbQyuBtDEWLnFhCrmJs8yfmfnXflfJxZO6UZOCtmSRyiKEs0gBz109t78DGAPdZ0iU7k3X8FhnOwcFRDRgW4vbr4AcHmkbYon82Z72FL2h4uaq0dU5e0z5K7LrI6g/E2kNfkJZ6ZeMHY3RRlOaTSIKkyDqPzzI98kw3BqZgR0xlq/rBy0BfKM6OmzhI02Ug==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y9myRUvIVsEaws9PeBrm8GgZdwHWt9wifkeyX7Lh122x6G1OAzPu5cWKqz51C10PvlWM2ebYMglDJSohFUI74yTWmRpIppzImqkz1jclRGBsIFnWFnUJhk2BxL4q2ISsgGtlAs0J7cm3cODNoLRB07kFewqfh0PYl4YjMfzuu+DS6XuyvfK5khZZsZplex5ItC2dxjdxF+M3ydhAstKkFzdov79tJbILaTZkeNz5hZSdHQil5Q+jhD8yebmNOUK6p9SYDkED/wLtjhWmqS3bhuXIgBTPr29HLajX3OUNMqRuHvKF/3FRJkMxNRSKUCJIOUYXPLWnEQ+6CdYQBx8x4Q==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 25 Aug 2021 15:16:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

> @@ -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.

> --- 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.

> --- 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?

Jan




 


Rackspace

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