]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
13 years agoFix ndlp nodelist not empty wait timeout during driver unloading (CR 127052)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:25 +0000 (17:01 -0500)]
Fix ndlp nodelist not empty wait timeout during driver unloading (CR 127052)

In lpfc_set_rrq_active the code allocates an RRQ while lock are held. The
driver either need to make this allocation ATOMIC or remove the allocation from
the lock. We choose to remove the locked version of lpfc_set_rrq_active since
there were no users of this function. Then rearrange the code so that the
allocation does not occur while the lock is held.

commit id: eff4a01b6e9f8cee3c541ab7f2ad18b5bbffd124

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix mailbox and vpi memory leaks (CR 126818)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:25 +0000 (17:01 -0500)]
Fix mailbox and vpi memory leaks (CR 126818)

The driver could hang or crash do to lack of memory. These memory leaks were
fixed.

commit id: 728599090a9bf3aefb1226cc063295886525cd0e

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix management communication issues by creating character device to take a reference...
Vaios Papadimitriou [Tue, 8 May 2012 22:01:25 +0000 (17:01 -0500)]
Fix management communication issues by creating character device to take a reference on the driver (CR 126082)

The management userspace applications have no way to take a lock on the driver
to prevent it from unloading. To remedy this a character device is created that
will up the reference count on lpfc by one when it is opened and decrement it by
one when it is closed.

commit id: 3ef6d24cd9f473518dd7941e86cc2a5f8992eed0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix for FDISC failures after firmware reset or link bounce (CR 126779)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:25 +0000 (17:01 -0500)]
Fix for FDISC failures after firmware reset or link bounce (CR 126779)

The driver failed to discover target on vports after a link bounce. This is a
regression on SLI4 adapters where the SID in the FDISC was set to a non-zero
value. There is no use case for a non-zero SID in the FDISC. Thefix is to clear
fc_myDID to guarentee a zero SID

commit id: 6b5151fd7baec6812fece993ddd7a2cf9fd0125f

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix for driver using duplicate RPIs after LPe16000 port reset (CR 126723)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:25 +0000 (17:01 -0500)]
Fix for driver using duplicate RPIs after LPe16000 port reset (CR 126723)

The RPI bit map is reinitiatized in the adapter port 'online' path. SLI4 RPI are
designed to be 'long lived', so when the adapter port is taken offline, the
driver will reuse the RPI if the port is recovered within devloss tmo.
These stale RPI values can collide when new RPIs are allocated. We now free RPIs
on all active nodes and then allocate new RPIs

commit id: 6b5151fd7baec6812fece993ddd7a2cf9fd0125f

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix discovery problem when in pt2pt (CR 126887)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:25 +0000 (17:01 -0500)]
Fix discovery problem when in pt2pt (CR 126887)

When a target is direct connected in pt2pt topology it is not discovered by the
driver. The confirm nport routine is called during plogi completion. It will
look up the ndlp using the service parameter wwpn in the target response. If the
ndlp that is returned in the lookup does not match the ndlp that the plogi was
sent with confirm_nport updates the new ndlp with old ndlp's information.
Confirm nport has to make sure that only one ndlp with that wwpn is active
before returning so it sets the old ndlp's state to NPR. It set the state
before it copied the state to the new ndlp so both ndlp's end up in NPR. When
the plogi completion routine calls the state machine with the plogi complete
event and the ndlp in NPR the ndlp'd state stays in NPR. The state machine is
stopped for this ndlp. Because it was the only target discovery is completed.
The old ndlp state is now copied to the new ndlp before setting the old one to
NPR

commit id: eff4a01b6e9f8cee3c541ab7f2ad18b5bbffd124

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFixed failure in handling large CQ/EQ identifiers in an IOV environment (CR 126856)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:24 +0000 (17:01 -0500)]
Fixed failure in handling large CQ/EQ identifiers in an IOV environment (CR 126856)

In an SR-IOV environment, when creating virtual functions, the driver failed to
issue INIT_LINK mailbox commands properly when attaching to the virtual
functions. The driver will now write into CQ/EQ doorbell registers by taking
both the lower and the possible higher bit CQ/EQ identifier fields into
consideration to comply for with the spec for handling INIT_LINK mailbox
commands.

commit id: 6b5151fd7baec6812fece993ddd7a2cf9fd0125f

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix Locking code raising IRQ twice
Vaios Papadimitriou [Tue, 8 May 2012 22:01:24 +0000 (17:01 -0500)]
Fix Locking code raising IRQ twice

Remove the irq part of the locking and unlocking calls, this could have caused
a deadlock because the cpu could have interrupted this thread while the hbalock
was still held.

commit id: 728599090a9bf3aefb1226cc063295886525cd0e

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix driver not returning when bad ndlp found in abts error event handling (CR 126209)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:24 +0000 (17:01 -0500)]
Fix driver not returning when bad ndlp found in abts error event handling (CR 126209)

The abts should not be processed when whne a bad ndlp is found. The function
now returns properly rather then continuing.

commit id: 6b5151fd7baec6812fece993ddd7a2cf9fd0125f

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix bug with driver returning the wrong ndlp (CR 125743)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:24 +0000 (17:01 -0500)]
Fix bug with driver returning the wrong ndlp (CR 125743)

When searching for a matching rpi the driver was not checking the active state
of the ndlp. A check was added to see if the nldp is active.

commit id: eff4a01b6e9f8cee3c541ab7f2ad18b5bbffd124

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix driver behavior when receiving an ADISC (CR 126654)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:24 +0000 (17:01 -0500)]
Fix driver behavior when receiving an ADISC (CR 126654)

ADISC gets ACC'ed if RPI is not present. RESUME_RPI does not get envoked when
receiving ADISC.

commit id: 6b5151fd7baec6812fece993ddd7a2cf9fd0125f

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix bug with driver processing dump command type 4 using 16Gb FC Adapter (CR 126406)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:24 +0000 (17:01 -0500)]
Fix bug with driver processing dump command type 4 using 16Gb FC Adapter (CR 126406)

Dump Mbox commands fail to LPe16000 adapter, these commands were not recognized
by the driver, they are now allowed to pass through.

commit id: 3ef6d24cd9f473518dd7941e86cc2a5f8992eed0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix driver does not reset port when reset is needed during fw_dump (CR 125807)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:23 +0000 (17:01 -0500)]
Fix driver does not reset port when reset is needed during fw_dump (CR 125807)

A port error was detacted during rest, this is because the driver was not
looking for a RN flag in the status reg. Now only fail the reset if ERR bit is
set and the reset needed flag is not.

commit id: 6b5151fd7baec6812fece993ddd7a2cf9fd0125f

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix ELS FDISC failing with local reject / invalid RPI (CR 126350)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:23 +0000 (17:01 -0500)]
Fix ELS FDISC failing with local reject / invalid RPI (CR 126350)

No FDISC seen on the wire when running with SLI4, the ELS command fails with
local reject / invalid RPI. Now allow the FDISC ELS command to use the
temporary RPI and the Destination DID for SLI4-FC.

commit id: 6b5151fd7baec6812fece993ddd7a2cf9fd0125f

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix SLI4 FC port internal loopback (CR 126409)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:23 +0000 (17:01 -0500)]
Fix SLI4 FC port internal loopback (CR 126409)

LPe16000s could fail internal loopback tests do to an issue with the serdes.
The loopback was properly changed to use internal rather then serdes internal.

commit id: 3ef6d24cd9f473518dd7941e86cc2a5f8992eed0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix REG_RPI fails on SLI4 HBA putting NPort into NPR state (CR 126230)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:23 +0000 (17:01 -0500)]
Fix REG_RPI fails on SLI4 HBA putting NPort into NPR state (CR 126230)

When we receive a PLOGI, the ndlp unexpectedly goes into the NPR state.
This is because the ndlp was not properly being unregistered.

commit id: 6b5151fd7baec6812fece993ddd7a2cf9fd0125f

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix bug with driver processing an els command using 16Gb FC Adapter (CR 126345)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:23 +0000 (17:01 -0500)]
Fix bug with driver processing an els command using 16Gb FC Adapter (CR 126345)

ELS echo fails on an LPe16000 adapter because the driver was not setting up
the ulpContext correctly. The ulpContext is now properly set from the rpi_ids
table for SLI4 devices.

commit id: 3ef6d24cd9f473518dd7941e86cc2a5f8992eed0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix NMI seen due to CQE starvation (CR 126149)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:23 +0000 (17:01 -0500)]
Fix NMI seen due to CQE starvation (CR 126149)

CQEs had to be upped in order to prevent NMI being issued. The firmware was
running of CQEs

commit id: ff78d8f97c85a568c0799b06137a4171db45b923

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFixed SLI4 FC port obtained link type and number dependent on link connection (CR...
Vaios Papadimitriou [Tue, 8 May 2012 22:01:22 +0000 (17:01 -0500)]
Fixed SLI4 FC port obtained link type and number dependent on link connection (CR 126264)

There are places in the driver diagnostic code space, which picked up
SLI4 FC port link type and number depend on link connection from asynchronous
link event. In those cases, instead of using the link type and link number
obtainedfrom the asynchronous link event, used the link type and link number
obtained from the READ_CONFIG mailbox command from SLI4 setup routine , which
will not depend on an external link or loopback plug present.

commit id: 1b51197d0fd0c06877c6df1bba84ac4008a7fc60

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFixed SLI4 FC port internal loopback without SFP and external link/loopback plug...
Vaios Papadimitriou [Tue, 8 May 2012 22:01:22 +0000 (17:01 -0500)]
Fixed SLI4 FC port internal loopback without SFP and external link/loopback plug (CR 125843)

When performing internal loopback diagnostic test on LPe16000 port without SFP
present or without external link/loopback plug plugged in, internal loopback on
port1 failed. Instead of using the link type and link number obtained reported
from the asynchronous link event, used the link type and link number obtained
from the READ_CONFIG mailbox command from SLI4 setup routine , which will not
depend on an external link or loopback plug present.

commit id: 1b51197d0fd0c06877c6df1bba84ac4008a7fc60

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoFix driver incorrectly building fcpCdb during scsi command prep (CR 126209)
Vaios Papadimitriou [Tue, 8 May 2012 22:01:22 +0000 (17:01 -0500)]
Fix driver incorrectly building fcpCdb during scsi command prep (CR 126209)

Some scsi inquiry commands were failing with sense key 0x5 and ASC/ASCQ values
of 24/00. At times, this failure cause retries over several hours because the
driver was returning DID_BUS_BUSY. These retries and failures were clogging up
the console logs. Now, always initialize the fcpCdb to 0 during
lpfc_scsi_prep_cmnd. After the memset, only copy scsi_cmnd->cmd_len bytes into
the fcpCdb.

commit id: df9e1b59f9e4671930a7762b9518461df4ea85f5

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoSPEC: v2.6.39-200.6.0
Maxim Uvarov [Fri, 4 May 2012 22:55:45 +0000 (15:55 -0700)]
SPEC: v2.6.39-200.6.0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years ago[USB] cdc-acm: Increase number of devices to 64
Joe Jin [Fri, 4 May 2012 22:52:06 +0000 (15:52 -0700)]
[USB] cdc-acm: Increase number of devices to 64

Orabug: 13693812
Increase usb acm devices to 64.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agogit-changelog: generate date entry
Maxim Uvarov [Fri, 4 May 2012 22:30:10 +0000 (15:30 -0700)]
git-changelog: generate date entry

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years ago[scsi] hpsa: Remove some PCI IDs if for OL5.
Joe Jin [Fri, 4 May 2012 02:05:37 +0000 (10:05 +0800)]
[scsi] hpsa: Remove some PCI IDs if for OL5.

Remove some PCI IDs if for OL5.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[block] cciss: fix incorrect PCI IDs and add two new ones
Joe Jin [Fri, 4 May 2012 01:19:53 +0000 (09:19 +0800)]
[block] cciss: fix incorrect PCI IDs and add two new ones

This patch backport from https://lkml.org/lkml/2011/3/4/207
commit d241b7cbd5b05c591aff96c5f1f0b7d616fdc0c3
Author: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Date:   Fri Mar 4 21:45:14 2011 -0600

    hpsa: fix some incorrect PCI IDs and add a couple of new ones.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[scsi] hpsa: add some older controllers to the kdump blacklist
Joe Jin [Fri, 4 May 2012 01:01:07 +0000 (09:01 +0800)]
[scsi] hpsa: add some older controllers to the kdump blacklist

This backport from RHEL6U3.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[block] cciss: Add IRQF_SHARED back in for the non-MSI(X) interrupt handler
Joe Jin [Fri, 4 May 2012 00:57:51 +0000 (08:57 +0800)]
[block] cciss: Add IRQF_SHARED back in for the non-MSI(X) interrupt handler

This backport from RHEL6U3.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[block] cciss: add some older controllers to the kdump blacklist
Joe Jin [Fri, 4 May 2012 00:55:34 +0000 (08:55 +0800)]
[block] cciss: add some older controllers to the kdump blacklist

This backport from RHEL6U3.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agoSPEC: v2.6.39-200.5.0
Maxim Uvarov [Tue, 1 May 2012 22:38:39 +0000 (15:38 -0700)]
SPEC: v2.6.39-200.5.0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agobe2net: query link status in be_open()
Sarveshwar Bandi [Sun, 19 Feb 2012 22:53:28 +0000 (04:23 +0530)]
be2net: query link status in be_open()

be2net gets an async link status notification from the FW when it creates
an MCC queue. There are some cases in which this gratuitous notification
is not received from FW. To cover this explicitly query the link status
in be_open().

Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
13 years agoSPEC: v2.6.39-200.4.0
Maxim Uvarov [Wed, 25 Apr 2012 23:48:01 +0000 (16:48 -0700)]
SPEC: v2.6.39-200.4.0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoMerge branch 'uek2-merge' of git://ca-git.us.oracle.com/linux-konrad-public into...
Maxim Uvarov [Wed, 25 Apr 2012 23:45:23 +0000 (16:45 -0700)]
Merge branch 'uek2-merge' of git://ca-git.us.oracle.com/linux-konrad-public into uek-2.6.39-200

13 years agoSPEC: v2.6.39-200.3.0
Maxim Uvarov [Wed, 25 Apr 2012 19:44:44 +0000 (12:44 -0700)]
SPEC: v2.6.39-200.3.0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoMerge branch 'loop' of git://ca-git.us.oracle.com/linux-dkleikam-public into uek...
Maxim Uvarov [Wed, 25 Apr 2012 19:22:04 +0000 (12:22 -0700)]
Merge branch 'loop' of git://ca-git.us.oracle.com/linux-dkleikam-public into uek-2.6.39-200

13 years agoloop: loop_thread needs to set the PF_LESS_THROTTLE flag
Dave Kleikamp [Tue, 24 Apr 2012 22:43:47 +0000 (17:43 -0500)]
loop: loop_thread needs to set the PF_LESS_THROTTLE flag

The underlying file system may call balance_dirty_pages. We don't want
it to throttle there since we may be in the process of writing dirty
pages. This patch addresses the problem in the same manner as a local
nfs mount, as nfsd does the same.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
13 years agoMerge branch 'stable/for-linus-3.4.rebased' into uek2-merge
Konrad Rzeszutek Wilk [Fri, 20 Apr 2012 16:36:15 +0000 (12:36 -0400)]
Merge branch 'stable/for-linus-3.4.rebased' into uek2-merge

* stable/for-linus-3.4.rebased:
  Revert "xen/p2m: m2p_find_override: use list_for_each_entry_safe"

13 years agoRevert "xen/p2m: m2p_find_override: use list_for_each_entry_safe"
Konrad Rzeszutek Wilk [Fri, 20 Apr 2012 16:03:32 +0000 (12:03 -0400)]
Revert "xen/p2m: m2p_find_override: use list_for_each_entry_safe"

This reverts commit f977bf653bafd05c48e8db3f789da5e8c3006df1.

[upstream git commit 3d81acb1cdb242378a1acb3eb1bc28c6bb5895f1]

13 years agoiov_iter: missing assignment of ii_bvec_ops.ii_shorten
Dave Kleikamp [Fri, 20 Apr 2012 15:45:22 +0000 (10:45 -0500)]
iov_iter: missing assignment of ii_bvec_ops.ii_shorten

This seems to have been an oversight when porting the patches. This
function should never be called, but it should be defined just in case.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
13 years agoSPEC: v2.6.39-200.2.0
Maxim Uvarov [Thu, 19 Apr 2012 22:43:06 +0000 (15:43 -0700)]
SPEC: v2.6.39-200.2.0

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoregset: Return -EFAULT, not -EIO, on host-side memory fault
H. Peter Anvin [Fri, 2 Mar 2012 18:43:49 +0000 (10:43 -0800)]
regset: Return -EFAULT, not -EIO, on host-side memory fault

There is only one error code to return for a bad user-space buffer
pointer passed to a system call in the same address space as the
system call is executed, and that is EFAULT.  Furthermore, the
low-level access routines, which catch most of the faults, return
EFAULT already.
This fixes: CVE-2012-1097

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Roland McGrath <roland@hack.frob.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoregset: Prevent null pointer reference on readonly regsets
H. Peter Anvin [Fri, 2 Mar 2012 18:43:48 +0000 (10:43 -0800)]
regset: Prevent null pointer reference on readonly regsets

The regset common infrastructure assumed that regsets would always
have .get and .set methods, but not necessarily .active methods.
Unfortunately people have since written regsets without .set methods.

Rather than putting in stub functions everywhere, handle regsets with
null .get or .set methods explicitly.
This fixes: CVE-2012-1097

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Roland McGrath <roland@hack.frob.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agocifs: fix dentry refcount leak when opening a FIFO on lookup
Jeff Layton [Thu, 23 Feb 2012 14:37:45 +0000 (09:37 -0500)]
cifs: fix dentry refcount leak when opening a FIFO on lookup

commit 5bccda0ebc7c0331b81ac47d39e4b920b198b2cd upstream.

The cifs code will attempt to open files on lookup under certain
circumstances. What happens though if we find that the file we opened
was actually a FIFO or other special file?

Currently, the open filehandle just ends up being leaked leading to
a dentry refcount mismatch and oops on umount. Fix this by having the
code close the filehandle on the server if it turns out not to be a
regular file. While we're at it, change this spaghetti if statement
into a switch too.
This fixes: CVE-2012-1090

Reported-by: CAI Qian <caiqian@redhat.com>
Tested-by: CAI Qian <caiqian@redhat.com>
Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 years agogit-changelog: add brackets around cve
Maxim Uvarov [Wed, 18 Apr 2012 22:52:57 +0000 (15:52 -0700)]
git-changelog: add brackets around cve

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoMerge branch 'stable/for-linus-3.4.rebased' into uek2-merge
Konrad Rzeszutek Wilk [Thu, 19 Apr 2012 21:54:38 +0000 (17:54 -0400)]
Merge branch 'stable/for-linus-3.4.rebased' into uek2-merge

* stable/for-linus-3.4.rebased: (29 commits)
  xen/blkback: Fix warning error.
  xen/blkback: Make optional features be really optional.
  xen-blkfront: module exit handling adjustments
  xen-blkfront: properly name all devices
  xen-blkfront: set pages are FOREIGN_FRAME when sharing them
  xen: EXPORT_SYMBOL set_phys_to_machine
  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
  xen/p2m: m2p_find_override: use list_for_each_entry_safe
  xen/gntdev: do not set VM_PFNMAP
  xen/grant-table: add error-handling code on failure of gnttab_resume
  xen: only check xen_platform_pci_unplug if hvm
  xen: initialize platform-pci even if xen_emul_unplug=never
  xen kconfig: relax INPUT_XEN_KBDDEV_FRONTEND deps
  xen: support pirq_eoi_map
  xen/smp: Remove unnecessary call to smp_processor_id()
  xen/smp: Fix bringup bug in AP code.
  ...

13 years agoxen/blkback: Fix warning error.
Konrad Rzeszutek Wilk [Tue, 17 Apr 2012 01:55:04 +0000 (21:55 -0400)]
xen/blkback: Fix warning error.

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.

[upstream git commit a71e23d]
Acked-by: Jens Axboe <axboe@kernel.dk>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Conflicts:

drivers/block/xen-blkback/xenbus.c

13 years agoxen/blkback: Make optional features be really optional.
Konrad Rzeszutek Wilk [Wed, 14 Mar 2012 17:04:00 +0000 (13:04 -0400)]
xen/blkback: Make optional features be really optional.

They were using the xenbus_dev_fatal() function which would
change the state of the connection immediately. Which is not
what we want when we advertise optional features.

So make 'feature-discard','feature-barrier','feature-flush-cache'
optional.

[upstream git commit 3389bb8]
Suggested-by: Jan Beulich <JBeulich@suse.com>
[v1: Made the discard function void and static]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Conflicts:

drivers/block/xen-blkback/xenbus.c

13 years agoMerge branch 'stable/xen-network-3.3.rebase' into uek2-merge
Konrad Rzeszutek Wilk [Thu, 19 Apr 2012 21:39:20 +0000 (17:39 -0400)]
Merge branch 'stable/xen-network-3.3.rebase' into uek2-merge

* stable/xen-network-3.3.rebase:
  xen-netback: make ops structs const
  netback: fix typo in comment
  netback: remove redundant assignment
  netback: Fix alert message.
  xen-netback: use correct index for invalidation in xen_netbk_tx_check_gop()
  net: xen-netback: correctly restart Tx after a VM restore/migrate
  xen/netback: Add module alias for autoloading

13 years agoxen-blkfront: module exit handling adjustments
Jan Beulich [Thu, 5 Apr 2012 15:04:52 +0000 (16:04 +0100)]
xen-blkfront: module exit handling adjustments

The blkdev major must be released upon exit, or else the module can't
attach to devices using the same majors upon being loaded again. Also
avoid leaking the minor tracking bitmap.

[upstream git commit 4e55b3c]
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen-blkfront: properly name all devices
Jan Beulich [Thu, 5 Apr 2012 15:37:22 +0000 (16:37 +0100)]
xen-blkfront: properly name all devices

- devices beyond xvdzz didn't get proper names assigned at all
- extended devices with minors not representable within the kernel's
  major/minor bit split spilled into foreign majors

[upstream git commit 85b6984]
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen-blkfront: set pages are FOREIGN_FRAME when sharing them
Stefano Stabellini [Tue, 10 Apr 2012 16:25:19 +0000 (17:25 +0100)]
xen-blkfront: set pages are FOREIGN_FRAME when sharing them

Set pages as FOREIGN_FRAME whenever blkfront shares them with another
domain. Then when blkfront un-share them, also removes the
FOREIGN_FRAME_BIT from the p2m.

We do it so that when the source and the destination domain are the same
(blkfront connected to a disk backend in the same domain) we can more easily
recognize which ones are the source pfns and which ones are the
destination pfns (both are going to be pointing to the same mfns).

Without this patch enstablishing a connection between blkfront and QEMU
qdisk in the same domain causes QEMU to hang and never return.

The scenario where this used is when a disk image in QCOW2 is used
for extracting the kernel and initrd image. The QCOW2 image file cannot
be loopback-ed and to run 'pygrub', the weird scaffolding of:
 - setup QEMU and qdisk with the qcow2 image [disk backend]
 - setup xen-blkfront mounting said disk backend in the domain.
 - extract kernel and initrd
 - tear it down.

The MFNs shared shared by the frontend are going to back two
different sets of PFNs: the original PFNs allocated by the frontend and
the new ones allocated by gntdev for the backend.

The problem is that when Linux calls mfn_to_pfn, passing as argument
one of the MFN shared by the frontend, we want to get the PFN returned by
m2p_find_override_pfn (that is the PFN setup by gntdev) but actually we
get the original PFN allocated by the frontend because considering that
the frontend and the backend are in the same domain:

pfn = machine_to_phys_mapping[mfn];
mfn2 = get_phys_to_machine(pfn);

in this case mfn == mfn2.

One possible solution would be to always call m2p_find_override_pfn to
check out whether we have an entry for a given MFN. However it is not
very efficient or scalable.

The other option (that this patch is implementing) is to mark the pages
shared by the frontend as "foreign", so that mfn != mfn2.

It makes sense because from the frontend point of view they are donated
to the backend and while so they are not supposed to be used by the
frontend. In a way, they don't belong to the frontend anymore, at least
temporarily.

[upstream git commit 6a2c6177]
[v3: only set_phys_to_machine if xen_pv_domain]
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[v1: Redid description a bit]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen: EXPORT_SYMBOL set_phys_to_machine
Stefano Stabellini [Thu, 29 Mar 2012 17:20:39 +0000 (18:20 +0100)]
xen: EXPORT_SYMBOL set_phys_to_machine

[upstream git commit 134c1d7]
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen-blkfront: make blkif_io_lock spinlock per-device
Steven Noonan [Fri, 17 Feb 2012 20:04:44 +0000 (12:04 -0800)]
xen-blkfront: make blkif_io_lock spinlock per-device

This patch moves the global blkif_io_lock to the per-device structure. The
spinlock seems to exists for two reasons: to disable IRQs when in the interrupt
handlers for blkfront, and to protect the blkfront VBDs when a detachment is
requested.

Having a global blkif_io_lock doesn't make sense given the use case, and it
drastically hinders performance due to contention. All VBDs with pending IOs
have to take the lock in order to get work done, which serializes everything
pretty badly.

[upstream git commit 3467811]
Signed-off-by: Steven Noonan <snoonan@amazon.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/blkfront: don't put bdev right after getting it
Andrew Jones [Thu, 16 Feb 2012 12:16:25 +0000 (13:16 +0100)]
xen/blkfront: don't put bdev right after getting it

We should hang onto bdev until we're done with it.

[upstream git commit dad5cf6]
Signed-off-by: Andrew Jones <drjones@redhat.com>
[v1: Fixed up git commit description]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen-blkfront: use bitmap_set() and bitmap_clear()
Akinobu Mita [Fri, 20 Jan 2012 15:15:26 +0000 (00:15 +0900)]
xen-blkfront: use bitmap_set() and bitmap_clear()

Use bitmap_set and bitmap_clear rather than modifying individual bits
in a memory region.

[upstream git commit 34ae2e4]
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xensource.com
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/blkback: Enable blkback on HVM guests
Daniel De Graaf [Mon, 28 Nov 2011 16:49:05 +0000 (11:49 -0500)]
xen/blkback: Enable blkback on HVM guests

[upstream git commit b2167ba]
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/blkback: use grant-table.c hypercall wrappers
Daniel De Graaf [Mon, 28 Nov 2011 16:49:03 +0000 (11:49 -0500)]
xen/blkback: use grant-table.c hypercall wrappers

[upstream git commit  4f14faa]
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/p2m: m2p_find_override: use list_for_each_entry_safe
Stefano Stabellini [Tue, 27 Mar 2012 13:52:44 +0000 (14:52 +0100)]
xen/p2m: m2p_find_override: use list_for_each_entry_safe

Use list_for_each_entry_safe and remove the spin_lock acquisition in
m2p_find_override.

[upstream git commit 8f2854c]
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/gntdev: do not set VM_PFNMAP
Stefano Stabellini [Tue, 3 Apr 2012 17:05:47 +0000 (18:05 +0100)]
xen/gntdev: do not set VM_PFNMAP

Since we are using the m2p_override we do have struct pages
corresponding to the user vma mmap'ed by gntdev.

Removing the VM_PFNMAP flag makes get_user_pages work on that vma.
An example test case would be using a Xen userspace block backend
(QDISK) on a file on NFS using O_DIRECT.

[upstream git commit df7219f]
CC: stable@kernel.org
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/grant-table: add error-handling code on failure of gnttab_resume
Julia Lawall [Sun, 15 Apr 2012 09:27:12 +0000 (11:27 +0200)]
xen/grant-table: add error-handling code on failure of gnttab_resume

Jump to the label ini_nomem as done on the failure of the page allocations
above.

The code at ini_nomem is modified to accommodate different return values.

[upstream git commit 6b5e7d9]
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen: only check xen_platform_pci_unplug if hvm
Igor Mammedov [Tue, 27 Mar 2012 17:31:08 +0000 (19:31 +0200)]
xen: only check xen_platform_pci_unplug if hvm

commit b9136d207f08
  xen: initialize platform-pci even if xen_emul_unplug=never

breaks blkfront/netfront by not loading them because of
xen_platform_pci_unplug=0 and it is never set for PV guest.

[upstream git commit e95ae5a]
Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen: initialize platform-pci even if xen_emul_unplug=never
Igor Mammedov [Wed, 21 Mar 2012 14:08:38 +0000 (15:08 +0100)]
xen: initialize platform-pci even if xen_emul_unplug=never

When xen_emul_unplug=never is specified on kernel command line
reading files from /sys/hypervisor is broken (returns -EBUSY).
It is caused by xen_bus dependency on platform-pci and
platform-pci isn't initialized when xen_emul_unplug=never is
specified.

Fix it by allowing platform-pci to ignore xen_emul_unplug=never,
and do not intialize xen_[blk|net]front instead.

[upstream git commit b9136d2]
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen kconfig: relax INPUT_XEN_KBDDEV_FRONTEND deps
Andrew Jones [Fri, 6 Jan 2012 09:43:09 +0000 (10:43 +0100)]
xen kconfig: relax INPUT_XEN_KBDDEV_FRONTEND deps

PV-on-HVM guests may want to use the xen keyboard/mouse frontend, but
they don't use the xen frame buffer frontend. For this case it doesn't
make much sense for INPUT_XEN_KBDDEV_FRONTEND to depend on
XEN_FBDEV_FRONTEND. The opposite direction always makes more sense, i.e.
if you're using xenfb, then you'll want xenkbd. Switch the dependencies.

[upstream git commit 4bc25af]
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen: support pirq_eoi_map
Stefano Stabellini [Mon, 30 Jan 2012 16:21:48 +0000 (16:21 +0000)]
xen: support pirq_eoi_map

The pirq_eoi_map is a bitmap offered by Xen to check which pirqs need to
be EOI'd without having to issue an hypercall every time.
We use PHYSDEVOP_pirq_eoi_gmfn_v2 to map the bitmap, then if we
succeed we use pirq_eoi_map to check whether pirqs need eoi.

Changes in v3:

- explicitly use PHYSDEVOP_pirq_eoi_gmfn_v2 rather than
PHYSDEVOP_pirq_eoi_gmfn;

- introduce pirq_check_eoi_map, a function to check if a pirq needs an
eoi using the map;

-rename pirq_needs_eoi into pirq_needs_eoi_flag;

- introduce a function pointer called pirq_needs_eoi that is going to be
set to the right implementation depending on the availability of
PHYSDEVOP_pirq_eoi_gmfn_v2.

[upstream git commit 9846ff1]
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/smp: Remove unnecessary call to smp_processor_id()
Srivatsa S. Bhat [Thu, 22 Mar 2012 12:59:24 +0000 (18:29 +0530)]
xen/smp: Remove unnecessary call to smp_processor_id()

There is an extra and unnecessary call to smp_processor_id()
in cpu_bringup(). Remove it.

[upstream git commit e8c9e78]
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/smp: Fix bringup bug in AP code.
Konrad Rzeszutek Wilk [Wed, 21 Mar 2012 17:03:45 +0000 (13:03 -0400)]
xen/smp: Fix bringup bug in AP code.

The CPU hotplug code has now a callback to help bring up the CPU.
Without the call we end up getting:

 BUG: soft lockup - CPU#0 stuck for 29s! [migration/0:6]
Modules linked in:
CPU ] Pid: 6, comm: migration/0 Not tainted 3.3.0upstream-01180-ged378a5 #1 Dell Inc. PowerEdge T105 /0RR825
RIP: e030:[<ffffffff810d3b8b>]  [<ffffffff810d3b8b>] stop_machine_cpu_stop+0x7b/0xf0
RSP: e02b:ffff8800ceaabdb0  EFLAGS: 00000293
.. snip..
Call Trace:
 [<ffffffff810d3b10>] ? stop_one_cpu_nowait+0x50/0x50
 [<ffffffff810d3841>] cpu_stopper_thread+0xf1/0x1c0
 [<ffffffff815a9776>] ? __schedule+0x3c6/0x760
 [<ffffffff815aa749>] ? _raw_spin_unlock_irqrestore+0x19/0x30
 [<ffffffff810d3750>] ? res_counter_charge+0x150/0x150
 [<ffffffff8108dc76>] kthread+0x96/0xa0
 [<ffffffff815b27e4>] kernel_thread_helper+0x4/0x10
 [<ffffffff815aacbc>] ? retint_restore_ar

Thix fixes it.
[upstream git commit 106b443]
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/tmem: cleanup
Jan Beulich [Fri, 3 Feb 2012 15:09:04 +0000 (15:09 +0000)]
xen/tmem: cleanup

Use 'bool' for boolean variables. Do proper section placement.
Eliminate an unnecessary export.

[upstream git commit 8e6f7c2]
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen: constify all instances of "struct attribute_group"
Jan Beulich [Wed, 14 Mar 2012 16:34:19 +0000 (12:34 -0400)]
xen: constify all instances of "struct attribute_group"

The functions these get passed to have been taking pointers to const
since at least 2.6.16.

[upstream git commit ead1d01]
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/xenbus: ignore console/0
Stefano Stabellini [Tue, 13 Mar 2012 18:30:44 +0000 (18:30 +0000)]
xen/xenbus: ignore console/0

Unfortunately xend creates a bogus console/0 frotend/backend entry pair
on xenstore that console backends cannot properly cope with.
Any guest behavior that is not completely ignoring console/0 is going
to either cause problems with xenconsoled or qemu.
Returning 0 or -ENODEV from xencons_probe is not enough because it is
going to cause the frontend state to become 4 or 6 respectively.
The best possible thing we can do here is just ignore the entry from
xenbus_probe_frontend.

[upstream git commit 42c46e6]
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agohvc_xen: introduce HVC_XEN_FRONTEND
Stefano Stabellini [Tue, 21 Feb 2012 11:30:42 +0000 (11:30 +0000)]
hvc_xen: introduce HVC_XEN_FRONTEND

Introduce a new config option HVC_XEN_FRONTEND to enable/disable the
xenbus based pv console frontend.

[upstream git commit cf8e019]
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agohvc_xen: implement multiconsole support
Stefano Stabellini [Mon, 30 Jan 2012 16:02:31 +0000 (16:02 +0000)]
hvc_xen: implement multiconsole support

This patch implements support for multiple consoles:
consoles other than the first one are setup using the traditional xenbus
and grant-table based mechanism.
We use a list to keep track of the allocated consoles, we don't
expect too many of them anyway.

Changes in v3:

- call hvc_remove before removing the console from xenconsoles;
- do not lock xencons_lock twice in the destruction path;
- use the DEFINE_XENBUS_DRIVER macro.

[upstream git commit 02e19f9]
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agohvc_xen: support PV on HVM consoles
Stefano Stabellini [Fri, 27 Jan 2012 18:31:36 +0000 (18:31 +0000)]
hvc_xen: support PV on HVM consoles

[upstream git commit eb5ef07]
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen: use this_cpu_xxx replace percpu_xxx funcs
Alex Shi [Fri, 13 Jan 2012 15:53:35 +0000 (23:53 +0800)]
xen: use this_cpu_xxx replace percpu_xxx funcs

percpu_xxx funcs are duplicated with this_cpu_xxx funcs, so replace them
for further code clean up.

I don't know much of xen code. But, since the code is in x86 architecture,
the percpu_xxx is exactly same as this_cpu_xxx serials functions. So, the
change is safe.

[upstream git commit 2113f46]
Signed-off-by: Alex Shi <alex.shi@intel.com>
Acked-by: Christoph Lameter <cl@gentwo.org>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxenbus: don't free other end details too early
Jan Beulich [Mon, 5 Mar 2012 17:11:31 +0000 (17:11 +0000)]
xenbus: don't free other end details too early

The individual drivers' remove functions could legitimately attempt to
access this information (for logging messages if nothing else). Note
that I did not in fact observe a problem anywhere, but I came across
this while looking into the reasons for what turned out to need the
fix at https://lkml.org/lkml/2012/3/5/336 to vsprintf().

[upstream git commit bd0d5aa]
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/resume: Fix compile warnings.
Konrad Rzeszutek Wilk [Tue, 17 Apr 2012 18:35:49 +0000 (14:35 -0400)]
xen/resume: Fix compile warnings.

linux/drivers/xen/manage.c: In function 'do_suspend':
linux/drivers/xen/manage.c:160:5: warning: 'si.cancelled' may be used uninitialized in this function

[git upstream commit 186bab1]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Conflicts:

drivers/xen/manage.c

13 years agoxen/xenbus: Add quirk to deal with misconfigured backends.
Konrad Rzeszutek Wilk [Wed, 18 Apr 2012 02:21:38 +0000 (22:21 -0400)]
xen/xenbus: Add quirk to deal with misconfigured backends.

A rather annoying and common case is when booting a PVonHVM guest
and exposing the PV KBD and PV VFB - as broken toolstacks don't
always initialize the backends correctly.

Normally The HVM guest is using the VGA driver and the emulated
keyboard for this (though upstream version of QEMU implements
PV KBD, but still uses a VGA driver). We provide a very basic
two-stage wait mechanism - where we wait for 30 seconds for all
devices, and then for 270 for all them except the two mentioned.

That allows us to wait for the essential devices, like network
or disk for the full 6 minutes.

To trigger this, put this in your guest config:

vfb = [ 'vnc=1, vnclisten=0.0.0.0 ,vncunused=1']

instead of this:
vnc=1
vnclisten="0.0.0.0"

[upstream git commit 3066616]
CC: stable@kernel.org
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[v3: Split delay in non-essential (30 seconds) and essential
 devices per Ian and Stefano suggestion]
[v4: Added comments per Stefano suggestion]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxenbus: address compiler warnings
Jan Beulich [Fri, 24 Feb 2012 11:46:32 +0000 (11:46 +0000)]
xenbus: address compiler warnings

- casting pointers to integer types of different size is being warned on
- an uninitialized variable warning occurred on certain gcc versions

[upstream git commit 5ac0800]
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoMerge branch 'stable/xen-pciback-0.6.3.bugfixes' into uek2-merge
Konrad Rzeszutek Wilk [Thu, 19 Apr 2012 21:08:38 +0000 (17:08 -0400)]
Merge branch 'stable/xen-pciback-0.6.3.bugfixes' into uek2-merge

* stable/xen-pciback-0.6.3.bugfixes:
  xen/pcifront: avoid pci_frontend_enable_msix() falsely returning success
  xen/pciback: fix XEN_PCI_OP_enable_msix result
  xen/pciback: Support pci_reset_function, aka FLR or D3 support.
  PCI: Introduce __pci_reset_function_locked to be used when holding device_lock.

13 years agoxen/pcifront: avoid pci_frontend_enable_msix() falsely returning success
Jan Beulich [Mon, 2 Apr 2012 14:22:39 +0000 (15:22 +0100)]
xen/pcifront: avoid pci_frontend_enable_msix() falsely returning success

The original XenoLinux code has always had things this way, and for
compatibility reasons (in particular with a subsequent pciback
adjustment) upstream Linux should behave the same way (allowing for two
distinct error indications to be returned by the backend).

[upstream git commit f09d843]
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/pciback: fix XEN_PCI_OP_enable_msix result
Jan Beulich [Mon, 2 Apr 2012 14:32:22 +0000 (15:32 +0100)]
xen/pciback: fix XEN_PCI_OP_enable_msix result

Prior to 2.6.19 and as of 2.6.31, pci_enable_msix() can return a
positive value to indicate the number of vectors (less than the amount
requested) that can be set up for a given device. Returning this as an
operation value (secondary result) is fine, but (primary) operation
results are expected to be negative (error) or zero (success) according
to the protocol. With the frontend fixed to match the XenoLinux
behavior, the backend can now validly return zero (success) here,
passing the upper limit on the number of vectors in op->value.

[upstream git commit 0ee46ec]
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/pciback: Support pci_reset_function, aka FLR or D3 support.
Konrad Rzeszutek Wilk [Thu, 12 Jan 2012 17:06:47 +0000 (12:06 -0500)]
xen/pciback: Support pci_reset_function, aka FLR or D3 support.

We use the __pci_reset_function_locked to perform the action.
Also on attaching ("bind") and detaching ("unbind") we save and
restore the configuration states. When the device is disconnected
from a guest we use the "pci_reset_function" to also reset the
device before being passed to another guest.

[upstream git commit 1160831]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
13 years agoPCI: Introduce __pci_reset_function_locked to be used when holding device_lock.
Konrad Rzeszutek Wilk [Thu, 12 Jan 2012 17:06:46 +0000 (12:06 -0500)]
PCI: Introduce __pci_reset_function_locked to be used when holding device_lock.

The use case of this is when a driver wants to call FLR when a device
is attached to it using the SysFS "bind" or "unbind" functionality.

The call chain when a user does "bind" looks as so:

 echo "0000:01.07.0" > /sys/bus/pci/drivers/XXXX/bind

and ends up calling:
  driver_bind:
    device_lock(dev);  <=== TAKES LOCK
    XXXX_probe:
         .. pci_enable_device()
         ...__pci_reset_function(), which calls
                 pci_dev_reset(dev, 0):
                        if (!0) {
                                device_lock(dev) <==== DEADLOCK

The __pci_reset_function_locked function allows the the drivers
'probe' function to call the "pci_reset_function" while still holding
the driver mutex lock.

[git commit 6fbf9e7]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
13 years agoxen/acpi: Fix Kconfig dependency on CPU_FREQ
Konrad Rzeszutek Wilk [Sat, 24 Mar 2012 13:18:57 +0000 (09:18 -0400)]
xen/acpi: Fix Kconfig dependency on CPU_FREQ

The functions: "acpi_processor_*" sound like they depend on CONFIG_ACPI_PROCESSOR
but in reality they are exposed when CONFIG_CPU_FREQ=[y|m]. As such
update the Kconfig to have this dependency and fix compile issues:

ERROR: "acpi_processor_unregister_performance" [drivers/xen/xen-acpi-processor.ko] undefined!
ERROR: "acpi_processor_notify_smm" [drivers/xen/xen-acpi-processor.ko] undefined!
ERROR: "acpi_processor_register_performance" [drivers/xen/xen-acpi-processor.ko] undefined!
ERROR: "acpi_processor_preregister_performance" [drivers/xen/xen-acpi-processor.ko] undefined!

Note: We still need the CONFIG_ACPI
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/acpi-processor: Do not depend on CPU frequency scaling drivers.
Konrad Rzeszutek Wilk [Tue, 13 Mar 2012 17:28:12 +0000 (13:28 -0400)]
xen/acpi-processor: Do not depend on CPU frequency scaling drivers.

With patch "xen/cpufreq: Disable the cpu frequency scaling drivers
from loading." we do not have to worry about said drivers loading
themselves before the xen-acpi-processor driver. Hence we can remove
the default selection (=y if CPU frequency drivers were built-in, or
=m if CPU frequency drivers were built as modules), and just
select =m for the default case.

[git commit 102b208]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/cpufreq: Disable the cpu frequency scaling drivers from loading.
Konrad Rzeszutek Wilk [Wed, 14 Mar 2012 00:06:57 +0000 (20:06 -0400)]
xen/cpufreq: Disable the cpu frequency scaling drivers from loading.

By using the functionality provided by "[CPUFREQ]: provide
disable_cpuidle() function to disable the API."

Under the Xen hypervisor we do not want the initial domain to exercise
the cpufreq scaling drivers. This is b/c the Xen hypervisor is
in charge of doing this as well and we can end up with both the
Linux kernel and the hypervisor trying to change the P-states
leading to weird performance issues.

[upstream 48cdd82]
Acked-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[v2: Fix compile error spotted by Benjamin Schweikert <b.schweikert@googlemail.com>]

13 years agoprovide disable_cpufreq() function to disable the API.
Konrad Rzeszutek Wilk [Tue, 13 Mar 2012 23:18:39 +0000 (19:18 -0400)]
provide disable_cpufreq() function to disable the API.

useful for disabling cpufreq altogether. The cpu frequency
scaling drivers and cpu frequency governors will fail to register.

[upstream a7b422c]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Dave Jones <davej@redhat.com>
13 years agogit-changelog: parse Oracle bug
Maxim Uvarov [Tue, 17 Apr 2012 18:16:31 +0000 (11:16 -0700)]
git-changelog: parse Oracle bug

Some commits has Orabug or Oracle bug not at first line,
this patch fixed it.
Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoMerge branch 'uek-2.6.39-200' of ca-git.us.oracle.com:linux-muvarov-public into uek...
Maxim Uvarov [Tue, 17 Apr 2012 18:05:24 +0000 (11:05 -0700)]
Merge branch 'uek-2.6.39-200' of ca-git.us.oracle.com:linux-muvarov-public into uek-2.6.39-200

13 years agoNFSv4: Save the owner/group name string when doing open
Trond Myklebust [Sat, 7 Jan 2012 18:22:46 +0000 (13:22 -0500)]
NFSv4: Save the owner/group name string when doing open

...so that we can do the uid/gid mapping outside the asynchronous RPC
context.
This fixes a bug in the current NFSv4 atomic open code where the client
isn't able to determine what the true uid/gid fields of the file are,
(because the asynchronous nature of the OPEN call denies it the ability
to do an upcall) and so fills them with default values, marking the
inode as needing revalidation.
Unfortunately, in some cases, the VFS will do some additional sanity
checks on the file, and may override the server's decision to allow
the open because it sees the wrong owner/group fields.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from commit 6926afd1925a54a13684ebe05987868890665e2b)

Oracle bug: 13842440 (from 13459986)
Signed-off-by: Todd Vierling <todd.vierling@oracle.com>
13 years agoext4: flush any pending end_io requests before DIO reads w/dioread_nolock
Jiaying Zhang [Fri, 19 Aug 2011 23:13:32 +0000 (19:13 -0400)]
ext4: flush any pending end_io requests before DIO reads w/dioread_nolock

commit dccaf33fa37a1bc5d651baeb3bfeb6becb86597b upstream.

(backported to 3.0 by mjt)

There is a race between ext4 buffer write and direct_IO read with
dioread_nolock mount option enabled. The problem is that we clear
PageWriteback flag during end_io time but will do
uninitialized-to-initialized extent conversion later with dioread_nolock.
If an O_direct read request comes in during this period, ext4 will return
zero instead of the recently written data.

This patch checks whether there are any pending uninitialized-to-initialized
extent conversion requests before doing O_direct read to close the race.
Note that this is just a bandaid fix. The fundamental issue is that we
clear PageWriteback flag before we really complete an IO, which is
problem-prone. To fix the fundamental issue, we may need to implement an
extent tree cache that we can use to look up pending to-be-converted extents.

Signed-off-by: Jiaying Zhang <jiayingz@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 years agoNFSv4: Return the delegation if the server returns NFS4ERR_OPENMODE
Trond Myklebust [Wed, 7 Mar 2012 21:39:06 +0000 (16:39 -0500)]
NFSv4: Return the delegation if the server returns NFS4ERR_OPENMODE

commit 3114ea7a24d3264c090556a2444fc6d2c06176d4 upstream.

If a setattr() fails because of an NFS4ERR_OPENMODE error, it is
probably due to us holding a read delegation. Ensure that the
recovery routines return that delegation in this case.

Reported-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 years agoNFS: Properly handle the case where the delegation is revoked
Trond Myklebust [Tue, 6 Mar 2012 00:56:44 +0000 (19:56 -0500)]
NFS: Properly handle the case where the delegation is revoked

commit a1d0b5eebc4fd6e0edb02688b35f17f67f42aea5 upstream.

If we know that the delegation stateid is bad or revoked, we need to
remove that delegation as soon as possible, and then mark all the
stateids that relied on that delegation for recovery. We cannot use
the delegation as part of the recovery process.

Also note that NFSv4.1 uses a different error code (NFS4ERR_DELEG_REVOKED)
to indicate that the delegation was revoked.

Finally, ensure that setlk() and setattr() can both recover safely from
a revoked delegation.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 years agonfsd: don't allow zero length strings in cache_parse()
Dan Carpenter [Wed, 18 Jan 2012 09:56:02 +0000 (12:56 +0300)]
nfsd: don't allow zero length strings in cache_parse()

commit 6d8d17499810479eabd10731179c04b2ca22152f upstream.

There is no point in passing a zero length string here and quite a
few of that cache_parse() implementations will Oops if count is
zero.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 years agox86, tls: Off by one limit check
Dan Carpenter [Sat, 24 Mar 2012 07:52:50 +0000 (10:52 +0300)]
x86, tls: Off by one limit check

commit 8f0750f19789cf352d7e24a6cc50f2ab1b4f1372 upstream.

These are used as offsets into an array of GDT_ENTRY_TLS_ENTRIES members
so GDT_ENTRY_TLS_ENTRIES is one past the end of the array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: http://lkml.kernel.org/r/20120324075250.GA28258@elgon.mountain
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 years agox86, tsc: Skip refined tsc calibration on systems with reliable TSC
Alok Kataria [Wed, 22 Feb 2012 02:19:55 +0000 (18:19 -0800)]
x86, tsc: Skip refined tsc calibration on systems with reliable TSC

commit 57779dc2b3b75bee05ef5d1ada47f615f7a13932 upstream.

While running the latest Linux as guest under VMware in highly
over-committed situations, we have seen cases when the refined TSC
algorithm fails to get a valid tsc_start value in
tsc_refine_calibration_work from multiple attempts. As a result the
kernel keeps on scheduling the tsc_irqwork task for later. Subsequently
after several attempts when it gets a valid start value it goes through
the refined calibration and either bails out or uses the new results.
Given that the kernel originally read the TSC frequency from the
platform, which is the best it can get, I don't think there is much
value in refining it.

So  for systems which get the TSC frequency from the platform we
should skip the refined tsc algorithm.

We can use the TSC_RELIABLE cpu cap flag to detect this, right now it is
set only on VMware and for Moorestown Penwell both of which have there
own TSC calibration methods.

Signed-off-by: Alok N Kataria <akataria@vmware.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Dirk Brandewie <dirk.brandewie@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
[jstultz: Reworked to simply not schedule the refining work,
rather then scheduling the work and bombing out later]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 years agolockd: fix arg parsing for grace_period and timeout.
NeilBrown [Tue, 7 Feb 2012 04:35:42 +0000 (15:35 +1100)]
lockd: fix arg parsing for grace_period and timeout.

commit de5b8e8e047534aac6bc9803f96e7257436aef9c upstream.

If you try to set grace_period or timeout via a module parameter
to lockd, and do this on a big-endian machine where

   sizeof(int) != sizeof(unsigned long)

it won't work.  This number given will be effectively shifted right
by the difference in those two sizes.

So cast kp->arg properly to get correct result.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 years agoxfrm: Access the replay notify functions via the registered callbacks
Steffen Klassert [Wed, 21 Mar 2012 23:36:13 +0000 (23:36 +0000)]
xfrm: Access the replay notify functions via the registered callbacks

[ Upstream commit 1265fd616782ef03b98fd19f65c2b47fcd4ea11f ]

We call the wrong replay notify function when we use ESN replay
handling. This leads to the fact that we don't send notifications
if we use ESN. Fix this by calling the registered callbacks instead
of xfrm_replay_notify().

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 years agoRemove printk from rds_sendmsg
Dave Jones [Mon, 19 Mar 2012 13:01:07 +0000 (13:01 +0000)]
Remove printk from rds_sendmsg

[ Upstream commit a6506e1486181975d318344143aca722b2b91621 ]

no socket layer outputs a message for this error and neither should rds.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 years agonet: fix napi_reuse_skb() skb reserve
Eric Dumazet [Wed, 21 Mar 2012 06:58:03 +0000 (06:58 +0000)]
net: fix napi_reuse_skb() skb reserve

[ Upstream commit 2a2a459eeeff48640dc557548ce576d666ab06ed ]

napi->skb is allocated in napi_get_frags() using
netdev_alloc_skb_ip_align(), with a reserve of NET_SKB_PAD +
NET_IP_ALIGN bytes.

However, when such skb is recycled in napi_reuse_skb(), it ends with a
reserve of NET_IP_ALIGN which is suboptimal.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 years agonet: fix a potential rcu_read_lock() imbalance in rt6_fill_node()
Eric Dumazet [Tue, 27 Mar 2012 09:53:52 +0000 (09:53 +0000)]
net: fix a potential rcu_read_lock() imbalance in rt6_fill_node()

[ Upstream commit 94f826b8076e2cb92242061e92f21b5baa3eccc2 ]

Commit f2c31e32b378 (net: fix NULL dereferences in check_peer_redir() )
added a regression in rt6_fill_node(), leading to rcu_read_lock()
imbalance.

Thats because NLA_PUT() can make a jump to nla_put_failure label.

Fix this by using nla_put()

Many thanks to Ben Greear for his help

Reported-by: Ben Greear <greearb@candelatech.com>
Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>