diff options
Diffstat (limited to 'drivers/xen/balloon.c')
| -rw-r--r-- | drivers/xen/balloon.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 0b52d92cb2e5..fd933695f232 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
| @@ -229,6 +229,29 @@ static enum bp_state reserve_additional_memory(long credit) | |||
| 229 | balloon_hotplug = round_up(balloon_hotplug, PAGES_PER_SECTION); | 229 | balloon_hotplug = round_up(balloon_hotplug, PAGES_PER_SECTION); |
| 230 | nid = memory_add_physaddr_to_nid(hotplug_start_paddr); | 230 | nid = memory_add_physaddr_to_nid(hotplug_start_paddr); |
| 231 | 231 | ||
| 232 | #ifdef CONFIG_XEN_HAVE_PVMMU | ||
| 233 | /* | ||
| 234 | * add_memory() will build page tables for the new memory so | ||
| 235 | * the p2m must contain invalid entries so the correct | ||
| 236 | * non-present PTEs will be written. | ||
| 237 | * | ||
| 238 | * If a failure occurs, the original (identity) p2m entries | ||
| 239 | * are not restored since this region is now known not to | ||
| 240 | * conflict with any devices. | ||
| 241 | */ | ||
| 242 | if (!xen_feature(XENFEAT_auto_translated_physmap)) { | ||
| 243 | unsigned long pfn, i; | ||
| 244 | |||
| 245 | pfn = PFN_DOWN(hotplug_start_paddr); | ||
| 246 | for (i = 0; i < balloon_hotplug; i++) { | ||
| 247 | if (!set_phys_to_machine(pfn + i, INVALID_P2M_ENTRY)) { | ||
| 248 | pr_warn("set_phys_to_machine() failed, no memory added\n"); | ||
| 249 | return BP_ECANCELED; | ||
| 250 | } | ||
| 251 | } | ||
| 252 | } | ||
| 253 | #endif | ||
| 254 | |||
| 232 | rc = add_memory(nid, hotplug_start_paddr, balloon_hotplug << PAGE_SHIFT); | 255 | rc = add_memory(nid, hotplug_start_paddr, balloon_hotplug << PAGE_SHIFT); |
| 233 | 256 | ||
| 234 | if (rc) { | 257 | if (rc) { |
