Revert "KVM: PPC: e500: Use __kvm_faultin_pfn() to handle page faults"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

This reverts commit deead14da7478b40a18cc439064c9c1a933e1b4b which is
commit 419cfb983ca93e75e905794521afefcfa07988bb upstream.

It should not have been applied.

Link: https://lore.kernel.org/r/CABgObfb5U9zwTQBPkPB=mKu-vMrRspPCm4wfxoQpB+SyAnb5WQ@xxxxxxxxxxxxxx
Reported-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 arch/powerpc/kvm/e500_mmu_host.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- a/arch/powerpc/kvm/e500_mmu_host.c
+++ b/arch/powerpc/kvm/e500_mmu_host.c
@@ -322,7 +322,6 @@ static inline int kvmppc_e500_shadow_map
 {
 	struct kvm_memory_slot *slot;
 	unsigned long pfn = 0; /* silence GCC warning */
-	struct page *page = NULL;
 	unsigned long hva;
 	int pfnmap = 0;
 	int tsize = BOOK3E_PAGESZ_4K;
@@ -444,7 +443,7 @@ static inline int kvmppc_e500_shadow_map
 
 	if (likely(!pfnmap)) {
 		tsize_pages = 1UL << (tsize + 10 - PAGE_SHIFT);
-		pfn = __kvm_faultin_pfn(slot, gfn, FOLL_WRITE, NULL, &page);
+		pfn = gfn_to_pfn_memslot(slot, gfn);
 		if (is_error_noslot_pfn(pfn)) {
 			if (printk_ratelimit())
 				pr_err("%s: real page not found for gfn %lx\n",
@@ -489,6 +488,8 @@ static inline int kvmppc_e500_shadow_map
 		}
 	}
 	writable = kvmppc_e500_ref_setup(ref, gtlbe, pfn, wimg);
+	if (writable)
+		kvm_set_pfn_dirty(pfn);
 
 	kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize,
 				ref, gvaddr, stlbe);
@@ -497,7 +498,8 @@ static inline int kvmppc_e500_shadow_map
 	kvmppc_mmu_flush_icache(pfn);
 
 out:
-	kvm_release_faultin_page(kvm, page, !!ret, writable);
+	/* Drop refcount on page, so that mmu notifiers can clear it */
+	kvm_release_pfn_clean(pfn);
 	spin_unlock(&kvm->mmu_lock);
 	return ret;
 }


Patches currently in stable-queue which might be from gregkh@xxxxxxxxxxxxxxxxxxx are

queue-6.1/ksmbd-fix-bug-on-trap-in-smb2_lock.patch
queue-6.1/bluetooth-add-check-for-mgmt_alloc_skb-in-mgmt_device_connected.patch
queue-6.1/hid-appleir-fix-potential-null-dereference-at-raw-event-handle.patch
queue-6.1/mptcp-fix-scheduling-while-atomic-in-mptcp_pm_nl_append_new_local_addr.patch
queue-6.1/drm-amd-display-fix-null-check-for-pipe_ctx-plane_state-in-resource_build_scaling_params.patch
queue-6.1/kbuild-userprogs-use-correct-lld-when-linking-through-clang.patch
queue-6.1/mei-me-add-panther-lake-p-did.patch
queue-6.1/usb-gadget-set-self-powered-based-on-maxpower-and-bmattributes.patch
queue-6.1/dma-kmsan-export-kmsan_handle_dma-for-modules.patch
queue-6.1/drm-radeon-fix-rs400_gpu_init-for-ati-mobility-radeon-xpress-200m.patch
queue-6.1/revert-kvm-e500-always-restore-irqs.patch
queue-6.1/mm-page_alloc-fix-uninitialized-variable.patch
queue-6.1/x86-cpu-validate-cpuid-leaf-0x2-edx-output.patch
queue-6.1/iio-adc-at91-sama5d2_adc-fix-sama7g5-realbits-value.patch
queue-6.1/gpio-rcar-use-raw_spinlock-to-protect-register-access.patch
queue-6.1/revert-of-reserved-memory-fix-using-wrong-number-of-cells-to-get-property-alignment.patch
queue-6.1/eeprom-digsy_mtc-make-gpio-lookup-table-match-the-device.patch
queue-6.1/rapidio-add-check-for-rio_add_net-in-rio_scan_alloc_net.patch
queue-6.1/usb-dwc3-set-suspendenable-soon-after-phy-init.patch
queue-6.1/alsa-hda-realtek-update-alc222-depop-optimize.patch
queue-6.1/x86-cacheinfo-validate-cpuid-leaf-0x2-edx-output.patch
queue-6.1/alsa-hda-realtek-fix-incorrect-is_reachable-usage.patch
queue-6.1/block-fix-conversion-of-gpt-partition-name-to-7-bit.patch
queue-6.1/drivers-virt-acrn-hsm-use-kzalloc-to-avoid-info-leak-in-pmcmd_ioctl.patch
queue-6.1/usb-renesas_usbhs-use-devm_usb_get_phy.patch
queue-6.1/iio-dac-ad3552r-clear-reset-status-flag.patch
queue-6.1/revert-drivers-card_reader-rtsx_usb-restore-interrupt-based-detection.patch
queue-6.1/platform-x86-thinkpad_acpi-add-battery-quirk-for-thinkpad-x131e.patch
queue-6.1/wifi-cfg80211-regulatory-improve-invalid-hints-checking.patch
queue-6.1/kvm-svm-drop-debugctl-from-guest-s-effective-value.patch
queue-6.1/usb-hub-lack-of-clearing-xhc-resources.patch
queue-6.1/ksmbd-fix-type-confusion-via-race-condition-when-using-ipc_msg_send_request.patch
queue-6.1/slimbus-messaging-free-transaction-id-in-delayed-interrupt-scenario.patch
queue-6.1/intel_th-pci-add-panther-lake-p-u-support.patch
queue-6.1/xhci-pci-fix-indentation-in-the-pci-device-id-definitions.patch
queue-6.1/revert-kvm-ppc-e500-mark-struct-page-dirty-in-kvmppc_e500_shadow_map.patch
queue-6.1/iio-filter-admv8818-force-initialization-of-sdo.patch
queue-6.1/revert-kvm-ppc-e500-use-__kvm_faultin_pfn-to-handle-page-faults.patch
queue-6.1/bus-mhi-host-pci_generic-use-pci_try_reset_function-to-avoid-deadlock.patch
queue-6.1/intel_th-pci-add-arrow-lake-support.patch
queue-6.1/drivers-core-fix-device-leak-in-__fw_devlink_relax_cycles.patch
queue-6.1/usb-typec-tcpci_rt1711h-unmask-alert-interrupts-to-fix-functionality.patch
queue-6.1/gpio-aggregator-protect-driver-attr-handlers-against-module-unload.patch
queue-6.1/usb-renesas_usbhs-call-clk_put.patch
queue-6.1/usb-dwc3-gadget-prevent-irq-storm-when-th-re-executes.patch
queue-6.1/revert-kvm-ppc-e500-mark-struct-page-pfn-accessed-before-dropping-mmu_lock.patch
queue-6.1/x86-cpu-properly-parse-cpuid-leaf-0x2-tlb-descriptor-0x63.patch
queue-6.1/wifi-nl80211-reject-cooked-mode-if-it-is-set-along-with-other-flags.patch
queue-6.1/usb-xhci-enable-the-trb-overfetch-quirk-on-via-vl805.patch
queue-6.1/intel_th-pci-add-panther-lake-h-support.patch
queue-6.1/alsa-hda-intel-add-dell-alc3271-to-power_save-denylist.patch
queue-6.1/alsa-hda-realtek-add-supported-mic-mute-led-for-lenovo-platform.patch
queue-6.1/rapidio-fix-an-api-misues-when-rio_add_net-fails.patch
queue-6.1/s390-traps-fix-test_monitor_call-inline-assembly.patch
queue-6.1/loongarch-convert-unreachable-to-bug.patch
queue-6.1/ksmbd-fix-use-after-free-in-smb2_lock.patch
queue-6.1/x86-amd_nb-use-rdmsr_safe-in-amd_get_mmconfig_range.patch
queue-6.1/bluetooth-add-check-for-mgmt_alloc_skb-in-mgmt_remote_name.patch
queue-6.1/usb-typec-ucsi-increase-timeout-for-ppm-reset-operations.patch
queue-6.1/mm-don-t-skip-arch_sync_kernel_mappings-in-error-paths.patch
queue-6.1/usb-renesas_usbhs-flush-the-notify_hotplug_work.patch
queue-6.1/usb-quirks-add-delay_init-and-no_lpm-for-prolific-mass-storage-card-reader.patch
queue-6.1/usb-gadget-fix-setting-self-powered-state-on-suspend.patch
queue-6.1/usb-gadget-check-bmattributes-only-if-configuration-is-valid.patch
queue-6.1/usb-atm-cxacru-fix-a-flaw-in-existing-endpoint-checks.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux