Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-10-31 12:36:54 +0100
committerMichal Suchanek <msuchanek@suse.de>2018-10-31 23:28:41 +0100
commitbaa085fc796e5f84ade8708b91f7107eb03b78b2 (patch)
tree078160940053921c39b3c6b180083e127c2f8e56
parent039e0a5ff35d545a815b8a32d4a682b5944b473e (diff)
KVM: PPC: Book3S HV: radix: Refine IO region partition scope
attributes (bsc#1061840).
-rw-r--r--patches.arch/KVM-PPC-Book3S-HV-radix-Refine-IO-region-partition-s.patch48
-rw-r--r--series.conf1
2 files changed, 49 insertions, 0 deletions
diff --git a/patches.arch/KVM-PPC-Book3S-HV-radix-Refine-IO-region-partition-s.patch b/patches.arch/KVM-PPC-Book3S-HV-radix-Refine-IO-region-partition-s.patch
new file mode 100644
index 0000000000..326eeb6499
--- /dev/null
+++ b/patches.arch/KVM-PPC-Book3S-HV-radix-Refine-IO-region-partition-s.patch
@@ -0,0 +1,48 @@
+From bc64dd0e1c4eddbec75dd5aa86b60c2a834aaef3 Mon Sep 17 00:00:00 2001
+From: Nicholas Piggin <npiggin@gmail.com>
+Date: Thu, 17 May 2018 17:06:30 +1000
+Subject: [PATCH] KVM: PPC: Book3S HV: radix: Refine IO region partition scope
+ attributes
+
+References: bsc#1061840
+Patch-mainline: v4.18-rc1
+Git-commit: bc64dd0e1c4eddbec75dd5aa86b60c2a834aaef3
+
+When the radix fault handler has no page from the process address
+space (e.g., for IO memory), it looks up the process pte and sets
+partition table pte using that to get attributes like CI and guarded.
+If the process table entry is to be writable, set _PAGE_DIRTY as well
+to avoid an RC update. If not, then ensure _PAGE_DIRTY does not come
+across. Set _PAGE_ACCESSED as well to avoid RC update.
+
+Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
+Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/kvm/book3s_64_mmu_radix.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/arch/powerpc/kvm/book3s_64_mmu_radix.c b/arch/powerpc/kvm/book3s_64_mmu_radix.c
+index e55db915af49..b0ba3628adc2 100644
+--- a/arch/powerpc/kvm/book3s_64_mmu_radix.c
++++ b/arch/powerpc/kvm/book3s_64_mmu_radix.c
+@@ -674,9 +674,13 @@ int kvmppc_book3s_radix_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu,
+ unsigned long mask = (1ul << shift) - PAGE_SIZE;
+ pte = __pte(pte_val(pte) | (hva & mask));
+ }
+- if (!(writing || upgrade_write))
+- pte = __pte(pte_val(pte) & ~ _PAGE_WRITE);
+- pte = __pte(pte_val(pte) | _PAGE_EXEC);
++ pte = __pte(pte_val(pte) | _PAGE_EXEC | _PAGE_ACCESSED);
++ if (writing || upgrade_write) {
++ if (pte_val(pte) & _PAGE_WRITE)
++ pte = __pte(pte_val(pte) | _PAGE_DIRTY);
++ } else {
++ pte = __pte(pte_val(pte) & ~(_PAGE_WRITE | _PAGE_DIRTY));
++ }
+ }
+
+ /* Allocate space in the tree and write the PTE */
+--
+2.13.7
+
diff --git a/series.conf b/series.conf
index 6fd9b3ebd0..727dac88cf 100644
--- a/series.conf
+++ b/series.conf
@@ -16730,6 +16730,7 @@
patches.arch/KVM-PPC-Book3S-HV-Lockless-tlbie-for-HPT-hcalls.patch
patches.arch/KVM-PPC-Book3S-HV-Use-a-helper-to-unmap-ptes-in-the-.patch
patches.arch/KVM-PPC-Book3S-HV-Recursively-unmap-all-page-table-e.patch
+ patches.arch/KVM-PPC-Book3S-HV-radix-Refine-IO-region-partition-s.patch
patches.suse/ipv6-allow-PMTU-exceptions-to-local-routes.patch
patches.suse/net-dsa-add-error-handling-for-pskb_trim_rcsum.patch
patches.drivers/ixgbe-Fix-setting-of-TC-configuration-for-macvlan-ca.patch