All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Paul Durrant <Paul.Durrant@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	DavidScott <dave@recoil.org>, "Tim \(Xen.org\)" <tim@xen.org>,
	George Dunlap <George.Dunlap@citrix.com>,
	JulienGrall <julien.grall@arm.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Anthony Perard <anthony.perard@citrix.com>,
	IanJackson <Ian.Jackson@citrix.com>
Subject: Re: [Xen-devel] [PATCH v9 3/6] sysctl / libxl: report whether IOMMU/HAP page table sharing is supported
Date: Thu, 12 Sep 2019 15:28:09 +0200	[thread overview]
Message-ID: <9db1e764-e19e-a3fc-7d51-515d5625682f@suse.com> (raw)
In-Reply-To: <db42dfe903484b948cd82ad5d2a46844@AMSPEX02CL03.citrite.net>

On 12.09.2019 15:18, Paul Durrant wrote:
>> -----Original Message-----
>> From: Jan Beulich <jbeulich@suse.com>
>> Sent: 12 September 2019 14:04
>> To: Paul Durrant <Paul.Durrant@citrix.com>
>> Cc: xen-devel@lists.xenproject.org; Julien Grall <julien.grall@arm.com>; Andrew Cooper
>> <Andrew.Cooper3@citrix.com>; Anthony Perard <anthony.perard@citrix.com>; Christian Lindig
>> <christian.lindig@citrix.com>; George Dunlap <George.Dunlap@citrix.com>; Ian Jackson
>> <Ian.Jackson@citrix.com>; Stefano Stabellini <sstabellini@kernel.org>; Konrad Rzeszutek Wilk
>> <konrad.wilk@oracle.com>; DavidScott <dave@recoil.org>; Tim (Xen.org) <tim@xen.org>; Wei Liu
>> <wl@xen.org>
>> Subject: Re: [PATCH v9 3/6] sysctl / libxl: report whether IOMMU/HAP page table sharing is supported
>>
>> On 12.09.2019 13:17, Paul Durrant wrote:
>>> --- a/xen/arch/arm/sysctl.c
>>> +++ b/xen/arch/arm/sysctl.c
>>> @@ -15,6 +15,9 @@
>>>  void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
>>>  {
>>>      pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm | XEN_SYSCTL_PHYSCAP_hap;
>>> +
>>> +    if ( iommu_enabled && iommu_hap_pt_share )
>>> +        pi->capabilities |= XEN_SYSCTL_PHYSCAP_iommu_hap_pt_share;
>>>  }
>>
>> I think this should be done in common code.
>>
>>> --- a/xen/arch/x86/sysctl.c
>>> +++ b/xen/arch/x86/sysctl.c
>>> @@ -164,7 +164,12 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
>>>      if ( IS_ENABLED(CONFIG_PV) )
>>>          pi->capabilities |= XEN_SYSCTL_PHYSCAP_pv;
>>>      if ( hvm_hap_supported() )
>>> +    {
>>>          pi->capabilities |= XEN_SYSCTL_PHYSCAP_hap;
>>> +
>>> +        if ( iommu_enabled && iommu_hap_pt_share )
>>> +            pi->capabilities |= XEN_SYSCTL_PHYSCAP_iommu_hap_pt_share;
>>> +    }
>>>  }
>>
>> And if it's important to not have the bit set when !hvm_hap_supported(),
> 
> ...and that's what it’s not in common code... there is no hvm_hap_supported() for Arm
> 
>> then iommu_hap_pt_share should be cleared in __init code in this case.
> 
> That would have been an alternative approach if you'd not wanted
> it #defined in patch #5. (Yes it's a later patch in the series,
> but this one is later chronologically and I didn't want to
> invalidate the other patch.)
> I could perhaps implement hvm_hap_supported() for Arm?

Well, implementing it for Arm is an option (at which point
XEN_SYSCTL_PHYSCAP_hap could also move to common code). But
personally I'd advise against providing more stubs than
necessary on Arm. I may not understand your remark regarding
patch 5: There's no problem with iommu_hap_pt_share now being
a #define on Arm - whether the system is HVM capable is an
x86 specific decision anyway, and hence the clearing of the
flag could occur e.g. in hvm_enable() when it bails early.
And btw., with !CONFIG_HVM it could be a #define on x86 as
well, just to "false" then.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-09-12 13:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12 11:17 [Xen-devel] [PATCH v9 0/6] add per-domain IOMMU control Paul Durrant
2019-09-12 11:17 ` [Xen-devel] [PATCH v9 1/6] domain: introduce XEN_DOMCTL_CDF_iommu flag Paul Durrant
2019-09-12 11:17 ` [Xen-devel] [PATCH v9 2/6] use is_iommu_enabled() where appropriate Paul Durrant
2019-09-12 11:17 ` [Xen-devel] [PATCH v9 3/6] sysctl / libxl: report whether IOMMU/HAP page table sharing is supported Paul Durrant
2019-09-12 11:48   ` Christian Lindig
2019-09-12 13:04   ` Jan Beulich
2019-09-12 13:18     ` Paul Durrant
2019-09-12 13:28       ` Jan Beulich [this message]
2019-09-12 14:13         ` Paul Durrant
2019-09-12 11:17 ` [Xen-devel] [PATCH v9 4/6] remove late (on-demand) construction of IOMMU page tables Paul Durrant
2019-09-12 11:17 ` [Xen-devel] [PATCH v9 5/6] iommu: tidy up iommu_use_hap_pt() and need_iommu_pt_sync() macros Paul Durrant
2019-09-12 13:06   ` Jan Beulich
2019-09-12 11:17 ` [Xen-devel] [PATCH v9 6/6] introduce a 'passthrough' configuration option to xl.cfg Paul Durrant
2019-09-12 13:08   ` Jan Beulich

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=9db1e764-e19e-a3fc-7d51-515d5625682f@suse.com \
    --to=jbeulich@suse.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=George.Dunlap@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=Paul.Durrant@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=christian.lindig@citrix.com \
    --cc=dave@recoil.org \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.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.