Skip to contentSkip to conversation

virtio-mem: minor clarification regarding read-access to unplugged blocks

PATCH In review David Hildenbrand 2 participants 7 messages Nov 16, 2020 – Dec 2, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-mem: minor clarification regarding read-access to unplugged blocks

Let's clarify that we don't expect all DMA to work with unplugged blocks. We really only give guarantees when reading from unplugged memory blocks via the CPU, e.g., as done by Linux when creating a system dump via
kdump: the new kernel will copy the content of the old (crashed) kernel via the CPU to user space, from where it will find its final destination inside the dump file. Note that dumping via makedumpfile under Linux will avoid reading unplugged blocks completely.

This is a preparation for device passthrough to VMs, whereby such dedicated devices might not be able to read from unplugged memory blocks.

Let's document that this scenario is possible, and why this handling is in place at all.

Cc teawater <[email protected]>
Cc Marek Kedzierski <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Cornelia Huck <[email protected]>
---
 virtio-mem.tex | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
virtio-mem.tex +7 -2
index 85cfb61..62a1d02 100644
@@ -246,8 +246,13 @@ \subsection{Device Operation}\label{sec:Device Types / Memory Device / Device Op
 
 The device MUST NOT change the content of plugged memory blocks.
 
-The device MUST allow to read from unplugged memory blocks inside
-the usable device-managed region.
+The device MUST allow the CPU to read from unplugged memory blocks inside
+the usable device-managed region. \footnote{To allow for simplified dumping of
+memory. The CPU is expected to copy such memory to another location before
+starting DMA.}
+
+The device MAY allow to read from unplugged memory blocks inside the
+usable device-managed region via DMA.
 
 The device MAY allow to read from unplugged memory blocks outside
 the usable device-managed region.
Signature · 18 lines
2.26.2


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · On Mon, 16 Nov 2020 20:16:29 +0100 David Hildenbrand <[email protected]> wrote:

Let's clarify that we don't expect all DMA to work with unplugged blocks. We really only give guarantees when reading from unplugged memory blocks via the CPU, e.g., as done by Linux when creating a system dump via
kdump: the new kernel will copy the content of the old (crashed) kernel via the CPU to user space, from where it will find its final destination inside the dump file. Note that dumping via makedumpfile under Linux will avoid reading unplugged blocks completely.

This is a preparation for device passthrough to VMs, whereby such dedicated devices might not be able to read from unplugged memory blocks.

Let's document that this scenario is possible, and why this handling is in place at all.

Quoted 8 lines
Cc teawater <[email protected]>
Cc Marek Kedzierski <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Cornelia Huck <[email protected]>
---
 virtio-mem.tex | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Looks reasonable to me.

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#2 lore raw
Quoted 26 lines · Cornelia Huck
Quoted 14 lines · On Mon, 16 Nov 2020 20:16:29 +0100 David Hildenbrand <[email protected]> wrote:

Let's clarify that we don't expect all DMA to work with unplugged blocks. We really only give guarantees when reading from unplugged memory blocks via the CPU, e.g., as done by Linux when creating a system dump via
kdump: the new kernel will copy the content of the old (crashed) kernel via the CPU to user space, from where it will find its final destination inside the dump file. Note that dumping via makedumpfile under Linux will avoid reading unplugged blocks completely.

This is a preparation for device passthrough to VMs, whereby such dedicated devices might not be able to read from unplugged memory blocks.

Let's document that this scenario is possible, and why this handling is in place at all.

Quoted 8 lines
Cc teawater <[email protected]>
Cc Marek Kedzierski <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Cornelia Huck <[email protected]>
---
 virtio-mem.tex | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
Quoted 3 lines

Looks reasonable to me.

Thanks!

I assume I'll need a github issue etc. to get this in, right?

Signature · 20 lines
Thanks,

David / dhildenb


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#3 lore raw
Quoted 27 lines · On Fri, 27 Nov 2020 11:39:50 +0100 David Hildenbrand <[email protected]> wrote:
Quoted 26 lines · Cornelia Huck
Quoted 22 lines · On Mon, 16 Nov 2020 20:16:29 +0100 David Hildenbrand <[email protected]> wrote:

Let's clarify that we don't expect all DMA to work with unplugged blocks. We really only give guarantees when reading from unplugged memory blocks via the CPU, e.g., as done by Linux when creating a system dump via
kdump: the new kernel will copy the content of the old (crashed) kernel via the CPU to user space, from where it will find its final destination inside the dump file. Note that dumping via makedumpfile under Linux will avoid reading unplugged blocks completely.

This is a preparation for device passthrough to VMs, whereby such dedicated devices might not be able to read from unplugged memory blocks.

Let's document that this scenario is possible, and why this handling is in place at all.

Cc teawater <[email protected]>
Cc Marek Kedzierski <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Cornelia Huck <[email protected]>
---
 virtio-mem.tex | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)  
Quoted 8 lines
Quoted 3 lines

Looks reasonable to me.

Thanks!

I assume I'll need a github issue etc. to get this in, right?

Yes; just open the issue, point to this patch in the archives, and reply with the issue here.

(I don't think this is trivial enough to push without voting.)

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#4 lore raw
Quoted 36 lines · Cornelia Huck
Quoted 33 lines · On Fri, 27 Nov 2020 11:39:50 +0100 David Hildenbrand <[email protected]> wrote:
Quoted 26 lines · Cornelia Huck
Quoted 14 lines · On Mon, 16 Nov 2020 20:16:29 +0100 David Hildenbrand <[email protected]> wrote:

Let's clarify that we don't expect all DMA to work with unplugged blocks. We really only give guarantees when reading from unplugged memory blocks via the CPU, e.g., as done by Linux when creating a system dump via
kdump: the new kernel will copy the content of the old (crashed) kernel via the CPU to user space, from where it will find its final destination inside the dump file. Note that dumping via makedumpfile under Linux will avoid reading unplugged blocks completely.

This is a preparation for device passthrough to VMs, whereby such dedicated devices might not be able to read from unplugged memory blocks.

Let's document that this scenario is possible, and why this handling is in place at all.

Quoted 8 lines
Cc teawater <[email protected]>
Cc Marek Kedzierski <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Cornelia Huck <[email protected]>
---
 virtio-mem.tex | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)  
Quoted 3 lines

Looks reasonable to me.

Thanks!

Quoted 8 lines
Quoted 2 lines

I assume I'll need a github issue etc. to get this in, right?

Yes; just open the issue, point to this patch in the archives, and reply with the issue here.

(I don't think this is trivial enough to push without voting.)

Makes sense. I'll wait a bit more. Thanks!

Signature · 20 lines
Thanks,

David / dhildenb


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#5 lore raw
Quoted 40 lines · On Wed, 2 Dec 2020 10:25:16 +0100 David Hildenbrand <[email protected]> wrote:
Quoted 39 lines · Cornelia Huck
Quoted 35 lines · On Fri, 27 Nov 2020 11:39:50 +0100 David Hildenbrand <[email protected]> wrote:
Quoted 26 lines · Cornelia Huck
Quoted 14 lines · On Mon, 16 Nov 2020 20:16:29 +0100 David Hildenbrand <[email protected]> wrote:

Let's clarify that we don't expect all DMA to work with unplugged blocks. We really only give guarantees when reading from unplugged memory blocks via the CPU, e.g., as done by Linux when creating a system dump via
kdump: the new kernel will copy the content of the old (crashed) kernel via the CPU to user space, from where it will find its final destination inside the dump file. Note that dumping via makedumpfile under Linux will avoid reading unplugged blocks completely.

This is a preparation for device passthrough to VMs, whereby such dedicated devices might not be able to read from unplugged memory blocks.

Let's document that this scenario is possible, and why this handling is in place at all.

Quoted 8 lines
Cc teawater <[email protected]>
Cc Marek Kedzierski <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Cornelia Huck <[email protected]>
---
 virtio-mem.tex | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)    
Quoted 3 lines

Looks reasonable to me.

Thanks!

I assume I'll need a github issue etc. to get this in, right?

Quoted 8 lines
Quoted 5 lines

Yes; just open the issue, point to this patch in the archives, and reply with the issue here.

(I don't think this is trivial enough to push without voting.)

Makes sense. I'll wait a bit more. Thanks!

I think you can just go ahead and request a vote... no need to wait further IMHO.

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#6 lore raw
In reply to David Hildenbrand
Quoted 34 lines · David Hildenbrand

Let's clarify that we don't expect all DMA to work with unplugged blocks. We really only give guarantees when reading from unplugged memory blocks via the CPU, e.g., as done by Linux when creating a system dump via
kdump: the new kernel will copy the content of the old (crashed) kernel via the CPU to user space, from where it will find its final destination inside the dump file. Note that dumping via makedumpfile under Linux will avoid reading unplugged blocks completely.

This is a preparation for device passthrough to VMs, whereby such dedicated devices might not be able to read from unplugged memory blocks.

Let's document that this scenario is possible, and why this handling is in place at all.

Cc teawater <[email protected]>
Cc Marek Kedzierski <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Cornelia Huck <[email protected]>
---
 virtio-mem.tex | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
virtio-mem.tex +0 -2
index 85cfb61..62a1d02 100644
@@ -246,8 +246,13 @@ \subsection{Device Operation}\label{sec:Device Types / Memory Device / Device Op
 
 The device MUST NOT change the content of plugged memory blocks.
 
-The device MUST allow to read from unplugged memory blocks inside
-the usable device-managed region.

virtio-mem.tex \subsection{Device Operation}\label{sec:Device Types / Memory Device / Device Op · line 258

Quoted 10 lines
virtio-mem.tex +7 -0
+The device MUST allow the CPU to read from unplugged memory blocks inside
+the usable device-managed region. \footnote{To allow for simplified dumping of
+memory. The CPU is expected to copy such memory to another location before
+starting DMA.}
+
+The device MAY allow to read from unplugged memory blocks inside the
+usable device-managed region via DMA.
 
 The device MAY allow to read from unplugged memory blocks outside
 the usable device-managed region.

Requesting a vote, thanks!

Signature · 20 lines
Thanks,

David / dhildenb


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/