]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
13 years agodl2k: Clean up rio_ioctl
Jeff Mahoney [Thu, 2 Aug 2012 12:04:00 +0000 (05:04 -0700)]
dl2k: Clean up rio_ioctl

Orabug: 14126896
The dl2k driver's rio_ioctl call has a few issues:
- No permissions checking
- Implements SIOCGMIIREG and SIOCGMIIREG using the SIOCDEVPRIVATE numbers
- Has a few ioctls that may have been used for debugging at one point
  but have no place in the kernel proper.

This patch removes all but the MII ioctls, renumbers them to use the
standard ones, and adds the proper permission check for SIOCSMIIREG.

We can also get rid of the dl2k-specific struct mii_data in favor of
the generic struct mii_ioctl_data.

Since we have the phyid on hand, we can add the SIOCGMIIPHY ioctl too.

Most of the MII code for the driver could probably be converted to use
the generic MII library but I don't have a device to test the results.
This fixes: CVE-2012-2313

Reported-by: Stephan Mueller <stephan.mueller@atsec.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoSPEC: v2.6.39-300.2.0
Maxim Uvarov [Thu, 2 Aug 2012 09:48:53 +0000 (02:48 -0700)]
SPEC: v2.6.39-300.2.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
Maxim Uvarov [Wed, 1 Aug 2012 15:37:03 +0000 (08:37 -0700)]
Merge branch 'uek2-merge' of git://ca-git.us.oracle.com/linux-konrad-public

13 years agoMerge branch 'stable/for-linus-3.7.rebased' into uek2-merge
Konrad Rzeszutek Wilk [Tue, 31 Jul 2012 19:33:39 +0000 (15:33 -0400)]
Merge branch 'stable/for-linus-3.7.rebased' into uek2-merge

* stable/for-linus-3.7.rebased:
  xen/mmu/enlighten: Fix memblock_x86_reserve_range downport.

13 years agoxen/mmu/enlighten: Fix memblock_x86_reserve_range downport.
Konrad Rzeszutek Wilk [Tue, 31 Jul 2012 19:21:02 +0000 (15:21 -0400)]
xen/mmu/enlighten: Fix memblock_x86_reserve_range downport.

This is not for upstream as it memblock_x86_reserve_range is not
used upstream anymore.

When I back-ported the patches:
xen/x86: Use memblock_reserve for sensitive areas.
xen/mmu: Recycle the Xen provided L4, L3, and L2 pages

I simply used sed s/memblock_reserve/memblock_x86_reserve_range/.
That was incorrect as the parameters are different - memblock_reserve
as second expects the size, while memblock_x86_reserve_range expects
the physical address. This patch fixes those bugs.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoMerge branch 'stable/for-linus-3.7.rebased' into uek2-merge
Konrad Rzeszutek Wilk [Tue, 31 Jul 2012 18:44:59 +0000 (14:44 -0400)]
Merge branch 'stable/for-linus-3.7.rebased' into uek2-merge

* stable/for-linus-3.7.rebased:
  xen/p2m: Reserve 8MB of _brk space for P2M leafs when populating back.
  xen/mmu: Remove from __ka space PMD entries for pagetables.
  xen/mmu: Copy and revector the P2M tree.
  xen/p2m: Add logic to revector a P2M tree to use __va leafs.
  xen/mmu: Recycle the Xen provided L4, L3, and L2 pages
  xen/mmu: For 64-bit do not call xen_map_identity_early
  xen/mmu: use copy_page instead of memcpy.
  xen/mmu: Provide comments describing the _ka and _va aliasing issue
  xen/mmu: The xen_setup_kernel_pagetable doesn't need to return anything.
  xen/x86: Use memblock_reserve for sensitive areas.
  xen/p2m: Fix the comment describing the P2M tree.
  xen/perf: Define .glob for the different hypercalls.

13 years agoxen/p2m: Reserve 8MB of _brk space for P2M leafs when populating back.
Konrad Rzeszutek Wilk [Mon, 30 Jul 2012 14:18:05 +0000 (10:18 -0400)]
xen/p2m: Reserve 8MB of _brk space for P2M leafs when populating back.

When we release pages back during bootup:

Freeing  9d-100 pfn range: 99 pages freed
Freeing  9cf36-9d0d2 pfn range: 412 pages freed
Freeing  9f6bd-9f6bf pfn range: 2 pages freed
Freeing  9f714-9f7bf pfn range: 171 pages freed
Freeing  9f7e0-9f7ff pfn range: 31 pages freed
Freeing  9f800-100000 pfn range: 395264 pages freed
Released 395979 pages of unused memory

We then try to populate those pages back. In the P2M tree however
the space for those leafs must be reserved - as such we use extend_brk.
We reserve 8MB of _brk space, which means we can fit over
1048576 PFNs - which is more than we should ever need.

[v1: Made it 8MB of _brk space instead of 4MB per Jan's suggestion]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from commit 99266871de5006ba7ad0bfece6bb283ede4094b9)

13 years agoxen/mmu: Remove from __ka space PMD entries for pagetables.
Konrad Rzeszutek Wilk [Thu, 26 Jul 2012 20:57:19 +0000 (16:57 -0400)]
xen/mmu: Remove from __ka space PMD entries for pagetables.

Please first read the description in "xen/mmu: Copy and revector the
P2M tree."

At this stage, the __ka address space (which is what the old
P2M tree was using) is partially disassembled. The cleanup_highmap
has removed the PMD entries from 0-16MB and anything past _brk_end
up to the max_pfn_mapped (which is the end of the ramdisk).

The xen_remove_p2m_tree and code around has ripped out the __ka for
the old P2M array.

Here we continue on doing it to where the Xen page-tables were.
It is safe to do it, as the page-tables are addressed using __va.
For good measure we delete anything that is within MODULES_VADDR
and up to the end of the PMD.

At this point the __ka only contains PMD entries for the start
of the kernel up to __brk.

[v1: Per Stefano's suggestion wrapped the MODULES_VADDR in debug]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from commit 4e928e1a48b6b76e0b8384160213a32d03197e4b)

13 years agoxen/mmu: Copy and revector the P2M tree.
Konrad Rzeszutek Wilk [Thu, 26 Jul 2012 16:47:40 +0000 (12:47 -0400)]
xen/mmu: Copy and revector the P2M tree.

Please first read the description in "xen/p2m: Add logic to revector a
P2M tree to use __va leafs" patch.

The 'xen_revector_p2m_tree()' function allocates a new P2M tree
copies the contents of the old one in it, and returns the new one.

At this stage, the __ka address space (which is what the old
P2M tree was using) is partially disassembled. The cleanup_highmap
has removed the PMD entries from 0-16MB and anything past _brk_end
up to the max_pfn_mapped (which is the end of the ramdisk).

We have revectored the P2M tree (and the one for save/restore as well)
to use new shiny __va address to new MFNs. The xen_start_info
has been taken care of already in 'xen_setup_kernel_pagetable()' and
xen_start_info->shared_info in 'xen_setup_shared_info()', so
we are free to roam and delete PMD entries - which is exactly what
we are going to do. We rip out the __ka for the old P2M array.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Conflicts:

arch/x86/xen/mmu.c
[upstream git commit 3a06359601deaec046ce33008527edfa6731ef23]
[s/memblock_free/memblock_x86_free_range]

13 years agoxen/p2m: Add logic to revector a P2M tree to use __va leafs.
Konrad Rzeszutek Wilk [Thu, 19 Jul 2012 17:52:29 +0000 (13:52 -0400)]
xen/p2m: Add logic to revector a P2M tree to use __va leafs.

During bootup Xen supplies us with a P2M array. It sticks
it right after the ramdisk, as can be seen with a 128GB PV guest:

(certain parts removed for clarity):
xc_dom_build_image: called
xc_dom_alloc_segment:   kernel       : 0xffffffff81000000 -> 0xffffffff81e43000  (pfn 0x1000 + 0xe43 pages)
xc_dom_pfn_to_ptr: domU mapping: pfn 0x1000+0xe43 at 0x7f097d8bf000
xc_dom_alloc_segment:   ramdisk      : 0xffffffff81e43000 -> 0xffffffff925c7000  (pfn 0x1e43 + 0x10784 pages)
xc_dom_pfn_to_ptr: domU mapping: pfn 0x1e43+0x10784 at 0x7f0952dd2000
xc_dom_alloc_segment:   phys2mach    : 0xffffffff925c7000 -> 0xffffffffa25c7000  (pfn 0x125c7 + 0x10000 pages)
xc_dom_pfn_to_ptr: domU mapping: pfn 0x125c7+0x10000 at 0x7f0942dd2000
xc_dom_alloc_page   :   start info   : 0xffffffffa25c7000 (pfn 0x225c7)
xc_dom_alloc_page   :   xenstore     : 0xffffffffa25c8000 (pfn 0x225c8)
xc_dom_alloc_page   :   console      : 0xffffffffa25c9000 (pfn 0x225c9)
nr_page_tables: 0x0000ffffffffffff/48: 0xffff000000000000 -> 0xffffffffffffffff, 1 table(s)
nr_page_tables: 0x0000007fffffffff/39: 0xffffff8000000000 -> 0xffffffffffffffff, 1 table(s)
nr_page_tables: 0x000000003fffffff/30: 0xffffffff80000000 -> 0xffffffffbfffffff, 1 table(s)
nr_page_tables: 0x00000000001fffff/21: 0xffffffff80000000 -> 0xffffffffa27fffff, 276 table(s)
xc_dom_alloc_segment:   page tables  : 0xffffffffa25ca000 -> 0xffffffffa26e1000  (pfn 0x225ca + 0x117 pages)
xc_dom_pfn_to_ptr: domU mapping: pfn 0x225ca+0x117 at 0x7f097d7a8000
xc_dom_alloc_page   :   boot stack   : 0xffffffffa26e1000 (pfn 0x226e1)
xc_dom_build_image  : virt_alloc_end : 0xffffffffa26e2000
xc_dom_build_image  : virt_pgtab_end : 0xffffffffa2800000

So the physical memory and virtual (using __START_KERNEL_map addresses)
layout looks as so:

  phys                             __ka
/------------\                   /-------------------\
| 0          | empty             | 0xffffffff80000000|
| ..         |                   | ..                |
| 16MB       | <= kernel starts  | 0xffffffff81000000|
| ..         |                   |                   |
| 30MB       | <= kernel ends => | 0xffffffff81e43000|
| ..         |  & ramdisk starts | ..                |
| 293MB      | <= ramdisk ends=> | 0xffffffff925c7000|
| ..         |  & P2M starts     | ..                |
| ..         |                   | ..                |
| 549MB      | <= P2M ends    => | 0xffffffffa25c7000|
| ..         | start_info        | 0xffffffffa25c7000|
| ..         | xenstore          | 0xffffffffa25c8000|
| ..         | cosole            | 0xffffffffa25c9000|
| 549MB      | <= page tables => | 0xffffffffa25ca000|
| ..         |                   |                   |
| 550MB      | <= PGT end     => | 0xffffffffa26e1000|
| ..         | boot stack        |                   |
\------------/                   \-------------------/

As can be seen, the ramdisk, P2M and pagetables are taking
a bit of __ka addresses space. Which is a problem since the
MODULES_VADDR starts at 0xffffffffa0000000 - and P2M sits
right in there! This results during bootup with the inability to
load modules, with this error:

------------[ cut here ]------------
WARNING: at /home/konrad/ssd/linux/mm/vmalloc.c:106 vmap_page_range_noflush+0x2d9/0x370()
Call Trace:
 [<ffffffff810719fa>] warn_slowpath_common+0x7a/0xb0
 [<ffffffff81030279>] ? __raw_callee_save_xen_pmd_val+0x11/0x1e
 [<ffffffff81071a45>] warn_slowpath_null+0x15/0x20
 [<ffffffff81130b89>] vmap_page_range_noflush+0x2d9/0x370
 [<ffffffff81130c4d>] map_vm_area+0x2d/0x50
 [<ffffffff811326d0>] __vmalloc_node_range+0x160/0x250
 [<ffffffff810c5369>] ? module_alloc_update_bounds+0x19/0x80
 [<ffffffff810c6186>] ? load_module+0x66/0x19c0
 [<ffffffff8105cadc>] module_alloc+0x5c/0x60
 [<ffffffff810c5369>] ? module_alloc_update_bounds+0x19/0x80
 [<ffffffff810c5369>] module_alloc_update_bounds+0x19/0x80
 [<ffffffff810c70c3>] load_module+0xfa3/0x19c0
 [<ffffffff812491f6>] ? security_file_permission+0x86/0x90
 [<ffffffff810c7b3a>] sys_init_module+0x5a/0x220
 [<ffffffff815ce339>] system_call_fastpath+0x16/0x1b
---[ end trace fd8f7704fdea0291 ]---
vmalloc: allocation failure, allocated 16384 of 20480 bytes
modprobe: page allocation failure: order:0, mode:0xd2

Since the __va and __ka are 1:1 up to MODULES_VADDR and
cleanup_highmap rids __ka of the ramdisk mapping, what
we want to do is similar - get rid of the P2M in the __ka
address space. There are two ways of fixing this:

 1) All P2M lookups instead of using the __ka address would
    use the __va address. This means we can safely erase from
    __ka space the PMD pointers that point to the PFNs for
    P2M array and be OK.
 2). Allocate a new array, copy the existing P2M into it,
    revector the P2M tree to use that, and return the old
    P2M to the memory allocate. This has the advantage that
    it sets the stage for using XEN_ELF_NOTE_INIT_P2M
    feature. That feature allows us to set the exact virtual
    address space we want for the P2M - and allows us to
    boot as initial domain on large machines.

So we pick option 2).

This patch only lays the groundwork in the P2M code. The patch
that modifies the MMU is called "xen/mmu: Copy and revector the P2M tree."

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from commit 0b4d1198932f4204d74f6032dce6dbd095fa9531)

13 years agoxen/mmu: Recycle the Xen provided L4, L3, and L2 pages
Konrad Rzeszutek Wilk [Thu, 26 Jul 2012 16:00:56 +0000 (12:00 -0400)]
xen/mmu: Recycle the Xen provided L4, L3, and L2 pages

As we are not using them. We end up only using the L1 pagetables
and grafting those to our page-tables.

[v1: Per Stefano's suggestion squashed two commits]
[v2: Per Stefano's suggestion simplified loop]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Conflicts:

arch/x86/xen/mmu.c
[s/memblock_reserve/memblock_x86_reserve-range]
[cherry picked from d950a0fb6d64c4c9f160e3770cef0109e27627b0]

13 years agoxen/mmu: For 64-bit do not call xen_map_identity_early
Konrad Rzeszutek Wilk [Thu, 12 Jul 2012 17:59:36 +0000 (13:59 -0400)]
xen/mmu: For 64-bit do not call xen_map_identity_early

B/c we do not need it. During the startup the Xen provides
us with all the memory mapped that we need to function.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from commit d90be24669f2c39a29f821a654956f30cc9c4ed2)

13 years agoxen/mmu: use copy_page instead of memcpy.
Konrad Rzeszutek Wilk [Thu, 26 Jul 2012 15:57:04 +0000 (11:57 -0400)]
xen/mmu: use copy_page instead of memcpy.

After all, this is what it is there for.

Acked-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from commit cbc09be35990fb3d15671507f11c3e90479ef816)

13 years agoxen/mmu: Provide comments describing the _ka and _va aliasing issue
Konrad Rzeszutek Wilk [Thu, 12 Jul 2012 17:55:25 +0000 (13:55 -0400)]
xen/mmu: Provide comments describing the _ka and _va aliasing issue

Which is that the level2_kernel_pgt (__ka virtual addresses)
and level2_ident_pgt (__va virtual address) contain the same
PMD entries. So if you modify a PTE in __ka, it will be reflected
in __va (and vice-versa).

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from commit 26e694dc644c36641d6d73585400caa1f015e1fd)

13 years agoxen/mmu: The xen_setup_kernel_pagetable doesn't need to return anything.
Konrad Rzeszutek Wilk [Fri, 29 Jun 2012 02:47:35 +0000 (22:47 -0400)]
xen/mmu: The xen_setup_kernel_pagetable doesn't need to return anything.

We don't need to return the new PGD - as we do not use it.

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from commit a573e36a3641f268ee6215a7d7cf74610ca5e81a)

Conflicts:

arch/x86/xen/enlighten.c
arch/x86/xen/mmu.c

13 years agoxen/x86: Use memblock_reserve for sensitive areas.
Konrad Rzeszutek Wilk [Thu, 19 Jul 2012 14:23:47 +0000 (10:23 -0400)]
xen/x86: Use memblock_reserve for sensitive areas.

instead of a big memblock_reserve. This way we can be more
selective in freeing regions (and it also makes it easier
to understand where is what).

[v1: Move the auto_translate_physmap to proper line]
[v2: Per Stefano suggestion add more comments]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[upstream git commit 91addbf07abfdd109a9da4e02061e6ed3728b298]
Conflicts:

arch/x86/xen/setup.c
[s/memblock_reserve/memblock_x86_reserve_range]

13 years agoxen/p2m: Fix the comment describing the P2M tree.
Konrad Rzeszutek Wilk [Fri, 29 Jun 2012 02:12:36 +0000 (22:12 -0400)]
xen/p2m: Fix the comment describing the P2M tree.

It mixed up the p2m_mid_missing with p2m_missing. Also
remove some extra spaces.

[upstream git commit 800ea898bbd7f79ef99695f71538f204e24cbcf3]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/perf: Define .glob for the different hypercalls.
Konrad Rzeszutek Wilk [Wed, 11 Jul 2012 19:03:18 +0000 (15:03 -0400)]
xen/perf: Define .glob for the different hypercalls.

This allows us in perf to have this:

 99.67%  [kernel]             [k] xen_hypercall_sched_op
  0.11%  [kernel]             [k] xen_hypercall_xen_version

instead of the borring ever-encompassing:

 99.13%  [kernel]              [k] hypercall_page

[v2: Use a macro to define the name and skip]
[v3: Use balign per Jan's suggestion]

[upstream git commit 7d0642b93780a7309d2954de6f6126d6ceb526f0]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoSPEC: v2.6.39-300.1.0
Maxim Uvarov [Thu, 26 Jul 2012 13:28:30 +0000 (06:28 -0700)]
SPEC: v2.6.39-300.1.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
Maxim Uvarov [Thu, 26 Jul 2012 13:11:26 +0000 (06:11 -0700)]
Merge branch 'uek2-merge' of git://ca-git.us.oracle.com/linux-konrad-public

13 years agoMerge branch 'stable/for-linus-3.6.rebased' into uek2-merge
Konrad Rzeszutek Wilk [Wed, 25 Jul 2012 17:13:12 +0000 (13:13 -0400)]
Merge branch 'stable/for-linus-3.6.rebased' into uek2-merge

* stable/for-linus-3.6.rebased:
  xen/p2m: Check __brk_limit before allocating.

13 years agoxen/p2m: Check __brk_limit before allocating.
Konrad Rzeszutek Wilk [Tue, 24 Jul 2012 20:07:48 +0000 (16:07 -0400)]
xen/p2m: Check __brk_limit before allocating.

The P2M code is smart enough to return false (which means that it
cannot allocate anymore) and the error can perculate up the calling
stack without trouble - with the error logic doing the proper thing.

So check the __brk_limit values before allocating from extend_brk.

This allows us to boot on machines where we do not have enough
__brk space, and we would get this:

(XEN) domain_crash_sync called from entry.S
(XEN) CPU:    0
(XEN) RIP:    e033:[<ffffffff818aad3b>]
(XEN) RFLAGS: 0000000000000206   EM: 1   CONTEXT: pv guest
(XEN) rax: ffffffff81a7c000   rbx: 000000000000003d   rcx: 0000000000001000
(XEN) rdx: ffffffff81a7b000   rsi: 0000000000001000   rdi: 0000000000001000
(XEN) rbp: ffffffff81801cd8   rsp: ffffffff81801c98   r8:  0000000000100000
(XEN) r9:  ffffffff81a7a000   r10: 0000000000000001   r11: 0000000000000003
(XEN) r12: 0000000000000004   r13: 0000000000000004   r14: 000000000000003d
(XEN) r15: 00000000000001e8   cr0: 000000008005003b   cr4: 00000000000006f0
(XEN) cr3: 0000000125803000   cr2: 0000000000000000
(XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: e02b   cs: e033
(XEN) Guest stack trace from rsp=ffffffff81801c98:

.. which is extend_brk hitting a BUG_ON.

Note that git commit c3d93f880197953f86ab90d9da4744e926b38e33
(xen: populate correct number of pages when across mem boundary (v2))
exposed this bug).

Interestingly enough, most of the time we are not going to hit this
b/c the _brk space is quite large (v3.5):
 ffffffff81a25000 B __brk_base
 ffffffff81e43000 B __brk_limit
= ~4MB.

vs earlier kernels (with this back-ported), the space is smaller:
 ffffffff81a25000 B __brk_base
 ffffffff81a7b000 B __brk_limit
= 344 kBytes.

With this patch, we would get now a limited amount of pages populated back:
Freeing 9f-100 pfn range: 97 pages freed
Freeing b7ee0-ecd9b pfn range: 216763 pages freed
Released 216860 pages of unused memory
Set 295297 page(s) to 1-1 mapping
Populating 100000-134f1c pfn range: 30720 pages added

[while it was instructed to populate 216860 pages back
on this particular machine]

[upstream git commit 6fc0f0142ecf25e3a7e1db52033586107f829af0]

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoSPEC: v2.6.39-300.0.7
Maxim Uvarov [Mon, 23 Jul 2012 08:08:10 +0000 (01:08 -0700)]
SPEC: v2.6.39-300.0.7

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoqla2xxx: Updated the driver version to 8.04.00.06.39.0-k.
Saurav Kashyap [Fri, 20 Jul 2012 08:19:40 +0000 (13:49 +0530)]
qla2xxx: Updated the driver version to 8.04.00.06.39.0-k.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: Dont call nic restart firmware if it is already active and running.
Saurav Kashyap [Tue, 3 Jul 2012 18:13:58 +0000 (11:13 -0700)]
qla2xxx: Dont call nic restart firmware if it is already active and running.

JIRA Key: V2632FC-230

13 years agoqla2xxx: Wrong PCIe(2.5Gb/s x8) speed in the kerenel message for QLE8242.
Atul Deshmukh [Thu, 19 Jul 2012 09:46:10 +0000 (15:16 +0530)]
qla2xxx: Wrong PCIe(2.5Gb/s x8) speed in the kerenel message for QLE8242.

qla2xxx show wrong PCIe(2.5Gb/s x8) speed in the kerenel message. It should be
5.0Gb/s.

JIRA Key: V2632FC-228

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: Perform ROM mbx cmd access only after ISP soft-reset during f/w recovery.
Santosh Vernekar [Mon, 2 Jul 2012 12:07:53 +0000 (05:07 -0700)]
qla2xxx: Perform ROM mbx cmd access only after ISP soft-reset during f/w recovery.

Initial assumption by driver was that the ROM mbx cmds will be accessible
even when FCoE operational f/w is in reset recovery. However it seems that
in case of "ISP System error" (i.e. 0x8002) there is a period when the ISP
ISP is not operational and firmware waits in tight loop for either the driver
to take a dump or perform soft-reset. During this time none of the ROM mbx
cmds will get serviced by f/w.

Hence the patch makes sure driver sends mbx only after soft reset is complete.

JIRA Key: V2632FC-227

13 years agoqla2xxx: Fix rval may be used uninitialized in this function warning.
Saurav Kashyap [Fri, 29 Jun 2012 12:47:29 +0000 (05:47 -0700)]
qla2xxx: Fix rval may be used uninitialized in this function warning.

Fix compile warning in qla25xx_process_bidir_status_iocb as rval is not
initialized with a return value.

JIRA Key: V2632FC-226

13 years agoqla2xxx: Implement beacon support for ISP83xx CNA.
Chad Dupuis [Wed, 13 Jun 2012 19:39:34 +0000 (15:39 -0400)]
qla2xxx: Implement beacon support for ISP83xx CNA.

JIRA Key: V2632FC-219

13 years agoqla2xxx: Fix for continuous rescan attempts in arbitrated loop topology.
Arun Easi [Tue, 19 Jun 2012 23:56:27 +0000 (16:56 -0700)]
qla2xxx: Fix for continuous rescan attempts in arbitrated loop topology.

Stale information in the temporary fcport created in
qla2x00_configure_local_loop() causes qla2x00_get_port_database() call
to fail. This reschedules scan, which gets stuck continuously in the
rescheduling-of-scan loop due to the failure.

JIRA Key: V2632FC-221

13 years agoqla2xxx: Only enable link up on the correct interrupt event.
Chad Dupuis [Thu, 21 Jun 2012 12:56:30 +0000 (05:56 -0700)]
qla2xxx: Only enable link up on the correct interrupt event.

JIRA Key: V2632FC-205

13 years agoqla2xxx: Don't register to legacy interrupt for ISP82xx.
Giridhar Malavali [Tue, 12 Jun 2012 14:56:33 +0000 (07:56 -0700)]
qla2xxx: Don't register to legacy interrupt for ISP82xx.

JIRA Key: V2632FC-210

13 years agoqla2xxx: Changes for ISP83xx CNA loopback support.
Chad Dupuis [Thu, 19 Jul 2012 09:39:59 +0000 (15:09 +0530)]
qla2xxx: Changes for ISP83xx CNA loopback support.

Minor changes to support loopback functionality with ISP83xx CNAs.

JIRA Key: V2632FC-214

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: Add bit to identify Sensei card for thermal temp.
Joe Carnuccio [Fri, 11 May 2012 18:23:13 +0000 (18:23 +0000)]
qla2xxx: Add bit to identify Sensei card for thermal temp.

Sensei card requires bit 12 to be set for accessing the thermal
temperature via the READ SFP/I2C mailbox command.

JIRA Key: V2632FC-206

13 years agoqla2xxx: Implemetation of mctp.
Saurav Kashyap [Thu, 19 Jul 2012 09:36:55 +0000 (15:06 +0530)]
qla2xxx: Implemetation of mctp.

JIRA Key: V2632FC-213

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: IDC implementation for ISP83xx.
Santosh Vernekar [Thu, 19 Jul 2012 09:33:13 +0000 (15:03 +0530)]
qla2xxx: IDC implementation for ISP83xx.

JIRA Key: V2632FC-212

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: Add FW DUMP SIZE sysfs attribute.
Harish Zunjarrao [Wed, 30 May 2012 06:44:58 +0000 (23:44 -0700)]
qla2xxx: Add FW DUMP SIZE sysfs attribute.

JIRA Key: V2632FC-211

13 years agoqla2xxx: Implementation of bidirectional.
Saurav Kashyap [Thu, 19 Jul 2012 09:17:39 +0000 (14:47 +0530)]
qla2xxx: Implementation of bidirectional.

JIRA Key: V2632FC-190

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: Use bitmap to store loop_id's for fcports.
Chad Dupuis [Thu, 19 Jul 2012 09:13:50 +0000 (14:43 +0530)]
qla2xxx: Use bitmap to store loop_id's for fcports.

Store used fcport loop_id's in a bitmap so that as opposed to looping through
all fcports to find the next free loop_id, new loop_id lookup can be just be
done via bitops.

JIRA Key: V2632FC-199

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: Display mailbox failure by default.
Saurav Kashyap [Fri, 20 Apr 2012 15:00:44 +0000 (10:00 -0500)]
qla2xxx: Display mailbox failure by default.

JIRA Key: V2632FC-194

13 years agoqla2xxx: Fix typo in qla2xxx files
Masanari Iida [Thu, 12 Apr 2012 20:54:32 +0000 (15:54 -0500)]
qla2xxx: Fix typo in qla2xxx files

Correct spelling typo within qla2xxx files.

JIRA Key: V2632FC-197

13 years agoqla2xxx: Remove redundant NULL check before release_firmware() call.
Jesper Juhl [Thu, 12 Apr 2012 20:37:41 +0000 (15:37 -0500)]
qla2xxx: Remove redundant NULL check before release_firmware() call.

release_firmware() checks for NULL pointers internally so checking before calling it is redundant.

JIRA Key: V2632FC-196

13 years agoqla2xxx: Add check in qla82xx_watchdog for failed hardware state.
Chad Dupuis [Thu, 19 Jul 2012 09:10:53 +0000 (14:40 +0530)]
qla2xxx: Add check in qla82xx_watchdog for failed hardware state.

JIRA Key: V2632FC-117

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: Add I2C BSG interface.
Joe Carnuccio [Wed, 18 Apr 2012 20:19:06 +0000 (13:19 -0700)]
qla2xxx: Add I2C BSG interface.

Add BSG interface to generically access I2C attached devices.

The transferred data limitations:
- the address must be on an even byte boundary,
- the chunk size must be no more than 64 bytes,
(these being limitations of the firmware).

So, to transfer more than 64 bytes, the caller must chunk up
the data into 64 byte chunks and perform multiple accesses.

The caller is responsible for setting the device address,
the data offset, the option bits, and the data length.

JIRA Key: V2632FC-198

13 years agoRevert "qla2xxx: During loopdown perform Diagnostic loopback."
Chad Dupuis [Fri, 6 Apr 2012 19:33:53 +0000 (12:33 -0700)]
Revert "qla2xxx: During loopdown perform Diagnostic loopback."

The LOOP_DOWN test is not needed.

JIRA Key: V2632FC-189

13 years agoqla2xxx: Display proper firmware version when new minidump template is gathered for...
Giridhar Malavali [Wed, 4 Apr 2012 21:47:17 +0000 (14:47 -0700)]
qla2xxx: Display proper firmware version when new minidump template is gathered for ISP82xx.

JIRA key: V2632FC-188.

13 years agoqla2xxx: Properly check for current state after the fabric-login request.
Saurav Kashyap [Wed, 4 Apr 2012 21:39:54 +0000 (14:39 -0700)]
qla2xxx: Properly check for current state after the fabric-login request.

JIRA Key: V2632FC-185

13 years agoqla2xxx: Proper completion to scsi-ml for scsi status task_set_full and busy.
Giridhar Malavali [Thu, 29 Mar 2012 20:14:09 +0000 (13:14 -0700)]
qla2xxx: Proper completion to scsi-ml for scsi status task_set_full and busy.

In case of firmmware detected under-run condition and scsi status of task_set_full
or busy_condition, DID_OK is returned to scsi-ml for faster recovery.

JIRA Key: V2632FC-186

13 years agoqla2xxx: Don't capture minidump for ISP82xx on flash update from application.
Giridhar Malavali [Thu, 19 Jul 2012 09:05:34 +0000 (14:35 +0530)]
qla2xxx: Don't capture minidump for ISP82xx on flash update from application.

JIRA Key: V2632FC-168.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: Print link up and link down messages.
Chad Dupuis [Thu, 19 Jul 2012 09:01:03 +0000 (14:31 +0530)]
qla2xxx: Print link up and link down messages.

JIRA Key: V2632FC-179

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: More trivial fixups.
Chad Dupuis [Thu, 19 Jul 2012 08:17:34 +0000 (13:47 +0530)]
qla2xxx: More trivial fixups.

JIRA Key: V2632FC-183

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: Avoid losing any fc ports when loop id's are exhausted.
Joe Carnuccio [Thu, 8 Mar 2012 01:18:33 +0000 (17:18 -0800)]
qla2xxx: Avoid losing any fc ports when loop id's are exhausted.

JIRA Key: V2632FC-128

13 years agoqla2xxx: Optimize existing port name server query matching.
Joe Carnuccio [Thu, 8 Mar 2012 01:01:42 +0000 (17:01 -0800)]
qla2xxx: Optimize existing port name server query matching.

JIRA Key: V2632FC-128

13 years agoqla2xxx: Remove mirrored field vp_idx from struct fc_port.
Joe Carnuccio [Wed, 11 Jan 2012 22:33:40 +0000 (14:33 -0800)]
qla2xxx: Remove mirrored field vp_idx from struct fc_port.

The field vp_idx in struct fc_port is a redundant/mirror copy of
the same field in struct scsi_qla_host;

struct fc_port has a pointer vha to scsi_qla_host which allows
the original copy of vp_idx to be readily accessed.

JIRA Key: V2632FC-128

13 years agoqla2xxx: Fixups for ISP83xx CNA.
Nigel Kirkland [Thu, 19 Jul 2012 08:07:53 +0000 (13:37 +0530)]
qla2xxx: Fixups for ISP83xx CNA.

JIRA Key: V2632FC-178

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: Display proper supported speeds for 16G FC adapters.
Giridhar Malavali [Fri, 24 Feb 2012 18:49:08 +0000 (12:49 -0600)]
qla2xxx: Display proper supported speeds for 16G FC adapters.

JIRA Key: V2632FC-174

13 years agoqla2xxx: handle default case in qla2x00_request_firmware()
Dan Carpenter [Fri, 24 Feb 2012 17:02:01 +0000 (11:02 -0600)]
qla2xxx: handle default case in qla2x00_request_firmware()

This silences a static checker warning.  Also we're always adding new types of
firmware, so it might fix a bug in real life some day.

JIRA Key: V2632FC-177

13 years agoqla2xxx: Fix reset time out as qla2xxx not ack to reset request.
Vikas Chaudhary [Thu, 23 Feb 2012 20:11:58 +0000 (14:11 -0600)]
qla2xxx: Fix reset time out as qla2xxx not ack to reset request.

JIRA Key: V2632FC-176

13 years agoqla2xxx: Fix typo in qla_mbx.c
Masanari Iida [Thu, 23 Feb 2012 19:47:16 +0000 (13:47 -0600)]
qla2xxx: Fix typo in qla_mbx.c

Correct spelling "occured" to "occurred" in
drivers/scsi/qla2xxx/qla_mbx.c

JIRA Key: V2632FC-175

13 years agoqla2xxx: Micro optimization in queuecommand handler
Chetan Loke [Thu, 16 Feb 2012 19:34:56 +0000 (13:34 -0600)]
qla2xxx: Micro optimization in queuecommand handler

Optimized queuecommand handler's to eliminate double head-room checks.
The checks are moved inside the 1st if-loop otherwise you would end up checking twice when there is
enough head room.

JIRA Key: V2632FC-172

13 years agoqla2xxx: Fix typo in qla_init.c
Raul Porcel [Thu, 16 Feb 2012 19:19:08 +0000 (13:19 -0600)]
qla2xxx: Fix typo in qla_init.c

Replace "Inconisistent" with "Inconsistent" in drivers/scsi/qla2xxx/qla_init.c

JIRA Key: V2632FC-171

13 years agoqla2xxx: Fix typo in qla_bsg.c
Masanari Iida [Tue, 7 Feb 2012 14:40:21 +0000 (08:40 -0600)]
qla2xxx: Fix typo in qla_bsg.c

JIRA Key: V2632FC-170

13 years agoqla2xxx: Stats should be different from physical and virtual ports
Saurav Kashyap [Wed, 1 Feb 2012 10:06:00 +0000 (15:36 +0530)]
qla2xxx: Stats should be different from physical and virtual ports

Currently stats is part of ha data structure, common for physical and virtual
ports. Moved the stats to vha, each port will have its own stat.

JIRA Key: V2632FC-111

13 years agoqla2xxx: Add ql_dbg_verbose logging level.
Saurav Kashyap [Thu, 19 Jul 2012 08:03:54 +0000 (13:33 +0530)]
qla2xxx: Add ql_dbg_verbose logging level.

Add an extra layer of logging granularity for messages that are necessary in
some circumstances but may flood the kernel log buffer with too many messages
otherwise.

JIRA Key: V2632FC-158

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: Block flash access from application when device is initialized for ISP82xx.
Giridhar Malavali [Fri, 27 Jan 2012 15:09:15 +0000 (09:09 -0600)]
qla2xxx: Block flash access from application when device is initialized for ISP82xx.

This could lead to CRB initialization failures or as fail to capture minidump
data. So access to flash needs to be avoided when device is doing reset for
ISP82xx.

JIRA Key: V2632FC-148

13 years agoqla2xxx: Handle interrupt registration failures more gracefully.
Chad Dupuis [Tue, 6 Dec 2011 19:53:04 +0000 (14:53 -0500)]
qla2xxx: Handle interrupt registration failures more gracefully.

If interrupt registration failed we could crash the machine as we were trying
to deference some pointers which weren't allocated yet.  Move the allocation
a little earlier and make some checks to the free resource code to make sure
that we don't try to free a resource that was never allocated.

JIRA Key: V2632FC-155

13 years agoqla2xxx: Change "Done" to "Entering" in the debug print statement in qla2x00_port_logout.
Chad Dupuis [Mon, 23 Jan 2012 13:38:11 +0000 (07:38 -0600)]
qla2xxx: Change "Done" to "Entering" in the debug print statement in qla2x00_port_logout.

JIRA Key: V2632FC-157

13 years agoqla2xxx: Logic to detect overheat condition and fail ISP82xx.
Giridhar Malavali [Thu, 19 Jul 2012 07:55:43 +0000 (13:25 +0530)]
qla2xxx: Logic to detect overheat condition and fail ISP82xx.

JIRA Key: V2632FC-79

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: Encapsulate prematurely completing mailbox commands during ISP82xx firmware...
Chad Dupuis [Thu, 19 Jul 2012 07:43:24 +0000 (13:13 +0530)]
qla2xxx: Encapsulate prematurely completing mailbox commands during ISP82xx firmware hang.

JIRA Key: V2632FC-81

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoqla2xxx: Remove unneeded DPC wakeups from qla82xx_watchdog.
Chad Dupuis [Thu, 19 Jul 2012 07:19:21 +0000 (12:49 +0530)]
qla2xxx: Remove unneeded DPC wakeups from qla82xx_watchdog.

JIRA Key: V2632FC-116

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
13 years agoMerge branch 'uek2-merge' of git://ca-git.us.oracle.com/linux-konrad-public
Maxim Uvarov [Fri, 20 Jul 2012 15:14:03 +0000 (08:14 -0700)]
Merge branch 'uek2-merge' of git://ca-git.us.oracle.com/linux-konrad-public

Conflicts:
arch/x86/xen/enlighten.c

13 years agoxen/setup: filter APERFMPERF cpuid feature out
Andre Przywara [Tue, 29 May 2012 11:07:31 +0000 (13:07 +0200)]
xen/setup: filter APERFMPERF cpuid feature out

Xen PV kernels allow access to the APERF/MPERF registers to read the
effective frequency. Access to the MSRs is however redirected to the
currently scheduled physical CPU, making consecutive read and
compares unreliable. In addition each rdmsr traps into the hypervisor.
So to avoid bogus readouts and expensive traps, disable the kernel
internal feature flag for APERF/MPERF if running under Xen.
This will
a) remove the aperfmperf flag from /proc/cpuinfo
b) not mislead the power scheduler (arch/x86/kernel/cpu/sched.c) to
   use the feature to improve scheduling (by default disabled)
c) not mislead the cpufreq driver to use the MSRs

This does not cover userland programs which access the MSRs via the
device file interface, but this will be addressed separately.

[upstream git commit 5e626254206a709c6e937f3dda69bf26c7344f6f]
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Cc: stable@vger.kernel.org # v3.0+
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/acpi: Fix potential memory leak.
Konrad Rzeszutek Wilk [Tue, 19 Jun 2012 18:39:31 +0000 (14:39 -0400)]
xen/acpi: Fix potential memory leak.

Coverity points out that we do not free in one case the
pr_backup - and sure enough we forgot.

Found by Coverity (CID 401970)

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoMerge branch 'stable/for-linus-3.6.rebased' into uek2-merge
Konrad Rzeszutek Wilk [Thu, 19 Jul 2012 23:09:22 +0000 (19:09 -0400)]
Merge branch 'stable/for-linus-3.6.rebased' into uek2-merge

* stable/for-linus-3.6.rebased:
  xen PVonHVM: move shared_info to MMIO before kexec
  xen: simplify init_hvm_pv_info
  xen: remove cast from HYPERVISOR_shared_info assignment
  xen: enable platform-pci only in a Xen guest
  xen/pv-on-hvm kexec: shutdown watches from old kernel
  Revert "xen/pv-on-hvm kexec: add xs_reset_watches to shutdown watches from old kernel"
  xen/hvc: Fix up checks when the info is allocated.
  xen/mm: zero PTEs for non-present MFNs in the initial page table
  xen/mm: do direct hypercall in xen_set_pte() if batching is unavailable
  xen/x86: add desc_equal() to compare GDT descriptors
  x86/xen: avoid updating TLS descriptors if they haven't changed
  xen: populate correct number of pages when across mem boundary (v2)
  xen/mce: add .poll method for mcelog device driver

Conflicts:
drivers/xen/xenbus/xenbus_xs.c
include/xen/interface/io/xs_wire.h

13 years agoxen PVonHVM: move shared_info to MMIO before kexec
Olaf Hering [Tue, 17 Jul 2012 15:43:35 +0000 (17:43 +0200)]
xen PVonHVM: move shared_info to MMIO before kexec

Currently kexec in a PVonHVM guest fails with a triple fault because the
new kernel overwrites the shared info page. The exact failure depends on
the size of the kernel image. This patch moves the pfn from RAM into
MMIO space before the kexec boot.

The pfn containing the shared_info is located somewhere in RAM. This
will cause trouble if the current kernel is doing a kexec boot into a
new kernel. The new kernel (and its startup code) can not know where the
pfn is, so it can not reserve the page. The hypervisor will continue to
update the pfn, and as a result memory corruption occours in the new
kernel.

One way to work around this issue is to allocate a page in the
xen-platform pci device's BAR memory range. But pci init is done very
late and the shared_info page is already in use very early to read the
pvclock. So moving the pfn from RAM to MMIO is racy because some code
paths on other vcpus could access the pfn during the small   window when
the old pfn is moved to the new pfn. There is even a  small window were
the old pfn is not backed by a mfn, and during that time all reads
return -1.

Because it is not known upfront where the MMIO region is located it can
not be used right from the start in xen_hvm_init_shared_info.

To minimise trouble the move of the pfn is done shortly before kexec.
This does not eliminate the race because all vcpus are still online when
the syscore_ops will be called. But hopefully there is no work pending
at this point in time. Also the syscore_op is run last which reduces the
risk further.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen: simplify init_hvm_pv_info
Olaf Hering [Tue, 17 Jul 2012 09:59:15 +0000 (11:59 +0200)]
xen: simplify init_hvm_pv_info

init_hvm_pv_info is called only in PVonHVM context, move it into ifdef.
init_hvm_pv_info does not fail, make it a void function.
remove arguments from init_hvm_pv_info because they are not used by the
caller.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen: remove cast from HYPERVISOR_shared_info assignment
Olaf Hering [Tue, 17 Jul 2012 09:57:41 +0000 (11:57 +0200)]
xen: remove cast from HYPERVISOR_shared_info assignment

Both have type struct shared_info so no cast is needed.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen: enable platform-pci only in a Xen guest
Olaf Hering [Tue, 10 Jul 2012 13:31:39 +0000 (15:31 +0200)]
xen: enable platform-pci only in a Xen guest

While debugging kexec issues in a PVonHVM guest I modified
xen_hvm_platform() to return false to disable all PV drivers. This
caused a crash in platform_pci_init() because it expects certain data
structures to be initialized properly.

To avoid such a crash make sure the driver is initialized only if
running in a Xen guest.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/pv-on-hvm kexec: shutdown watches from old kernel
Olaf Hering [Tue, 10 Jul 2012 12:50:03 +0000 (14:50 +0200)]
xen/pv-on-hvm kexec: shutdown watches from old kernel

Add xs_reset_watches function to shutdown watches from old kernel after
kexec boot.  The old kernel does not unregister all watches in the
shutdown path.  They are still active, the double registration can not
be detected by the new kernel.  When the watches fire, unexpected events
will arrive and the xenwatch thread will crash (jumps to NULL).  An
orderly reboot of a hvm guest will destroy the entire guest with all its
resources (including the watches) before it is rebuilt from scratch, so
the missing unregister is not an issue in that case.

With this change the xenstored is instructed to wipe all active watches
for the guest.  However, a patch for xenstored is required so that it
accepts the XS_RESET_WATCHES request from a client (see changeset
23839:42a45baf037d in xen-unstable.hg). Without the patch for xenstored
the registration of watches will fail and some features of a PVonHVM
guest are not available. The guest is still able to boot, but repeated
kexec boots will fail.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoRevert "xen/pv-on-hvm kexec: add xs_reset_watches to shutdown watches from old kernel"
Konrad Rzeszutek Wilk [Thu, 19 Jul 2012 23:07:16 +0000 (19:07 -0400)]
Revert "xen/pv-on-hvm kexec: add xs_reset_watches to shutdown watches from old kernel"

This reverts commit ddacf5ef684a655abe2bb50c4b2a5b72ae0d5e05.

13 years agoxen/hvc: Fix up checks when the info is allocated.
Konrad Rzeszutek Wilk [Tue, 26 Jun 2012 13:30:51 +0000 (09:30 -0400)]
xen/hvc: Fix up checks when the info is allocated.

Coverity would complain about this - even thought it looks OK.

CID 401957
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Conflicts:

drivers/tty/hvc/hvc_xen.c

13 years agoxen/mm: zero PTEs for non-present MFNs in the initial page table
David Vrabel [Mon, 9 Jul 2012 10:39:06 +0000 (11:39 +0100)]
xen/mm: zero PTEs for non-present MFNs in the initial page table

When constructing the initial page tables, if the MFN for a usable PFN
is missing in the p2m then that frame is initially ballooned out.  In
this case, zero the PTE (as in decrease_reservation() in
drivers/xen/balloon.c).

This is obviously safe instead of having an valid PTE with an MFN of
INVALID_P2M_ENTRY (~0).

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/mm: do direct hypercall in xen_set_pte() if batching is unavailable
David Vrabel [Mon, 9 Jul 2012 10:39:05 +0000 (11:39 +0100)]
xen/mm: do direct hypercall in xen_set_pte() if batching is unavailable

In xen_set_pte() if batching is unavailable (because the caller is in
an interrupt context such as handling a page fault) it would fall back
to using native_set_pte() and trapping and emulating the PTE write.

On 32-bit guests this requires two traps for each PTE write (one for
each dword of the PTE).  Instead, do one mmu_update hypercall
directly.

During construction of the initial page tables, continue to use
native_set_pte() because most of the PTEs being set are in writable
and unpinned pages (see phys_pmd_init() in arch/x86/mm/init_64.c) and
using a hypercall for this is very expensive.

This significantly improves page fault performance in 32-bit PV
guests.

lmbench3 test  Before    After     Improvement
----------------------------------------------
lat_pagefault  3.18 us   2.32 us   27%
lat_proc fork  356 us    313.3 us  11%

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/x86: add desc_equal() to compare GDT descriptors
David Vrabel [Mon, 9 Jul 2012 10:39:07 +0000 (11:39 +0100)]
xen/x86: add desc_equal() to compare GDT descriptors

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
[v1: Moving it to the Xen file]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agox86/xen: avoid updating TLS descriptors if they haven't changed
David Vrabel [Mon, 9 Jul 2012 10:39:08 +0000 (11:39 +0100)]
x86/xen: avoid updating TLS descriptors if they haven't changed

When switching tasks in a Xen PV guest, avoid updating the TLS
descriptors if they haven't changed.  This improves the speed of
context switches by almost 10% as much of the time the descriptors are
the same or only one is different.

The descriptors written into the GDT by Xen are modified from the
values passed in the update_descriptor hypercall so we keep shadow
copies of the three TLS descriptors to compare against.

lmbench3 test     Before  After  Improvement
--------------------------------------------
lat_ctx -s 32 24   7.19    6.52  9%
lat_pipe          12.56   11.66  7%

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen: populate correct number of pages when across mem boundary (v2)
zhenzhong.duan [Wed, 18 Jul 2012 05:06:39 +0000 (13:06 +0800)]
xen: populate correct number of pages when across mem boundary (v2)

When populate pages across a mem boundary at bootup, the page count
populated isn't correct. This is due to mem populated to non-mem
region and ignored.

Pfn range is also wrongly aligned when mem boundary isn't page aligned.

For a dom0 booted with dom_mem=3368952K(0xcd9ff000-4k) dmesg diff is:
 [    0.000000] Freeing 9e-100 pfn range: 98 pages freed
 [    0.000000] 1-1 mapping on 9e->100
 [    0.000000] 1-1 mapping on cd9ff->100000
 [    0.000000] Released 98 pages of unused memory
 [    0.000000] Set 206435 page(s) to 1-1 mapping
-[    0.000000] Populating cd9fe-cda00 pfn range: 1 pages added
+[    0.000000] Populating cd9fe-cd9ff pfn range: 1 pages added
+[    0.000000] Populating 100000-100061 pfn range: 97 pages added
 [    0.000000] BIOS-provided physical RAM map:
 [    0.000000] Xen: 0000000000000000 - 000000000009e000 (usable)
 [    0.000000] Xen: 00000000000a0000 - 0000000000100000 (reserved)
 [    0.000000] Xen: 0000000000100000 - 00000000cd9ff000 (usable)
 [    0.000000] Xen: 00000000cd9ffc00 - 00000000cda53c00 (ACPI NVS)
...
 [    0.000000] Xen: 0000000100000000 - 0000000100061000 (usable)
 [    0.000000] Xen: 0000000100061000 - 000000012c000000 (unusable)
...
 [    0.000000] MEMBLOCK configuration:
...
-[    0.000000]  reserved[0x4]       [0x000000cd9ff000-0x000000cd9ffbff], 0xc00 bytes
-[    0.000000]  reserved[0x5]       [0x00000100000000-0x00000100060fff], 0x61000 bytes

Related xen memory layout:
(XEN) Xen-e820 RAM map:
(XEN)  0000000000000000 - 000000000009ec00 (usable)
(XEN)  00000000000f0000 - 0000000000100000 (reserved)
(XEN)  0000000000100000 - 00000000cd9ffc00 (usable)

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
[v2: If xen_do_chunk fail(populate), abort this chunk and any others]
Suggested by David, thanks.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoSPEC: v2.6.39-300.0.6
Maxim Uvarov [Wed, 18 Jul 2012 11:10:04 +0000 (04:10 -0700)]
SPEC: v2.6.39-300.0.6

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoexport devinet_ioctl
Maxim Uvarov [Thu, 12 Jul 2012 14:51:22 +0000 (07:51 -0700)]
export devinet_ioctl

Orabug: 14306942
RDS will be using devinet_ioctl() to implement IP failover/fallback for IB
devices to support active/active. This is an enhancement request to export
devinet_ioctl() so non-kernel modules such as RDS can use it.
Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoChanged length for strncpy to OVMM_MAX_NAME_LEN
Cathy Avery [Thu, 12 Jul 2012 13:45:08 +0000 (09:45 -0400)]
Changed length for strncpy to OVMM_MAX_NAME_LEN

Orabug: 14233627
This is the fix for Oracle Bug 14233627
Signed-off-by: Cathy Avery <cathy.avery@oracle.com>
13 years agoAdd Oracle VM guest messaging driver
Maxim Uvarov [Thu, 12 Jul 2012 15:43:38 +0000 (08:43 -0700)]
Add Oracle VM guest messaging driver

Signed-off-by: Cathy Avery <cathy.avery@oracle.com>
Signed-off-by: Steve Prochniak <steve.prochniak@oracle.com>
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Conflicts:

drivers/xen/Kconfig

13 years agoMerge branch 'uek2-300#bug14306496' of git://ca-git.us.oracle.com/linux-guasun-public
Maxim Uvarov [Thu, 12 Jul 2012 15:41:59 +0000 (08:41 -0700)]
Merge branch 'uek2-300#bug14306496' of git://ca-git.us.oracle.com/linux-guasun-public

13 years agoSPEC: v2.6.39-300.0.5
Maxim Uvarov [Tue, 10 Jul 2012 17:55:51 +0000 (10:55 -0700)]
SPEC: v2.6.39-300.0.5

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoepoll: clear the tfile_check_list on -ELOOP
Guangyu Sun [Wed, 11 Jul 2012 01:48:04 +0000 (18:48 -0700)]
epoll: clear the tfile_check_list on -ELOOP

Orabug: 14306496
upstream commit: 13d518074a952d33d47c428419693f63389547e9

An epoll_ctl(,EPOLL_CTL_ADD,,) operation can return '-ELOOP' to prevent
circular epoll dependencies from being created.  However, in that case we
do not properly clear the 'tfile_check_list'.  Thus, add a call to
clear_tfile_check_list() for the -ELOOP case.

Signed-off-by: Jason Baron <jbaron@redhat.com>
Reported-by: Yurij M. Plotnikov <Yurij.Plotnikov@oktetlabs.ru>
Cc: Nelson Elhage <nelhage@nelhage.com>
Cc: Davide Libenzi <davidel@xmailserver.org>
Tested-by: Alexandra N. Kossovsky <Alexandra.Kossovsky@oktetlabs.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
13 years agoSPEC: v2.6.39-300.0.5
Maxim Uvarov [Tue, 10 Jul 2012 17:55:51 +0000 (10:55 -0700)]
SPEC: v2.6.39-300.0.5

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agotg3: fix VLAN tagging regression
Kasper Pedersen [Tue, 20 Sep 2011 12:41:17 +0000 (12:41 +0000)]
tg3: fix VLAN tagging regression

commit 92cd3a17ce9c719abb4c28dee3438e0c641f8de4
    tg3: Simplify tx bd assignments

broke VLAN tagging on outbound packets.
It ifdef'ed BCM_KERNEL_SUPPORTS_8021Q, but this
is not set anywhere. So vlan never gets set, and
all packets are sent with vlan=0.

v2: We can just remove the test. vlan_tx_tag_present
is valid regardless of whether the 802.1q module
is built.

Tested on BCM5721 rev 11.

Signed-off-by: Kasper Pedersen <kernel@kasperkp.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5c1e688388f629e8d8e88183b5ebc21e209252aa)

Conflicts:
drivers/net/tg3.c

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agothp: avoid atomic64_read in pmd_read_atomic for 32bit PAE
Andrea Arcangeli [Wed, 20 Jun 2012 19:52:57 +0000 (12:52 -0700)]
thp: avoid atomic64_read in pmd_read_atomic for 32bit PAE

Orabug: 14300370
In the x86 32bit PAE CONFIG_TRANSPARENT_HUGEPAGE=y case while holding the
mmap_sem for reading, cmpxchg8b cannot be used to read pmd contents under
Xen.

So instead of dealing only with "consistent" pmdvals in
pmd_none_or_trans_huge_or_clear_bad() (which would be conceptually
simpler) we let pmd_none_or_trans_huge_or_clear_bad() deal with pmdvals
where the low 32bit and high 32bit could be inconsistent (to avoid having
to use cmpxchg8b).

The only guarantee we get from pmd_read_atomic is that if the low part of
the pmd was found null, the high part will be null too (so the pmd will be
considered unstable).  And if the low part of the pmd is found "stable"
later, then it means the whole pmd was read atomically (because after a
pmd is stable, neither MADV_DONTNEED nor page faults can alter it anymore,
and we read the high part after the low part).

In the 32bit PAE x86 case, it is enough to read the low part of the pmdval
atomically to declare the pmd as "stable" and that's true for THP and no
THP, furthermore in the THP case we also have a barrier() that will
prevent any inconsistent pmdvals to be cached by a later re-read of the
*pmd.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>
Cc: Ulrich Obergfell <uobergfe@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: Larry Woodman <lwoodman@redhat.com>
Cc: Petr Matousek <pmatouse@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Tested-by: Andrew Jones <drjones@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years ago[SCSI] libfc: fcoe_transport_create fails in single-CPU environment
Steven Clark [Fri, 9 Mar 2012 22:50:30 +0000 (14:50 -0800)]
[SCSI] libfc: fcoe_transport_create fails in single-CPU environment

Orabug: 14239242
(mainline commit: 011a9008b11604b12e8386fa6ac3433ab3175dc2)
Starting fcoe fails at fcoe_transport_create when attempting to allocate a
pool of 4K exchanges on a 64-bit single-CPU environment because the call to
__alloc_percpu() is greater than the max of 32K.  This patch reduces the
number of exchanges to fit within the maximum allowed space.

[ Whitespace problems fixed by Robert Love to satisfy chechpatch.pl ]

Signed-off-by: Steven Clark <sclark@crossbeam.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoSPEC: v2.6.39-300.0.4
Maxim Uvarov [Mon, 9 Jul 2012 11:05:49 +0000 (04:05 -0700)]
SPEC: v2.6.39-300.0.4

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoMerge branch 'uek-2.6.39-200' of git://ca-git.us.oracle.com/linux-uek-2.6.39 into...
Maxim Uvarov [Mon, 9 Jul 2012 10:11:39 +0000 (03:11 -0700)]
Merge branch 'uek-2.6.39-200' of git://ca-git.us.oracle.com/linux-uek-2.6.39 into master_stableup

Conflicts:
kernel/time/timekeeping.c
uek-rpm/ol5/kernel-uek.spec
uek-rpm/ol6/kernel-uek.spec

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
13 years agoRevert "mm: mempolicy: Let vma_merge and vma_split handle vma->vm_policy linkages"
Guangyu Sun [Fri, 6 Jul 2012 15:19:53 +0000 (08:19 -0700)]
Revert "mm: mempolicy: Let vma_merge and vma_split handle vma->vm_policy linkages"

This reverts commit 05f144a0d5c2207a0349348127f996e104ad7404.

This patch is broken and should have been reverted by now by an
alternative fix.

Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>