Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c809744 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Do not allow CPU mappings of secure buffers"

parents dc4a9e25 926e9ca3
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -11,6 +11,14 @@
 */

&soc {

	pil_gpu: qcom,kgsl-hyp {
		compatible = "qcom,pil-tz-generic";
		qcom,pas-id = <13>;
		qcom,firmware-name = "a530_zap";
		memory-region = <&peripheral_mem>;
	};

	msm_bus: qcom,kgsl-busmon{
		label = "kgsl-busmon";
		compatible = "qcom,kgsl-busmon";
+6 −6
Original line number Diff line number Diff line
@@ -1086,6 +1086,12 @@ int adreno_probe(struct platform_device *pdev)
	/* Identify the specific GPU */
	adreno_identify_gpu(adreno_dev);

	status = kgsl_device_platform_probe(device);
	if (status) {
		device->pdev = NULL;
		return status;
	}

	/*
	 * qcom,iommu-secure-id is used to identify MMUs that can handle secure
	 * content but that is only part of the story - the GPU also has to be
@@ -1097,12 +1103,6 @@ int adreno_probe(struct platform_device *pdev)
	if (!ADRENO_FEATURE(adreno_dev, ADRENO_CONTENT_PROTECTION))
		device->mmu.secured = false;

	status = kgsl_device_platform_probe(device);
	if (status) {
		device->pdev = NULL;
		return status;
	}

	status = adreno_ringbuffer_init(device);
	if (status)
		goto out;
+7 −0
Original line number Diff line number Diff line
@@ -3605,6 +3605,13 @@ kgsl_get_unmapped_area(struct file *file, unsigned long addr,
	ret = arch_mmap_check(addr, len, flags);
	if (ret)
		goto put;

	/* Do not allow CPU mappings for secure buffers */
	if (kgsl_memdesc_is_secured(&entry->memdesc)) {
		ret = -EPERM;
		goto put;
	}

	/*
	 * If we're not going to use CPU map feature, get an ordinary mapping
	 * with nothing more to be done.
+1 −0
Original line number Diff line number Diff line
@@ -757,6 +757,7 @@ static int _get_iommu_ctxs(struct kgsl_mmu *mmu)
		} else if (!strcmp("gfx3d_secure",
				data->iommu_ctxs[i].iommu_ctx_name)) {
			ctx = &iommu->ctx[KGSL_IOMMU_CONTEXT_SECURE];
			mmu->secured = true;
		} else if (!strcmp("gfx3d_spare",
				data->iommu_ctxs[i].iommu_ctx_name)) {
			continue;