version 3.17.0-1
This commit is contained in:
parent
a784eee66f
commit
bb54078b2d
823
config-pvops
823
config-pvops
File diff suppressed because it is too large
Load Diff
@ -78,8 +78,8 @@ index fd14be1..1f3eb19 100644
|
||||
+ $(if $(AFTER_LINK),; $(AFTER_LINK)) && \
|
||||
+ sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
|
||||
|
||||
VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
|
||||
GCOV_PROFILE := n
|
||||
VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \
|
||||
$(call cc-ldoption, -Wl$(comma)--build-id) -Wl,-Bsymbolic $(LTO_CFLAGS)
|
||||
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
|
||||
index cd9c6c6..3edf048 100644
|
||||
--- a/scripts/link-vmlinux.sh
|
||||
|
@ -1,207 +0,0 @@
|
||||
PCI: Add x86_msi.msi_mask_irq() and msix_mask_irq()
|
||||
|
||||
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
|
||||
Certain platforms do not allow writes in the MSI-X BARs to setup or tear
|
||||
down vector values. To combat against the generic code trying to write to
|
||||
that and either silently being ignored or crashing due to the pagetables
|
||||
being marked R/O this patch introduces a platform override.
|
||||
|
||||
Note that we keep two separate, non-weak, functions default_mask_msi_irqs()
|
||||
and default_mask_msix_irqs() for the behavior of the arch_mask_msi_irqs()
|
||||
and arch_mask_msix_irqs(), as the default behavior is needed by x86 PCI
|
||||
code.
|
||||
|
||||
For Xen, which does not allow the guest to write to MSI-X tables - as the
|
||||
hypervisor is solely responsible for setting the vector values - we
|
||||
implement two nops.
|
||||
|
||||
This fixes a Xen guest crash when passing a PCI device with MSI-X to the
|
||||
guest. See the bugzilla for more details.
|
||||
|
||||
[bhelgaas: add bugzilla info]
|
||||
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=64581
|
||||
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
CC: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
|
||||
CC: Zhenzhong Duan <zhenzhong.duan@oracle.com>
|
||||
---
|
||||
arch/x86/include/asm/x86_init.h | 3 +++
|
||||
arch/x86/kernel/x86_init.c | 10 ++++++++++
|
||||
arch/x86/pci/xen.c | 13 ++++++++++++-
|
||||
drivers/pci/msi.c | 22 ++++++++++++++++------
|
||||
include/linux/msi.h | 2 ++
|
||||
5 files changed, 43 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
|
||||
index 828a156..0f1be11 100644
|
||||
--- a/arch/x86/include/asm/x86_init.h
|
||||
+++ b/arch/x86/include/asm/x86_init.h
|
||||
@@ -172,6 +172,7 @@ struct x86_platform_ops {
|
||||
|
||||
struct pci_dev;
|
||||
struct msi_msg;
|
||||
+struct msi_desc;
|
||||
|
||||
struct x86_msi_ops {
|
||||
int (*setup_msi_irqs)(struct pci_dev *dev, int nvec, int type);
|
||||
@@ -182,6 +183,8 @@ struct x86_msi_ops {
|
||||
void (*teardown_msi_irqs)(struct pci_dev *dev);
|
||||
void (*restore_msi_irqs)(struct pci_dev *dev, int irq);
|
||||
int (*setup_hpet_msi)(unsigned int irq, unsigned int id);
|
||||
+ u32 (*msi_mask_irq)(struct msi_desc *desc, u32 mask, u32 flag);
|
||||
+ u32 (*msix_mask_irq)(struct msi_desc *desc, u32 flag);
|
||||
};
|
||||
|
||||
struct IO_APIC_route_entry;
|
||||
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
|
||||
index 8ce0072..021783b 100644
|
||||
--- a/arch/x86/kernel/x86_init.c
|
||||
+++ b/arch/x86/kernel/x86_init.c
|
||||
@@ -116,6 +116,8 @@ struct x86_msi_ops x86_msi = {
|
||||
.teardown_msi_irqs = default_teardown_msi_irqs,
|
||||
.restore_msi_irqs = default_restore_msi_irqs,
|
||||
.setup_hpet_msi = default_setup_hpet_msi,
|
||||
+ .msi_mask_irq = default_msi_mask_irq,
|
||||
+ .msix_mask_irq = default_msix_mask_irq,
|
||||
};
|
||||
|
||||
/* MSI arch specific hooks */
|
||||
@@ -138,6 +140,14 @@ void arch_restore_msi_irqs(struct pci_dev *dev, int irq)
|
||||
{
|
||||
x86_msi.restore_msi_irqs(dev, irq);
|
||||
}
|
||||
+u32 arch_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
|
||||
+{
|
||||
+ return x86_msi.msi_mask_irq(desc, mask, flag);
|
||||
+}
|
||||
+u32 arch_msix_mask_irq(struct msi_desc *desc, u32 flag)
|
||||
+{
|
||||
+ return x86_msi.msix_mask_irq(desc, flag);
|
||||
+}
|
||||
#endif
|
||||
|
||||
struct x86_io_apic_ops x86_io_apic_ops = {
|
||||
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
|
||||
index 48e8461..5eee495 100644
|
||||
--- a/arch/x86/pci/xen.c
|
||||
+++ b/arch/x86/pci/xen.c
|
||||
@@ -382,7 +382,14 @@ static void xen_teardown_msi_irq(unsigned int irq)
|
||||
{
|
||||
xen_destroy_irq(irq);
|
||||
}
|
||||
-
|
||||
+static u32 xen_nop_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+static u32 xen_nop_msix_mask_irq(struct msi_desc *desc, u32 flag)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
#endif
|
||||
|
||||
int __init pci_xen_init(void)
|
||||
@@ -406,6 +413,8 @@ int __init pci_xen_init(void)
|
||||
x86_msi.setup_msi_irqs = xen_setup_msi_irqs;
|
||||
x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
|
||||
x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs;
|
||||
+ x86_msi.msi_mask_irq = xen_nop_msi_mask_irq;
|
||||
+ x86_msi.msix_mask_irq = xen_nop_msix_mask_irq;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -485,6 +494,8 @@ int __init pci_xen_initial_domain(void)
|
||||
x86_msi.setup_msi_irqs = xen_initdom_setup_msi_irqs;
|
||||
x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
|
||||
x86_msi.restore_msi_irqs = xen_initdom_restore_msi_irqs;
|
||||
+ x86_msi.msi_mask_irq = xen_nop_msi_mask_irq;
|
||||
+ x86_msi.msix_mask_irq = xen_nop_msix_mask_irq;
|
||||
#endif
|
||||
xen_setup_acpi_sci();
|
||||
__acpi_register_gsi = acpi_register_gsi_xen;
|
||||
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
|
||||
index 604265c..5e63645 100644
|
||||
--- a/drivers/pci/msi.c
|
||||
+++ b/drivers/pci/msi.c
|
||||
@@ -185,7 +185,7 @@ static inline __attribute_const__ u32 msi_enabled_mask(u16 control)
|
||||
* reliably as devices without an INTx disable bit will then generate a
|
||||
* level IRQ which will never be cleared.
|
||||
*/
|
||||
-static u32 __msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
|
||||
+u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
|
||||
{
|
||||
u32 mask_bits = desc->masked;
|
||||
|
||||
@@ -199,9 +199,14 @@ static u32 __msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
|
||||
return mask_bits;
|
||||
}
|
||||
|
||||
+__weak u32 arch_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
|
||||
+{
|
||||
+ return default_msi_mask_irq(desc, mask, flag);
|
||||
+}
|
||||
+
|
||||
static void msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
|
||||
{
|
||||
- desc->masked = __msi_mask_irq(desc, mask, flag);
|
||||
+ desc->masked = arch_msi_mask_irq(desc, mask, flag);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -211,7 +216,7 @@ static void msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
|
||||
* file. This saves a few milliseconds when initialising devices with lots
|
||||
* of MSI-X interrupts.
|
||||
*/
|
||||
-static u32 __msix_mask_irq(struct msi_desc *desc, u32 flag)
|
||||
+u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag)
|
||||
{
|
||||
u32 mask_bits = desc->masked;
|
||||
unsigned offset = desc->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE +
|
||||
@@ -224,9 +229,14 @@ static u32 __msix_mask_irq(struct msi_desc *desc, u32 flag)
|
||||
return mask_bits;
|
||||
}
|
||||
|
||||
+__weak u32 arch_msix_mask_irq(struct msi_desc *desc, u32 flag)
|
||||
+{
|
||||
+ return default_msix_mask_irq(desc, flag);
|
||||
+}
|
||||
+
|
||||
static void msix_mask_irq(struct msi_desc *desc, u32 flag)
|
||||
{
|
||||
- desc->masked = __msix_mask_irq(desc, flag);
|
||||
+ desc->masked = arch_msix_mask_irq(desc, flag);
|
||||
}
|
||||
|
||||
static void msi_set_mask_bit(struct irq_data *data, u32 flag)
|
||||
@@ -902,7 +912,7 @@ void pci_msi_shutdown(struct pci_dev *dev)
|
||||
pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &ctrl);
|
||||
mask = msi_capable_mask(ctrl);
|
||||
/* Keep cached state to be restored */
|
||||
- __msi_mask_irq(desc, mask, ~mask);
|
||||
+ arch_msi_mask_irq(desc, mask, ~mask);
|
||||
|
||||
/* Restore dev->irq to its default pin-assertion irq */
|
||||
dev->irq = desc->msi_attrib.default_irq;
|
||||
@@ -998,7 +1008,7 @@ void pci_msix_shutdown(struct pci_dev *dev)
|
||||
/* Return the device with MSI-X masked as initial states */
|
||||
list_for_each_entry(entry, &dev->msi_list, list) {
|
||||
/* Keep cached states to be restored */
|
||||
- __msix_mask_irq(entry, 1);
|
||||
+ arch_msix_mask_irq(entry, 1);
|
||||
}
|
||||
|
||||
msix_set_enable(dev, 0);
|
||||
diff --git a/include/linux/msi.h b/include/linux/msi.h
|
||||
index b17ead8..87cce50 100644
|
||||
--- a/include/linux/msi.h
|
||||
+++ b/include/linux/msi.h
|
||||
@@ -64,6 +64,8 @@ void arch_restore_msi_irqs(struct pci_dev *dev, int irq);
|
||||
|
||||
void default_teardown_msi_irqs(struct pci_dev *dev);
|
||||
void default_restore_msi_irqs(struct pci_dev *dev, int irq);
|
||||
+u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag);
|
||||
+u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag);
|
||||
|
||||
struct msi_chip {
|
||||
struct module *owner;
|
@ -1,41 +0,0 @@
|
||||
From c275a57f5ec3056f732843b11659d892235faff7 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
|
||||
Date: Wed, 6 Nov 2013 15:37:40 -0500
|
||||
Subject: [PATCH] xen/balloon: Set balloon's initial state to number of
|
||||
existing RAM pages
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Invisible Things Lab
|
||||
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
||||
|
||||
Currently balloon's initial value is set to max_pfn which includes
|
||||
non-RAM ranges such as MMIO hole. As result, initial memory target
|
||||
(specified by guest's configuration file) will appear smaller than
|
||||
what balloon driver perceives to be the current number of available
|
||||
pages. Thus it will balloon down "extra" pages, decreasing amount of
|
||||
available memory for no good reason.
|
||||
|
||||
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
|
||||
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
||||
---
|
||||
drivers/xen/balloon.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
|
||||
index b232908..1b62304 100644
|
||||
--- a/drivers/xen/balloon.c
|
||||
+++ b/drivers/xen/balloon.c
|
||||
@@ -641,7 +641,7 @@ static int __init balloon_init(void)
|
||||
|
||||
balloon_stats.current_pages = xen_pv_domain()
|
||||
? min(xen_start_info->nr_pages - xen_released_pages, max_pfn)
|
||||
- : max_pfn;
|
||||
+ : get_num_physpages();
|
||||
balloon_stats.target_pages = balloon_stats.current_pages;
|
||||
balloon_stats.balloon_low = 0;
|
||||
balloon_stats.balloon_high = 0;
|
||||
--
|
||||
1.8.1.4
|
||||
|
@ -1,145 +0,0 @@
|
||||
From c1d15f5c8bc1170dafe16e988e55437245966dfe Mon Sep 17 00:00:00 2001
|
||||
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
|
||||
Date: Wed, 11 Dec 2013 16:58:42 +0000
|
||||
Subject: [PATCH] xen/balloon: Seperate the auto-translate logic properly (v2)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Invisible Things Lab
|
||||
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
||||
|
||||
The auto-xlat logic vs the non-xlat means that we don't need to for
|
||||
auto-xlat guests (like PVH, HVM or ARM):
|
||||
- use P2M
|
||||
- use scratch page.
|
||||
|
||||
However the code in increase_reservation does modify the p2m for
|
||||
auto_translate guests, but not in decrease_reservation.
|
||||
|
||||
Fix that by avoiding any p2m modifications in both increase_reservation
|
||||
and decrease_reservation for auto_translated guests.
|
||||
|
||||
And also avoid allocating or using scratch pages for auto_translated guests.
|
||||
|
||||
Lastly, since !auto-xlat is really another way of saying 'xen_pv'
|
||||
remove the redundant 'xen_pv_domain' check.
|
||||
|
||||
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
|
||||
[v2: Updated the description]
|
||||
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
||||
---
|
||||
drivers/xen/balloon.c | 63 +++++++++++++++++++++++++++------------------------
|
||||
1 file changed, 34 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
|
||||
index 55ea73f..4c02e2b 100644
|
||||
--- a/drivers/xen/balloon.c
|
||||
+++ b/drivers/xen/balloon.c
|
||||
@@ -350,17 +350,19 @@ static enum bp_state increase_reservation(unsigned long nr_pages)
|
||||
|
||||
pfn = page_to_pfn(page);
|
||||
|
||||
- set_phys_to_machine(pfn, frame_list[i]);
|
||||
-
|
||||
#ifdef CONFIG_XEN_HAVE_PVMMU
|
||||
- /* Link back into the page tables if not highmem. */
|
||||
- if (xen_pv_domain() && !PageHighMem(page)) {
|
||||
- int ret;
|
||||
- ret = HYPERVISOR_update_va_mapping(
|
||||
- (unsigned long)__va(pfn << PAGE_SHIFT),
|
||||
- mfn_pte(frame_list[i], PAGE_KERNEL),
|
||||
- 0);
|
||||
- BUG_ON(ret);
|
||||
+ if (!xen_feature(XENFEAT_auto_translated_physmap)) {
|
||||
+ set_phys_to_machine(pfn, frame_list[i]);
|
||||
+
|
||||
+ /* Link back into the page tables if not highmem. */
|
||||
+ if (!PageHighMem(page)) {
|
||||
+ int ret;
|
||||
+ ret = HYPERVISOR_update_va_mapping(
|
||||
+ (unsigned long)__va(pfn << PAGE_SHIFT),
|
||||
+ mfn_pte(frame_list[i], PAGE_KERNEL),
|
||||
+ 0);
|
||||
+ BUG_ON(ret);
|
||||
+ }
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -378,7 +380,6 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp)
|
||||
enum bp_state state = BP_DONE;
|
||||
unsigned long pfn, i;
|
||||
struct page *page;
|
||||
- struct page *scratch_page;
|
||||
int ret;
|
||||
struct xen_memory_reservation reservation = {
|
||||
.address_bits = 0,
|
||||
@@ -411,27 +412,29 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp)
|
||||
frame_list[i] = pfn_to_mfn(pfn);
|
||||
page = pfn_to_page(pfn);
|
||||
|
||||
+#ifdef CONFIG_XEN_HAVE_PVMMU
|
||||
/*
|
||||
* Ballooned out frames are effectively replaced with
|
||||
* a scratch frame. Ensure direct mappings and the
|
||||
* p2m are consistent.
|
||||
*/
|
||||
- scratch_page = get_balloon_scratch_page();
|
||||
-#ifdef CONFIG_XEN_HAVE_PVMMU
|
||||
- if (xen_pv_domain() && !PageHighMem(page)) {
|
||||
- ret = HYPERVISOR_update_va_mapping(
|
||||
- (unsigned long)__va(pfn << PAGE_SHIFT),
|
||||
- pfn_pte(page_to_pfn(scratch_page),
|
||||
- PAGE_KERNEL_RO), 0);
|
||||
- BUG_ON(ret);
|
||||
- }
|
||||
-#endif
|
||||
if (!xen_feature(XENFEAT_auto_translated_physmap)) {
|
||||
unsigned long p;
|
||||
+ struct page *scratch_page = get_balloon_scratch_page();
|
||||
+
|
||||
+ if (!PageHighMem(page)) {
|
||||
+ ret = HYPERVISOR_update_va_mapping(
|
||||
+ (unsigned long)__va(pfn << PAGE_SHIFT),
|
||||
+ pfn_pte(page_to_pfn(scratch_page),
|
||||
+ PAGE_KERNEL_RO), 0);
|
||||
+ BUG_ON(ret);
|
||||
+ }
|
||||
p = page_to_pfn(scratch_page);
|
||||
__set_phys_to_machine(pfn, pfn_to_mfn(p));
|
||||
+
|
||||
+ put_balloon_scratch_page();
|
||||
}
|
||||
- put_balloon_scratch_page();
|
||||
+#endif
|
||||
|
||||
balloon_append(page);
|
||||
}
|
||||
@@ -627,15 +630,17 @@ static int __init balloon_init(void)
|
||||
if (!xen_domain())
|
||||
return -ENODEV;
|
||||
|
||||
- for_each_online_cpu(cpu)
|
||||
- {
|
||||
- per_cpu(balloon_scratch_page, cpu) = alloc_page(GFP_KERNEL);
|
||||
- if (per_cpu(balloon_scratch_page, cpu) == NULL) {
|
||||
- pr_warn("Failed to allocate balloon_scratch_page for cpu %d\n", cpu);
|
||||
- return -ENOMEM;
|
||||
+ if (!xen_feature(XENFEAT_auto_translated_physmap)) {
|
||||
+ for_each_online_cpu(cpu)
|
||||
+ {
|
||||
+ per_cpu(balloon_scratch_page, cpu) = alloc_page(GFP_KERNEL);
|
||||
+ if (per_cpu(balloon_scratch_page, cpu) == NULL) {
|
||||
+ pr_warn("Failed to allocate balloon_scratch_page for cpu %d\n", cpu);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
}
|
||||
+ register_cpu_notifier(&balloon_cpu_notifier);
|
||||
}
|
||||
- register_cpu_notifier(&balloon_cpu_notifier);
|
||||
|
||||
pr_info("Initialising balloon driver\n");
|
||||
|
||||
--
|
||||
1.8.1.4
|
||||
|
@ -1,53 +0,0 @@
|
||||
From 9346c2a8defab777d1fba6bcc284f6ada181fe96 Mon Sep 17 00:00:00 2001
|
||||
From: Jie Liu <jeff.liu@oracle.com>
|
||||
Date: Wed, 13 Nov 2013 20:59:58 +0800
|
||||
Subject: [PATCH] xen: simplify balloon_first_page() with
|
||||
list_first_entry_or_null()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Invisible Things Lab
|
||||
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
||||
|
||||
Replace the code logic at balloon_first_page() by calling
|
||||
list_first_entry_or_null() directly. since here is only
|
||||
one user of that routine, therefore we can just remove it.
|
||||
|
||||
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
|
||||
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
|
||||
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
||||
---
|
||||
drivers/xen/balloon.c | 9 +--------
|
||||
1 file changed, 1 insertion(+), 8 deletions(-)
|
||||
|
||||
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
|
||||
index 4c02e2b..37d06ea 100644
|
||||
--- a/drivers/xen/balloon.c
|
||||
+++ b/drivers/xen/balloon.c
|
||||
@@ -157,13 +157,6 @@ static struct page *balloon_retrieve(bool prefer_highmem)
|
||||
return page;
|
||||
}
|
||||
|
||||
-static struct page *balloon_first_page(void)
|
||||
-{
|
||||
- if (list_empty(&ballooned_pages))
|
||||
- return NULL;
|
||||
- return list_entry(ballooned_pages.next, struct page, lru);
|
||||
-}
|
||||
-
|
||||
static struct page *balloon_next_page(struct page *page)
|
||||
{
|
||||
struct list_head *next = page->lru.next;
|
||||
@@ -328,7 +321,7 @@ static enum bp_state increase_reservation(unsigned long nr_pages)
|
||||
if (nr_pages > ARRAY_SIZE(frame_list))
|
||||
nr_pages = ARRAY_SIZE(frame_list);
|
||||
|
||||
- page = balloon_first_page();
|
||||
+ page = list_first_entry_or_null(&ballooned_pages, struct page, lru);
|
||||
for (i = 0; i < nr_pages; i++) {
|
||||
if (!page) {
|
||||
nr_pages = i;
|
||||
--
|
||||
1.8.1.4
|
||||
|
@ -1,55 +0,0 @@
|
||||
Date: Fri, 27 Jun 2014 10:51:42 +0100
|
||||
From: David Vrabel <david.vrabel@citrix.com>
|
||||
Subject: xen/balloon: set ballooned out pages as invalid in p2m
|
||||
|
||||
Since cd9151e26d31048b2b5e00fd02e110e07d2200c9 (xen/balloon: set a
|
||||
mapping for ballooned out pages), a ballooned out page had its entry
|
||||
in the p2m set to the MFN of one of the scratch page. This means that
|
||||
the p2m will contain many entries pointing to the same MFN.
|
||||
|
||||
During a domain save, this many-to-one entries are not considered and
|
||||
the scratch page is saved multiple times. On restore the ballooned
|
||||
pages are populated with new frames and the domain may use up its
|
||||
allocation before all pages can be restores.
|
||||
|
||||
Set ballooned out pages as INVALID_P2M_ENTRY in the p2m (as they
|
||||
werebefore), preventing them from being saved and re-populated on
|
||||
restore.
|
||||
|
||||
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
|
||||
---
|
||||
drivers/xen/balloon.c | 12 +++++-------
|
||||
1 file changed, 5 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
|
||||
index b7a506f..5c660c7 100644
|
||||
--- a/drivers/xen/balloon.c
|
||||
+++ b/drivers/xen/balloon.c
|
||||
@@ -426,20 +426,18 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp)
|
||||
* p2m are consistent.
|
||||
*/
|
||||
if (!xen_feature(XENFEAT_auto_translated_physmap)) {
|
||||
- unsigned long p;
|
||||
- struct page *scratch_page = get_balloon_scratch_page();
|
||||
-
|
||||
if (!PageHighMem(page)) {
|
||||
+ struct page *scratch_page = get_balloon_scratch_page();
|
||||
+
|
||||
ret = HYPERVISOR_update_va_mapping(
|
||||
(unsigned long)__va(pfn << PAGE_SHIFT),
|
||||
pfn_pte(page_to_pfn(scratch_page),
|
||||
PAGE_KERNEL_RO), 0);
|
||||
BUG_ON(ret);
|
||||
- }
|
||||
- p = page_to_pfn(scratch_page);
|
||||
- __set_phys_to_machine(pfn, pfn_to_mfn(p));
|
||||
|
||||
- put_balloon_scratch_page();
|
||||
+ put_balloon_scratch_page();
|
||||
+ }
|
||||
+ __set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
|
||||
}
|
||||
#endif
|
||||
|
||||
--
|
||||
1.7.10.4
|
@ -34,7 +34,7 @@ index 69f5857..a5d252a 100644
|
||||
--- a/arch/x86/xen/mmu.c
|
||||
+++ b/arch/x86/xen/mmu.c
|
||||
@@ -420,13 +420,13 @@ static pteval_t iomap_pte(pteval_t val)
|
||||
static pteval_t xen_pte_val(pte_t pte)
|
||||
__visible pteval_t xen_pte_val(pte_t pte)
|
||||
{
|
||||
pteval_t pteval = pte.pte;
|
||||
-#if 0
|
||||
@ -50,7 +50,7 @@ index 69f5857..a5d252a 100644
|
||||
return pteval;
|
||||
|
||||
@@ -468,7 +468,7 @@ void xen_set_pat(u64 pat)
|
||||
static pte_t xen_make_pte(pteval_t pte)
|
||||
__visible pte_t xen_make_pte(pteval_t pte)
|
||||
{
|
||||
phys_addr_t addr = (pte & PTE_PFN_MASK);
|
||||
-#if 0
|
||||
|
@ -1,22 +1,11 @@
|
||||
patches.rpmify/makefile-after_link.patch
|
||||
|
||||
# should be included in 3.13
|
||||
patches.xen/PCI-Add-x86_msi-msi_mask_irq-and-msix_mask_irq.patch
|
||||
|
||||
# backports from 3.14
|
||||
patches.xen/balloon-0001-xen-balloon-Set-balloon-s-initial-state-to-number-of.patch
|
||||
patches.xen/balloon-0002-xen-balloon-Seperate-the-auto-translate-logic-proper.patch
|
||||
patches.xen/balloon-0003-xen-simplify-balloon_first_page-with-list_first_entr.patch
|
||||
|
||||
# should be included in 3.16/3.17
|
||||
patches.xen/balloon-driver-fix.patch
|
||||
|
||||
# fix for GPU performance (revert workaround and apply proper fix)
|
||||
patches.xen/pvops-3.4-Revert-xen-pat-Disable-PAT-support-for-now.patch
|
||||
patches.xen/pvops-Revert-xen-pat-Disable-PAT-using-pat_enabled-value.patch
|
||||
patches.xen/pvops-3.4-x86-cpa-Use-pte_attrs-instead-of-pte_flags-on-CPA-se.patch
|
||||
|
||||
# Additional features
|
||||
patches.xen/pvops-0100-usb-xen-pvusb-driver.patch
|
||||
#patches.xen/pvops-0100-usb-xen-pvusb-driver.patch
|
||||
patches.xen/pvops-blkfront-removable-flag.patch
|
||||
patches.xen/pvops-blkfront-eject-support.patch
|
||||
|
@ -1 +1 @@
|
||||
3.12.23
|
||||
3.17
|
||||
|
Loading…
Reference in New Issue
Block a user