From 942e7f19e75d562380ee6e0795a1b03a57ba47d8 Mon Sep 17 00:00:00 2001 From: Patrick Daly Date: Mon, 8 Jul 2024 23:51:27 -0700 Subject: [PATCH 1/2] ARM: dts: msm: Fix dependency between virtio-mem and mem-buf-msgq The virtio-mem device has always had a dependency on mem-buf for plugging in memory. Previously, the ordering was not a concern, since hotplug was not done until userspace was up. However, in subsequent patches we will instead hotplug in memory as soon as the virtio-mem device probes. Change-Id: I9c4e4728a15ab32d65ffaea0ba2681a816a4abf0 Signed-off-by: Patrick Daly --- qcom/sun-vm.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qcom/sun-vm.dtsi b/qcom/sun-vm.dtsi index 32240b3c..49949341 100644 --- a/qcom/sun-vm.dtsi +++ b/qcom/sun-vm.dtsi @@ -707,13 +707,14 @@ qcom,vmid = <45>; }; - qcom,mem-buf-msgq { + mem_buf_msgq: qcom,mem-buf-msgq { compatible = "qcom,mem-buf-msgq"; qcom,msgq-names = "trusted_vm"; }; virtio_mem_device { compatible = "qcom,virtio-mem"; + depends-on-supply = <&mem_buf_msgq>; /* Must be memory_block_size_bytes() aligned */ qcom,max-size = <0x0 0x10000000>; qcom,ipa-range = <0x0 0x0 0xf 0xffffffff>; From 5a1d998abd1724a64479b038e34d2a765f62e4f0 Mon Sep 17 00:00:00 2001 From: Patrick Daly Date: Tue, 30 Jul 2024 18:20:02 -0700 Subject: [PATCH 2/2] dt-bindings: Document qcom,initial-movable-zone-size property This property describes how large of a movable zone should be created when the virtio_mem device probes. Also, fix all errors reported by make dt_binding_check. Change-Id: I487ad7592d54021ddbb3caddb20774d3e076c766 Signed-off-by: Patrick Daly --- bindings/virtio/qcom,virtio-mem.yaml | 32 +++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/bindings/virtio/qcom,virtio-mem.yaml b/bindings/virtio/qcom,virtio-mem.yaml index 0239476f..a640cd9f 100644 --- a/bindings/virtio/qcom,virtio-mem.yaml +++ b/bindings/virtio/qcom,virtio-mem.yaml @@ -1,10 +1,13 @@ # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- -$id: "http://devicetree.org/schemas/soc/qcom/qcom,secure-buffer.yaml#" +$id: "http://devicetree.org/schemas/virtio/qcom,virtio-mem.yaml#" $schema: "http://devicetree.org/meta-schemas/core.yaml#" -title: Qualcomm Technologies, Inc. Virtio-Mem bindings +title: Qualcomm Technologies, Inc. Virtio-Mem + +maintainers: + - Patrick Daly description: | QTI virtio mem driver supports Guest initiated memory hotplug operations @@ -16,6 +19,7 @@ properties: - const: qcom,virtio-mem qcom,block-size: + $ref: '/schemas/types.yaml#/definitions/uint32' description: Minimum transfer size in bytes. Should be multiple of PAGE_SIZE. @@ -31,6 +35,11 @@ properties: is allowed to choose when adding hotpluggable memory for this device. + qcom,initial-movable-zone-size: + $ref: '/schemas/types.yaml#/definitions/uint32' + description: | + Initial size of movable zone. + qcom,memory-encryption: type: boolean description: | @@ -39,14 +48,17 @@ properties: required: - compatible - - qcom,size + - qcom,max-size - qcom,ipa-range - qcom,block-size -example: - virtio_mem_device@0x60000000 { - compatible = "qcom,virtio-mem"; - qcom,block_size = <0x400000>; - qcom,size = <0x0 0x10000000>; - qcom,ipa-range = <0x0 0x0 0xf 0xffffffff>; - }; +additionalProperties: false + +examples: + - |+ + virtio_mem_device@0x60000000 { + compatible = "qcom,virtio-mem"; + qcom,block-size = <0x400000>; + qcom,max-size = <0x0 0x10000000>; + qcom,ipa-range = <0x0 0x0 0xf 0xffffffff>; + };