public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Lu Baolu <baolu.lu@linux.intel.com>
To: "Zhang, Tina" <tina.zhang@intel.com>,
	"Yuan, Hang" <hang.yuan@intel.com>,
	"Tian, Kevin" <kevin.tian@intel.com>,
	Zhenyu Wang <zhenyuw@linux.intel.com>,
	"Lu, Baolu" <baolu.lu@intel.com>,
	"Liu, Yi L" <yi.l.liu@intel.com>,
	"Zhang, Xiong Y" <xiong.y.zhang@intel.com>
Cc: intel-gfx@lists.freedesktop.org, baolu.lu@linux.intel.com
Subject: Re: IOMMU RMRR for Intel graphic device
Date: Fri, 10 May 2019 13:21:59 +0800	[thread overview]
Message-ID: <28244102-1f2f-020b-7c67-0f8ca9d15768@linux.intel.com> (raw)
In-Reply-To: <237F54289DF84E4997F34151298ABEBC8760DA5D@SHSMSX101.ccr.corp.intel.com>

Forward to i915 mailing list and post the question again so people knows
what are the key concerns.

The background is that Linux community is going to collect and report
the reserved memory ranges of an assigned device to VFIO driver, and any
mapped address will be checked against the reserved ranges. If there's
any conflict, vifo will refuse the map request.

Unfortunately, when it comes Intel graphic device, the conflict happens.
That means address range mapped through vfio conflicts with the rmrr for
graphic device.

https://lkml.org/lkml/2018/6/5/760

The questions are 1) will the rmrr for graphic device still needs to be
reserved for BIOS or firmware use, when a device is going to be assigned
to user level? 2) if no, what's the check point, after which the rmrr is
unnecessary anymore?

Best regards,
Lu Baolu

On 5/9/19 5:14 PM, Zhang, Tina wrote:
> Hi Baolu,
> 
> +Xiong
> 
> I think the root cause is that guest i915 needs to access RMRR. Xiong cooked a patch to disable the RMRR use in i915 guest, however that patch didn't get landed into the i915 upstream repo due to some concerns from i915 maintainers. Xiong can give us more backgrounds.
> 
> So agreed, need to ask the i915 folk for this.
> 
> BR,
> Tina
> 
> 
>> -----Original Message-----
>> From: Yuan, Hang
>> Sent: Thursday, May 9, 2019 4:07 PM
>> To: Lu Baolu <baolu.lu@linux.intel.com>; Tian, Kevin <kevin.tian@intel.com>;
>> Zhenyu Wang <zhenyuw@linux.intel.com>; Zhang, Tina
>> <tina.zhang@intel.com>; Lu, Baolu <baolu.lu@intel.com>; Liu, Yi L
>> <yi.l.liu@intel.com>
>> Subject: RE: IOMMU RMRR for Intel graphic device
>>
>> Hi Baolu, as Kevin suggested, would you like to ask i915 people in their
>> mailing list intel-gfx@lists.freedesktop.org?
>>
>> Regards,
>> Henry
>>
>>> -----Original Message-----
>>> From: Lu Baolu [mailto:baolu.lu@linux.intel.com]
>>> Sent: Thursday, May 9, 2019 2:42 PM
>>> To: Tian, Kevin <kevin.tian@intel.com>; Zhenyu Wang
>>> <zhenyuw@linux.intel.com>; Zhang, Tina <tina.zhang@intel.com>; Yuan,
>>> Hang <hang.yuan@intel.com>; Lu, Baolu <baolu.lu@intel.com>; Liu, Yi L
>>> <yi.l.liu@intel.com>
>>> Cc: baolu.lu@linux.intel.com
>>> Subject: Re: IOMMU RMRR for Intel graphic device
>>>
>>> Hi,
>>>
>>> +Tina and Henry and cc more people
>>>
>>> The background is that Linux community is going to collect and report
>>> the reserved memory ranges of an assigned device to VFIO driver, and
>>> any mapped address will be checked against the reserved ranges. If
>>> there's any conflict, vifo will refuse the map request.
>>>
>>> Unfortunately, when it comes Intel graphic device, the conflict happens.
>>> That means address range mapped through vfio conflicts with the rmrr
>>> for graphic device.
>>>
>>> https://lkml.org/lkml/2018/6/5/760
>>>
>>> The questions are 1) will the rmrr for graphic device still needs to
>>> be reserved for BIOS or firmware use, when a device is going to be
>>> assigned to user level? 2) if no, what's the check point, after which
>>> the rmrr is unnecessary anymore?
>>>
>>> Best regards,
>>> Lu Baolu
>>>
>>> On 5/6/19 2:16 PM, Tian, Kevin wrote:
>>>> this should better be asked to i915 guys, since it's not
>>>> virtualization related. :-)
>>>>
>>>> One caveat, iirc, i915 driver tries to reuse stolen memory (covered
>>>> by
>>>> RMRR) even after boot time. take it as if another type of memory
>>>> resource. If true I'm afraid this might be a gap to your proposal.
>>>>
>>>> Since nothing confidential, possibly you can directly discuss in
>> community.
>>>>
>>>>> From: Lu Baolu [mailto:baolu.lu@linux.intel.com]
>>>>> Sent: Thursday, May 2, 2019 2:45 PM
>>>>>
>>>>> Ping...
>>>>>
>>>>> Any comments? This has been postponed in the community for a long
>>> time.
>>>>> We need to response this as soon as possible.
>>>>>
>>>>> Best regards,
>>>>> Lu Baolu
>>>>>
>>>>> On 4/29/19 1:19 PM, Lu Baolu wrote:
>>>>>> Hi Zhenyu,
>>>>>>
>>>>>> As we discussed, BIOS always exports IOMMU reserved memory
>> regions
>>>>>> for (a.k.a. RMRR in vt-d spec) Intel integrated graphic device.
>>>>>> This caused some problems when we pass-through such graphic
>>>>>> devices to
>>> user level.
>>>>>>
>>>>>> I am about to propose something to the community so that a RMRR
>>>>>> for graphic devices could be explicitly canceled as long as the
>>>>>> driver
>>>>>> (i915 or vfio) knows that the RMRR will never be used by BIOS
>> anymore.
>>>>>>
>>>>>> The same story happens for USB host controller devices. And since
>>>>>> we know that BIOS will stop using that memory region as soon as
>>>>>> the driver clears the SMI bits.
>>>>>>
>>>>>> So the question is, can graphic driver know when the RMRR for
>>>>>> graphic could be canceled?
>>>>>>
>>>>>> Best regards,
>>>>>> Lu Baolu
>>>>>>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

       reply	other threads:[~2019-05-10  5:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6473ebb1-d44b-1dd7-19c6-cdd93c64fbca@linux.intel.com>
     [not found] ` <2a12e17e-16b4-b48c-ea6b-1a25043ac2fe@linux.intel.com>
     [not found]   ` <AADFC41AFE54684AB9EE6CBC0274A5D19CA2004B@SHSMSX104.ccr.corp.intel.com>
     [not found]     ` <c425e8fc-d720-9a09-f52b-7a7d140098f7@linux.intel.com>
     [not found]       ` <C294FBAE55175941838A8D362DCD8AA225EEA42A@SHSMSX104.ccr.corp.intel.com>
     [not found]         ` <237F54289DF84E4997F34151298ABEBC8760DA5D@SHSMSX101.ccr.corp.intel.com>
2019-05-10  5:21           ` Lu Baolu [this message]
2019-05-10  8:34             ` IOMMU RMRR for Intel graphic device Daniel Vetter
2019-05-16  1:51               ` Lu Baolu

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=28244102-1f2f-020b-7c67-0f8ca9d15768@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=baolu.lu@intel.com \
    --cc=hang.yuan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=kevin.tian@intel.com \
    --cc=tina.zhang@intel.com \
    --cc=xiong.y.zhang@intel.com \
    --cc=yi.l.liu@intel.com \
    --cc=zhenyuw@linux.intel.com \
    /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