Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31018acd authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branches 'stable/bug.fixes-3.2' and 'stable/mmu.fixes' of...

Merge branches 'stable/bug.fixes-3.2' and 'stable/mmu.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

* 'stable/bug.fixes-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/p2m/debugfs: Make type_name more obvious.
  xen/p2m/debugfs: Fix potential pointer exception.
  xen/enlighten: Fix compile warnings and set cx to known value.
  xen/xenbus: Remove the unnecessary check.
  xen/irq: If we fail during msi_capability_init return proper error code.
  xen/events: Don't check the info for NULL as it is already done.
  xen/events: BUG() when we can't allocate our event->irq array.

* 'stable/mmu.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: Fix selfballooning and ensure it doesn't go too far
  xen/gntdev: Fix sleep-inside-spinlock
  xen: modify kernel mappings corresponding to granted pages
  xen: add an "highmem" parameter to alloc_xenballooned_pages
  xen/p2m: Use SetPagePrivate and its friends for M2P overrides.
  xen/p2m: Make debug/xen/mmu/p2m visible again.
  Revert "xen/debug: WARN_ON when identity PFN has no _PAGE_IOMAP flag set."
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include <asm/pgtable.h>

#include <xen/interface/xen.h>
#include <xen/grant_table.h>
#include <xen/features.h>

/* Xen machine address */
@@ -48,14 +49,11 @@ extern unsigned long set_phys_range_identity(unsigned long pfn_s,
					     unsigned long pfn_e);

extern int m2p_add_override(unsigned long mfn, struct page *page,
			    bool clear_pte);
			    struct gnttab_map_grant_ref *kmap_op);
extern int m2p_remove_override(struct page *page, bool clear_pte);
extern struct page *m2p_find_override(unsigned long mfn);
extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn);

#ifdef CONFIG_XEN_DEBUG_FS
extern int p2m_dump_show(struct seq_file *m, void *v);
#endif
static inline unsigned long pfn_to_mfn(unsigned long pfn)
{
	unsigned long mfn;
+7 −3
Original line number Diff line number Diff line
@@ -175,8 +175,10 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
					       "pcifront-msi-x" :
					       "pcifront-msi",
						DOMID_SELF);
		if (irq < 0)
		if (irq < 0) {
			ret = irq;
			goto free;
		}
		i++;
	}
	kfree(v);
@@ -221,8 +223,10 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
		if (msg.data != XEN_PIRQ_MSI_DATA ||
		    xen_irq_from_pirq(pirq) < 0) {
			pirq = xen_allocate_pirq_msi(dev, msidesc);
			if (pirq < 0)
			if (pirq < 0) {
				irq = -ENODEV;
				goto error;
			}
			xen_msi_compose_msg(dev, pirq, &msg);
			__write_msi_msg(msidesc, &msg);
			dev_dbg(&dev->dev, "xen: msi bound to pirq=%d\n", pirq);
@@ -244,7 +248,7 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
error:
	dev_err(&dev->dev,
		"Xen PCI frontend has not registered MSI/MSI-X support!\n");
	return -ENODEV;
	return irq;
}

#ifdef CONFIG_XEN_DOM0
+0 −8
Original line number Diff line number Diff line
@@ -49,11 +49,3 @@ config XEN_DEBUG_FS
	help
	  Enable statistics output and various tuning options in debugfs.
	  Enabling this option may incur a significant performance overhead.

config XEN_DEBUG
	bool "Enable Xen debug checks"
	depends on XEN
	default n
	help
	  Enable various WARN_ON checks in the Xen MMU code.
	  Enabling this option WILL incur a significant performance overhead.
+1 −0
Original line number Diff line number Diff line
@@ -251,6 +251,7 @@ static void __init xen_init_cpuid_mask(void)
			~((1 << X86_FEATURE_APIC) |  /* disable local APIC */
			  (1 << X86_FEATURE_ACPI));  /* disable ACPI */
	ax = 1;
	cx = 0;
	xen_cpuid(&ax, &bx, &cx, &dx);

	xsave_mask =
+0 −52
Original line number Diff line number Diff line
@@ -495,41 +495,6 @@ static pte_t xen_make_pte(pteval_t pte)
}
PV_CALLEE_SAVE_REGS_THUNK(xen_make_pte);

#ifdef CONFIG_XEN_DEBUG
pte_t xen_make_pte_debug(pteval_t pte)
{
	phys_addr_t addr = (pte & PTE_PFN_MASK);
	phys_addr_t other_addr;
	bool io_page = false;
	pte_t _pte;

	if (pte & _PAGE_IOMAP)
		io_page = true;

	_pte = xen_make_pte(pte);

	if (!addr)
		return _pte;

	if (io_page &&
	    (xen_initial_domain() || addr >= ISA_END_ADDRESS)) {
		other_addr = pfn_to_mfn(addr >> PAGE_SHIFT) << PAGE_SHIFT;
		WARN_ONCE(addr != other_addr,
			"0x%lx is using VM_IO, but it is 0x%lx!\n",
			(unsigned long)addr, (unsigned long)other_addr);
	} else {
		pteval_t iomap_set = (_pte.pte & PTE_FLAGS_MASK) & _PAGE_IOMAP;
		other_addr = (_pte.pte & PTE_PFN_MASK);
		WARN_ONCE((addr == other_addr) && (!io_page) && (!iomap_set),
			"0x%lx is missing VM_IO (and wasn't fixed)!\n",
			(unsigned long)addr);
	}

	return _pte;
}
PV_CALLEE_SAVE_REGS_THUNK(xen_make_pte_debug);
#endif

static pgd_t xen_make_pgd(pgdval_t pgd)
{
	pgd = pte_pfn_to_mfn(pgd);
@@ -1992,9 +1957,6 @@ void __init xen_ident_map_ISA(void)

static void __init xen_post_allocator_init(void)
{
#ifdef CONFIG_XEN_DEBUG
	pv_mmu_ops.make_pte = PV_CALLEE_SAVE(xen_make_pte_debug);
#endif
	pv_mmu_ops.set_pte = xen_set_pte;
	pv_mmu_ops.set_pmd = xen_set_pmd;
	pv_mmu_ops.set_pud = xen_set_pud;
@@ -2404,17 +2366,3 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
	return err;
}
EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range);

#ifdef CONFIG_XEN_DEBUG_FS
static int p2m_dump_open(struct inode *inode, struct file *filp)
{
	return single_open(filp, p2m_dump_show, NULL);
}

static const struct file_operations p2m_dump_fops = {
	.open		= p2m_dump_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= single_release,
};
#endif /* CONFIG_XEN_DEBUG_FS */
Loading