Commit cc675d22 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-linus-6.1-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross:
 "Two trivial cleanups, and three simple fixes"

* tag 'for-linus-6.1-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  xen/platform-pci: use define instead of literal number
  xen/platform-pci: add missing free_irq() in error path
  xen-pciback: Allow setting PCI_MSIX_FLAGS_MASKALL too
  xen/pcpu: fix possible memory leak in register_pcpu()
  x86/xen: Use kstrtobool() instead of strtobool()
parents 31c9c4c5 4abb77fc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <linux/start_kernel.h>
#include <linux/sched.h>
#include <linux/kprobes.h>
#include <linux/kstrtox.h>
#include <linux/memblock.h>
#include <linux/export.h>
#include <linux/mm.h>
@@ -113,7 +114,7 @@ static __read_mostly bool xen_msr_safe = IS_ENABLED(CONFIG_XEN_PV_MSR_SAFE);
static int __init parse_xen_msr_safe(char *str)
{
	if (str)
		return strtobool(str, &xen_msr_safe);
		return kstrtobool(str, &xen_msr_safe);
	return -EINVAL;
}
early_param("xen_msr_safe", parse_xen_msr_safe);
+2 −1
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@

#include <linux/init.h>
#include <linux/sched.h>
#include <linux/kstrtox.h>
#include <linux/mm.h>
#include <linux/pm.h>
#include <linux/memblock.h>
@@ -85,7 +86,7 @@ static void __init xen_parse_512gb(void)
	arg = strstr(xen_start_info->cmd_line, "xen_512gb_limit=");
	if (!arg)
		val = true;
	else if (strtobool(arg + strlen("xen_512gb_limit="), &val))
	else if (kstrtobool(arg + strlen("xen_512gb_limit="), &val))
		return;

	xen_512gb_limit = val;
+1 −1
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ static int register_pcpu(struct pcpu *pcpu)

	err = device_register(dev);
	if (err) {
		pcpu_release(dev);
		put_device(dev);
		return err;
	}

+7 −3
Original line number Diff line number Diff line
@@ -54,7 +54,8 @@ static uint64_t get_callback_via(struct pci_dev *pdev)
	pin = pdev->pin;

	/* We don't know the GSI. Specify the PCI INTx line instead. */
	return ((uint64_t)0x01 << HVM_CALLBACK_VIA_TYPE_SHIFT) | /* PCI INTx identifier */
	return ((uint64_t)HVM_PARAM_CALLBACK_TYPE_PCI_INTX <<
			  HVM_CALLBACK_VIA_TYPE_SHIFT) |
		((uint64_t)pci_domain_nr(pdev->bus) << 32) |
		((uint64_t)pdev->bus->number << 16) |
		((uint64_t)(pdev->devfn & 0xff) << 8) |
@@ -144,7 +145,7 @@ static int platform_pci_probe(struct pci_dev *pdev,
		if (ret) {
			dev_warn(&pdev->dev, "Unable to set the evtchn callback "
					 "err=%d\n", ret);
			goto out;
			goto irq_out;
		}
	}

@@ -152,13 +153,16 @@ static int platform_pci_probe(struct pci_dev *pdev,
	grant_frames = alloc_xen_mmio(PAGE_SIZE * max_nr_gframes);
	ret = gnttab_setup_auto_xlat_frames(grant_frames);
	if (ret)
		goto out;
		goto irq_out;
	ret = gnttab_init();
	if (ret)
		goto grant_out;
	return 0;
grant_out:
	gnttab_free_auto_xlat_frames();
irq_out:
	if (!xen_have_vector_callback)
		free_irq(pdev->irq, pdev);
out:
	pci_release_region(pdev, 0);
mem_out:
+6 −3
Original line number Diff line number Diff line
@@ -191,12 +191,15 @@ static const struct config_field caplist_pm[] = {

static struct msi_msix_field_config {
	u16          enable_bit;   /* bit for enabling MSI/MSI-X */
	u16          allowed_bits; /* bits allowed to be changed */
	unsigned int int_type;     /* interrupt type for exclusiveness check */
} msi_field_config = {
	.enable_bit	= PCI_MSI_FLAGS_ENABLE,
	.allowed_bits	= PCI_MSI_FLAGS_ENABLE,
	.int_type	= INTERRUPT_TYPE_MSI,
}, msix_field_config = {
	.enable_bit	= PCI_MSIX_FLAGS_ENABLE,
	.allowed_bits	= PCI_MSIX_FLAGS_ENABLE | PCI_MSIX_FLAGS_MASKALL,
	.int_type	= INTERRUPT_TYPE_MSIX,
};

@@ -229,7 +232,7 @@ static int msi_msix_flags_write(struct pci_dev *dev, int offset, u16 new_value,
		return 0;

	if (!dev_data->allow_interrupt_control ||
	    (new_value ^ old_value) & ~field_config->enable_bit)
	    (new_value ^ old_value) & ~field_config->allowed_bits)
		return PCIBIOS_SET_FAILED;

	if (new_value & field_config->enable_bit) {