Skip to content
  1. May 08, 2012
  2. May 07, 2012
    • Konrad Rzeszutek Wilk's avatar
      xen/pte: Fix crashes when trying to see non-existent PGD/PMD/PUD/PTEs · b7e5ffe5
      Konrad Rzeszutek Wilk authored
      
      
      If I try to do "cat /sys/kernel/debug/kernel_page_tables"
      I end up with:
      
      BUG: unable to handle kernel paging request at ffffc7fffffff000
      IP: [<ffffffff8106aa51>] ptdump_show+0x221/0x480
      PGD 0
      Oops: 0000 [#1] SMP
      CPU 0
      .. snip..
      RAX: 0000000000000000 RBX: ffffc00000000fff RCX: 0000000000000000
      RDX: 0000800000000000 RSI: 0000000000000000 RDI: ffffc7fffffff000
      
      which is due to the fact we are trying to access a PFN that is not
      accessible to us. The reason (at least in this case) was that
      PGD[256] is set to __HYPERVISOR_VIRT_START which was setup (by the
      hypervisor) to point to a read-only linear map of the MFN->PFN array.
      During our parsing we would get the MFN (a valid one), try to look
      it up in the MFN->PFN tree and find it invalid and return ~0 as PFN.
      Then pte_mfn_to_pfn would happilly feed that in, attach the flags
      and return it back to the caller. 'ptdump_show' bitshifts it and
      gets and invalid value that it tries to dereference.
      
      Instead of doing all of that, we detect the ~0 case and just
      return !_PAGE_PRESENT.
      
      This bug has been in existence .. at least until 2.6.37 (yikes!)
      
      CC: stable@kernel.org
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      b7e5ffe5
    • Konrad Rzeszutek Wilk's avatar
      xen/apic: Return the APIC ID (and version) for CPU 0. · 558daa28
      Konrad Rzeszutek Wilk authored
      
      
      On x86_64 on AMD machines where the first APIC_ID is not zero, we get:
      
      ACPI: LAPIC (acpi_id[0x01] lapic_id[0x10] enabled)
      BIOS bug: APIC version is 0 for CPU 1/0x10, fixing up to 0x10
      BIOS bug: APIC version mismatch, boot CPU: 0, CPU 1: version 10
      
      which means that when the ACPI processor driver loads and
      tries to parse the _Pxx states it fails to do as, as it
      ends up calling acpi_get_cpuid which does this:
      
      for_each_possible_cpu(i) {
              if (cpu_physical_id(i) == apic_id)
                      return i;
      }
      
      And the bootup CPU, has not been found so it fails and returns -1
      for the first CPU - which then subsequently in the loop that
      "acpi_processor_get_info" does results in returning an error, which
      means that "acpi_processor_add" failing and per_cpu(processor)
      is never set (and is NULL).
      
      That means that when xen-acpi-processor tries to load (much much
      later on) and parse the P-states it gets -ENODEV from
      acpi_processor_register_performance() (which tries to read
      the per_cpu(processor)) and fails to parse the data.
      
      Reported-by-and-Tested-by: default avatarStefan Bader <stefan.bader@canonical.com>
      Suggested-by: default avatarBoris Ostrovsky <boris.ostrovsky@amd.com>
      [v2: Bit-shift APIC ID by 24 bits]
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      558daa28
    • Julia Lawall's avatar
      drivers/video/xen-fbfront.c: add missing cleanup code · a7a97c63
      Julia Lawall authored
      
      
      The operations in the subsequent error-handling code appear to be also
      useful here.
      
      Acked-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      [v1: Collapse some of the error handling functions]
      [v2: Fix compile warning]
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      a7a97c63
  3. Apr 28, 2012
  4. Apr 27, 2012
    • Konrad Rzeszutek Wilk's avatar
      xen/acpi: Workaround broken BIOSes exporting non-existing C-states. · b930fe5e
      Konrad Rzeszutek Wilk authored
      
      
      We did a similar check for the P-states but did not do it for
      the C-states. What we want to do is ignore cases where the DSDT
      has definition for sixteen CPUs, but the machine only has eight
      CPUs and we get:
      xen-acpi-processor: (CX): Hypervisor error (-22) for ACPI CPU14
      
      Reported-by: default avatarTobias Geiger <tobias.geiger@vido.info>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      b930fe5e
    • Konrad Rzeszutek Wilk's avatar
      xen/smp: Fix crash when booting with ACPI hotplug CPUs. · cf405ae6
      Konrad Rzeszutek Wilk authored
      
      
      When we boot on a machine that can hotplug CPUs and we
      are using 'dom0_max_vcpus=X' on the Xen hypervisor line
      to clip the amount of CPUs available to the initial domain,
      we get this:
      
      (XEN) Command line: com1=115200,8n1 dom0_mem=8G noreboot dom0_max_vcpus=8 sync_console mce_verbosity=verbose console=com1,vga loglvl=all guest_loglvl=all
      .. snip..
      DMI: Intel Corporation S2600CP/S2600CP, BIOS SE5C600.86B.99.99.x032.072520111118 07/25/2011
      .. snip.
      SMP: Allowing 64 CPUs, 32 hotplug CPUs
      installing Xen timer for CPU 7
      cpu 7 spinlock event irq 361
      NMI watchdog: disabled (cpu7): hardware events not enabled
      Brought up 8 CPUs
      .. snip..
      	[acpi processor finds the CPUs are not initialized and starts calling
      	arch_register_cpu, which creates /sys/devices/system/cpu/cpu8/online]
      CPU 8 got hotplugged
      CPU 9 got hotplugged
      CPU 10 got hotplugged
      .. snip..
      initcall 1_acpi_battery_init_async+0x0/0x1b returned 0 after 406 usecs
      calling  erst_init+0x0/0x2bb @ 1
      
      	[and the scheduler sticks newly started tasks on the new CPUs, but
      	said CPUs cannot be initialized b/c the hypervisor has limited the
      	amount of vCPUS to 8 - as per the dom0_max_vcpus=8 flag.
      	The spinlock tries to kick the other CPU, but the structure for that
      	is not initialized and we crash.]
      BUG: unable to handle kernel paging request at fffffffffffffed8
      IP: [<ffffffff81035289>] xen_spin_lock+0x29/0x60
      PGD 180d067 PUD 180e067 PMD 0
      Oops: 0002 [#1] SMP
      CPU 7
      Modules linked in:
      
      Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc2upstream-00001-gf5154e8 #1 Intel Corporation S2600CP/S2600CP
      RIP: e030:[<ffffffff81035289>]  [<ffffffff81035289>] xen_spin_lock+0x29/0x60
      RSP: e02b:ffff8801fb9b3a70  EFLAGS: 00010282
      
      With this patch, we cap the amount of vCPUS that the initial domain
      can run, to exactly what dom0_max_vcpus=X has specified.
      
      In the future, if there is a hypercall that will allow a running
      domain to expand past its initial set of vCPUS, this patch should
      be re-evaluated.
      
      CC: stable@kernel.org
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      cf405ae6
    • Stefano Stabellini's avatar
      xen: use the pirq number to check the pirq_eoi_map · 521394e4
      Stefano Stabellini authored
      
      
      In pirq_check_eoi_map use the pirq number rather than the Linux irq
      number to check whether an eoi is needed in the pirq_eoi_map.
      
      The reason is that the irq number is not always identical to the
      pirq number so if we wrongly use the irq number to check the
      pirq_eoi_map we are going to check for the wrong pirq to EOI.
      
      As a consequence some interrupts might not be EOI'ed by the
      guest correctly.
      
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Tested-by: default avatarTobias Geiger <tobias.geiger@vido.info>
      [v1: Added some extra wording to git commit]
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      521394e4
    • Konrad Rzeszutek Wilk's avatar
      xen/enlighten: Disable MWAIT_LEAF so that acpi-pad won't be loaded. · df88b2d9
      Konrad Rzeszutek Wilk authored
      
      
      There are exactly four users of __monitor and __mwait:
      
       - cstate.c (which allows acpi_processor_ffh_cstate_enter to be called
         when the cpuidle API drivers are used. However patch
         "cpuidle: replace xen access to x86 pm_idle and default_idle"
         provides a mechanism to disable the cpuidle and use safe_halt.
       - smpboot (which allows mwait_play_dead to be called). However
         safe_halt is always used so we skip that.
       - intel_idle (same deal as above).
       - acpi_pad.c. This the one that we do not want to run as we
         will hit the below crash.
      
      Why do we want to expose MWAIT_LEAF in the first place?
      We want it for the xen-acpi-processor driver - which uploads
      C-states to the hypervisor. If MWAIT_LEAF is set, the cstate.c
      sets the proper address in the C-states so that the hypervisor
      can benefit from using the MWAIT functionality. And that is
      the sole reason for using it.
      
      Without this patch, if a module performs mwait or monitor we
      get this:
      
      invalid opcode: 0000 [#1] SMP
      CPU 2
      .. snip..
      Pid: 5036, comm: insmod Tainted: G           O 3.4.0-rc2upstream-dirty #2 Intel Corporation S2600CP/S2600CP
      RIP: e030:[<ffffffffa000a017>]  [<ffffffffa000a017>] mwait_check_init+0x17/0x1000 [mwait_check]
      RSP: e02b:ffff8801c298bf18  EFLAGS: 00010282
      RAX: ffff8801c298a010 RBX: ffffffffa03b2000 RCX: 0000000000000000
      RDX: 0000000000000000 RSI: ffff8801c29800d8 RDI: ffff8801ff097200
      RBP: ffff8801c298bf18 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
      R13: ffffffffa000a000 R14: 0000005148db7294 R15: 0000000000000003
      FS:  00007fbb364f2700(0000) GS:ffff8801ff08c000(0000) knlGS:0000000000000000
      CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 000000000179f038 CR3: 00000001c9469000 CR4: 0000000000002660
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process insmod (pid: 5036, threadinfo ffff8801c298a000, task ffff8801c29cd7e0)
      Stack:
       ffff8801c298bf48 ffffffff81002124 ffffffffa03b2000 00000000000081fd
       000000000178f010 000000000178f030 ffff8801c298bf78 ffffffff810c41e6
       00007fff3fb30db9 00007fff3fb30db9 00000000000081fd 0000000000010000
      Call Trace:
       [<ffffffff81002124>] do_one_initcall+0x124/0x170
       [<ffffffff810c41e6>] sys_init_module+0xc6/0x220
       [<ffffffff815b15b9>] system_call_fastpath+0x16/0x1b
      Code: <0f> 01 c8 31 c0 0f 01 c9 c9 c3 00 00 00 00 00 00 00 00 00 00 00 00
      RIP  [<ffffffffa000a017>] mwait_check_init+0x17/0x1000 [mwait_check]
       RSP <ffff8801c298bf18>
      ---[ end trace 16582fc8a3d1e29a ]---
      Kernel panic - not syncing: Fatal exception
      
      With this module (which is what acpi_pad.c would hit):
      
      MODULE_AUTHOR("Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>");
      MODULE_DESCRIPTION("mwait_check_and_back");
      MODULE_LICENSE("GPL");
      MODULE_VERSION();
      
      static int __init mwait_check_init(void)
      {
      	__monitor((void *)&current_thread_info()->flags, 0, 0);
      	__mwait(0, 0);
      	return 0;
      }
      static void __exit mwait_check_exit(void)
      {
      }
      module_init(mwait_check_init);
      module_exit(mwait_check_exit);
      
      Reported-by: default avatarLiu, Jinsong <jinsong.liu@intel.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      df88b2d9
  5. Apr 20, 2012
  6. Apr 19, 2012
    • Konrad Rzeszutek Wilk's avatar
      xen/blkback: Fix warning error. · a71e23d9
      Konrad Rzeszutek Wilk authored
      
      
      drivers/block/xen-blkback/xenbus.c: In function 'xen_blkbk_discard':
      drivers/block/xen-blkback/xenbus.c:419:4: warning: passing argument 1 of 'dev_warn' makes pointer from integer without a cast
      +[enabled by default]
      include/linux/device.h:894:5: note: expected 'const struct device *' but argument is of type 'long int'
      
      It is unclear how that mistake made it in. It surely is wrong.
      
      Acked-by: default avatarJens Axboe <axboe@kernel.dk>
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      a71e23d9
    • Konrad Rzeszutek Wilk's avatar
      Merge commit 'c104f1fa' into stable/for-linus-3.4 · 681e4a5e
      Konrad Rzeszutek Wilk authored
      * commit 'c104f1fa': (14566 commits)
        cpufreq: OMAP: fix build errors: depends on ARCH_OMAP2PLUS
        sparc64: Eliminate obsolete __handle_softirq() function
        sparc64: Fix bootup crash on sun4v.
        kconfig: delete last traces of __enabled_ from autoconf.h
        Revert "kconfig: fix __enabled_ macros definition for invisible and un-selected symbols"
        kconfig: fix IS_ENABLED to not require all options to be defined
        irq_domain: fix type mismatch in debugfs output format
        staging: android: fix mem leaks in __persistent_ram_init()
        staging: vt6656: Don't leak memory in drivers/staging/vt6656/ioctl.c::private_ioctl()
        staging: iio: hmc5843: Fix crash in probe function.
        panic: fix stack dump print on direct call to panic()
        drivers/rtc/rtc-pl031.c: enable clock on all ST variants
        Revert "mm: vmscan: fix misused nr_reclaimed in shrink_mem_cgroup_zone()"
        hugetlb: fix race condition in hugetlb_fault()
        drivers/rtc/rtc-twl.c: use static register while reading time
        drivers/rtc/rtc-s3c.c: add placeholder for driver private data
        drivers/rtc/rtc-s3c.c: fix compilation error
        MAINTAINERS: add PCDP console maintainer
        memcg: do not open code accesses to res_counter members
        drivers/rtc/rtc-efi.c: fix section mismatch warning
        ...
      681e4a5e
  7. Apr 18, 2012
  8. Apr 17, 2012
  9. Apr 14, 2012
    • Linus Torvalds's avatar
      Merge branch 'for-3.4/drivers' of git://git.kernel.dk/linux-block · c104f1fa
      Linus Torvalds authored
      Pull block driver bits from Jens Axboe:
      
       - A series of fixes for mtip32xx.  Most from Asai at Micron, but also
         one from Greg, getting rid of the dependency on PCIE_HOTPLUG.
      
       - A few bug fixes for xen-blkfront, and blkback.
      
       - A virtio-blk fix for Vivek, making resize actually work.
      
       - Two fixes from Stephen, making larger transfers possible on cciss.
         This is needed for tape drive support.
      
      * 'for-3.4/drivers' of git://git.kernel.dk/linux-block:
        block: mtip32xx: remove HOTPLUG_PCI_PCIE dependancy
        mtip32xx: dump tagmap on failure
        mtip32xx: fix handling of commands in various scenarios
        mtip32xx: Shorten macro names
        mtip32xx: misc changes
        mtip32xx: Add new sysfs entry 'status'
        mtip32xx: make setting comp_time as common
        mtip32xx: Add new bitwise flag 'dd_flag'
        mtip32xx: fix error handling in mtip_init()
        virtio-blk: Call revalidate_disk() upon online disk resize
        xen/blkback: Make optional features be really optional.
        xen/blkback: Squash the discard support for 'file' and 'phy' type.
        mtip32xx: fix incorrect value set for drv_cleanup_done, and re-initialize and start port in mtip_restart_port()
        cciss: Fix scsi tape io with more than 255 scatter gather elements
        cciss: Initialize scsi host max_sectors for tape drive support
        xen-blkfront: make blkif_io_lock spinlock per-device
        xen/blkfront: don't put bdev right after getting it
        xen-blkfront: use bitmap_set() and bitmap_clear()
        xen/blkback: Enable blkback on HVM guests
        xen/blkback: use grant-table.c hypercall wrappers
      c104f1fa
    • Linus Torvalds's avatar
      Merge branch 'for-3.4/core' of git://git.kernel.dk/linux-block · d8dd0b6d
      Linus Torvalds authored
      Pull block core bits from Jens Axboe:
       "It's a nice and quiet round this time, since most of the tricky stuff
        has been pushed to 3.5 to give it more time to mature.  After a few
        hectic block IO core changes for 3.3 and 3.2, I'm quite happy with a
        slow round.
      
        Really minor stuff in here, the only real functional change is making
        the auto-unplug threshold a per-queue entity.  The threshold is set so
        that it's low enough that we don't hold off IO for too long, but still
        big enough to get a nice benefit from the batched insert (and hence
        queue lock cost reduction).  For raid configurations, this currently
        breaks down."
      
      * 'for-3.4/core' of git://git.kernel.dk/linux-block:
        block: make auto block plug flush threshold per-disk based
        Documentation: Add sysfs ABI change for cfq's target latency.
        block: Make cfq_target_latency tunable through sysfs.
        block: use lockdep_assert_held for queue locking
        block: blk_alloc_queue_node(): use caller's GFP flags instead of GFP_KERNEL
      d8dd0b6d
    • Kevin Hilman's avatar
      cpufreq: OMAP: fix build errors: depends on ARCH_OMAP2PLUS · 2d59dcfb
      Kevin Hilman authored
      The OMAP driver needs a 'depends on ARCH_OMAP2PLUS' since it only
      builds for OMAP2+ platforms.
      
      This 'depends on' was in the original patch from Russell King, but was
      erroneously removed by me when making this option user-selectable in
      commit b09db45c
      
       (cpufreq: OMAP driver depends CPUfreq tables.)  This
      patch remedies that.
      
      Apologies to Russell King for breaking his originally working patch.
      
      Also, thanks to Grazvydas Ignotas for reporting the same problem.
      
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Grazvydas Ignotas <notasas@gmail.com>
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2d59dcfb
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · 7d93101f
      Linus Torvalds authored
      Pull sparc fixes from David Miller.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc64: Eliminate obsolete __handle_softirq() function
        sparc64: Fix bootup crash on sun4v.
      7d93101f
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging · 6e117339
      Linus Torvalds authored
      Pull hwmon patches from Guenter Roeck:
       "Fix build warnings in four drivers"
      
      * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (pmbus_core) Fix compiler warning
        hwmon: (smsc47m1) Fix compiler warning
        hwmon: (acpi_power_meter) Fix compiler warning seen in some configurations
        hwmon: (smsc47b397) Fix compiler warning
      6e117339
    • Linus Torvalds's avatar
      Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6 · 461c1491
      Linus Torvalds authored
      Pull GPIO bug fixes from Grant Likely:
       "Miscellaneous bug fixes to GPIO drivers and for a corner case in the
        gpio device tree parsing code."
      
      * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6:
        gpio/exynos: Fix compiler warning in gpio-samsung.c file
        gpio: Fix range check in of_gpio_simple_xlate()
        gpio: Fix uninitialized variable bit in adp5588_irq_handler
        gpio/sodaville: Convert sodaville driver to new irqdomain API
      461c1491
    • Linus Torvalds's avatar
      Merge tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6 · cf7d8a55
      Linus Torvalds authored
      Pull SPI bug fixes from Grant Likely:
       "Miscellaneous driver bug fixes.  No major changes in this branch."
      
      * tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6:
        spi/imx: prevent NULL pointer dereference in spi_imx_probe()
        spi/imx: mark base member in spi_imx_data as __iomem
        spi/mpc83xx: fix NULL pdata dereference bug
        spi/davinci: Fix DMA API usage in davinci
        spi/pL022: include types.h to remove compilation warnings
      cf7d8a55
    • Paul E. McKenney's avatar
      sparc64: Eliminate obsolete __handle_softirq() function · 3d3eeb2e
      Paul E. McKenney authored
      
      
      The invocation of softirq is now handled by irq_exit(), so there is no
      need for sparc64 to invoke it on the trap-return path.  In fact, doing so
      is a bug because if the trap occurred in the idle loop, this invocation
      can result in lockdep-RCU failures.  The problem is that RCU ignores idle
      CPUs, and the sparc64 trap-return path to the softirq handlers fails to
      tell RCU that the CPU must be considered non-idle while those handlers
      are executing.  This means that RCU is ignoring any RCU read-side critical
      sections in those handlers, which in turn means that RCU-protected data
      can be yanked out from under those read-side critical sections.
      
      The shiny new lockdep-RCU ability to detect RCU read-side critical sections
      that RCU is ignoring located this problem.
      
      The fix is straightforward: Make sparc64 stop manually invoking the
      softirq handlers.
      
      Reported-by: default avatarMeelis Roos <mroos@linux.ee>
      Suggested-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Tested-by: default avatarMeelis Roos <mroos@linux.ee>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d3eeb2e
    • David S. Miller's avatar
      sparc64: Fix bootup crash on sun4v. · 9e0daff3
      David S. Miller authored
      
      
      The DS driver registers as a subsys_initcall() but this can be too
      early, in particular this risks registering before we've had a chance
      to allocate and setup module_kset in kernel/params.c which is
      performed also as a subsyts_initcall().
      
      Register DS using device_initcall() insteal.
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Cc: stable@vger.kernel.org
      9e0daff3
  10. Apr 13, 2012