mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Per Bilse <Per.Bilse@citrix.com>
To: Juergen Gross <jgross@suse.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	"moderated list:XEN HYPERVISOR INTERFACE" 
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] drivers/xen/hypervisor: Expose Xen SIF flags to userspace
Date: Mon, 12 Dec 2022 13:35:22 +0000	[thread overview]
Message-ID: <0c3471d6-1a27-2e45-7093-b6d3898dcc6a@citrix.com> (raw)
In-Reply-To: <15fff7b8-b030-edf9-5bff-073b9757cb2e@suse.com>

On 09/12/2022 09:04, Juergen Gross wrote:
> On 02.12.22 19:22, Per Bilse wrote:
>> +Description:    If running under Xen:
>> +        All bits in Xen's start-flags are represented as
>> +        boolean files, returning '1' if set, '0' otherwise.
> 
> I think at least the files which want to be used by e.g. systemd
> ("initdomain" as replacement for the "control_d" string in capabilities,
> but I think "privileged" as well) should be explicitly added to this
> description, as those are meant to be used as a stable ABI.

OK, yes, it's a bit vague as is.

>> +static struct hyp_sysfs_attr flag_attrs[FLAG_COUNT] = {
>> +    [ilog2(SIF_PRIVILEGED)] = {
>> +        .attr = { .name = "privileged", .mode = 0444 },
>> +        .show = flag_show,
>> +        .hyp_attr_value = SIF_PRIVILEGED
>> +    },
> 
> What about:
> 
> #define FLAG_NODE(bit, node)                    \
>      [ilog2(bit)] = {                    \
>          .attr = { .name = #node, .mode = 0444 },    \
>          .show = flag_show,                \
>          .hyp_attr_value = bit                \
>      }

Yes ... I was thinking that maybe flags wouldn't normally share most 
characteristics, but they probably do.

> In order to avoid a consumer having to look into the sources for any other
> set flag, maybe add names for currently defined flags, too? Or just skip > the other flags and add a single additional node ("flags"?) with the 
whole
> value of xen_start_flags either in hex or binary form?

The current format is as suggested by Andrew Cooper in email about a 
previous incarnation 
(https://lore.kernel.org/lkml/92300a81-b97b-f5d6-e3e8-363d8a7d3742@citrix.com/); 
specifically, that of the known flags only initdomain and privileged are 
relevant outside a kernel context, and that all other flags be exposed 
individually.

> Please note that this is a suggestion only, I'm not insisting on it.

Please, many thanks for the feedback, it's always good to hear other 
people's thoughts.

Best,

   -- Per


      reply	other threads:[~2022-12-12 13:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02 18:22 Per Bilse
2022-12-09  9:04 ` Juergen Gross
2022-12-12 13:35   ` Per Bilse [this message]

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=0c3471d6-1a27-2e45-7093-b6d3898dcc6a@citrix.com \
    --to=per.bilse@citrix.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®