From bd8f90e1d46793fd17f189648b3d0c397f393bfc Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 20 Feb 2022 18:55:49 -0500 Subject: [PATCH] Fixes for 4.9 Signed-off-by: Sasha Levin --- ...amd64_raw_event_mask-for-perf_type_r.patch | 39 +++++++++++++++++ ...port-writeback-errors-in-nfs_getattr.patch | 42 +++++++++++++++++++ queue-4.9/series | 2 + 3 files changed, 83 insertions(+) create mode 100644 queue-4.9/kvm-x86-pmu-use-amd64_raw_event_mask-for-perf_type_r.patch create mode 100644 queue-4.9/nfs-do-not-report-writeback-errors-in-nfs_getattr.patch diff --git a/queue-4.9/kvm-x86-pmu-use-amd64_raw_event_mask-for-perf_type_r.patch b/queue-4.9/kvm-x86-pmu-use-amd64_raw_event_mask-for-perf_type_r.patch new file mode 100644 index 00000000000..a759aaee8ac --- /dev/null +++ b/queue-4.9/kvm-x86-pmu-use-amd64_raw_event_mask-for-perf_type_r.patch @@ -0,0 +1,39 @@ +From 41dfcaa6eb1a713068e8d828235e1b1ad0b73904 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 2 Feb 2022 17:48:13 -0800 +Subject: KVM: x86/pmu: Use AMD64_RAW_EVENT_MASK for PERF_TYPE_RAW + +From: Jim Mattson + +[ Upstream commit 710c476514313c74045c41c0571bb5178fd16e3d ] + +AMD's event select is 3 nybbles, with the high nybble in bits 35:32 of +a PerfEvtSeln MSR. Don't mask off the high nybble when configuring a +RAW perf event. + +Fixes: ca724305a2b0 ("KVM: x86/vPMU: Implement AMD vPMU code for KVM") +Signed-off-by: Jim Mattson +Message-Id: <20220203014813.2130559-2-jmattson@google.com> +Reviewed-by: David Dunn +Signed-off-by: Paolo Bonzini +Signed-off-by: Sasha Levin +--- + arch/x86/kvm/pmu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c +index 0827ee7d0e9b6..f1aa0b932c547 100644 +--- a/arch/x86/kvm/pmu.c ++++ b/arch/x86/kvm/pmu.c +@@ -164,7 +164,7 @@ void reprogram_gp_counter(struct kvm_pmc *pmc, u64 eventsel) + } + + if (type == PERF_TYPE_RAW) +- config = eventsel & X86_RAW_EVENT_MASK; ++ config = eventsel & AMD64_RAW_EVENT_MASK; + + pmc_reprogram_counter(pmc, type, config, + !(eventsel & ARCH_PERFMON_EVENTSEL_USR), +-- +2.34.1 + diff --git a/queue-4.9/nfs-do-not-report-writeback-errors-in-nfs_getattr.patch b/queue-4.9/nfs-do-not-report-writeback-errors-in-nfs_getattr.patch new file mode 100644 index 00000000000..f1930553b00 --- /dev/null +++ b/queue-4.9/nfs-do-not-report-writeback-errors-in-nfs_getattr.patch @@ -0,0 +1,42 @@ +From 15c00d4a4df8a7ea959c2f2ecdb53942f4b15c96 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 15 Feb 2022 18:05:18 -0500 +Subject: NFS: Do not report writeback errors in nfs_getattr() + +From: Trond Myklebust + +[ Upstream commit d19e0183a88306acda07f4a01fedeeffe2a2a06b ] + +The result of the writeback, whether it is an ENOSPC or an EIO, or +anything else, does not inhibit the NFS client from reporting the +correct file timestamps. + +Fixes: 79566ef018f5 ("NFS: Getattr doesn't require data sync semantics") +Signed-off-by: Trond Myklebust +Signed-off-by: Anna Schumaker +Signed-off-by: Sasha Levin +--- + fs/nfs/inode.c | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c +index 7a94f5a5f8c8c..3f93b659c849a 100644 +--- a/fs/nfs/inode.c ++++ b/fs/nfs/inode.c +@@ -661,11 +661,8 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) + + trace_nfs_getattr_enter(inode); + /* Flush out writes to the server in order to update c/mtime. */ +- if (S_ISREG(inode->i_mode)) { +- err = filemap_write_and_wait(inode->i_mapping); +- if (err) +- goto out; +- } ++ if (S_ISREG(inode->i_mode)) ++ filemap_write_and_wait(inode->i_mapping); + + /* + * We may force a getattr if the user cares about atime. +-- +2.34.1 + diff --git a/queue-4.9/series b/queue-4.9/series index 1bae179b019..5d554f250ce 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -24,3 +24,5 @@ alsa-hda-fix-missing-codec-probe-on-shenker-dock-15.patch asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw.patch asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw_range.patch nfs-lookup_directory-is-also-ok-with-symlinks.patch +kvm-x86-pmu-use-amd64_raw_event_mask-for-perf_type_r.patch +nfs-do-not-report-writeback-errors-in-nfs_getattr.patch -- 2.47.3