Re: [RFC PATCH 19/30] vfio/pci: Add TSM TDI bind/unbind IOCTLs for TEE-IO support

2025-06-05 Thread Jason Gunthorpe
On Thu, Jun 05, 2025 at 09:47:01PM +0530, Aneesh Kumar K.V wrote: > Jason Gunthorpe writes: > > > On Thu, Jun 05, 2025 at 05:33:52PM +0530, Aneesh Kumar K.V wrote: > > > >> > + > >> > +/* To ensure no host side MMIO

Re: [RFC PATCH 19/30] vfio/pci: Add TSM TDI bind/unbind IOCTLs for TEE-IO support

2025-06-05 Thread Jason Gunthorpe
do pci_request_regions_exclusive() once at the very start and it should stay that way. There is no reason to change it dynamically. The only decision to make is if all vfio should switch to exclusive mode or if we need to make it optional for userspace. Jason

Re: [RFC PATCH 19/30] vfio/pci: Add TSM TDI bind/unbind IOCTLs for TEE-IO support

2025-06-05 Thread Jason Gunthorpe
mware fails the MMIO unmap for S2. For > AMD, will trigger some HW protection called "ASID fence" [1]. Not sure > how ARM handles this? This seems even more extreme, if the guest gets a bad DMA address into the device then the entire device gets killed? No chance to debug it? Jason

Re: [PATCH 07/12] mm: Remove redundant pXd_devmap calls

2025-06-05 Thread Jason Gunthorpe
certainly your tests *should* be failing as special entries should never ever be converted to struct page. Jason

Re: [bug report] drm/xe/svm: Implement prefetch support for SVM ranges

2025-06-04 Thread Jason Gunthorpe
On Wed, Jun 04, 2025 at 04:54:43PM +0200, Simona Vetter wrote: > On Tue, Jun 03, 2025 at 07:29:52PM -0300, Jason Gunthorpe wrote: > > On Mon, May 26, 2025 at 10:15:17PM +0530, Ghimiray, Himal Prasad wrote: > > > > > > > > > On 26-05-2025 20:36, Dan Carpent

Re: [RFC PATCH 17/30] iommufd/device: Add TSM Bind/Unbind for TIO support

2025-06-04 Thread Jason Gunthorpe
On Wed, Jun 04, 2025 at 02:10:43PM +0530, Aneesh Kumar K.V wrote: > Jason Gunthorpe writes: > > > On Tue, Jun 03, 2025 at 02:20:51PM +0800, Xu Yilun wrote: > >> > Wouldn’t it be simpler to skip the reference count increment altogether > >> > and just cal

Re: [bug report] drm/xe/svm: Implement prefetch support for SVM ranges

2025-06-03 Thread Jason Gunthorpe
#x27;ERR_PTR' > > Hi Dan, > > Thanks for pointing this out. I see there's a gap in how hmm_range_fault() > adheres to its documented behavior. I believe the function should sanitize > positive return values from walk_page_range() to ensure consistency. > > Jason can comment f

Re: [PATCH 12/12] mm/memremap: Remove unused devmap_managed_key

2025-06-03 Thread Jason Gunthorpe
On Thu, May 29, 2025 at 04:32:13PM +1000, Alistair Popple wrote: > It's no longer used so remove it. > > Signed-off-by: Alistair Popple > --- > mm/memremap.c | 27 --- > 1 file changed, 27 deletions(-) Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH 11/12] mm: Remove callers of pfn_t functionality

2025-06-03 Thread Jason Gunthorpe
toph Hellwig Yay! Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH 10/12] mm: Remove devmap related functions and page table bits

2025-06-03 Thread Jason Gunthorpe
le.h | 19 +-- > mm/Kconfig| 4 +- > mm/debug_vm_pgtable.c | 59 + > mm/hmm.c | 3 +- > mm/madvise.c | 8 +-- > 25 files changed, 17 insertions(+), 318 deletions(-) Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH 09/12] powerpc: Remove checks for devmap pages and PMDs/PUDs

2025-06-03 Thread Jason Gunthorpe
- > arch/powerpc/mm/book3s64/radix_pgtable.c | 5 ++--- > arch/powerpc/mm/pgtable.c| 2 +- > 6 files changed, 10 insertions(+), 14 deletions(-) Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH 08/12] mm/khugepaged: Remove redundant pmd_devmap() check

2025-06-03 Thread Jason Gunthorpe
t; > Signed-off-by: Alistair Popple > --- > mm/khugepaged.c | 2 -- > 1 file changed, 2 deletions(-) Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH 07/12] mm: Remove redundant pXd_devmap calls

2025-06-03 Thread Jason Gunthorpe
2 +- > mm/mremap.c| 5 ++--- > mm/page_vma_mapped.c | 5 ++--- > mm/pagewalk.c | 8 +++- > mm/pgtable-generic.c | 7 +++ > mm/userfaultfd.c | 4 ++-- > mm/vmscan.c| 3 --- > 15 files changed, 40 insertions(+), 66 deletions(-) Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH 06/12] mm/gup: Remove pXX_devmap usage from get_user_pages()

2025-06-03 Thread Jason Gunthorpe
yway so can be removed. > > Signed-off-by: Alistair Popple > --- > include/linux/huge_mm.h | 3 +- > mm/gup.c| 162 + > mm/huge_memory.c| 40 +-- > 3 files changed, 5 insertions(+), 200 deletions(-) Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH 05/12] mm: Remove remaining uses of PFN_DEV

2025-06-03 Thread Jason Gunthorpe
| 2 +- > include/linux/pfn_t.h | 25 ++--- > mm/memory.c| 4 ++-- > 7 files changed, 11 insertions(+), 36 deletions(-) Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH 04/12] mm: Convert vmf_insert_mixed() from using pte_devmap to pte_special

2025-06-03 Thread Jason Gunthorpe
.c| 3 --- > mm/memory.c | 20 ++-- > mm/vmscan.c | 2 +- > 3 files changed, 3 insertions(+), 22 deletions(-) Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH 03/12] mm/pagewalk: Skip dax pages in pagewalk

2025-06-03 Thread Jason Gunthorpe
ike to see DAX pages? I guess it makes sense from the perspective of not changing things, but it seems like a comment should be left behind explaining that this is just for legacy reasons until someone audits the callers. Jason

Re: [PATCH 02/12] mm: Convert pXd_devmap checks to vma_is_dax

2025-06-03 Thread Jason Gunthorpe
2 +- > mm/userfaultfd.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Jason Gunthorpe Jason

Re: [PATCH 01/12] mm: Remove PFN_MAP, PFN_SG_CHAIN and PFN_SG_LAST

2025-06-03 Thread Jason Gunthorpe
Christoph Hellwig > --- > include/linux/pfn_t.h | 31 +++ > mm/memory.c | 2 -- > tools/testing/nvdimm/test/iomap.c | 4 > 3 files changed, 3 insertions(+), 34 deletions(-) Reviewed-by: Jason Gunthorpe Jason

Re: [RFC PATCH 17/30] iommufd/device: Add TSM Bind/Unbind for TIO support

2025-06-03 Thread Jason Gunthorpe
n concern, there is also an IOMMU_DESTROY > ioctl. User could just free the vdevice instance if no refcount, while VFIO > is still in bound state. That seems not the correct free order. Freeing the vdevice should automatically unbind it.. Jason

Re: [RFC PATCH 00/30] Host side (KVM/VFIO/IOMMUFD) support for TDISP using TSM

2025-06-02 Thread Jason Gunthorpe
On Thu, May 29, 2025 at 01:34:43PM +0800, Xu Yilun wrote: > This series has 3 sections: I really think this is too big to try to progress, even in RFC form. > Patch 1 - 11 deal with the private MMIO mapping in KVM MMU via DMABUF. > Leverage Jason & Vivek's latest VFIO dmab

Re: [RFC PATCH 10/30] vfio/pci: Export vfio dma-buf specific info for importers

2025-06-02 Thread Jason Gunthorpe
ulated into the standard DMABUF API in some way. Jason

[PATCH v6 11/20] soc: mediatek: mtk-cmdq: Add mminfra_offset adjustment for DRAM addresses

2025-06-01 Thread Jason-JH Lin
address when generating instructions to ensure GCE accesses the correct DRAM address. CMDQ users can then call CMDQ helper APIs as usual. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/soc

[PATCH v6 19/20] soc: mediatek: mtk-cmdq: Remove cmdq_pkt_write() and cmdq_pkt_write_mask()

2025-06-01 Thread Jason-JH Lin
no longer in use. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 49 ++ include/linux/soc/mediatek/mtk-cmdq.h | 35 -- 2 files changed, 18 insertions(+), 66 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b

[PATCH v6 18/20] soc: mediatek: mtk-cmdq: Remove cmdq_pkt_jump() and cmdq_pkt_jump_rel_temp()

2025-06-01 Thread Jason-JH Lin
Since all users have migrated to the new cmdq_pkt_jump* APIs without shift_pa, the wrapper APIs cmdq_pkt_jump() and cmdq_pkt_jump_rel_temp() can be removed. Fixes: ade176534112 ("soc: mediatek: cmdq: Add parameter shift_pa to cmdq_pkt_jump()") Signed-off-by: Jason-JH Lin --- d

[PATCH v6 08/20] mailbox: mtk-cmdq: Add driver data to support for MT8196

2025-06-01 Thread Jason-JH Lin
. gce_vm: For GCE hardware virtualization control Currently, the first version of the mt8196 mailbox controller only requires setting the VM-related registers to enable the permissions of a host VM. Signed-off-by: Jason-JH Lin --- drivers/mailbox/mtk-cmdq-mailbox.c | 12 1 file

[PATCH v6 01/20] arm64: dts: mediatek: Add GCE header for MT8196

2025-06-01 Thread Jason-JH Lin
Add GCE header define for GCE Thread Priority and GCE Event IDs that used in the MT8196 dtsi. Signed-off-by: Jason-JH Lin --- arch/arm64/boot/dts/mediatek/mt8196-gce.h | 612 ++ 1 file changed, 612 insertions(+) create mode 100644 arch/arm64/boot/dts/mediatek/mt8196-gce.h

[PATCH v6 10/20] soc: mediatek: mtk-cmdq: Add new APIs to replace cmdq_pkt_write() and cmdq_pkt_write_mask()

2025-06-01 Thread Jason-JH Lin
cmdq_pkt_write_mask_pa() and cmdq_pkt_write_mask_subsys(). The original cmdq_pkt_write() and cmdq_pkt_write_mask() will be removed after all CMDQ users have migrated to the new APIs. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 41 + include/linux/soc/mediatek

[PATCH v6 06/20] mailbox: mtk-cmdq: Add GCE hardware virtualization configuration

2025-06-01 Thread Jason-JH Lin
thread for the host VM. 2. VM_CPR_GSIZE It is used to allocate the CPR SRAM size to each VM. Each VM has 4-bit configuration, where setting bit 0-3 to configures the size of host VM. This setting must be configured before the VM configuration to prevent resource leakage. Signed-off-by: Jason-JH

[PATCH v6 20/20] mailbox: mtk-cmdq: Remove unsued cmdq_get_shift_pa()

2025-06-01 Thread Jason-JH Lin
Since the mailbox driver data can be obtained using cmdq_get_mbox_priv() and all CMDQ users have transitioned to cmdq_get_mbox_priv(), cmdq_get_shift_pa() can be removed. Fixes: 0858fde496f8 ("mailbox: cmdq: variablize address shift in platform") Signed-off-by: Jason-JH Lin --- drive

[PATCH v6 16/20] soc: mediatek: mtk-cmdq: Remove shift_pa parameter from cmdq_pkt_jump()

2025-06-01 Thread Jason-JH Lin
meter shift_pa to cmdq_pkt_jump()") Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 8 include/linux/soc/mediatek/mtk-cmdq.h | 18 +++--- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/d

[PATCH v6 03/20] mailbox: mtk-cmdq: Add cmdq private data to cmdq_pkt for generating instruction

2025-06-01 Thread Jason-JH Lin
tform") Signed-off-by: Jason-JH Lin --- drivers/mailbox/mtk-cmdq-mailbox.c | 8 include/linux/mailbox/mtk-cmdq-mailbox.h | 18 ++ 2 files changed, 26 insertions(+) diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c index a3

[PATCH v6 05/20] soc: mediatek: mtk-cmdq: Add cmdq_pkt_jump_rel_temp() for removing shift_pa

2025-06-01 Thread Jason-JH Lin
("soc: mediatek: cmdq: Add parameter shift_pa to cmdq_pkt_jump()") Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 6 ++ include/linux/soc/mediatek/mtk-cmdq.h | 9 + 2 files changed, 15 insertions(+) diff --git a/drivers/soc/mediatek/mtk-cmdq-h

[PATCH v6 07/20] mailbox: mtk-cmdq: Add mminfra_offset configuration for DRAM transaction

2025-06-01 Thread Jason-JH Lin
the cmdq_mbox_priv of cmdq_pkt and add the mminfra_offset to the DRAM address in GCE instructions. Signed-off-by: Jason-JH Lin --- drivers/mailbox/mtk-cmdq-mailbox.c | 6 -- include/linux/mailbox/mtk-cmdq-mailbox.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/driv

[PATCH v6 04/20] soc: mediatek: mtk-cmdq: Add cmdq_get_mbox_priv() in cmdq_pkt_create()

2025-06-01 Thread Jason-JH Lin
Add cmdq_get_mbox_priv() in cmdq_pkt_create() to ensure getting private data before generating GCE instructions. Fixes: 0858fde496f8 ("mailbox: cmdq: variablize address shift in platform") Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 1 + 1 file changed, 1

[PATCH v6 14/20] media: platform: mtk-mdp3: Add programming flow for unsupported subsys ID hardware

2025-06-01 Thread Jason-JH Lin
subsys ID is invalid, the flow will call cmdq_pkt_write_pa() and cmdq_pkt_write_mask_pa() to achieve the same functionality. Signed-off-by: Jason-JH Lin --- .../platform/mediatek/mdp3/mtk-mdp3-cmdq.c| 14 +++- .../platform/mediatek/mdp3/mtk-mdp3-comp.h| 70 ++- 2 files

[PATCH v6 17/20] media: platform: mtk-mdp3: Use cmdq_pkt_jump_rel() without shift_pa

2025-06-01 Thread Jason-JH Lin
pa to cmdq_pkt_jump()") Signed-off-by: Jason-JH Lin --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 2 +- drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c | 2 -- drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git

[PATCH v6 02/20] mailbox: mtk-cmdq: Refine DMA address handling for the command buffer

2025-06-01 Thread Jason-JH Lin
("mailbox: cmdq: variablize address shift in platform") Signed-off-by: Jason-JH Lin --- drivers/mailbox/mtk-cmdq-mailbox.c | 43 include/linux/mailbox/mtk-cmdq-mailbox.h | 10 ++ 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/drivers/mailbo

[PATCH v6 13/20] drm/mediatek: Add programming flow for unsupported subsys ID hardware

2025-06-01 Thread Jason-JH Lin
cmdq_pkt_write_mask_pa() to achieve the same functionality. Signed-off-by: Jason-JH Lin --- drivers/gpu/drm/mediatek/mtk_ddp_comp.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c index

[PATCH v6 00/20] Add GCE support for MT8196

2025-06-01 Thread Jason-JH Lin
-jason-jh@mediatek.com/ Change in v4: 1. Remove dt-binding header and add a gce header in dts folder. 2. Remove dot in sign-off name. 3. Change addr type from u32 to dma_addr_t for cmdq_reg_shift_addr() and cmdq_reg_revert_addr(). Change in v3: 1. Merge 2 dt-bindings pathes together and add

[PATCH v6 09/20] soc: mediatek: mtk-cmdq: Add pa_base parsing for hardware without subsys ID support

2025-06-01 Thread Jason-JH Lin
physical address is the only option to achieve the same functionality. This commit adds a pa_base parsing flow to the cmdq_client_reg structure to handle hardware without subsys ID support. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 15 +-- include/linux/soc

[PATCH v6 12/20] soc: mediatek: Add programming flow for unsupported subsys ID hardware

2025-06-01 Thread Jason-JH Lin
subsys ID is invalid, the flow will call cmdq_pkt_write_pa() and cmdq_pkt_write_mask_pa() to achieve the same functionality. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-mmsys.c | 12 +--- drivers/soc/mediatek/mtk-mutex.c | 8 ++-- 2 files changed, 15 insertions(+), 5

[PATCH v6 15/20] media: platform: mtk-mdp3: Change cmdq_pkt_jump_rel() to cmdq_pkt_jump_rel_temp()

2025-06-01 Thread Jason-JH Lin
_jump()") Signed-off-by: Jason-JH Lin --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c index 555d35ad553e..7575ec376

Re: [RFC PATCH 00/12] Private MMIO support for private assigned dev

2025-05-29 Thread Jason Gunthorpe
s the PCI memory enable bit, doesn't it? Jason

[PATCH] drm/mediatek: Add wait_event_timeout when disabling plane

2025-05-22 Thread Jason-JH Lin
() callback,indicating that the GCE IRQ has been triggered. Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Jason-JH Lin --- drivers/gpu/drm/mediatek/mtk_crtc.c | 30 drivers/gpu/drm/mediatek/mtk_crtc.h | 1 + d

Re: [RFC PATCH 00/12] Private MMIO support for private assigned dev

2025-05-16 Thread Jason Gunthorpe
tell the already existing secure vIOMMU that it is allowed to translate for a specific vPCI function. Jason

Re: [RFC PATCH 00/12] Private MMIO support for private assigned dev

2025-05-15 Thread Jason Gunthorpe
> *TDX tdi free > 48. > *enable mmio > 49.*cb dmabuf recover > 50.workable shared dev This is a nice chart, it would be good to see a comparable chart for AMD and ARM Jason

Re: [RFC PATCH 00/12] Private MMIO support for private assigned dev

2025-05-15 Thread Jason Gunthorpe
ce destruction trigger vdevice destruction >-> tsm_tdi_unbind() > -> tdi stop > -> callback to VFIO, dmabuf_move_notify(revoke) > -> KVM unmap MMIO > -> tdi metadata remove This omits the viommu. It won't get destroyed until the iommufd closes, so iommufd will be holding the kvm and it will do the final put. Jason

Re: [RFC PATCH 00/12] Private MMIO support for private assigned dev

2025-05-14 Thread Jason Gunthorpe
doesn't know about this. > > I have to interpret this as VFIO firstly hand over device CC features > and MMIO resources to IOMMUFD, so VFIO never cares about them. > > [1] https://lore.kernel.org/all/20250218111017.491719-15-...@amd.com/ There is also the PCI layer involved here and maybe PCI should be participating in managing some of this. Like it makes a bit of sense that PCI would block the FLR on platforms that require this? Jason

Re: [RFC PATCH 00/12] Private MMIO support for private assigned dev

2025-05-12 Thread Jason Gunthorpe
ce things, it can destroy all these IOMMUFD objects and talk to > VFIO too, I've tried, so far it is looking easier to manage. Thanks, Yes, qemu should be sequencing this. The kernel only needs to enforce any rules required to keep the system from crashing. Jason

[PATCH RESEND v5 10/20] mailbox: mtk-cmdq: Remove unsued cmdq_get_shift_pa()

2025-05-12 Thread Jason-JH Lin
Since the mailbox driver data can be obtained using cmdq_get_mbox_priv() and all CMDQ users have transitioned to cmdq_get_mbox_priv(), cmdq_get_shift_pa() can be removed. Fixes: 0858fde496f8 ("mailbox: cmdq: variablize address shift in platform") Signed-off-by: Jason-JH Lin --- drive

[PATCH RESEND v5 06/20] media: platform: mtk-mdp3: Change cmdq_pkt_jump_rel() to cmdq_pkt_jump_rel_temp()

2025-05-12 Thread Jason-JH Lin
_jump()") Signed-off-by: Jason-JH Lin --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c index e5ccf673e152..aa245bf7e

[PATCH RESEND v5 14/20] soc: mediatek: mtk-cmdq: Add pa_base parsing for hardware without subsys ID support

2025-05-12 Thread Jason-JH Lin
physical address is the only option to achieve the same functionality. This commit adds a pa_base parsing flow to the cmdq_client_reg structure to handle hardware without subsys ID support. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 15 +-- include/linux/soc

[PATCH RESEND v5 11/20] mailbox: mtk-cmdq: Add GCE hardware virtualization configuration

2025-05-12 Thread Jason-JH Lin
thread for the host VM. 2. VM_CPR_GSIZE It is used to allocate the CPR SRAM size to each VM. Each VM has 4-bit configuration, where setting bit 0-3 to configures the size of host VM. This setting must be configured before the VM configuration to prevent resource leakage. Signed-off-by: Jason-JH

[PATCH RESEND v5 15/20] soc: mediatek: mtk-cmdq: Add new APIs to replace cmdq_pkt_write() and cmdq_pkt_write_mask()

2025-05-12 Thread Jason-JH Lin
cmdq_pkt_write_mask_pa() and cmdq_pkt_write_mask_subsys(). The original cmdq_pkt_write() and cmdq_pkt_write_mask() will be removed after all CMDQ users have migrated to the new APIs. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 41 + include/linux/soc/mediatek

[PATCH RESEND v5 17/20] soc: mediatek: Add programming flow for unsupported subsys ID hardware

2025-05-12 Thread Jason-JH Lin
subsys ID is invalid, the flow will call cmdq_pkt_write_pa() and cmdq_pkt_write_mask_pa() to achieve the same functionality. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-mmsys.c | 12 +--- drivers/soc/mediatek/mtk-mutex.c | 8 ++-- 2 files changed, 15 insertions(+), 5

[PATCH RESEND v5 16/20] soc: mediatek: mtk-cmdq: Add mminfra_offset adjustment for DRAM addresses

2025-05-12 Thread Jason-JH Lin
address when generating instructions to ensure GCE accesses the correct DRAM address. CMDQ users can then call CMDQ helper APIs as usual. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/soc

[PATCH RESEND v5 05/20] soc: mediatek: mtk-cmdq: Add cmdq_pkt_jump_rel_temp() for removing shift_pa

2025-05-12 Thread Jason-JH Lin
("soc: mediatek: cmdq: Add parameter shift_pa to cmdq_pkt_jump()") Signed-off-by: Jason-JH Lin --- include/linux/soc/mediatek/mtk-cmdq.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h index 0c

[PATCH RESEND v5 12/20] mailbox: mtk-cmdq: Add mminfra_offset configuration for DRAM transaction

2025-05-12 Thread Jason-JH Lin
the cmdq_mbox_priv of cmdq_pkt and add the mminfra_offset to the DRAM address in GCE instructions. Signed-off-by: Jason-JH Lin --- drivers/mailbox/mtk-cmdq-mailbox.c | 6 -- include/linux/mailbox/mtk-cmdq-mailbox.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/driv

[PATCH RESEND v5 18/20] drm/mediatek: Add programming flow for unsupported subsys ID hardware

2025-05-12 Thread Jason-JH Lin
cmdq_pkt_write_mask_pa() to achieve the same functionality. Signed-off-by: Jason-JH Lin --- drivers/gpu/drm/mediatek/mtk_ddp_comp.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c index

[PATCH RESEND v5 20/20] soc: mediatek: mtk-cmdq: Remove cmdq_pkt_write() and cmdq_pkt_write_mask()

2025-05-12 Thread Jason-JH Lin
no longer in use. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 49 ++ include/linux/soc/mediatek/mtk-cmdq.h | 35 -- 2 files changed, 18 insertions(+), 66 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b

[PATCH RESEND v5 03/20] mailbox: mtk-cmdq: Add cmdq private data to cmdq_pkt for generating instruction

2025-05-12 Thread Jason-JH Lin
tform") Signed-off-by: Jason-JH Lin --- drivers/mailbox/mtk-cmdq-mailbox.c | 8 include/linux/mailbox/mtk-cmdq-mailbox.h | 18 ++ 2 files changed, 26 insertions(+) diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c index a3

[PATCH RESEND v5 04/20] soc: mediatek: mtk-cmdq: Add cmdq_get_mbox_priv() in cmdq_pkt_create()

2025-05-12 Thread Jason-JH Lin
Add cmdq_get_mbox_priv() in cmdq_pkt_create() to ensure getting private data before generating GCE instructions. Fixes: 0858fde496f8 ("mailbox: cmdq: variablize address shift in platform") Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 1 + 1 file changed, 1

[PATCH RESEND v5 19/20] media: mediatek: mdp3: Add programming flow for unsupported subsys ID hardware

2025-05-12 Thread Jason-JH Lin
subsys ID is invalid, the flow will call cmdq_pkt_write_pa() and cmdq_pkt_write_mask_pa() to achieve the same functionality. Signed-off-by: Jason-JH Lin --- .../platform/mediatek/mdp3/mtk-mdp3-cmdq.c| 14 +++- .../platform/mediatek/mdp3/mtk-mdp3-comp.h| 70 ++- 2 files

[PATCH RESEND v5 09/20] soc: mediatek: mtk-cmdq: Remove cmdq_pkt_jump() and cmdq_pkt_jump_rel_temp()

2025-05-12 Thread Jason-JH Lin
Since all users have migrated to the new cmdq_pkt_jump* APIs without shift_pa, the wrapper APIs cmdq_pkt_jump() and cmdq_pkt_jump_rel_temp() can be removed. Fixes: ade176534112 ("soc: mediatek: cmdq: Add parameter shift_pa to cmdq_pkt_jump()") Signed-off-by: Jason-JH Lin --- include

[PATCH RESEND v5 07/20] soc: mediatek: mtk-cmdq: Remove shift_pa parameter from cmdq_pkt_jump()

2025-05-12 Thread Jason-JH Lin
meter shift_pa to cmdq_pkt_jump()") Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 8 include/linux/soc/mediatek/mtk-cmdq.h | 20 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c

[PATCH RESEND v5 02/20] mailbox: mtk-cmdq: Refine DMA address handling for the command buffer

2025-05-12 Thread Jason-JH Lin
("mailbox: cmdq: variablize address shift in platform") Signed-off-by: Jason-JH Lin --- drivers/mailbox/mtk-cmdq-mailbox.c | 43 include/linux/mailbox/mtk-cmdq-mailbox.h | 10 ++ 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/drivers/mailbo

[PATCH RESEND v5 00/20] Add GCE support for MT8196

2025-05-12 Thread Jason-JH Lin
() APIs to replace the cmdq_pkt_write(). [1] mailbox: mtk-cmdq: Refine GCE_GCTL_VALUE setting - https://patchwork.kernel.org/project/linux-mediatek/patch/20250421035650.441383-1-jason-jh@mediatek.com/ Change in v4: 1. Remove dt-binding header and add a gce header in dts folder. 2. Remove dot in

[PATCH RESEND v5 01/20] arm64: dts: mediatek: Add GCE header for MT8196

2025-05-12 Thread Jason-JH Lin
Add GCE header define for GCE Thread Priority and GCE Event IDs that used in the MT8196 dtsi. Signed-off-by: Jason-JH Lin --- arch/arm64/boot/dts/mediatek/mt8196-gce.h | 612 ++ 1 file changed, 612 insertions(+) create mode 100644 arch/arm64/boot/dts/mediatek/mt8196-gce.h

[PATCH RESEND v5 13/20] mailbox: mtk-cmdq: Add driver data to support for MT8196

2025-05-12 Thread Jason-JH Lin
. gce_vm: For GCE hardware virtualization control Currently, the first version of the mt8196 mailbox controller only requires setting the VM-related registers to enable the permissions of a host VM. Signed-off-by: Jason-JH Lin --- drivers/mailbox/mtk-cmdq-mailbox.c | 12 1 file

[PATCH RESEND v5 08/20] media: platform: mtk-mdp3: Use cmdq_pkt_jump_rel() without shift_pa

2025-05-12 Thread Jason-JH Lin
pa to cmdq_pkt_jump()") Signed-off-by: Jason-JH Lin --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 2 +- drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c | 2 -- drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git

Re: [RFC PATCH 00/12] Private MMIO support for private assigned dev

2025-05-09 Thread Jason Gunthorpe
Table cleanup for the TDI > 4. TDI ownership reclaim and metadata free So your issue is you need to shoot down the dmabuf during vPCI device destruction? VFIO also needs to shoot down the MMIO during things like FLR I don't think moving to iommufd really fixes it, it sounds like you need more coordination between the two parts?? Jason

Re: [RFC 9/9] {fwctl,drm}/xe/pcode: Introduce xe_pcode_fwctl

2025-05-07 Thread Jason Gunthorpe
just for flash. Some internal improvement kernel side to allow streaming from large user-space RPC buffers instead of a single alloc and copy would be sufficient.. Jason

Re: [RFC 9/9] {fwctl,drm}/xe/pcode: Introduce xe_pcode_fwctl

2025-05-06 Thread Jason Gunthorpe
gt; + * FWCTL info.uctx_caps: FWCTL_XE_PCODE_LATEBINDING > + * FWCTL rpc.scope: FWCTL_RPC_CONFIGURATION > + * > + * Command 0x5C - LATE_BINDING > + * Param10x0 - GET_CAPABILITY_STATUS > + * Param20 > + * Data in None > + * Data out: > + * > + * - Bit0: ate binding for V1 Fan Tables is supported. "ate" is a typo? This seems fine, though very simple in what it can do. Do you imagine more commands down the road? Jason

Re: [PATCH v3 03/33] iommu/io-pgtable-arm: Add quirk to quiet WARN_ON()

2025-04-29 Thread Jason Gunthorpe
On Tue, Apr 29, 2025 at 06:58:32AM -0700, Rob Clark wrote: > On Tue, Apr 29, 2025 at 5:28 AM Jason Gunthorpe wrote: > > > > On Mon, Apr 28, 2025 at 01:54:10PM -0700, Rob Clark wrote: > > > From: Rob Clark > > > > > > In situations where mapp

Re: [PATCH v3 03/33] iommu/io-pgtable-arm: Add quirk to quiet WARN_ON()

2025-04-29 Thread Jason Gunthorpe
should have the WARN_ON? eg iommufd already has a WARN_ON around iommu_unmap failures so having one in the ARM page table is a double WARN. Don't really like using a quirk to change the API contract. Jason

[PATCH v5 10/19] mailbox: mtk-cmdq: Add GCE hardware virtualization configuration

2025-04-25 Thread Jason-JH Lin
thread for the host VM. 2. VM_CPR_GSIZE It is used to allocate the CPR SRAM size to each VM. Each VM has 4-bit configuration, where setting bit 0-3 to configures the size of host VM. This setting must be configured before the VM configuration to prevent resource leakage. Signed-off-by: Jason-JH

[PATCH v5 12/19] mailbox: mtk-cmdq: Add driver data to support for MT8196

2025-04-25 Thread Jason-JH Lin
. gce_vm: For GCE hardware virtualization control Currently, the first version of the mt8196 mailbox controller only requires setting the VM-related registers to enable the permissions of a host VM. Signed-off-by: Jason-JH Lin --- drivers/mailbox/mtk-cmdq-mailbox.c | 12 1 file

[PATCH v5 04/19] soc: mediatek: mtk-cmdq: Add cmdq_get_mbox_priv() in cmdq_pkt_create()

2025-04-25 Thread Jason-JH Lin
Add cmdq_get_mbox_priv() in cmdq_pkt_create() to ensure getting private data before generating GCE instructions. Fixes: 0858fde496f8 ("mailbox: cmdq: variablize address shift in platform") Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 1 + 1 file changed, 1

[PATCH v5 07/19] soc: mediatek: mtk-cmdq: Remove shift_pa parameter from cmdq_pkt_jump()

2025-04-25 Thread Jason-JH Lin
meter shift_pa to cmdq_pkt_jump()") Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 8 include/linux/soc/mediatek/mtk-cmdq.h | 20 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c

[PATCH v5 19/19] soc: mediatek: mtk-cmdq: Remove cmdq_pkt_write() and cmdq_pkt_write_mask()

2025-04-25 Thread Jason-JH Lin
no longer in use. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 49 ++ include/linux/soc/mediatek/mtk-cmdq.h | 35 -- 2 files changed, 18 insertions(+), 66 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b

[PATCH v5 06/19] media: platform: mtk-mdp3: Change cmdq_pkt_jump_rel() to cmdq_pkt_jump_rel_temp()

2025-04-25 Thread Jason-JH Lin
_jump()") Signed-off-by: Jason-JH Lin --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c index e5ccf673e152..aa245bf7e

[PATCH v5 16/19] soc: mediatek: Add programming flow for unsupported subsys ID hardware

2025-04-25 Thread Jason-JH Lin
subsys ID is invalid, the flow will call cmdq_pkt_write_pa() and cmdq_pkt_write_mask_pa() to achieve the same functionality. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-mmsys.c | 12 +--- drivers/soc/mediatek/mtk-mutex.c | 8 ++-- 2 files changed, 15 insertions(+), 5

[PATCH v5 02/19] mailbox: mtk-cmdq: Refine DMA address handling for the command buffer

2025-04-25 Thread Jason-JH Lin
("mailbox: cmdq: variablize address shift in platform") Signed-off-by: Jason-JH Lin --- drivers/mailbox/mtk-cmdq-mailbox.c | 43 include/linux/mailbox/mtk-cmdq-mailbox.h | 10 ++ 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/drivers/mailbo

[PATCH v5 11/19] mailbox: mtk-cmdq: Add mminfra_offset configuration for DRAM transaction

2025-04-25 Thread Jason-JH Lin
the cmdq_mbox_priv of cmdq_pkt and add the mminfra_offset to the DRAM address in GCE instructions. Signed-off-by: Jason-JH Lin --- drivers/mailbox/mtk-cmdq-mailbox.c | 6 -- include/linux/mailbox/mtk-cmdq-mailbox.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/driv

[PATCH v5 08/19] media: platform: mtk-mdp3: Use cmdq_pkt_jump_rel() without shift_pa

2025-04-25 Thread Jason-JH Lin
pa to cmdq_pkt_jump()") Signed-off-by: Jason-JH Lin --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 2 +- drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c | 2 -- drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git

[PATCH v5 15/19] soc: mediatek: mtk-cmdq: Add mminfra_offset adjustment for DRAM addresses

2025-04-25 Thread Jason-JH Lin
address when generating instructions to ensure GCE accesses the correct DRAM address. CMDQ users can then call CMDQ helper APIs as usual. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/soc

[PATCH v5 01/19] arm64: dts: mediatek: Add GCE header for MT8196

2025-04-25 Thread Jason-JH Lin
Add GCE header define for GCE Thread Priority and GCE Event IDs that used in the MT8196 dtsi. Signed-off-by: Jason-JH Lin --- arch/arm64/boot/dts/mediatek/mt8196-gce.h | 612 ++ 1 file changed, 612 insertions(+) create mode 100644 arch/arm64/boot/dts/mediatek/mt8196-gce.h

[PATCH v5 09/19] soc: mediatek: mtk-cmdq: Remove cmdq_pkt_jump() and cmdq_pkt_jump_rel_temp()

2025-04-25 Thread Jason-JH Lin
Since all users have migrated to the new cmdq_pkt_jump* APIs without shift_pa, the wrapper APIs cmdq_pkt_jump() and cmdq_pkt_jump_rel_temp() can be removed. Fixes: ade176534112 ("soc: mediatek: cmdq: Add parameter shift_pa to cmdq_pkt_jump()") Signed-off-by: Jason-JH Lin --- include

[PATCH v5 14/19] soc: mediatek: mtk-cmdq: Add new APIs to replace cmdq_pkt_write() and cmdq_pkt_write_mask()

2025-04-25 Thread Jason-JH Lin
cmdq_pkt_write_mask_pa() and cmdq_pkt_write_mask_subsys(). The original cmdq_pkt_write() and cmdq_pkt_write_mask() will be removed after all CMDQ users have migrated to the new APIs. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 41 + include/linux/soc/mediatek

[PATCH v5 05/19] soc: mediatek: mtk-cmdq: Add cmdq_pkt_jump_rel_temp() for removing shift_pa

2025-04-25 Thread Jason-JH Lin
("soc: mediatek: cmdq: Add parameter shift_pa to cmdq_pkt_jump()") Signed-off-by: Jason-JH Lin --- include/linux/soc/mediatek/mtk-cmdq.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h index 0c

[PATCH v5 17/19] drm/mediatek: Add programming flow for unsupported subsys ID hardware

2025-04-25 Thread Jason-JH Lin
cmdq_pkt_write_mask_pa() to achieve the same functionality. Signed-off-by: Jason-JH Lin --- drivers/gpu/drm/mediatek/mtk_ddp_comp.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c index

[PATCH v5 18/19] media: mediatek: mdp3: Add programming flow for unsupported subsys ID hardware

2025-04-25 Thread Jason-JH Lin
subsys ID is invalid, the flow will call cmdq_pkt_write_pa() and cmdq_pkt_write_mask_pa() to achieve the same functionality. Signed-off-by: Jason-JH Lin --- .../platform/mediatek/mdp3/mtk-mdp3-cmdq.c| 14 +++- .../platform/mediatek/mdp3/mtk-mdp3-comp.h| 70 ++- 2 files

[PATCH v5 13/19] soc: mediatek: mtk-cmdq: Add pa_base parsing for hardware without subsys ID support

2025-04-25 Thread Jason-JH Lin
physical address is the only option to achieve the same functionality. This commit adds a pa_base parsing flow to the cmdq_client_reg structure to handle hardware without subsys ID support. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 15 +-- include/linux/soc

[PATCH v5 00/19] Add GCE support for MT8196

2025-04-25 Thread Jason-JH Lin
/linux-mediatek/patch/20250421035650.441383-1-jason-jh@mediatek.com/ Change in v4: 1. Remove dt-binding header and add a gce header in dts folder. 2. Remove dot in sign-off name. 3. Change addr type from u32 to dma_addr_t for cmdq_reg_shift_addr() and cmdq_reg_revert_addr(). Change in v3: 1

[PATCH v5 03/19] mailbox: mtk-cmdq: Add cmdq private data to cmdq_pkt for generating instruction

2025-04-25 Thread Jason-JH Lin
tform") Signed-off-by: Jason-JH Lin --- drivers/mailbox/mtk-cmdq-mailbox.c | 6 +++--- include/linux/mailbox/mtk-cmdq-mailbox.h | 18 -- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailb

Re: [PATCH 0/3] uio/dma-buf: Give UIO users access to DMA addresses.

2025-04-22 Thread Jason Gunthorpe
ot any worse than that. That isn't fully true.. UIO isn't fitting into the security model by allowing DMA capable devices to be exposed without checking for CAP_SYS_RAW_IO first. Jason

Re: [PATCH v2 0/4] kbuild: resurrect generic header check facility

2025-04-08 Thread Jason Gunthorpe
On Tue, Apr 08, 2025 at 09:42:36PM +0300, Jani Nikula wrote: > On Tue, 08 Apr 2025, Jason Gunthorpe wrote: > > On Tue, Apr 08, 2025 at 11:27:58AM +0300, Jani Nikula wrote: > >> On Mon, 07 Apr 2025, Jason Gunthorpe wrote: > >> > On Mon, Apr 07, 2025 at 10:17

Re: [PATCH v2 0/4] kbuild: resurrect generic header check facility

2025-04-08 Thread Jason Gunthorpe
On Tue, Apr 08, 2025 at 11:27:58AM +0300, Jani Nikula wrote: > On Mon, 07 Apr 2025, Jason Gunthorpe wrote: > > On Mon, Apr 07, 2025 at 10:17:40AM +0300, Jani Nikula wrote: > > > >> Even with Jason's idea [1], you *still* have to start small and opt-in > >>

Re: [PATCH v2 0/4] kbuild: resurrect generic header check facility

2025-04-07 Thread Jason Gunthorpe
y. > And this is the primary reason subsystems and drivers hack up stuff in > their little corners of the kernel instead of sticking their necks out > and trying to generalize anything. Seems to me like this is the usual case of generalizing being actually hard, you almost always have to actually do more work to succeed. Jason

  1   2   3   4   5   6   7   8   9   10   >