From 555e1bade6065109a6c14b7d89272280d0f5dfaf Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 13 Aug 2022 14:56:48 +0200 Subject: [PATCH] 4.19-stable patches added patches: drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch parisc-fix-device-names-in-proc-iomem.patch --- ...omains-against-its-preferred_domains.patch | 49 +++++++++++++++++++ ...ix-another-off-by-one-in-nvbios_addr.patch | 35 +++++++++++++ ...arisc-fix-device-names-in-proc-iomem.patch | 45 +++++++++++++++++ queue-4.19/series | 3 ++ 4 files changed, 132 insertions(+) create mode 100644 queue-4.19/drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch create mode 100644 queue-4.19/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch create mode 100644 queue-4.19/parisc-fix-device-names-in-proc-iomem.patch diff --git a/queue-4.19/drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch b/queue-4.19/drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch new file mode 100644 index 00000000000..e1aa75e0939 --- /dev/null +++ b/queue-4.19/drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch @@ -0,0 +1,49 @@ +From f5ba14043621f4afdf3ad5f92ee2d8dbebbe4340 Mon Sep 17 00:00:00 2001 +From: Leo Li +Date: Tue, 12 Jul 2022 12:30:29 -0400 +Subject: drm/amdgpu: Check BO's requested pinning domains against its preferred_domains +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Leo Li + +commit f5ba14043621f4afdf3ad5f92ee2d8dbebbe4340 upstream. + +When pinning a buffer, we should check to see if there are any +additional restrictions imposed by bo->preferred_domains. This will +prevent the BO from being moved to an invalid domain when pinning. + +For example, this can happen if the user requests to create a BO in GTT +domain for display scanout. amdgpu_dm will allow pinning to either VRAM +or GTT domains, since DCN can scanout from either or. However, in +amdgpu_bo_pin_restricted(), pinning to VRAM is preferred if there is +adequate carveout. This can lead to pinning to VRAM despite the user +requesting GTT placement for the BO. + +v2: Allow the kernel to override the domain, which can happen when + exporting a BO to a V4L camera (for example). + +Signed-off-by: Leo Li +Reviewed-by: Alex Deucher +Reviewed-by: Christian König +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +@@ -883,6 +883,10 @@ int amdgpu_bo_pin_restricted(struct amdg + if (WARN_ON_ONCE(min_offset > max_offset)) + return -EINVAL; + ++ /* Check domain to be pinned to against preferred domains */ ++ if (bo->preferred_domains & domain) ++ domain = bo->preferred_domains & domain; ++ + /* A shared bo cannot be migrated to VRAM */ + if (bo->prime_shared_count) { + if (domain & AMDGPU_GEM_DOMAIN_GTT) diff --git a/queue-4.19/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch b/queue-4.19/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch new file mode 100644 index 00000000000..a3edec84b86 --- /dev/null +++ b/queue-4.19/drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch @@ -0,0 +1,35 @@ +From c441d28945fb113220d48d6c86ebc0b090a2b677 Mon Sep 17 00:00:00 2001 +From: Timur Tabi +Date: Wed, 11 May 2022 11:37:16 -0500 +Subject: drm/nouveau: fix another off-by-one in nvbios_addr + +From: Timur Tabi + +commit c441d28945fb113220d48d6c86ebc0b090a2b677 upstream. + +This check determines whether a given address is part of +image 0 or image 1. Image 1 starts at offset image0_size, +so that address should be included. + +Fixes: 4d4e9907ff572 ("drm/nouveau/bios: guard against out-of-bounds accesses to image") +Cc: # v4.8+ +Signed-off-by: Timur Tabi +Reviewed-by: Karol Herbst +Signed-off-by: Lyude Paul +Link: https://patchwork.freedesktop.org/patch/msgid/20220511163716.3520591-1-ttabi@nvidia.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c ++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c +@@ -33,7 +33,7 @@ nvbios_addr(struct nvkm_bios *bios, u32 + { + u32 p = *addr; + +- if (*addr > bios->image0_size && bios->imaged_addr) { ++ if (*addr >= bios->image0_size && bios->imaged_addr) { + *addr -= bios->image0_size; + *addr += bios->imaged_addr; + } diff --git a/queue-4.19/parisc-fix-device-names-in-proc-iomem.patch b/queue-4.19/parisc-fix-device-names-in-proc-iomem.patch new file mode 100644 index 00000000000..06fd2136112 --- /dev/null +++ b/queue-4.19/parisc-fix-device-names-in-proc-iomem.patch @@ -0,0 +1,45 @@ +From cab56b51ec0e69128909cef4650e1907248d821b Mon Sep 17 00:00:00 2001 +From: Helge Deller +Date: Mon, 18 Jul 2022 17:06:47 +0200 +Subject: parisc: Fix device names in /proc/iomem + +From: Helge Deller + +commit cab56b51ec0e69128909cef4650e1907248d821b upstream. + +Fix the output of /proc/iomem to show the real hardware device name +including the pa_pathname, e.g. "Merlin 160 Core Centronics [8:16:0]". +Up to now only the pa_pathname ("[8:16.0]") was shown. + +Signed-off-by: Helge Deller +Cc: # v4.9+ +Signed-off-by: Greg Kroah-Hartman +--- + arch/parisc/kernel/drivers.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/arch/parisc/kernel/drivers.c ++++ b/arch/parisc/kernel/drivers.c +@@ -499,7 +499,6 @@ alloc_pa_dev(unsigned long hpa, struct h + dev->id.hversion_rev = iodc_data[1] & 0x0f; + dev->id.sversion = ((iodc_data[4] & 0x0f) << 16) | + (iodc_data[5] << 8) | iodc_data[6]; +- dev->hpa.name = parisc_pathname(dev); + dev->hpa.start = hpa; + /* This is awkward. The STI spec says that gfx devices may occupy + * 32MB or 64MB. Unfortunately, we don't know how to tell whether +@@ -513,10 +512,10 @@ alloc_pa_dev(unsigned long hpa, struct h + dev->hpa.end = hpa + 0xfff; + } + dev->hpa.flags = IORESOURCE_MEM; +- name = parisc_hardware_description(&dev->id); +- if (name) { +- strlcpy(dev->name, name, sizeof(dev->name)); +- } ++ dev->hpa.name = dev->name; ++ name = parisc_hardware_description(&dev->id) ? : "unknown"; ++ snprintf(dev->name, sizeof(dev->name), "%s [%s]", ++ name, parisc_pathname(dev)); + + /* Silently fail things like mouse ports which are subsumed within + * the keyboard controller diff --git a/queue-4.19/series b/queue-4.19/series index 06454f98eb9..b4d18e89d46 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -18,3 +18,6 @@ thermal-sysfs-fix-cooling_device_stats_setup-error-code-path.patch fbcon-fix-boundary-checks-for-fbcon-vc-n1-n2-parameters.patch usbnet-fix-linkwatch-use-after-free-on-disconnect.patch ovl-drop-warn_on-dentry-is-null-in-ovl_encode_fh.patch +parisc-fix-device-names-in-proc-iomem.patch +drm-nouveau-fix-another-off-by-one-in-nvbios_addr.patch +drm-amdgpu-check-bo-s-requested-pinning-domains-against-its-preferred_domains.patch -- 2.47.3