[PATCH v3 04/14] vfio: Provide better generic support for open/release vfio_device_ops

2021-07-28 Thread Jason Gunthorpe
Currently the driver ops have an open/release pair that is called once each time a device FD is opened or closed. Add an additional set of open/close_device() ops which are called when the device FD is opened for the first time and closed for the last time. An analysis shows that all of the driver

[PATCH v3 11/14] vfio/mbochs: Fix close when multiple device FDs are open

2021-07-28 Thread Jason Gunthorpe
mbochs_close() iterates over global device state and frees it. Currently this is done every time a device FD is closed, but if multiple device FDs are open this could corrupt other still active FDs. Change this to use close_device() so it only runs on the last close. Reviewed-by: Cornelia Huck R

[PATCH v3 05/14] vfio/samples: Delete useless open/close

2021-07-28 Thread Jason Gunthorpe
The core code no longer requires these ops to be defined, so delete these empty functions and leave the op as NULL. mtty's functions only log a pointless message, delete that entirely. Signed-off-by: Yishai Hadas Reviewed-by: Cornelia Huck Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gun

[PATCH v3 10/14] vfio/pci: Reorganize VFIO_DEVICE_PCI_HOT_RESET to use the device set

2021-07-28 Thread Jason Gunthorpe
Like vfio_pci_try_bus_reset() this code wants to reset all of the devices in the "reset group" which is the same membership as the device set. Instead of trying to reconstruct the device set from the PCI list go directly from the device set's device list to execute the reset. The same basic struc

[PATCH v3 06/14] vfio/fsl: Move to the device set infrastructure

2021-07-28 Thread Jason Gunthorpe
FSL uses the internal reflck to implement the open_device() functionality, conversion to the core code is straightforward. The decision on which set to be part of is trivially based on the is_fsl_mc_bus_dprc() and we use a 'struct device *' pointer as the set_id. The dev_set lock is protecting th

[PATCH v3 13/14] vfio/gvt: Fix open/close when multiple device FDs are open

2021-07-28 Thread Jason Gunthorpe
The user can open multiple device FDs if it likes, however the open function calls vfio_register_notifier() on device global state. Calling vfio_register_notifier() twice will trigger a WARN_ON from notifier_chain_register() and the first close will wrongly delete the notifier and more. Since thes

[PATCH v3 03/14] vfio: Introduce a vfio_uninit_group_dev() API call

2021-07-28 Thread Jason Gunthorpe
From: Max Gurtovoy This pairs with vfio_init_group_dev() and allows undoing any state that is stored in the vfio_device unrelated to registration. Add appropriately placed calls to all the drivers. The following patch will use this to add pre-registration state for the device set. Signed-off-by

[PATCH v3 01/14] vfio/samples: Remove module get/put

2021-07-28 Thread Jason Gunthorpe
The patch to move the get/put to core and the patch to convert the samples to use vfio_device crossed in a way that this was missed. When both patches are together the samples do not need their own get/put. Fixes: 437e41368c01 ("vfio/mdpy: Convert to use vfio_register_group_dev()") Fixes: 681c1615

[PATCH v3 14/14] vfio: Remove struct vfio_device_ops open/release

2021-07-28 Thread Jason Gunthorpe
Nothing uses this anymore, delete it. Signed-off-by: Yishai Hadas Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe --- drivers/vfio/mdev/vfio_mdev.c | 22 -- drivers/vfio/vfio.c | 14 +- include/linux/mdev.h | 7 --- include/

[PATCH v3 09/14] vfio/pci: Change vfio_pci_try_bus_reset() to use the dev_set

2021-07-28 Thread Jason Gunthorpe
Keep track of all the vfio_devices that have been added to the device set and use this list in vfio_pci_try_bus_reset() instead of trying to work backwards from the pci_device. The dev_set->lock directly prevents devices from joining/leaving the set, which further implies the pci_device cannot cha

Re: [early pull] drm/msm: drm-msm-next-2021-07-28 for v5.15

2021-07-28 Thread Rob Clark
Jordan, any idea if more frequent frequency changes would for some reason make a630 grumpy? I was expecting it should be somewhat similar to a618 (same GMU fw, etc). The main result of that patch should be clamping to min freq when gpu goes idle, and the toggling back to devfreq provided freq on

Re: [PATCH 19/64] ip: Use struct_group() for memcpy() regions

2021-07-28 Thread Bart Van Assche
On 7/28/21 2:01 PM, Kees Cook wrote: > On Wed, Jul 28, 2021 at 07:55:53AM +0200, Greg Kroah-Hartman wrote: >>> struct ethhdr { >>> - unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ >>> - unsigned char h_source[ETH_ALEN]; /* source ether addr*/ >>> + union { >>> +

[PATCH v6 02/15] mei: pxp: export pavp client to me client bus

2021-07-28 Thread Daniele Ceraolo Spurio
From: Vitaly Lubart Export PAVP client to work with i915 driver, for binding it uses kernel component framework. v2:drop debug prints, refactor match code to match mei_hdcp (Tomas) Signed-off-by: Vitaly Lubart Signed-off-by: Tomas Winkler Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: Ro

[PATCH v6 00/15] drm/i915: Introduce Intel PXP

2021-07-28 Thread Daniele Ceraolo Spurio
PXP (Protected Xe Path) is an i915 component, available on GEN12+, that helps to establish the hardware protected session and manage the status of the alive software session, as well as its life cycle. Very minimal changes from v5: - Update mei_pxp match code to look the same as mei_hdcp (no fu

[PATCH v6 01/15] drm/i915/pxp: Define PXP component interface

2021-07-28 Thread Daniele Ceraolo Spurio
This will be used for communication between the i915 driver and the mei one. Defining it in a stand-alone patch to avoid circualr dependedencies between the patches modifying the 2 drivers. Split out from an original patch from Huang, Sean Z v2: rename the component struct (Rodrigo) Signed-off-

[PATCH v6 03/15] drm/i915/pxp: define PXP device flag and kconfig

2021-07-28 Thread Daniele Ceraolo Spurio
Ahead of the PXP implementation, define the relevant define flag and kconfig option. v2: flip kconfig default to N. Some machines have IFWIs that do not support PXP, so we need it to be an opt-in until we add support to query the caps from the mei device. Signed-off-by: Daniele Ceraolo Spurio Re

[PATCH v6 04/15] drm/i915/pxp: allocate a vcs context for pxp usage

2021-07-28 Thread Daniele Ceraolo Spurio
The context is required to send the session termination commands to the VCS, which will be implemented in a follow-up patch. We can also use the presence of the context as a check of pxp initialization completion. v2: use perma-pinned context (Chris) v3: rename pinned_context functions (Chris) v4:

[PATCH v6 05/15] drm/i915/pxp: Implement funcs to create the TEE channel

2021-07-28 Thread Daniele Ceraolo Spurio
From: "Huang, Sean Z" Implement the funcs to create the TEE channel, so kernel can send the TEE commands directly to TEE for creating the arbitrary (default) session. v2: fix locking, don't pollute dev_priv (Chris) v3: wait for mei PXP component to be bound. v4: drop the wait, as the component

[PATCH v6 06/15] drm/i915/pxp: set KCR reg init

2021-07-28 Thread Daniele Ceraolo Spurio
The setting is required by hardware to allow us doing further protection operation such as sending commands to GPU or TEE. The register needs to be re-programmed on resume, so for simplicitly we bundle the programming with the component binding, which is automatically called on resume. Further HW

[PATCH v6 07/15] drm/i915/pxp: Create the arbitrary session after boot

2021-07-28 Thread Daniele Ceraolo Spurio
From: "Huang, Sean Z" Create the arbitrary session, with the fixed session id 0xf, after system boot, for the case that application allocates the protected buffer without establishing any protection session. Because the hardware requires at least one alive session for protected buffer creation. T

[PATCH v6 11/15] drm/i915/pxp: start the arb session on demand

2021-07-28 Thread Daniele Ceraolo Spurio
Now that we can handle destruction and re-creation of the arb session, we can postpone the start of the session to the first submission that requires it, to avoid keeping it running with no user. Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: Rodrigo Vivi --- .../gpu/drm/i915/gem/i915_gem_e

[PATCH v6 08/15] drm/i915/pxp: Implement arb session teardown

2021-07-28 Thread Daniele Ceraolo Spurio
From: "Huang, Sean Z" Teardown is triggered when the display topology changes and no long meets the secure playback requirement, and hardware trashes all the encryption keys for display. Additionally, we want to emit a teardown operation to make sure we're clean on boot and resume v2: emit in th

[PATCH v6 10/15] drm/i915/pxp: interfaces for using protected objects

2021-07-28 Thread Daniele Ceraolo Spurio
This api allow user mode to create protected buffers and to mark contexts as making use of such objects. Only when using contexts marked in such a way is the execution guaranteed to work as expected. Contexts can only be marked as using protected content at creation time (i.e. the parameter is imm

[PATCH v6 09/15] drm/i915/pxp: Implement PXP irq handler

2021-07-28 Thread Daniele Ceraolo Spurio
From: "Huang, Sean Z" The HW will generate a teardown interrupt when session termination is required, which requires i915 to submit a terminating batch. Once the HW is done with the termination it will generate another interrupt, at which point it is safe to re-create the session. Since the term

[PATCH v6 13/15] drm/i915/pxp: Add plane decryption support

2021-07-28 Thread Daniele Ceraolo Spurio
From: Anshuman Gupta Add support to enable/disable PLANE_SURF Decryption Request bit. It requires only to enable plane decryption support when following condition met. 1. PXP session is enabled. 2. Buffer object is protected. v2: - Used gen fb obj user_flags instead gem_object_metadata. [Krishna

[PATCH v6 14/15] drm/i915/pxp: black pixels on pxp disabled

2021-07-28 Thread Daniele Ceraolo Spurio
From: Anshuman Gupta When protected sufaces has flipped and pxp session is disabled, display black pixels by using plane color CTM correction. v2: - Display black pixels in async flip too. v3: - Removed the black pixels logic for async flip. [Ville] - Used plane state to force black pixels. [Vi

[PATCH v6 15/15] drm/i915/pxp: enable PXP for integrated Gen12

2021-07-28 Thread Daniele Ceraolo Spurio
Note that discrete cards can support PXP as well, but we haven't tested on those yet so keeping it disabled for now. Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i915/i91

[PATCH v6 12/15] drm/i915/pxp: Enable PXP power management

2021-07-28 Thread Daniele Ceraolo Spurio
From: "Huang, Sean Z" During the power event S3+ sleep/resume, hardware will lose all the encryption keys for every hardware session, even though the session state might still be marked as alive after resume. Therefore, we should consider the session as dead on suspend and invalidate all the obje

Re: [PATCH] drm/i915/selftests: prefer the create_user helper

2021-07-28 Thread Jason Ekstrand
On July 28, 2021 10:57:23 Matthew Auld wrote: No need to hand roll the set_placements stuff, now that that we have a helper for this. Also no need to handle the -ENODEV case here, since NULL mr implies missing device support, where the for_each_memory_region helper will always skip over such re

Re: [early pull] drm/msm: drm-msm-next-2021-07-28 for v5.15

2021-07-28 Thread Rob Clark
On Wed, Jul 28, 2021 at 7:18 PM Caleb Connolly wrote: > > > > On 29/07/2021 02:02, Rob Clark wrote: > > Jordan, any idea if more frequent frequency changes would for some > > reason make a630 grumpy? I was expecting it should be somewhat > > similar to a618 (same GMU fw, etc). The main result of

[pull] amdgpu drm-fixes-5.14

2021-07-28 Thread Alex Deucher
Hi Dave, Daniel, Fixes for 5.14. The following changes since commit ff1176468d368232b684f75e82563369208bc371: Linux 5.14-rc3 (2021-07-25 15:35:14 -0700) are available in the Git repository at: https://gitlab.freedesktop.org/agd5f/linux.git tags/amd-drm-fixes-5.14-2021-07-28 for you to fe

Re: [PATCH 36/64] scsi: ibmvscsi: Avoid multi-field memset() overflow by aiming at srp

2021-07-28 Thread Martin K. Petersen
Kees, > For example, change it to: > > + BUILD_BUG_ON(sizeof(evt_struct->iu.srp) != SRP_MAX_IU_LEN); > + memset(&evt_struct->iu.srp, 0x00, sizeof(evt_struct->iu.srp)); > srp_cmd = &evt_struct->iu.srp.cmd; > - memset(srp_cmd, 0x00, SRP_MAX_IU_LEN); > For the moment, I'll leave

Re: [PATCH 0/3] iommu/drm/msm: Allow non-coherent masters to use system cache

2021-07-28 Thread Sai Prakash Ranjan
Hi Georgi, On 2021-07-28 19:30, Georgi Djakov wrote: On Mon, Jan 11, 2021 at 07:45:02PM +0530, Sai Prakash Ranjan wrote: commit ecd7274fb4cd ("iommu: Remove unused IOMMU_SYS_CACHE_ONLY flag") removed unused IOMMU_SYS_CACHE_ONLY prot flag and along with it went the memory type setting required f

[PATCH v3 12/14] vfio/ap, ccw: Fix open/close when multiple device FDs are open

2021-07-28 Thread Jason Gunthorpe
The user can open multiple device FDs if it likes, however these open() functions call vfio_register_notifier() on some device global state. Calling vfio_register_notifier() twice in will trigger a WARN_ON from notifier_chain_register() and the first close will wrongly delete the notifier and more.

Re: [PATCH v2 13/14] drm/mediatek: add ETHDR support for MT8195

2021-07-28 Thread Nancy . Lin
Hi Chun-Kuang, Thanks for your review. On Wed, 2021-07-28 at 07:39 +0800, Chun-Kuang Hu wrote: > Hi, Nancy: > > Nancy.Lin 於 2021年7月22日 週四 下午5:46寫道: > > > > Add ETHDR module files: > > ETHDR is designed for HDR video and graphics conversion in the > > external > > display path. It handles multi

Re: [PATCH 01/64] media: omap3isp: Extract struct group for memcpy() region

2021-07-28 Thread Greg Kroah-Hartman
On Wed, Jul 28, 2021 at 11:37:30PM +0200, David Sterba wrote: > On Wed, Jul 28, 2021 at 02:37:20PM -0700, Bart Van Assche wrote: > > On 7/28/21 2:14 AM, Dan Carpenter wrote: > > > On Wed, Jul 28, 2021 at 10:59:22AM +0200, David Sterba wrote: > > >>> drivers/media/platform/omap3isp/ispstat.c | 5

Re: [PATCH 0/7] drm: Extend COMPILE_TEST support to some ARM drivers

2021-07-28 Thread Tomi Valkeinen
On 28/07/2021 18:37, Laurent Pinchart wrote: Hello, This patch series stems from subsystem-wide changes I wanted to compile-test with an ARM64 cross-compiler. My laziness to fire a 32-bit ARM build probably resulted in more time being spent writing these patches, but hopefully they'll turn out t

Re: [early pull] drm/msm: drm-msm-next-2021-07-28 for v5.15

2021-07-28 Thread Caleb Connolly
On 29/07/2021 02:02, Rob Clark wrote: Jordan, any idea if more frequent frequency changes would for some reason make a630 grumpy? I was expecting it should be somewhat similar to a618 (same GMU fw, etc). The main result of that patch should be clamping to min freq when gpu goes idle, and the

[PATCH] drm/msm: remove a repeated including of

2021-07-28 Thread Guo Zhengkui
Remove a repeated "#include " in line 19 of the original file. Signed-off-by: Guo Zhengkui --- drivers/gpu/drm/msm/disp/msm_disp_snapshot.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/msm_disp_snapshot.h b/drivers/gpu/drm/msm/disp/msm_disp_snapshot.h index c92a95

Re: [early pull] drm/msm: drm-msm-next-2021-07-28 for v5.15

2021-07-28 Thread Caleb Connolly
Hi Rob, This series causes a fatal crash on my Oneplus 6, the device goes to Qualcomm crashdump mode shortly after reaching UI with the following errors: https://paste.ubuntu.com/p/HvjmzZYtgw/ I did a git bisect and the patch ("drm/msm: Devfreq tuning") seems to be the cause of the crash, re

Re: [PATCH 1/7] drm/omap: Cast pointer to integer safely

2021-07-28 Thread Tomi Valkeinen
On 28/07/2021 18:37, Laurent Pinchart wrote: On 64-bit platforms, the compiler complains that casting a void pointer to an unsigned int loses data. Cast the pointer to a uintptr_t unsigned to fix this. Signed-off-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/omap_drv.c | 2 +- 1 file chan

Re: [PATCH] drm/vc4: hdmi: Add debugfs prefix

2021-07-28 Thread Ivan T . Ivanov
Quoting Maxime Ripard (2021-07-28 14:54:19) > Hi, > > On Fri, Jul 23, 2021 at 09:24:14AM +0200, Ivan T. Ivanov wrote: > > Without prefix debugfs can't properly create component > > debug information tree when driver register more than > > one component per device, in this case two. Fix this. > >

<    1   2   3