1. 07 May, 2012 7 commits
    • Konrad Rzeszutek Wilk's avatar
      xen/smp: Fix crash when booting with ACPI hotplug CPUs. · 5b094710
      Konrad Rzeszutek Wilk authored
      commit cf405ae6 upstream.
      
      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.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5b094710
    • David Vrabel's avatar
      xen: correctly check for pending events when restoring irq flags · aa4a6ac6
      David Vrabel authored
      commit 7eb7ce4d upstream.
      
      In xen_restore_fl_direct(), xen_force_evtchn_callback() was being
      called even if no events were pending.  This resulted in (depending on
      workload) about a 100 times as many xen_version hypercalls as
      necessary.
      
      Fix this by correcting the sense of the conditional jump.
      
      This seems to give a significant performance benefit for some
      workloads.
      
      There is some subtle tricksy "..since the check here is trying to
      check both pending and masked in a single cmpw, but I think this is
      correct. It will call check_events now only when the combined
      mask+pending word is 0x0001 (aka unmasked, pending)." (Ian)
      Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aa4a6ac6
    • Linus Torvalds's avatar
      Revert "autofs: work around unhappy compat problem on x86-64" · d25895e8
      Linus Torvalds authored
      commit fcbf94b9 upstream.
      
      This reverts commit a32744d4.
      
      While that commit was technically the right thing to do, and made the
      x86-64 compat mode work identically to native 32-bit mode (and thus
      fixing the problem with a 32-bit systemd install on a 64-bit kernel), it
      turns out that the automount binaries had workarounds for this compat
      problem.
      
      Now, the workarounds are disgusting: doing an "uname()" to find out the
      architecture of the kernel, and then comparing it for the 64-bit cases
      and fixing up the size of the read() in automount for those.  And they
      were confused: it's not actually a generic 64-bit issue at all, it's
      very much tied to just x86-64, which has different alignment for an
      'u64' in 64-bit mode than in 32-bit mode.
      
      But the end result is that fixing the compat layer actually breaks the
      case of a 32-bit automount on a x86-64 kernel.
      
      There are various approaches to fix this (including just doing a
      "strcmp()" on current->comm and comparing it to "automount"), but I
      think that I will do the one that teaches pipes about a special "packet
      mode", which will allow user space to not have to care too deeply about
      the padding at the end of the autofs packet.
      
      That change will make the compat workaround unnecessary, so let's revert
      it first, and get automount working again in compat mode.  The
      packetized pipes will then fix autofs for systemd.
      Reported-and-requested-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
      Cc: Ian Kent <raven@themaw.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d25895e8
    • Bryan O'Donoghue's avatar
      x86, apic: APIC code touches invalid MSR on P5 class machines · 322fd620
      Bryan O'Donoghue authored
      commit cbf2829b upstream.
      
      Current APIC code assumes MSR_IA32_APICBASE is present for all systems.
      Pentium Classic P5 and friends didn't have this MSR. MSR_IA32_APICBASE
      was introduced as an architectural MSR by Intel @ P6.
      
      Code paths that can touch this MSR invalidly are when vendor == Intel &&
      cpu-family == 5 and APIC bit is set in CPUID - or when you simply pass
      lapic on the kernel command line, on a P5.
      
      The below patch stops Linux incorrectly interfering with the
      MSR_IA32_APICBASE for P5 class machines. Other code paths exist that
      touch the MSR - however those paths are not currently reachable for a
      conformant P5.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linux.intel.com>
      Link: http://lkml.kernel.org/r/4F8EEDD3.1080404@linux.intel.comSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      322fd620
    • Trond Myklebust's avatar
      NFSv4: Ensure that we check lock exclusive/shared type against open modes · 95cb2c60
      Trond Myklebust authored
      commit 55725513 upstream.
      
      Since we may be simulating flock() locks using NFS byte range locks,
      we can't rely on the VFS having checked the file open mode for us.
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      95cb2c60
    • Trond Myklebust's avatar
      NFSv4: Ensure that the LOCK code sets exception->inode · 03a9f194
      Trond Myklebust authored
      commit 05ffe24f upstream.
      
      All callers of nfs4_handle_exception() that need to handle
      NFS4ERR_OPENMODE correctly should set exception->inode
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      03a9f194
    • Jan Kara's avatar
      nfs: Enclose hostname in brackets when needed in nfs_do_root_mount · cb2fee32
      Jan Kara authored
      commit 98a2139f upstream.
      
      When hostname contains colon (e.g. when it is an IPv6 address) it needs
      to be enclosed in brackets to make parsing of NFS device string possible.
      Fix nfs_do_root_mount() to enclose hostname properly when needed. NFS code
      actually does not need this as it does not parse the string passed by
      nfs_do_root_mount() but the device string is exposed to userspace in
      /proc/mounts.
      
      CC: Josh Boyer <jwboyer@redhat.com>
      CC: Trond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cb2fee32
  2. 27 Apr, 2012 33 commits