Skip to contentSkip to conversation

IOMMU RMRR for Intel graphic device

DISCUSSION Lu Baolu 2 participants 3 messages May 10, 2019 – May 16, 2019 6 messages not in the archive

lore
Share & tools
lore

Lu Baolu

author
#6 lore raw
In reply to a message not in the archive

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

Quoted 110 lines · Tina

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

Quoted 98 lines

-----Original Message-----
From: Yuan, Hang
Sent: Thursday, May 9, 2019 4:07 PM
To: Lu Baolu <[email protected]>; Tian, Kevin <[email protected]>; Zhenyu Wang <[email protected]>; Zhang, Tina <[email protected]>; Lu, Baolu <[email protected]>; Liu, Yi L <[email protected]>
Subject: RE: IOMMU RMRR for Intel graphic device

Hi Baolu, as Kevin suggested, would you like to ask i915 people in their mailing list [email protected]?

Regards,
Henry

Quoted 30 lines

-----Original Message-----
From: Lu Baolu [mailto:[email protected]]
Sent: Thursday, May 9, 2019 2:42 PM
To: Tian, Kevin <[email protected]>; Zhenyu Wang <[email protected]>; Zhang, Tina <[email protected]>; Yuan, Hang <[email protected]>; Lu, Baolu <[email protected]>; Liu, Yi L <[email protected]>
Cc: [email protected]
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?

Quoted 13 lines

Best regards,
Lu Baolu

Quoted 9 lines · Kevin

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.

Quoted 17 lines
Quoted 7 lines
Quoted 7 lines

From: Lu Baolu [mailto:[email protected]]
Sent: Thursday, May 2, 2019 2:45 PM

Ping...

Any comments? This has been postponed in the community for a long

time.

Quoted 9 lines
Quoted 9 lines

We need to response this as soon as possible.

Best regards,
Lu Baolu

Quoted 3 lines · Lu Baolu

Hi Zhenyu,

As we discussed, BIOS always exports IOMMU reserved memory

regions

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

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.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

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.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw
Quoted 12 lines · Lu Baolu

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.

Quoted 6 lines

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?

The gfx RMRR isn't for the bios, it's for the driver. It covers stolen memory, and we need it. There's various piles of hacks to disable use of stolen, but they're all somewhat fragile, and afaiui for huc/guc we need it, and huc is part of the uapi exposed by the driver/device combo on gen9+.

Until our hw folks come up with a better design I think we're just stuck on this, iow you can't pass-thru modern intel igfx because of this. -Daniel

Quoted 119 lines

Best regards,
Lu Baolu

Quoted 110 lines · Tina

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

Quoted 98 lines

-----Original Message-----
From: Yuan, Hang
Sent: Thursday, May 9, 2019 4:07 PM
To: Lu Baolu <[email protected]>; Tian, Kevin <[email protected]>; Zhenyu Wang <[email protected]>; Zhang, Tina <[email protected]>; Lu, Baolu <[email protected]>; Liu, Yi L <[email protected]>
Subject: RE: IOMMU RMRR for Intel graphic device

Hi Baolu, as Kevin suggested, would you like to ask i915 people in their mailing list [email protected]?

Regards,
Henry

Quoted 30 lines

-----Original Message-----
From: Lu Baolu [mailto:[email protected]]
Sent: Thursday, May 9, 2019 2:42 PM
To: Tian, Kevin <[email protected]>; Zhenyu Wang <[email protected]>; Zhang, Tina <[email protected]>; Yuan, Hang <[email protected]>; Lu, Baolu <[email protected]>; Liu, Yi L <[email protected]>
Cc: [email protected]
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?

Quoted 13 lines

Best regards,
Lu Baolu

Quoted 9 lines · Kevin

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.

Quoted 17 lines
Quoted 7 lines
Quoted 7 lines

From: Lu Baolu [mailto:[email protected]]
Sent: Thursday, May 2, 2019 2:45 PM

Ping...

Any comments? This has been postponed in the community for a long

time.

Quoted 9 lines
Quoted 9 lines

We need to response this as soon as possible.

Best regards,
Lu Baolu

Quoted 3 lines · Lu Baolu

Hi Zhenyu,

As we discussed, BIOS always exports IOMMU reserved memory

regions

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

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.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

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.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#8 lore raw

Hi Daniel,

Quoted 26 lines · Daniel Vetter
Quoted 12 lines · Lu Baolu

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.

Quoted 6 lines

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?

The gfx RMRR isn't for the bios, it's for the driver. It covers stolen memory, and we need it. There's various piles of hacks to disable use of stolen, but they're all somewhat fragile, and afaiui for huc/guc we need it, and huc is part of the uapi exposed by the driver/device combo on gen9+.

Quoted 4 lines

Until our hw folks come up with a better design I think we're just stuck on this, iow you can't pass-thru modern intel igfx because of this. -Daniel

Thanks for the explanation. It's clear to me now.

Best regards,
Lu Baolu

Quoted 112 lines
Quoted 112 lines

Best regards,
Lu Baolu

Quoted 107 lines · Tina

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

Quoted 95 lines

-----Original Message-----
From: Yuan, Hang
Sent: Thursday, May 9, 2019 4:07 PM
To: Lu Baolu <[email protected]>; Tian, Kevin <[email protected]>; Zhenyu Wang <[email protected]>; Zhang, Tina <[email protected]>; Lu, Baolu <[email protected]>; Liu, Yi L <[email protected]>
Subject: RE: IOMMU RMRR for Intel graphic device

Hi Baolu, as Kevin suggested, would you like to ask i915 people in their mailing list [email protected]?

Regards,
Henry

Quoted 30 lines

-----Original Message-----
From: Lu Baolu [mailto:[email protected]]
Sent: Thursday, May 9, 2019 2:42 PM
To: Tian, Kevin <[email protected]>; Zhenyu Wang <[email protected]>; Zhang, Tina <[email protected]>; Yuan, Hang <[email protected]>; Lu, Baolu <[email protected]>; Liu, Yi L <[email protected]>
Cc: [email protected]
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?

Quoted 13 lines

Best regards,
Lu Baolu

Quoted 9 lines · Kevin

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.

Quoted 17 lines
Quoted 7 lines
Quoted 7 lines

From: Lu Baolu [mailto:[email protected]]
Sent: Thursday, May 2, 2019 2:45 PM

Ping...

Any comments? This has been postponed in the community for a long

time.

Quoted 9 lines
Quoted 9 lines

We need to response this as soon as possible.

Best regards,
Lu Baolu

Quoted 3 lines · Lu Baolu

Hi Zhenyu,

As we discussed, BIOS always exports IOMMU reserved memory

regions

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

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.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

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.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

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?

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Best regards,
Lu Baolu

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx