* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/gentoo-kernel/files/, sys-kernel/gentoo-kernel/
@ 2021-05-12 18:43 Georgy Yakovlev
0 siblings, 0 replies; 2+ messages in thread
From: Georgy Yakovlev @ 2021-05-12 18:43 UTC (permalink / raw
To: gentoo-commits
commit: ca82103ffc4fb31a981fb7671a8251796df0f3fa
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Wed May 12 18:40:31 2021 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Wed May 12 18:41:05 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca82103f
sys-kernel/gentoo-kernel: add amggpu pagesz patch to 5.10.33
Bug: https://bugs.gentoo.org/788847
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
.../files/5.10.33-amdgpu-pagesz.patch | 50 ++++++++++++++++++++++
.../gentoo-kernel/gentoo-kernel-5.10.33.ebuild | 1 +
2 files changed, 51 insertions(+)
diff --git a/sys-kernel/gentoo-kernel/files/5.10.33-amdgpu-pagesz.patch b/sys-kernel/gentoo-kernel/files/5.10.33-amdgpu-pagesz.patch
new file mode 100644
index 00000000000..23185919326
--- /dev/null
+++ b/sys-kernel/gentoo-kernel/files/5.10.33-amdgpu-pagesz.patch
@@ -0,0 +1,50 @@
+From 566c6e25f957ebdb0b6e8073ee291049118f47fb Mon Sep 17 00:00:00 2001
+From: Huacai Chen <chenhc@lemote.com>
+Date: Tue, 30 Mar 2021 23:33:33 +0800
+Subject: drm/amdgpu: Set a suitable dev_info.gart_page_size
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In Mesa, dev_info.gart_page_size is used for alignment and it was
+set to AMDGPU_GPU_PAGE_SIZE(4KB). However, the page table of AMDGPU
+driver requires an alignment on CPU pages. So, for non-4KB page system,
+gart_page_size should be max_t(u32, PAGE_SIZE, AMDGPU_GPU_PAGE_SIZE).
+
+Signed-off-by: Rui Wang <wangr@lemote.com>
+Signed-off-by: Huacai Chen <chenhc@lemote.com>
+Link: https://github.com/loongson-community/linux-stable/commit/caa9c0a1
+[Xi: rebased for drm-next, use max_t for checkpatch,
+ and reworded commit message.]
+[gyakovlev@gentoo.org: backported to apply cleanly to 5.10.33]
+Signed-off-by: Xi Ruoyao <xry111@mengyan1223.wang>
+BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1549
+Tested-by: Dan Horák <dan@danny.cz>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+(limited to 'drivers/gpu/drm/amd/amdgpu')
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+index 64beb3399604..a4e2cf7cada1 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+@@ -766,9 +766,9 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
+ dev_info.high_va_offset = AMDGPU_GMC_HOLE_END;
+ dev_info.high_va_max = AMDGPU_GMC_HOLE_END | vm_size;
+ }
+- dev_info.virtual_address_alignment = max((int)PAGE_SIZE, AMDGPU_GPU_PAGE_SIZE);
++ dev_info.virtual_address_alignment = max_t(u32, PAGE_SIZE, AMDGPU_GPU_PAGE_SIZE);
+ dev_info.pte_fragment_size = (1 << adev->vm_manager.fragment_size) * AMDGPU_GPU_PAGE_SIZE;
+- dev_info.gart_page_size = AMDGPU_GPU_PAGE_SIZE;
++ dev_info.gart_page_size = max_t(u32, PAGE_SIZE, AMDGPU_GPU_PAGE_SIZE);
+ dev_info.cu_active_number = adev->gfx.cu_info.number;
+ dev_info.cu_ao_mask = adev->gfx.cu_info.ao_cu_mask;
+ dev_info.ce_ram_size = adev->gfx.ce_ram_size;
+--
+cgit v1.2.1
+
diff --git a/sys-kernel/gentoo-kernel/gentoo-kernel-5.10.33.ebuild b/sys-kernel/gentoo-kernel/gentoo-kernel-5.10.33.ebuild
index bd7b42ef34b..7beead52930 100644
--- a/sys-kernel/gentoo-kernel/gentoo-kernel-5.10.33.ebuild
+++ b/sys-kernel/gentoo-kernel/gentoo-kernel-5.10.33.ebuild
@@ -53,6 +53,7 @@ src_prepare() {
local PATCHES=(
# meh, genpatches have no directory
"${WORKDIR}"/*.patch
+ "${FILESDIR}"/5.10.33-amdgpu-pagesz.patch
)
default
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/gentoo-kernel/files/, sys-kernel/gentoo-kernel/
@ 2021-07-08 2:32 Georgy Yakovlev
0 siblings, 0 replies; 2+ messages in thread
From: Georgy Yakovlev @ 2021-07-08 2:32 UTC (permalink / raw
To: gentoo-commits
commit: 14561011b6e2f7e5a3d62ad4e7565fec4f326512
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 8 02:09:36 2021 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Thu Jul 8 02:12:19 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14561011
sys-kernel/gentoo-kernel: add power9 kvm patch to 5.10.47
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
.../gentoo-kernel/files/5.10.47-ppc64-kvm.patch | 56 ++++++++++++++++++++++
.../gentoo-kernel/gentoo-kernel-5.10.47.ebuild | 1 +
2 files changed, 57 insertions(+)
diff --git a/sys-kernel/gentoo-kernel/files/5.10.47-ppc64-kvm.patch b/sys-kernel/gentoo-kernel/files/5.10.47-ppc64-kvm.patch
new file mode 100644
index 00000000000..59a7c7e7581
--- /dev/null
+++ b/sys-kernel/gentoo-kernel/files/5.10.47-ppc64-kvm.patch
@@ -0,0 +1,56 @@
+From 25edcc50d76c834479d11fcc7de46f3da4d95121 Mon Sep 17 00:00:00 2001
+From: Fabiano Rosas <farosas@linux.ibm.com>
+Date: Thu, 4 Feb 2021 17:05:17 -0300
+Subject: [PATCH] KVM: PPC: Book3S HV: Save and restore FSCR in the P9 path
+
+The Facility Status and Control Register is a privileged SPR that
+defines the availability of some features in problem state. Since it
+can be written by the guest, we must restore it to the previous host
+value after guest exit.
+
+This restoration is currently done by taking the value from
+current->thread.fscr, which in the P9 path is not enough anymore
+because the guest could context switch the QEMU thread, causing the
+guest-current value to be saved into the thread struct.
+
+The above situation manifested when running a QEMU linked against a
+libc with System Call Vectored support, which causes scv
+instructions to be run by QEMU early during the guest boot (during
+SLOF), at which point the FSCR is 0 due to guest entry. After a few
+scv calls (1 to a couple hundred), the context switching happens and
+the QEMU thread runs with the guest value, resulting in a Facility
+Unavailable interrupt.
+
+This patch saves and restores the host value of FSCR in the inner
+guest entry loop in a way independent of current->thread.fscr. The old
+way of doing it is still kept in place because it works for the old
+entry path.
+
+Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
+Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
+---
+ arch/powerpc/kvm/book3s_hv.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
+index 89c686c17f0606..f6d470157fcb62 100644
+--- a/arch/powerpc/kvm/book3s_hv.c
++++ b/arch/powerpc/kvm/book3s_hv.c
+@@ -3611,6 +3611,7 @@ static int kvmhv_p9_guest_entry(struct kvm_vcpu *vcpu, u64 time_limit,
+ unsigned long host_tidr = mfspr(SPRN_TIDR);
+ unsigned long host_iamr = mfspr(SPRN_IAMR);
+ unsigned long host_amr = mfspr(SPRN_AMR);
++ unsigned long host_fscr = mfspr(SPRN_FSCR);
+ s64 dec;
+ u64 tb;
+ int trap, save_pmu;
+@@ -3751,6 +3752,9 @@ static int kvmhv_p9_guest_entry(struct kvm_vcpu *vcpu, u64 time_limit,
+ if (host_amr != vcpu->arch.amr)
+ mtspr(SPRN_AMR, host_amr);
+
++ if (host_fscr != vcpu->arch.fscr)
++ mtspr(SPRN_FSCR, host_fscr);
++
+ msr_check_and_set(MSR_FP | MSR_VEC | MSR_VSX);
+ store_fp_state(&vcpu->arch.fp);
+ #ifdef CONFIG_ALTIVEC
diff --git a/sys-kernel/gentoo-kernel/gentoo-kernel-5.10.47.ebuild b/sys-kernel/gentoo-kernel/gentoo-kernel-5.10.47.ebuild
index 484c3c53d62..85ca3ef0d12 100644
--- a/sys-kernel/gentoo-kernel/gentoo-kernel-5.10.47.ebuild
+++ b/sys-kernel/gentoo-kernel/gentoo-kernel-5.10.47.ebuild
@@ -55,6 +55,7 @@ src_prepare() {
local PATCHES=(
# meh, genpatches have no directory
"${WORKDIR}"/*.patch
+ "${FILESDIR}"/5.10.47-ppc64-kvm.patch
)
default
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-08 2:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-08 2:32 [gentoo-commits] repo/gentoo:master commit in: sys-kernel/gentoo-kernel/files/, sys-kernel/gentoo-kernel/ Georgy Yakovlev
-- strict thread matches above, loose matches on Subject: below --
2021-05-12 18:43 Georgy Yakovlev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox