Skip to contentSkip to conversation

devicetree, xen: add xen, shared-memory binding

PATCH Superseded Stefano Stabellini 3 participants 8 messages Oct 24, 2018 – Nov 2, 2018 Device tree bindings

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 devicetree, xen: add xen, shared-memory binding

From: Stefano Stabellini <[email protected]>

Introduce a device tree binding for Xen reserved-memory regions. They are used to share memory across VMs from the VM config files. (See static_shm config option.)

---
Changes in v3:
- remove fallback version

Changes in v2:
- fix Author line
- add versioning
- xen,id instead of id

---
 .../bindings/reserved-memory/xen,shared-memory.txt   | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file +20 -0
new file mode 100644
index 0000000..7c81683
@@ -0,0 +1,20 @@
+* Xen hypervisor reserved-memory binding
+
+Expose one or more memory regions as reserved-memory to the guest
+virtual machine. Typically, a region is configured at VM creation time
+to be a shared memory area across multiple virtual machines for
+communication among them.
+
+For each of these pre-shared memory regions, a range is exposed under
+the /reserved-memory node as a child node. Each range sub-node is named
+xen-shmem@<address> and has the following properties:
+
+- compatible:
+	compatible = "xen,shared-memory-v1"
+
+- reg:
+	the base guest physical address and size of the shared memory region
+
+- xen,id:
+	a string that identifies the shared memory region as specified in
+	the VM config file
Signature · 7 lines
1.9.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

Hi,

Quoted 27 lines · Stefano Stabellini

From: Stefano Stabellini <[email protected]>

Introduce a device tree binding for Xen reserved-memory regions. They are used to share memory across VMs from the VM config files. (See static_shm config option.)

---
Changes in v3:
- remove fallback version

Changes in v2:
- fix Author line
- add versioning
- xen,id instead of id

---
  .../bindings/reserved-memory/xen,shared-memory.txt   | 20 ++++++++++++++++++++
  1 file changed, 20 insertions(+)

create mode 100644 Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt

Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file +0 -0
new file mode 100644
index 0000000..7c81683

Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt line 6

Quoted 6 lines
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file +6 -0
@@ -0,0 +1,20 @@
+* Xen hypervisor reserved-memory binding
+
+Expose one or more memory regions as reserved-memory to the guest
+virtual machine. Typically, a region is configured at VM creation time
+to be a shared memory area across multiple virtual machines for
+communication among them.

I may have notice some issue with this binding. Looking at the design document [1], the "master" domain may provide a big backing region that would be split and share with multiple "slave".

For the "master" domain, this binding would specify the full backing region. The "master" OS would not be able to know how the region would be used here.

For the "slave" domain, it looks like it might be possible to map the same region (so same ID) twice. So we would end up to create the same bindings twice.

Any opionion on how we should proceed with these two use cases?

Quoted 5 lines
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file +4 -0
+
+For each of these pre-shared memory regions, a range is exposed under
+the /reserved-memory node as a child node. Each range sub-node is named
+xen-shmem@<address> and has the following properties:

Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt line 20

Quoted 10 lines
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file +10 -0
+
+- compatible:
+	compatible = "xen,shared-memory-v1"
+
+- reg:
+	the base guest physical address and size of the shared memory region
+
+- xen,id:
+	a string that identifies the shared memory region as specified in
+	the VM config file

Cheers,

[1] https://lists.xen.org/archives/html/xen-devel/2018-10/msg00730.html

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#2 lore raw
Quoted 46 lines · Julien Grall

Hi,

Quoted 32 lines · Stefano Stabellini

From: Stefano Stabellini <[email protected]>

Introduce a device tree binding for Xen reserved-memory regions. They are used to share memory across VMs from the VM config files. (See static_shm config option.)

---
Changes in v3:
- remove fallback version

Changes in v2:
- fix Author line
- add versioning
- xen,id instead of id

---
  .../bindings/reserved-memory/xen,shared-memory.txt   | 20
++++++++++++++++++++
  1 file changed, 20 insertions(+)

create mode 100644
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt

diff --git a/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt b/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file mode 100644
index 0000000..7c81683
--- /dev/null
+++
b/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt

Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt line 6

Quoted 6 lines
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file +6 -0
@@ -0,0 +1,20 @@
+* Xen hypervisor reserved-memory binding
+
+Expose one or more memory regions as reserved-memory to the guest
+virtual machine. Typically, a region is configured at VM creation time
+to be a shared memory area across multiple virtual machines for
+communication among them.

I may have notice some issue with this binding. Looking at the design document [1], the "master" domain may provide a big backing region that would be split and share with multiple "slave".

Quoted 8 lines

For the "master" domain, this binding would specify the full backing region. The "master" OS would not be able to know how the region would be used here.

For the "slave" domain, it looks like it might be possible to map the same region (so same ID) twice. So we would end up to create the same bindings twice.

Any opionion on how we should proceed with these two use cases?

Julien and I discussed this morning to clarify that regions shouldn't be mapped twice in the Xen docs, and adding an "offset" property to this binding.

I'll send an update to this proposal adding the offset.

Quoted 18 lines
Quoted 5 lines
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file +4 -0
+
+For each of these pre-shared memory regions, a range is exposed under
+the /reserved-memory node as a child node. Each range sub-node is named
+xen-shmem@<address> and has the following properties:

Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt line 20

Quoted 10 lines
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file +10 -0
+
+- compatible:
+	compatible = "xen,shared-memory-v1"
+
+- reg:
+	the base guest physical address and size of the shared memory region
+
+- xen,id:
+	a string that identifies the shared memory region as specified in
+	the VM config file

Cheers,

Quoted 1 line

[1] https://lists.xen.org/archives/html/xen-devel/2018-10/msg00730.html

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw

Hi,

Quoted 54 lines · Stefano Stabellini
Quoted 53 lines · Julien Grall

Hi,

Quoted 32 lines · Stefano Stabellini

From: Stefano Stabellini <[email protected]>

Introduce a device tree binding for Xen reserved-memory regions. They are used to share memory across VMs from the VM config files. (See static_shm config option.)

---
Changes in v3:
- remove fallback version

Changes in v2:
- fix Author line
- add versioning
- xen,id instead of id

---
   .../bindings/reserved-memory/xen,shared-memory.txt   | 20
++++++++++++++++++++
   1 file changed, 20 insertions(+)

create mode 100644
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt

diff --git a/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt b/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file mode 100644
index 0000000..7c81683
--- /dev/null
+++
b/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt

Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt line 6

Quoted 6 lines
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file +6 -0
@@ -0,0 +1,20 @@
+* Xen hypervisor reserved-memory binding
+
+Expose one or more memory regions as reserved-memory to the guest
+virtual machine. Typically, a region is configured at VM creation time
+to be a shared memory area across multiple virtual machines for
+communication among them.

I may have notice some issue with this binding. Looking at the design document [1], the "master" domain may provide a big backing region that would be split and share with multiple "slave".

For the "master" domain, this binding would specify the full backing region. The "master" OS would not be able to know how the region would be used here.

For the "slave" domain, it looks like it might be possible to map the same region (so same ID) twice. So we would end up to create the same bindings twice.

Quoted 5 lines
Quoted 1 line

Any opionion on how we should proceed with these two use cases?

Julien and I discussed this morning to clarify that regions shouldn't be mapped twice in the Xen docs, and adding an "offset" property to this binding.

Well, why would you forbid the mappings twice if the offset is present?

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#4 lore raw
Quoted 61 lines · Julien Grall

Hi,

Quoted 58 lines · Stefano Stabellini
Quoted 57 lines · Julien Grall

Hi,

Quoted 32 lines · Stefano Stabellini

From: Stefano Stabellini <[email protected]>

Introduce a device tree binding for Xen reserved-memory regions. They are used to share memory across VMs from the VM config files. (See static_shm config option.)

---
Changes in v3:
- remove fallback version

Changes in v2:
- fix Author line
- add versioning
- xen,id instead of id

---
   .../bindings/reserved-memory/xen,shared-memory.txt   | 20
++++++++++++++++++++
   1 file changed, 20 insertions(+)

create mode 100644
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt

diff --git a/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt b/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file mode 100644
index 0000000..7c81683
--- /dev/null
+++
b/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt

Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt line 6

Quoted 6 lines
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file +6 -0
@@ -0,0 +1,20 @@
+* Xen hypervisor reserved-memory binding
+
+Expose one or more memory regions as reserved-memory to the guest
+virtual machine. Typically, a region is configured at VM creation time
+to be a shared memory area across multiple virtual machines for
+communication among them.

I may have notice some issue with this binding. Looking at the design document
[1], the "master" domain may provide a big backing region that would be split
and share with multiple "slave".

For the "master" domain, this binding would specify the full backing region.
The "master" OS would not be able to know how the region would be used here.

For the "slave" domain, it looks like it might be possible to map the same region (so same ID) twice. So we would end up to create the same bindings twice.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Any opionion on how we should proceed with these two use cases?

Julien and I discussed this morning to clarify that regions shouldn't be mapped twice in the Xen docs, and adding an "offset" property to this binding.

Well, why would you forbid the mappings twice if the offset is present?

From the DT binding point of view, it would be fine. Conceptually it would also be fine. However, I doubt that the current libxl implementation would work with multiple mappings.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#5 lore raw

Hi,

Quoted 68 lines · Stefano Stabellini
Quoted 67 lines · Julien Grall

Hi,

Quoted 63 lines · Stefano Stabellini
Quoted 53 lines · Julien Grall

Hi,

Quoted 32 lines · Stefano Stabellini

From: Stefano Stabellini <[email protected]>

Introduce a device tree binding for Xen reserved-memory regions. They are used to share memory across VMs from the VM config files. (See static_shm config option.)

---
Changes in v3:
- remove fallback version

Changes in v2:
- fix Author line
- add versioning
- xen,id instead of id

---
    .../bindings/reserved-memory/xen,shared-memory.txt   | 20
++++++++++++++++++++
    1 file changed, 20 insertions(+)
    create mode 100644

Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt

diff --git a/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt b/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file mode 100644
index 0000000..7c81683
--- /dev/null
+++
b/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt

Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt line 6

Quoted 6 lines
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt new file +6 -0
@@ -0,0 +1,20 @@
+* Xen hypervisor reserved-memory binding
+
+Expose one or more memory regions as reserved-memory to the guest
+virtual machine. Typically, a region is configured at VM creation time
+to be a shared memory area across multiple virtual machines for
+communication among them.

I may have notice some issue with this binding. Looking at the design document
[1], the "master" domain may provide a big backing region that would be split
and share with multiple "slave".

For the "master" domain, this binding would specify the full backing region.
The "master" OS would not be able to know how the region would be used here.

Quoted 5 lines

For the "slave" domain, it looks like it might be possible to map the same region (so same ID) twice. So we would end up to create the same bindings twice.

Any opionion on how we should proceed with these two use cases?

Julien and I discussed this morning to clarify that regions shouldn't be mapped twice in the Xen docs, and adding an "offset" property to this binding.

Quoted 5 lines
Quoted 1 line

Well, why would you forbid the mappings twice if the offset is present?

From the DT binding point of view, it would be fine. Conceptually it
would also be fine. However, I doubt that the current libxl implementation would work with multiple mappings.

I can't see why it would not work. I think we designed the refcount for this purpose.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#6 lore raw

Julien Grall writes ("Re: [PATCH v3] devicetree,xen: add xen,shared-memory binding"):

Quoted 7 lines · Stefano Stabellini
Quoted 3 lines

From the DT binding point of view, it would be fine. Conceptually it
would also be fine. However, I doubt that the current libxl implementation would work with multiple mappings.

I can't see why it would not work. I think we designed the refcount for this purpose.

libxl doesn't see the actual mappings, does it ? It just puts things into the p2m.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#7 lore raw

Hi Ian,

Quoted 11 lines · Ian Jackson

Julien Grall writes ("Re: [PATCH v3] devicetree,xen: add xen,shared-memory binding"):

Quoted 7 lines · Stefano Stabellini
Quoted 3 lines

From the DT binding point of view, it would be fine. Conceptually it
would also be fine. However, I doubt that the current libxl implementation would work with multiple mappings.

I can't see why it would not work. I think we designed the refcount for this purpose.

libxl doesn't see the actual mappings, does it ? It just puts things into the p2m.

Yes. That's why I think multiple mappings is actually possible.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel