powerpc/pseries: Flush lazy kernel mappings after unplug operations

This ensures that the translations for unmapped IO mappings or
unmapped memory are properly removed from the MMU hash table
before such an unplug. Without this, the hypervisor refuses the
unplug operations due to those resources still being mapped by
the partition.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

+13
+7
arch/powerpc/platforms/pseries/hotplug-memory.c
··· 11 11 12 12 #include <linux/of.h> 13 13 #include <linux/lmb.h> 14 + #include <linux/vmalloc.h> 14 15 #include <asm/firmware.h> 15 16 #include <asm/machdep.h> 16 17 #include <asm/pSeries_reconfig.h> ··· 55 54 */ 56 55 start = (unsigned long)__va(base); 57 56 ret = remove_section_mapping(start, start + lmb_size); 57 + 58 + /* Ensure all vmalloc mappings are flushed in case they also 59 + * hit that section of memory 60 + */ 61 + vm_unmap_aliases(); 62 + 58 63 return ret; 59 64 } 60 65
+3
drivers/pci/hotplug/rpadlpar_core.c
··· 20 20 #include <linux/init.h> 21 21 #include <linux/pci.h> 22 22 #include <linux/string.h> 23 + #include <linux/vmalloc.h> 23 24 24 25 #include <asm/pci-bridge.h> 25 26 #include <linux/mutex.h> ··· 431 430 rc = dlpar_remove_pci_slot(drc_name, dn); 432 431 break; 433 432 } 433 + vm_unmap_aliases(); 434 + 434 435 printk(KERN_INFO "%s: slot %s removed\n", DLPAR_MODULE_NAME, drc_name); 435 436 exit: 436 437 mutex_unlock(&rpadlpar_mutex);
+3
drivers/pci/hotplug/rpaphp_core.c
··· 29 29 #include <linux/pci_hotplug.h> 30 30 #include <linux/smp.h> 31 31 #include <linux/init.h> 32 + #include <linux/vmalloc.h> 32 33 #include <asm/eeh.h> /* for eeh_add_device() */ 33 34 #include <asm/rtas.h> /* rtas_call */ 34 35 #include <asm/pci-bridge.h> /* for pci_controller */ ··· 419 418 return -EINVAL; 420 419 421 420 pcibios_remove_pci_devices(slot->bus); 421 + vm_unmap_aliases(); 422 + 422 423 slot->state = NOT_CONFIGURED; 423 424 return 0; 424 425 }