linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, "Felix Kuehling" <Felix.Kuehling@amd.com>,
	"Laurent Morichetti" <laurent.morichetti@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Sasha Levin" <sashal@kernel.org>
Subject: [PATCH 5.7 046/124] drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access
Date: Mon, 24 Aug 2020 10:29:40 +0200	[thread overview]
Message-ID: <20200824082411.690630357@linuxfoundation.org> (raw)
In-Reply-To: <20200824082409.368269240@linuxfoundation.org>

From: Felix Kuehling <Felix.Kuehling@amd.com>

[ Upstream commit c0001213d195d1bac83e0744c06ff06dd5a8ba53 ]

VMAs with a pg_offs that's offset from the start of the vma_node need
to adjust the offset within the BO accordingly. This matches the
offset calculation in ttm_bo_vm_fault_reserved.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Tested-by: Laurent Morichetti <laurent.morichetti@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/381169/
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c
index 72100b84c7a90..b08fdfa4291b2 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
@@ -505,8 +505,10 @@ static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo,
 int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned long addr,
 		     void *buf, int len, int write)
 {
-	unsigned long offset = (addr) - vma->vm_start;
 	struct ttm_buffer_object *bo = vma->vm_private_data;
+	unsigned long offset = (addr) - vma->vm_start +
+		((vma->vm_pgoff - drm_vma_node_start(&bo->base.vma_node))
+		 << PAGE_SHIFT);
 	int ret;
 
 	if (len < 1 || (offset + len) >> PAGE_SHIFT > bo->num_pages)
-- 
2.25.1




  parent reply	other threads:[~2020-08-24  9:48 UTC|newest]

Thread overview: 125+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24  8:28 [PATCH 5.7 000/124] 5.7.18-rc1 review Greg Kroah-Hartman
2020-08-24  8:28 ` [PATCH 5.7 001/124] drm/vgem: Replace opencoded version of drm_gem_dumb_map_offset() Greg Kroah-Hartman
2020-08-24  8:28 ` [PATCH 5.7 002/124] drm/panel-simple: Fix inverted V/H SYNC for Frida FRD350H54004 panel Greg Kroah-Hartman
2020-08-24  8:28 ` [PATCH 5.7 003/124] khugepaged: khugepaged_test_exit() check mmget_still_valid() Greg Kroah-Hartman
2020-08-24  8:28 ` [PATCH 5.7 004/124] khugepaged: adjust VM_BUG_ON_MM() in __khugepaged_enter() Greg Kroah-Hartman
2020-08-24  8:28 ` [PATCH 5.7 005/124] bcache: avoid nr_stripes overflow in bcache_device_init() Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 006/124] ALSA: hda/realtek: Add quirk for Samsung Galaxy Flex Book Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 007/124] ALSA: hda/realtek: Add quirk for Samsung Galaxy Book Ion Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 008/124] can: j1939: transport: j1939_session_tx_dat(): fix use-after-free read in j1939_tp_txtimer() Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 009/124] can: j1939: socket: j1939_sk_bind(): make sure ml_priv is allocated Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 010/124] spi: Prevent adding devices below an unregistering controller Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 011/124] romfs: fix uninitialized memory leak in romfs_dev_read() Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 012/124] kernel/relay.c: fix memleak on destroy relay channel Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 013/124] uprobes: __replace_page() avoid BUG in munlock_vma_page() Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 014/124] mm: include CMA pages in lowmem_reserve at boot Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 015/124] mm, page_alloc: fix core hung in free_pcppages_bulk() Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 016/124] RDMA/hfi1: Correct an interlock issue for TID RDMA WRITE request Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 017/124] ext4: do not block RWF_NOWAIT dio write on unallocated space Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 018/124] ext4: fix checking of directory entry validity for inline directories Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 019/124] jbd2: add the missing unlock_buffer() in the error path of jbd2_write_superblock() Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 020/124] scsi: zfcp: Fix use-after-free in request timeout handlers Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 021/124] selftests: kvm: Use a shorter encoding to clear RAX Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 022/124] mm/memory.c: skip spurious TLB flush for retried page fault Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 023/124] drm/amdgpu/display: use GFP_ATOMIC in dcn20_validate_bandwidth_internal Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 024/124] drm/amd/display: Fix EDID parsing after resume from suspend Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 025/124] drm/amd/display: Blank stream before destroying HDCP session Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 026/124] drm/amd/display: Fix DFPstate hang due to view port changed Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 027/124] drm/amd/display: fix pow() crashing when given base 0 Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 028/124] io-wq: reorder cancellation pending -> running Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 029/124] io-wq: add an option to cancel all matched reqs Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 030/124] io_uring: cancel all tasks requests on exit Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 031/124] io_uring: find and cancel head link async work on files exit Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 032/124] opp: Enable resources again if they were disabled earlier Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 033/124] opp: Reorder the code for !target_freq case Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 034/124] opp: Put opp table in dev_pm_opp_set_rate() for empty tables Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 035/124] scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 036/124] scsi: target: tcmu: Fix crash in tcmu_flush_dcache_range on ARM Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 037/124] media: budget-core: Improve exception handling in budget_register() Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 038/124] f2fs: fix to check page dirty status before writeback Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 039/124] rtc: goldfish: Enable interrupt in set_alarm() when necessary Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 040/124] media: vpss: clean up resources in init Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 041/124] Input: psmouse - add a newline when printing proto by sysfs Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 042/124] MIPS: Fix unable to reserve memory for Crash kernel Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 043/124] m68knommu: fix overwriting of bits in ColdFire V3 cache control Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 044/124] svcrdma: Fix another Receive buffer leak Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 045/124] xfs: fix inode quota reservation checks Greg Kroah-Hartman
2020-08-24  8:29 ` Greg Kroah-Hartman [this message]
2020-08-24  8:29 ` [PATCH 5.7 047/124] riscv: Fixup static_obj() fail Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 048/124] jffs2: fix UAF problem Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 049/124] ceph: fix use-after-free for fsc->mdsc Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 050/124] swiotlb-xen: use vmalloc_to_page on vmalloc virt addresses Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 051/124] cpufreq: intel_pstate: Fix cpuinfo_max_freq when MSR_TURBO_RATIO_LIMIT is 0 Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 052/124] scsi: libfc: Free skb in fc_disc_gpn_id_resp() for valid cases Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 053/124] virtio_ring: Avoid loop when vq is broken in virtqueue_poll Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 054/124] media: camss: fix memory leaks on error handling paths in probe Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 055/124] tools/testing/selftests/cgroup/cgroup_util.c: cg_read_strcmp: fix null pointer dereference Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 056/124] xfs: Fix UBSAN null-ptr-deref in xfs_sysfs_init Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 057/124] alpha: fix annotation of io{read,write}{16,32}be() Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 058/124] fs/signalfd.c: fix inconsistent return codes for signalfd4 Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 059/124] ext4: fix potential negative array index in do_split() Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 060/124] drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl() Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 061/124] ext4: dont allow overlapping system zones Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 062/124] ext4: check journal inode extents more carefully Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 063/124] netfilter: nf_tables: nft_exthdr: the presence return value should be little-endian Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 064/124] spi: stm32: fixes suspend/resume management Greg Kroah-Hartman
2020-08-24  8:29 ` [PATCH 5.7 065/124] ASoC: q6afe-dai: mark all widgets registers as SND_SOC_NOPM Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 066/124] ASoC: q6routing: add dummy register read/write function Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 067/124] tools/bpftool: Make skeleton code C++17-friendly by dropping typeof() Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 068/124] bpf: sock_ops ctx access may stomp registers in corner case Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 069/124] bpf: sock_ops sk access may stomp registers when dst_reg = src_reg Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 070/124] can: j1939: fix kernel-infoleak in j1939_sk_sock2sockaddr_can() Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 071/124] can: j1939: transport: j1939_simple_recv(): ignore local J1939 messages send not by J1939 stack Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 072/124] can: j1939: transport: add j1939_session_skb_find_by_offset() function Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 073/124] igc: Fix PTP initialization Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 074/124] i40e: Set RX_ONLY mode for unicast promiscuous on VLAN Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 075/124] i40e: Fix crash during removing i40e driver Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 076/124] net: fec: correct the error path for regulator disable in probe Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 077/124] bonding: show saner speed for broadcast mode Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 078/124] can: j1939: fix support for multipacket broadcast message Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 079/124] can: j1939: cancel rxtimer on multipacket broadcast session complete Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 080/124] can: j1939: abort multipacket broadcast session when timeout occurs Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 081/124] can: j1939: add rxtimer for multipacket broadcast session Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 082/124] bonding: fix a potential double-unregister Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 083/124] ipvlan: fix device features Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 084/124] s390/runtime_instrumentation: fix storage key handling Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 085/124] s390/ptrace: " Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 086/124] ASoC: msm8916-wcd-analog: fix register Interrupt offset Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 087/124] ASoC: intel: Fix memleak in sst_media_open Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 088/124] vfio/type1: Add proper error unwind for vfio_iommu_replay() Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 089/124] kvm: x86: Toggling CR4.SMAP does not load PDPTEs in PAE mode Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 090/124] kvm: x86: Toggling CR4.PKE " Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 091/124] of/address: check for invalid range.cpu_addr Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 092/124] scsi: ufs: ti-j721e-ufs: Fix error return in ti_j721e_ufs_probe() Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 093/124] scsi: ufs: Add quirk to fix mishandling utrlclr/utmrlclr Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 094/124] scsi: ufs: Add quirk to disallow reset of interrupt aggregation Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 095/124] scsi: ufs: Add quirk to enable host controller without hce Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 096/124] scsi: ufs: Introduce UFSHCD_QUIRK_PRDT_BYTE_GRAN quirk Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 097/124] scsi: ufs: Add quirk to fix abnormal ocs fatal error Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 098/124] scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel EHL Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 099/124] scsi: ufs: Fix interrupt error message for shared interrupts Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 100/124] Revert "scsi: qla2xxx: Disable T10-DIF feature with FC-NVMe during probe" Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 101/124] kconfig: qconf: do not limit the pop-up menu to the first row Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 102/124] kconfig: qconf: fix signal connection to invalid slots Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 103/124] efi: avoid error message when booting under Xen Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 104/124] Fix build error when CONFIG_ACPI is not set/enabled: Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 105/124] RDMA/bnxt_re: Do not add user qps to flushlist Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 106/124] afs: Fix NULL deref in afs_dynroot_depopulate() Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 107/124] ARM64: vdso32: Install vdso32 from vdso_install Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 108/124] powerpc/fixmap: Fix the size of the early debug area Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 109/124] powerpc/pseries/hotplug-cpu: wait indefinitely for vCPU death Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 110/124] bonding: fix active-backup failover for current ARP slave Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 111/124] net: ena: Prevent reset after device destruction Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 112/124] net: ena: Change WARN_ON expression in ena_del_napi_in_range() Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 113/124] net: gemini: Fix missing free_netdev() in error path of gemini_ethernet_port_probe() Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 114/124] hv_netvsc: Fix the queue_mapping in netvsc_vf_xmit() Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 115/124] net: dsa: b53: check for timeout Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 116/124] epoll: Keep a reference on files added to the check list Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 117/124] powerpc/pseries: Do not initiate shutdown when system is running on UPS Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 118/124] EDAC/{i7core,sb,pnd2,skx}: Fix error event severity Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 119/124] efi/x86: Mark kernel rodata non-executable for mixed mode Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 120/124] efi: add missed destroy_workqueue when efisubsys_init fails Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 121/124] efi/libstub: Stop parsing arguments at "--" Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 122/124] efi/libstub: Handle NULL cmdline Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 123/124] do_epoll_ctl(): clean the failure exits up a bit Greg Kroah-Hartman
2020-08-24  8:30 ` [PATCH 5.7 124/124] xen: dont reschedule in preemption off sections Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200824082411.690630357@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=Felix.Kuehling@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=laurent.morichetti@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).