On 16.11.2023 12:58, Roger Pau Monne wrote:
> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -991,10 +991,7 @@ struct livepatch_func {
> uint32_t new_size;
> uint32_t old_size;
> uint8_t version; /* MUST be LIVEPATCH_PAYLOAD_VERSION. */
> - uint8_t opaque[LIVEPATCH_OPAQUE_SIZE];
> - uint8_t applied;
> - uint8_t patch_offset;
> - uint8_t _pad[6];
> + uint8_t _pad[39];
Should this be LIVEPATCH_OPAQUE_SIZE+8 and ...
> --- a/xen/include/xen/livepatch.h
> +++ b/xen/include/xen/livepatch.h
> @@ -13,6 +13,9 @@ struct xen_sysctl_livepatch_op;
>
> #include <xen/elfstructs.h>
> #include <xen/errno.h> /* For -ENOSYS or -EOVERFLOW */
> +
> +#include <public/sysctl.h> /* For LIVEPATCH_OPAQUE_SIZE */
> +
> #ifdef CONFIG_LIVEPATCH
>
> /*
> @@ -51,6 +54,12 @@ struct livepatch_symbol {
> bool_t new_symbol;
> };
>
> +struct livepatch_fstate {
> + unsigned int patch_offset;
> + enum livepatch_func_state applied;
> + uint8_t opaque[LIVEPATCH_OPAQUE_SIZE];
... this use a separate, new (and internal only) constant? Thus also
elimiating the need to include public/sysctl.h above?
Jan