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

Commit 67755d44 authored by Bharath's avatar Bharath Committed by Luca Weiss
Browse files

Merge tag 'LA.UM.9.6.2.c26-02500-89xx.0' into int/11/fp3

"LA.UM.9.6.2.c26-02500-89xx.0"

* tag 'LA.UM.9.6.2.c26-02500-89xx.0':
  msm: kgsl: Fix gpuaddr_in_range() to check upper bound
  msm: kgsl: Remove 'fd' dependency to get dma_buf handle
  msm: ADSPRPC: Restrict untrusted applications from attaching to GuestOS
  msm: kgsl: Zap performance counters across context switches
  msm: kgsl: Add a sysfs node to control performance counter reads
  msm: kgsl: Perform cache flush on the pages obtained using get_user_pages()
  disp: msm: sde: protect file private structure with mutex lock
  msm: kgsl: Fix out of bound write in adreno_profile_submit_time
  disp: msm: sde: add null check for drm file in msm_release

Change-Id: I18d27eba1665394953df0080527b4bd902c47678
parents 84eb0117 e35ccc91
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -2236,6 +2236,12 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
		remote_arg_t ra[1];
		int tgid = fl->tgid;

		if (fl->dev_minor == MINOR_NUM_DEV) {
			err = -ECONNREFUSED;
			pr_err("adsprpc: %s: untrusted apk trying to attach to privileged DSP PD\n",
				__func__);
			return err;
		}
		ra[0].buf.pv = (void *)&tgid;
		ra[0].buf.len = sizeof(tgid);
		ioctl.inv.handle = FASTRPC_STATIC_HANDLE_PROCESS_GROUP;
@@ -2358,6 +2364,13 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
			unsigned int pageslen;
		} inbuf;

		if (fl->dev_minor == MINOR_NUM_DEV) {
			err = -ECONNREFUSED;
			pr_err("adsprpc: %s: untrusted apk trying to attach to audio PD\n",
				__func__);
			return err;
		}

		if (!init->filelen)
			goto bail;

+1 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2018, 2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2018, 2020-2021, The Linux Foundation. All rights reserved.
 * Copyright (C) 2013 Red Hat
 * Author: Rob Clark <robdclark@gmail.com>
 *
+3 −0
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -395,6 +396,8 @@
#define A6XX_RBBM_PERFCTR_RBBM_SEL_2             0x509
#define A6XX_RBBM_PERFCTR_RBBM_SEL_3             0x50A
#define A6XX_RBBM_PERFCTR_GPU_BUSY_MASKED        0x50B
#define A6XX_RBBM_PERFCTR_SRAM_INIT_CMD          0x50e
#define A6XX_RBBM_PERFCTR_SRAM_INIT_STATUS       0x50f

#define A6XX_RBBM_ISDB_CNT                       0x533

+3 −0
Original line number Diff line number Diff line
/* Copyright (c) 2002,2007-2018,2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1426,6 +1427,8 @@ static int adreno_probe(struct platform_device *pdev)
	adreno_debugfs_init(adreno_dev);
	adreno_profile_init(adreno_dev);

	adreno_dev->perfcounter = false;

	adreno_sysfs_init(adreno_dev);

	kgsl_pwrscale_init(&pdev->dev, CONFIG_QCOM_ADRENO_DEFAULT_GOVERNOR);
+14 −0
Original line number Diff line number Diff line
/* Copyright (c) 2008-2018,2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -34,6 +35,9 @@
#define DEVICE_3D_NAME "kgsl-3d"
#define DEVICE_3D0_NAME "kgsl-3d0"

/* Index to preemption scratch buffer to store KMD postamble */
#define KMD_POSTAMBLE_IDX 100

/* ADRENO_DEVICE - Given a kgsl_device return the adreno device struct */
#define ADRENO_DEVICE(device) \
		container_of(device, struct adreno_device, dev)
@@ -251,6 +255,9 @@ struct adreno_gpudev;
/* Time to allow preemption to complete (in ms) */
#define ADRENO_PREEMPT_TIMEOUT 10000

#define PREEMPT_SCRATCH_ADDR(dev, id) \
	((dev)->preempt.scratch.gpuaddr + (id * sizeof(u64)))

#define ADRENO_INT_BIT(a, _bit) (((a)->gpucore->gpudev->int_bits) ? \
		(adreno_get_int(a, _bit) < 0 ? 0 : \
		BIT(adreno_get_int(a, _bit))) : 0)
@@ -287,6 +294,7 @@ enum adreno_preempt_states {
 * skipsaverestore: To skip saverestore during L1 preemption (for 6XX)
 * usesgmem: enable GMEM save/restore across preemption (for 6XX)
 * count: Track the number of preemptions triggered
 * @postamble_len: Number of dwords in KMD postamble pm4 packet
 */
struct adreno_preemption {
	atomic_t state;
@@ -298,6 +306,7 @@ struct adreno_preemption {
	bool skipsaverestore;
	bool usesgmem;
	unsigned int count;
	u32 postamble_len;
};


@@ -578,6 +587,11 @@ struct adreno_device {
	bool gpuhtw_llc_slice_enable;
	unsigned int zap_loaded;
	unsigned int soc_hw_rev;
	/*
	 * @perfcounter: Flag to clear perfcounters across contexts and
	 * controls perfcounter ioctl read
	 */
	bool perfcounter;
};

/**
Loading