All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr <olekstysh@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Oleksandr Tyshchenko" <oleksandr_tyshchenko@epam.com>,
	"Ian Jackson" <iwj@xenproject.org>, "Wei Liu" <wl@xen.org>,
	"Anthony PERARD" <anthony.perard@citrix.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Julien Grall" <julien@xen.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Juergen Gross" <jgross@suse.com>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH V6 1/2] xen/arm: Introduce gpaddr_bits field to struct xen_domctl_getdomaininfo
Date: Tue, 12 Oct 2021 16:18:11 +0300	[thread overview]
Message-ID: <31f869a5-5788-74c7-c290-ce6797584e9e@gmail.com> (raw)
In-Reply-To: <0e03fe6e-8236-fc7d-669f-98107f40e014@suse.com>


On 12.10.21 14:49, Jan Beulich wrote:

Hi Jan

> On 12.10.2021 13:28, Oleksandr wrote:
>> On 12.10.21 12:24, Jan Beulich wrote:
>>> On 11.10.2021 19:48, Oleksandr Tyshchenko wrote:
>>>> @@ -150,6 +150,7 @@ struct xen_domctl_getdomaininfo {
>>>>        uint32_t ssidref;
>>>>        xen_domain_handle_t handle;
>>>>        uint32_t cpupool;
>>>> +    uint8_t gpaddr_bits; /* Guest physical address space size. */
>>>>        struct xen_arch_domainconfig arch_config;
>>> On the basis of the above, please add uint8_t pad[3] (or perhaps
>>> better pad[7] to be independent of the present
>>> alignof(struct xen_arch_domainconfig) == 4) and make sure the
>>> array will always be zero-filled, such that the padding space can
>>> subsequently be assigned a purpose without needing to bump the
>>> interface version(s) again.
>> ok, will do.
>>
>>
>>> Right now the sysctl caller of getdomaininfo() clears the full
>>> structure (albeit only once, so stale / inapplicable data might get
>>> reported for higher numbered domains if any field was filled only
>>> in certain cases), while the domctl one doesn't. Maybe it would be
>>> best looking forward if the domctl path also cleared the full buffer
>>> up front, or if the clearing was moved into the function. (In the
>>> latter case some writes of zeros into the struct could be eliminated
>>> in return.)
>> Well, I would be OK either way, with a little preference for the latter.
>>
>> Is it close to what you meant?
> Yes, just that ...
>
>> --- a/xen/common/domctl.c
>> +++ b/xen/common/domctl.c
>> @@ -69,10 +69,10 @@ void getdomaininfo(struct domain *d, struct
>> xen_domctl_getdomaininfo *info)
>>        int flags = XEN_DOMINF_blocked;
>>        struct vcpu_runstate_info runstate;
>>
>> +    memset(info, 0, sizeof(*info));
>> +
>>        info->domain = d->domain_id;
>>        info->max_vcpu_id = XEN_INVALID_MAX_VCPU_ID;
>> -    info->nr_online_vcpus = 0;
>> -    info->ssidref = 0;
> ... there are a few more "... = 0" further down iirc.

I didn't spot anything except "info->flags = ..." which probably can now 
be converted into "info->flags |= ..."


>
>>> Perhaps, once properly first zero-filling the struct in all cases,
>>> the padding field near the start should also be made explicit,
>>> clarifying visually that it is an option to use the space there for
>>> something that makes sense to live early in the struct (i.e. I
>>> wouldn't necessarily recommend putting there the new field you add,
>>> albeit - as mentioned near the top - that's certainly an option).
>> I read this as a request to also add uint16_t pad after "domid_t domain"
>> at least. Correct?
> I guess I should really leave this up to you - that's largely a cosmetic
> thing after all once clearing the whole struct up front.

ok, thank you for the clarification.


>
> Jan
>
-- 
Regards,

Oleksandr Tyshchenko



  reply	other threads:[~2021-10-12 13:18 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 17:48 [PATCH V6 0/2] Add handling of extended regions (safe ranges) on Arm (Was "xen/memory: Introduce a hypercall to provide unallocated space") Oleksandr Tyshchenko
2021-10-11 17:48 ` [PATCH V6 1/2] xen/arm: Introduce gpaddr_bits field to struct xen_domctl_getdomaininfo Oleksandr Tyshchenko
2021-10-11 20:01   ` Stefano Stabellini
2021-10-12  9:24   ` Jan Beulich
2021-10-12 11:28     ` Oleksandr
2021-10-12 11:49       ` Jan Beulich
2021-10-12 13:18         ` Oleksandr [this message]
2021-10-12 13:26           ` Jan Beulich
2021-10-12 15:15   ` Ian Jackson
2021-10-12 15:48     ` Oleksandr
2021-10-12 16:18       ` Ian Jackson
2021-10-12 17:57         ` Oleksandr
2021-10-12 18:07           ` Ian Jackson
2021-10-12 18:22             ` Oleksandr
2021-10-12 21:22               ` Oleksandr Tyshchenko
2021-10-13 13:50                 ` Oleksandr
2021-10-13 13:56                 ` Jan Beulich
2021-10-13 15:05                   ` Oleksandr
2021-10-13 15:17                     ` Julien Grall
2021-10-13 15:24                       ` Oleksandr
2021-10-11 17:48 ` [PATCH V6 2/2] libxl/arm: Add handling of extended regions for DomU Oleksandr Tyshchenko
2021-10-11 20:00   ` Stefano Stabellini
2021-10-12 15:11     ` Ian Jackson
2021-10-12 15:22   ` Oleksandr
2021-10-12 15:32     ` Ian Jackson
2021-10-12 15:38       ` Oleksandr
2021-10-12 16:05   ` Julien Grall
2021-10-12 17:42     ` Oleksandr
2021-10-12 21:22       ` Julien Grall
2021-10-12 21:43         ` Oleksandr
2021-10-13 13:46           ` Oleksandr
2021-10-13 15:15             ` Julien Grall
2021-10-13 15:49               ` Oleksandr
2021-10-13 16:24                 ` Julien Grall
2021-10-13 16:44                   ` Oleksandr
2021-10-13 17:07                     ` Julien Grall
2021-10-13 18:26                       ` Oleksandr
2021-10-13 20:19                         ` Oleksandr
2021-10-13 20:24                           ` Stefano Stabellini
2021-10-14 11:44                             ` Oleksandr

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=31f869a5-5788-74c7-c290-ce6797584e9e@gmail.com \
    --to=olekstysh@gmail.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.