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: [RFC PATCH] xen: Introduce arch specific field to XEN_SYSCTL_physinfo
Date: Sun, 29 Aug 2021 23:28:42 +0300	[thread overview]
Message-ID: <8c622f4f-1931-3e2c-4f6e-9b832e8e435e@gmail.com> (raw)
In-Reply-To: <908e2d59-41f0-3bad-6030-b2889d9c5cc2@suse.com>


On 16.08.21 10:33, Jan Beulich wrote:

Hi Jan

Sorry for the late response.

> On 14.08.2021 01:28, Oleksandr Tyshchenko wrote:
>> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>
>> We need to pass info about maximum supported address space size
>> to the toolstack on Arm in order to properly calculate the base
>> and size of the safe range for the guest. Use p2m_ipa_bits variable
>> which purpose is to hold the bit size of IPAs in P2M tables.
> What is "the safe range"?

It is unallocated (unused) address space which could be safely used by 
domain for foreign/grant mappings on Arm, I will update description.


>
>> --- a/xen/include/public/arch-arm.h
>> +++ b/xen/include/public/arch-arm.h
>> @@ -332,6 +332,11 @@ struct xen_arch_domainconfig {
>>        */
>>       uint32_t clock_frequency;
>>   };
>> +
>> +struct arch_physinfo {
>> +    /* Holds the bit size of IPAs in p2m tables. */
>> +    uint32_t p2m_ipa_bits;
>> +};
>>   #endif /* __XEN__ || __XEN_TOOLS__ */
>>   
>>   struct arch_vcpu_info {
>> --- a/xen/include/public/arch-x86/xen.h
>> +++ b/xen/include/public/arch-x86/xen.h
>> @@ -346,6 +346,8 @@ typedef struct xen_msr_entry {
>>   } xen_msr_entry_t;
>>   DEFINE_XEN_GUEST_HANDLE(xen_msr_entry_t);
>>   
>> +struct arch_physinfo {
>> +};
>>   #endif /* !__ASSEMBLY__ */
> While the term "p2m_ipa_bits" surely isn't arch-agnostic, I wonder
> whether the expressed information is (the x86 equivalent being
> hap_paddr_bits, at a guess), and hence whether this really ought
> to live in an arch-specific sub-struct.

Well, on Arm we calculate the number of the IPA bits based on the number 
of PA bits when setting Stage 2 address translation.
I might mistake, but what we currently have on Arm is "ipa_bits == 
pa_bits". So, this means that information we need at the toolstack side 
isn't really arch-specific and
we could probably avoid introducing arch-specific sub-struct by suitable 
renaming the field (pa_bits, paddr_bits, whatever).

We could even name the field as hap_paddr_bits. Although, I don't know 
whether the hap_* is purely x86-ism, but I see there are several 
mentions in the common code (hap_pt_share, use_hap_pt, etc). Any 
suggestions?


> If indeed so, please name
> the struct in a name space clean way, i.e. add xen_ as prefix.

ok


>
> Also please retain a blank line before the #endif. I wonder whether
> on Arm you wouldn't want to add one at this occasion.

ok


>
> Jan
>
-- 
Regards,

Oleksandr Tyshchenko



  reply	other threads:[~2021-08-29 20:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13 23:28 [RFC PATCH] xen: Introduce arch specific field to XEN_SYSCTL_physinfo Oleksandr Tyshchenko
2021-08-16  7:33 ` Jan Beulich
2021-08-29 20:28   ` Oleksandr [this message]
2021-08-30 13:16     ` Jan Beulich
2021-08-30 16:14       ` 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=8c622f4f-1931-3e2c-4f6e-9b832e8e435e@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.