]> xenbits.xensource.com Git - people/aperard/linux-chromebook.git/log
people/aperard/linux-chromebook.git
12 years agoAdd .config file. previous_config
Anthony PERARD [Tue, 9 Apr 2013 15:02:52 +0000 (16:02 +0100)]
Add .config file.

12 years agoignore uart initialisation. previous_master
Anthony PERARD [Mon, 25 Feb 2013 19:06:36 +0000 (19:06 +0000)]
ignore uart initialisation.

12 years agoxen: arm: implement remap interfaces needed for privcmd mappings.
Ian Campbell [Wed, 3 Oct 2012 15:37:09 +0000 (16:37 +0100)]
xen: arm: implement remap interfaces needed for privcmd mappings.

We use XENMEM_add_to_physmap_range which is the preferred interface
for foreign mappings.

Acked-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agocompile with fewer CONFIG_ symbols
Anthony PERARD [Mon, 25 Feb 2013 18:10:13 +0000 (18:10 +0000)]
compile with fewer CONFIG_ symbols

12 years agoxen: arm: make p2m operations NOPs
Ian Campbell [Wed, 17 Oct 2012 08:39:17 +0000 (09:39 +0100)]
xen: arm: make p2m operations NOPs

This makes common code less ifdef-y and is consistent with PVHVM on
x86.

Also note that phys_to_machine_mapping_valid should take a pfn
argument and make it do so.

Add __set_phys_to_machine, make set_phys_to_machine a simple wrapper
(on systems with non-nop implementations the outer one can allocate
new p2m pages).

Make __set_phys_to_machine check for identity mapping or invalid only.

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen: correctly use xen_pfn_t in remap_domain_mfn_range.
Ian Campbell [Tue, 16 Oct 2012 16:19:15 +0000 (17:19 +0100)]
xen: correctly use xen_pfn_t in remap_domain_mfn_range.

For Xen on ARM a PFN is 64 bits so we need to use the appropriate
type here.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[v2: include the necessary header,
Reported-by: Fengguang Wu <fengguang.wu@intel.com> ]
12 years agoxen: arm: enable balloon driver
Ian Campbell [Wed, 3 Oct 2012 11:28:26 +0000 (12:28 +0100)]
xen: arm: enable balloon driver

The code is now in a state where can just enable it.

Drop the *_xenballloned_pages duplicates since these are now supplied
by the balloon code.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Conflicts:
arch/arm/xen/enlighten.c

12 years agoxen: balloon: allow PVMMU interfaces to be compiled out
Ian Campbell [Wed, 3 Oct 2012 11:17:50 +0000 (12:17 +0100)]
xen: balloon: allow PVMMU interfaces to be compiled out

The ARM platform has no concept of PVMMU and therefor no
HYPERVISOR_update_va_mapping et al. Allow this code to be compiled out
when not required.

In some similar situations (e.g. P2M) we have defined dummy functions
to avoid this, however I think we can/should draw the line at dummying
out actual hypercalls.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Conflicts:
drivers/xen/Kconfig

12 years agoxen: balloon: use correct type for frame_list
Ian Campbell [Wed, 17 Oct 2012 08:39:16 +0000 (09:39 +0100)]
xen: balloon: use correct type for frame_list

This is now a xen_pfn_t.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen: balloon: don't include e820.h
Ian Campbell [Wed, 17 Oct 2012 08:39:15 +0000 (09:39 +0100)]
xen: balloon: don't include e820.h

This breaks on !X86 and AFAICT is not required on X86 either.

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen: privcmd: support autotranslated physmap guests.
Mukesh Rathor [Thu, 18 Oct 2012 00:11:21 +0000 (17:11 -0700)]
xen: privcmd: support autotranslated physmap guests.

PVH and ARM only support the batch interface. To map a foreign page to
a process, the PFN must be allocated and the autotranslated path uses
ballooning for that purpose.

The returned PFN is then mapped to the foreign page.
xen_unmap_domain_mfn_range() is introduced to unmap these pages via the
privcmd close call.

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
[v1: Fix up privcmd_close]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
[v2: used for ARM too]

12 years agoxen: add pages parameter to xen_remap_domain_mfn_range
Ian Campbell [Wed, 17 Oct 2012 20:37:49 +0000 (13:37 -0700)]
xen: add pages parameter to xen_remap_domain_mfn_range

Also introduce xen_unmap_domain_mfn_range. These are the parts of
Mukesh's "xen/pvh: Implement MMU changes for PVH" which are also
needed as a baseline for ARM privcmd support.

The original patch was:

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This derivative is also:

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/privcmd: Correctly return success from IOCTL_PRIVCMD_MMAPBATCH
Mats Petersson [Fri, 16 Nov 2012 18:36:49 +0000 (18:36 +0000)]
xen/privcmd: Correctly return success from IOCTL_PRIVCMD_MMAPBATCH

This is a regression introduced by ceb90fa0 (xen/privcmd: add
PRIVCMD_MMAPBATCH_V2 ioctl).  It broke xentrace as it used
xc_map_foreign() instead of xc_map_foreign_bulk().

Most code-paths prefer the MMAPBATCH_V2, so this wasn't very obvious
that it broke. The return value is set early on to -EINVAL, and if all
goes well, the "set top bits of the MFN's" never gets called, so the
return value is still EINVAL when the function gets to the end, causing
the caller to think it went wrong (which it didn't!)

Now also including Andres "move the ret = -EINVAL into the error handling
path, as this avoids other similar errors in future.

Signed-off-by: Mats Petersson <mats.petersson@citrix.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/privcmd: return -EFAULT on error
Dan Carpenter [Sat, 8 Sep 2012 09:57:35 +0000 (12:57 +0300)]
xen/privcmd: return -EFAULT on error

__copy_to_user() returns the number of bytes remaining to be copied but
we want to return a negative error code here.

Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/privcmd: Fix mmap batch ioctl error status copy back.
Andres Lagar-Cavilla [Thu, 6 Sep 2012 17:24:39 +0000 (13:24 -0400)]
xen/privcmd: Fix mmap batch ioctl error status copy back.

Copy back of per-slot error codes is only necessary for V2. V1 does not provide
an error array, so copyback will unconditionally set the global rc to EFAULT.
Only copyback for V2.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/privcmd: add PRIVCMD_MMAPBATCH_V2 ioctl
Andres Lagar-Cavilla [Fri, 31 Aug 2012 13:59:30 +0000 (09:59 -0400)]
xen/privcmd: add PRIVCMD_MMAPBATCH_V2 ioctl

PRIVCMD_MMAPBATCH_V2 extends PRIVCMD_MMAPBATCH with an additional
field for reporting the error code for every frame that could not be
mapped.  libxc prefers PRIVCMD_MMAPBATCH_V2 over PRIVCMD_MMAPBATCH.

Also expand PRIVCMD_MMAPBATCH to return appropriate error-encoding top nibble
in the mfn array.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoioremap_cache
Stefano Stabellini [Mon, 11 Feb 2013 17:15:57 +0000 (17:15 +0000)]
ioremap_cache

Conflicts:
drivers/tty/hvc/hvc_xen.c

12 years agocompile fixes
Anthony PERARD [Tue, 19 Feb 2013 18:31:44 +0000 (18:31 +0000)]
compile fixes

12 years agoxen/Makefile: fix dom-y build
Stefano Stabellini [Tue, 2 Oct 2012 15:00:43 +0000 (16:00 +0100)]
xen/Makefile: fix dom-y build

We need to add $(dom0-y) to obj-$(CONFIG_XEN_DOM0) after dom0-y is
defined otherwise we end up adding nothing.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen: mark xen_init_IRQ __init
Stefano Stabellini [Tue, 2 Oct 2012 14:57:57 +0000 (15:57 +0100)]
xen: mark xen_init_IRQ __init

xen_init_IRQ should be marked __init because it calls other functions
marked __init and is always called by functions marked __init (on both
x86 and arm).

Also remove the unused EXPORT_SYMBOL_GPL(xen_init_IRQ).

Both changes were introduced by "xen/arm: receive Xen events on ARM".

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/xen_initial_domain: check that xen_start_info is initialized
Stefano Stabellini [Wed, 3 Oct 2012 17:08:52 +0000 (18:08 +0100)]
xen/xen_initial_domain: check that xen_start_info is initialized

Since commit commit 4c071ee5268f7234c3d084b6093bebccc28cdcba ("arm:
initial Xen support") PV on HVM guests can be xen_initial_domain.
However PV on HVM guests might have an unitialized xen_start_info, so
check before accessing its fields.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/arm: use the __HVC macro
Stefano Stabellini [Wed, 24 Oct 2012 15:26:08 +0000 (16:26 +0100)]
xen/arm: use the __HVC macro

Use the new __HVC macro in hypercall.S.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/arm: Fix compile errors when drivers are compiled as modules (export more).
Stefano Stabellini [Thu, 8 Nov 2012 15:58:55 +0000 (15:58 +0000)]
xen/arm: Fix compile errors when drivers are compiled as modules (export more).

The commit 911dec0db4de6ccc544178a8ddaf9cec0a11d533
"xen/arm: Fix compile errors when drivers are compiled as modules." exports
the neccessary functions. But to guard ourselves against out-of-tree modules
and future drivers hitting this, lets export all of the relevant
hypercalls.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Conflicts:
arch/arm/xen/enlighten.c

12 years agoarm: introduce a DTS for Xen unprivileged virtual machines
Stefano Stabellini [Mon, 24 Sep 2012 16:40:52 +0000 (16:40 +0000)]
arm: introduce a DTS for Xen unprivileged virtual machines

Given that the xenvm machine is based on vexpress but with an extremely
limited selection of peripherals (the guest is supposed to use virtual
devices instead), add "xen,xenvm" to the list of compatible machines in
mach-vexpress.

Changes in v3:

- add comments to mark fields that are likely to be changed by the
hypervisor.

Changes in v2:

- remove include skeleton;
- use #address-cells = <2> and #size-cells = <2>;
- remove the debug bootargs;
- use memory@80000000 instead of memory;
- remove the ranges and interrupt-map from the motherboard node;
- set the machine compatible to "xen,xenvm-4.2", "xen,xenvm";
- rename the dts file to xenvm-4.2.dts;
- add "xen,xenvm" to the list of compatible DT strings to mach-vexpress.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Pawel Moll <pawel.moll@arm.com> (v2m changes)
Conflicts:
arch/arm/mach-vexpress/Makefile.boot

12 years agoMAINTAINERS: add myself as Xen ARM maintainer
Stefano Stabellini [Fri, 14 Sep 2012 13:35:15 +0000 (13:35 +0000)]
MAINTAINERS: add myself as Xen ARM maintainer

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: Arnd Bergmann <arnd@arndb.de>
12 years agoxen/arm: compile netback
Stefano Stabellini [Wed, 8 Aug 2012 17:21:23 +0000 (17:21 +0000)]
xen/arm: compile netback

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/arm: compile blkfront and blkback
Stefano Stabellini [Wed, 8 Aug 2012 17:21:14 +0000 (17:21 +0000)]
xen/arm: compile blkfront and blkback

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/arm: implement alloc/free_xenballooned_pages with alloc_pages/kfree
Stefano Stabellini [Wed, 8 Aug 2012 17:20:58 +0000 (17:20 +0000)]
xen/arm: implement alloc/free_xenballooned_pages with alloc_pages/kfree

Only until we get the balloon driver to work.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/arm: receive Xen events on ARM
Stefano Stabellini [Fri, 14 Sep 2012 13:37:32 +0000 (13:37 +0000)]
xen/arm: receive Xen events on ARM

Compile events.c on ARM.
Parse, map and enable the IRQ to get event notifications from the device
tree (node "/xen").

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/arm: initialize grant_table on ARM
Stefano Stabellini [Thu, 13 Sep 2012 12:06:52 +0000 (12:06 +0000)]
xen/arm: initialize grant_table on ARM

Initialize the grant table mapping at the address specified at index 0
in the DT under the /xen node.
After the grant table is initialized, call xenbus_probe (if not dom0).

Changes in v2:

- introduce GRANT_TABLE_PHYSADDR;
- remove unneeded initialization of boot_max_nr_grant_frames.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen/arm: get privilege status
Stefano Stabellini [Wed, 8 Aug 2012 17:20:18 +0000 (17:20 +0000)]
xen/arm: get privilege status

Use Xen features to figure out if we are privileged.

XENFEAT_dom0 was introduced by 23735 in xen-unstable.hg.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/arm: introduce CONFIG_XEN on ARM
Stefano Stabellini [Mon, 17 Sep 2012 14:58:17 +0000 (14:58 +0000)]
xen/arm: introduce CONFIG_XEN on ARM

Changes in v5:

- make XEN_DOM0 depend on XEN;
- avoid "select XEN_DOM0" in XEN.

Changes in v2:

- mark Xen guest support on ARM as EXPERIMENTAL.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: Sergei Shtylyov <sshtylyov@mvista.com>
12 years agoxen: do not compile manage, balloon, pci, acpi, pcpu and cpu_hotplug on ARM
Stefano Stabellini [Thu, 13 Sep 2012 17:28:06 +0000 (17:28 +0000)]
xen: do not compile manage, balloon, pci, acpi, pcpu and cpu_hotplug on ARM

Changes in v4:
- compile pcpu only on x86;
- use "+=" instead of ":=" for dom0- targets.

Changes in v2:

- make pci.o depend on CONFIG_PCI and acpi.o depend on CONFIG_ACPI.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Conflicts:
drivers/xen/Makefile

12 years agoxen/arm: Introduce xen_ulong_t for unsigned long
Stefano Stabellini [Fri, 14 Sep 2012 13:34:43 +0000 (13:34 +0000)]
xen/arm: Introduce xen_ulong_t for unsigned long

All the original Xen headers have xen_ulong_t as unsigned long type, however
when they have been imported in Linux, xen_ulong_t has been replaced with
unsigned long. That might work for x86 and ia64 but it does not for arm.
Bring back xen_ulong_t and let each architecture define xen_ulong_t as they
see fit.

Also explicitly size pointers (__DEFINE_GUEST_HANDLE) to 64 bit.

Changes in v3:

- remove the incorrect changes to multicall_entry;
- remove the change to apic_physbase.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/arm: Xen detection and shared_info page mapping
Stefano Stabellini [Fri, 14 Sep 2012 10:47:52 +0000 (10:47 +0000)]
xen/arm: Xen detection and shared_info page mapping

Check for a node in the device tree compatible with "xen,xen", if it is
present set xen_domain_type to XEN_HVM_DOMAIN and continue
initialization.

Map the real shared info page using XENMEM_add_to_physmap with
XENMAPSPACE_shared_info.

Changes in v4:

- simpler parsing of Xen version in the compatible DT node.

Changes in v3:

- use the "xen,xen" notation rather than "arm,xen";
- add an additional check on the presence of the Xen version.

Changes in v2:

- replace pr_info with pr_debug.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agodocs: Xen ARM DT bindings
Stefano Stabellini [Tue, 18 Sep 2012 09:57:47 +0000 (09:57 +0000)]
docs: Xen ARM DT bindings

Add a doc to describe the Xen ARM device tree bindings

Changes in v5:

- add a comment about the size of the grant table memory region;
- add a comment about the required presence of a GIC node;
- specify that the described properties are part of a top-level
"hypervisor" node;
- specify #address-cells and #size-cells for the example.

Changes in v4:

- "xen,xen" should be last as it is less specific;
- update reg property using 2 address-cells and 2 size-cells.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
CC: devicetree-discuss@lists.ozlabs.org
CC: David Vrabel <david.vrabel@citrix.com>
CC: Rob Herring <robherring2@gmail.com>
CC: Dave Martin <dave.martin@linaro.org>
12 years agoxen/arm: empty implementation of grant_table arch specific functions
Stefano Stabellini [Wed, 8 Aug 2012 16:34:11 +0000 (16:34 +0000)]
xen/arm: empty implementation of grant_table arch specific functions

Changes in v2:

- return -ENOSYS rather than -1.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/arm: sync_bitops
Stefano Stabellini [Wed, 8 Aug 2012 16:34:01 +0000 (16:34 +0000)]
xen/arm: sync_bitops

sync_bitops functions are equivalent to the SMP implementation of the
original functions, independently from CONFIG_SMP being defined.

We need them because _set_bit etc are not SMP safe if !CONFIG_SMP. But
under Xen you might be communicating with a completely external entity
who might be on another CPU (e.g. two uniprocessor guests communicating
via event channels and grant tables). So we need a variant of the bit
ops which are SMP safe even on a UP kernel.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/arm: page.h definitions
Stefano Stabellini [Wed, 8 Aug 2012 16:33:46 +0000 (16:33 +0000)]
xen/arm: page.h definitions

ARM Xen guests always use paging in hardware, like PV on HVM guests in
the X86 world.

Changes in v3:

- improve comments.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/arm: hypercalls
Stefano Stabellini [Fri, 14 Sep 2012 13:33:21 +0000 (13:33 +0000)]
xen/arm: hypercalls

Use r12 to pass the hypercall number to the hypervisor.

We need a register to pass the hypercall number because we might not
know it at compile time and HVC only takes an immediate argument.

Among the available registers r12 seems to be the best choice because it
is defined as "intra-procedure call scratch register".

Use the ISS to pass an hypervisor specific tag.

Changes in v2:
- define an HYPERCALL macro for 5 arguments hypercall wrappers, even if
at the moment is unused;
- use ldm instead of pop;
- fix up comments.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoarm: initial Xen support
Stefano Stabellini [Fri, 14 Sep 2012 13:53:39 +0000 (13:53 +0000)]
arm: initial Xen support

- Basic hypervisor.h and interface.h definitions.
- Skeleton enlighten.c, set xen_start_info to an empty struct.
- Make xen_initial_domain dependent on the SIF_PRIVILIGED_BIT.

The new code only compiles when CONFIG_XEN is set, that is going to be
added to arch/arm/Kconfig in patch #11 "xen/arm: introduce CONFIG_XEN on
ARM".

Changes in v3:

- improve comments.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/arm: compile and run xenbus
Stefano Stabellini [Fri, 14 Sep 2012 11:13:12 +0000 (12:13 +0100)]
xen/arm: compile and run xenbus

bind_evtchn_to_irqhandler can legitimately return 0 (irq 0): it is not
an error.

If Linux is running as an HVM domain and is running as Dom0, use
xenstored_local_init to initialize the xenstore page and event channel.

Changes in v4:
- do not xs_reset_watches on dom0.

Changes in v2:
- refactor xenbus_init.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[v5: Fixed case switch indentations]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Conflicts:
drivers/xen/xenbus/xenbus_xs.c

12 years agoxen: resynchronise grant table status codes with upstream
Ian Campbell [Fri, 14 Sep 2012 07:19:01 +0000 (08:19 +0100)]
xen: resynchronise grant table status codes with upstream

Adds GNTST_address_too_big and GNTST_eagain.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen: missing includes
Stefano Stabellini [Mon, 6 Aug 2012 14:27:09 +0000 (15:27 +0100)]
xen: missing includes

Changes in v2:
- remove pvclock hack;
- remove include linux/types.h from xen/interface/xen.h.
v3:
- Compile under IA64
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen: clear IRQ_NOAUTOEN and IRQ_NOREQUEST
Stefano Stabellini [Wed, 22 Aug 2012 16:20:15 +0000 (17:20 +0100)]
xen: clear IRQ_NOAUTOEN and IRQ_NOREQUEST

Reset the IRQ_NOAUTOEN and IRQ_NOREQUEST flags that are enabled by
default on ARM. If IRQ_NOAUTOEN is set, __setup_irq doesn't call
irq_startup, that is responsible for calling irq_unmask at startup time.
As a result event channels remain masked.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen: allow privcmd for HVM guests
Stefano Stabellini [Wed, 22 Aug 2012 16:20:16 +0000 (17:20 +0100)]
xen: allow privcmd for HVM guests

This patch removes the "return -ENOSYS" for auto_translated_physmap
guests from privcmd_mmap, thus it allows ARM guests to issue privcmd
mmap calls. However privcmd mmap calls are still going to fail for HVM
and hybrid guests on x86 because the xen_remap_domain_mfn_range
implementation is currently PV only.

Changes in v2:

- better commit message;
- return -EINVAL from xen_remap_domain_mfn_range if
  auto_translated_physmap.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen: Introduce xen_pfn_t for pfn and mfn types
Stefano Stabellini [Wed, 22 Aug 2012 16:20:14 +0000 (17:20 +0100)]
xen: Introduce xen_pfn_t for pfn and mfn types

All the original Xen headers have xen_pfn_t as mfn and pfn type, however
when they have been imported in Linux, xen_pfn_t has been replaced with
unsigned long. That might work for x86 and ia64 but it does not for arm.
Bring back xen_pfn_t and let each architecture define xen_pfn_t as they
see fit.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/events: fix unmask_evtchn for PV on HVM guests
Stefano Stabellini [Wed, 22 Aug 2012 16:20:11 +0000 (17:20 +0100)]
xen/events: fix unmask_evtchn for PV on HVM guests

When unmask_evtchn is called, if we already have an event pending, we
just set evtchn_pending_sel waiting for local_irq_enable to be called.
That is because PV guests set the irq_enable pvops to
xen_irq_enable_direct in xen_setup_vcpu_info_placement:
xen_irq_enable_direct is implemented in assembly in
arch/x86/xen/xen-asm.S and call xen_force_evtchn_callback if
XEN_vcpu_info_pending is set.

However HVM guests (and ARM guests) do not change or do not have the
irq_enable pvop, so evtchn_unmask cannot work properly for them.

Considering that having the pending_irq bit set when unmask_evtchn is
called is not very common, and it is simpler to keep the
native_irq_enable implementation for HVM guests (and ARM guests), the
best thing to do is just use the EVTCHNOP_unmask hypercall (Xen
re-injects pending events in response).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agodebug: Xen dts, add dom0 bootarg, remove second cpu, remove dump-oops.
Anthony PERARD [Tue, 19 Feb 2013 16:51:29 +0000 (16:51 +0000)]
debug: Xen dts, add dom0 bootarg, remove second cpu, remove dump-oops.

12 years agofixup! DEBUG Xen: have proper gic
Anthony PERARD [Tue, 19 Feb 2013 16:50:37 +0000 (16:50 +0000)]
fixup! DEBUG Xen: have proper gic

12 years agoHACK! arm: set v7 translation table entries as uncachable
David Vrabel [Mon, 17 Dec 2012 12:30:58 +0000 (12:30 +0000)]
HACK! arm: set v7 translation table entries as uncachable

There appears to be a bug in the model where the MMU does not
correctly see updates to translation table entries if they are marked
as cachable.  This bug only happens when running under the Xen
hypervisor.

As a workaround, mark the entries as uncachable.  This decreases
performance.

[ijc - rebase, applying to both proc-v7-{2,3}level.S]

12 years agoARM: 7511/1: opcodes: Opcode definitions for the Virtualization Extensions
Dave Martin [Mon, 3 Sep 2012 12:49:25 +0000 (13:49 +0100)]
ARM: 7511/1: opcodes: Opcode definitions for the Virtualization Extensions

For now, this patch just adds a definition for the HVC instruction.
More can be added here later, as needed.

Now that we have a real example of how to use the opcode injection
macros properly, this patch also adds a cross-reference from the
explanation in opcodes.h (since without an example, figuring out
how to use the macros is not that easy).

Signed-off-by: Dave Martin <dave.martin@linaro.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Conflicts:
arch/arm/include/asm/opcodes.h

12 years agoDEBUG Xen: have proper gic
Anthony PERARD [Fri, 30 Nov 2012 12:25:59 +0000 (12:25 +0000)]
DEBUG Xen: have proper gic

12 years agoCHROMIUM: Input: cyapa - Set to power mode OFF on remove
Benson Leung [Thu, 6 Dec 2012 20:24:42 +0000 (12:24 -0800)]
CHROMIUM: Input: cyapa - Set to power mode OFF on remove

If the driver is unloaded, set the trackpad to the lowest
power state.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=Set CONFIG_MOUSE_CYAPA=m in the chromeos config.
Builds clean.
Load the driver on a test system with the trackpad INT line scoped.
Check that the touchpad is functional.
rmmod cyapa to unload the cyapa module.
Click on the trackpad.
Check that the INT line does not assert on the scope, indicating
that the trackpad is indeed in OFF power state.

Change-Id: I11528776c82468a2d35a21fe22f5a6c7781d7ec0
Reviewed-on: https://gerrit.chromium.org/gerrit/42281
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
12 years agoCHROMIUM: Input: cyapa - Change phys to use a static array in cyapa
Benson Leung [Thu, 6 Dec 2012 20:44:26 +0000 (12:44 -0800)]
CHROMIUM: Input: cyapa - Change phys to use a static array in cyapa

Simplify this so we don't have to worry about freeing memory
later.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=builds clean.
cat /proc/bus/input/devices | grep -A1 cyapa
Check that the output is something like this (middle number will vary
based on adapter number on particular platform and kernel):
N: Name="cyapa"
P: Phys=i2c-1-0067/input0

Change-Id: I13fe249fb0ac83ce2703c22cb4dcc0bf89f0aa9f
Reviewed-on: https://gerrit.chromium.org/gerrit/42279
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
12 years agoCHROMIUM: Input: cyapa - Remove BL_KEY defines.
Benson Leung [Wed, 5 Dec 2012 23:52:04 +0000 (15:52 -0800)]
CHROMIUM: Input: cyapa - Remove BL_KEY defines.

These defines are not used anywhere in the driver.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=Builds clean.

Change-Id: I478862c52ba065af3af270ad3ec5c04592979123
Reviewed-on: https://gerrit.chromium.org/gerrit/42278
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
12 years agoCHROMIUM: Input: cyapa - Only set INPUT_PROP_BUTTONPAD on buttonpads
Benson Leung [Thu, 6 Dec 2012 21:00:36 +0000 (13:00 -0800)]
CHROMIUM: Input: cyapa - Only set INPUT_PROP_BUTTONPAD on buttonpads

Use the button capabilities to determine if this is a buttonpad,
ie, one where there is a single button under the trackpad.

If there is exactly one physical button, a left button, then set
INPUT_PROP_BUTTONPAD.

Signed-off-by: Benson Leung <bleung@chromium.org>
BUG=chromium-os:21047
TEST=builds clean.
Test on two systems, one with a buttonpad (such as Lumpy)
and another with real physical buttons (Butterfly).
Do the following on both:
from crosh, run tpcontrol log
Then, from the shell, grep isButtonPad /var/log/touchpad_activity_log.txt
On Lumpy, this should return "isButtonPad": true
On Butterfly, this should return "isButtonPad": false

Change-Id: Ic46b5a7c9585f22bef7693be53c0344a62ba331a
Reviewed-on: https://gerrit.chromium.org/gerrit/42277
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
12 years agoCHROMIUM: spring: dts: add Atmel trackpad configuration
Vincent Palatin [Wed, 13 Feb 2013 20:24:49 +0000 (12:24 -0800)]
CHROMIUM: spring: dts: add Atmel trackpad configuration

The Cypress one is defined in the common device tree,
so we currently define both of them.

Also add another entry if the trackpad is in bootloader mode at
address 0x25.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17825
TEST=boot a machine with an Atmel trackpad attached and one with Cypress
trackpad and have a working pointer on both of them.

Change-Id: I1886f7d3b2eedf39d73ca31376bd3229f8373b2d
Reviewed-on: https://gerrit.chromium.org/gerrit/43230
Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: input: atmel_mxt_ts - bail out early if we have no hardware
Vincent Palatin [Wed, 13 Feb 2013 23:29:49 +0000 (15:29 -0800)]
CHROMIUM: input: atmel_mxt_ts - bail out early if we have no hardware

When using the device tree to configure the kernel I2C devices,
the devices are not probed. So if we want to support multiple optional
peripherals, we might end up executing their probe callback.
In that case, just probe early the Atmel chip on the i2c and bail out
early if it is not present.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17825
TEST=boot a machine with an Atmel trackpad attached and one with Cypress
trackpad and have a working pointer on both of them.

Change-Id: I0c948cac2a38f587cc5f1efa5ba424715f25804d
Reviewed-on: https://gerrit.chromium.org/gerrit/43229
Reviewed-by: Benson Leung <bleung@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: input: cyapa - bail out early if we have no hardware
Vincent Palatin [Wed, 13 Feb 2013 23:29:49 +0000 (15:29 -0800)]
CHROMIUM: input: cyapa - bail out early if we have no hardware

When using the device tree to configure the kernel I2C devices,
the devices are not probed. So if we want to support multiple optional
peripherals, we might end up executing their probe callback.
In that case, just probe early the Cypress chip on the i2c and bail out
early if it is not present.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17825
TEST=boot a machine with an Atmel trackpad attached and one with Cypress
trackpad and have a working pointer on both of them.

Change-Id: I7d8cc499c5844521fe1b0eb703001f734cc43499
Reviewed-on: https://gerrit.chromium.org/gerrit/43228
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: exynos: de-activate internal backlight on Spring
Vincent Palatin [Thu, 14 Feb 2013 20:29:57 +0000 (12:29 -0800)]
CHROMIUM: exynos: de-activate internal backlight on Spring

On Spring, the Parade eDP bridge generates internally the PWM for the
LCD backlight.
When it is present, we can avoid configuring the
internal Exynos PWM in order to save power and to have only one
backlight device.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17227
TEST=boot on Spring and Snow, see backlight coming up in both cases

Change-Id: Id4d9db185b5e928f0b81d7fb358575cf07a20e36
Reviewed-on: https://gerrit.chromium.org/gerrit/43308
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: auxdisplay/ps8620: implement backlight control
Vincent Palatin [Thu, 14 Feb 2013 19:40:36 +0000 (11:40 -0800)]
CHROMIUM: auxdisplay/ps8620: implement backlight control

Add a standard backlight interface to the PS8622 bridge.

Also refactor how we are storing the driver data in a more classical fashion.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17227
TEST=on Spring, boot ChromeOS and press Backlight+/- keys from 100% to 0%
and back.

Change-Id: I1989192161ed6f6d5aafb5399658114a2f60bd97
Reviewed-on: https://gerrit.chromium.org/gerrit/43307
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: atkbd: improve workaround for chromeos EC bug
Luigi Semenzato [Thu, 14 Feb 2013 20:36:50 +0000 (12:36 -0800)]
CHROMIUM: atkbd: improve workaround for chromeos EC bug

This makes the workaround for commit b483f9730b97ba8812340cf1584b491d5aa1e774
(https://gerrit.chromium.org/gerrit/43049, "CHROMIUM: atkbd: workaround
for ChromeOS EC keyboard enable bug") work properly by re-enabling the
keyboard IRQ which was accidentally disabled.

BUG=chrome-os-partner:17810
TEST=tested with > 200 power cycles and > 30 workaround triggers
BRANCH=none

Change-Id: Ia8a817f665a3575eebeb1ba2ec3aa89f80c3e0e3
Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43300

12 years agoCHROMEOS: config: Add support for iptables QUEUE
Paul Stewart [Thu, 7 Feb 2013 00:18:22 +0000 (16:18 -0800)]
CHROMEOS: config: Add support for iptables QUEUE

Add the QUEUE target to the kernel.  This pulls in a bunch of
other modules we DON'T want, so explicilty configure these
off.

Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium-os:38605
TEST=Compile kernel.  run ./chromeos/scripts/kernelconfig oldconfig
and confirm there are no additional changes

Change-Id: I07b53e81df045fae522c1048895138dd66e6d5d4
Reviewed-on: https://gerrit.chromium.org/gerrit/43133
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
12 years agodrm/exynos: Turn off VT switching on suspend
Sean Paul [Tue, 12 Feb 2013 20:34:07 +0000 (15:34 -0500)]
drm/exynos: Turn off VT switching on suspend

The exynos driver keeps track of dpms state on suspend/resume such that
we don't require VT switching. Disable it on driver probe.

BUG=chromium-os:38536
TEST=Tested on snow, used powerd_suspend and verified no VT switch

Change-Id: Ie20a0090474d259db6c063a1feb2e4eeee289a4d
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43118
Reviewed-by: Benson Leung <bleung@chromium.org>
12 years agoUPSTREAM: PM: make VT switching to the suspend console optional
Jesse Barnes [Tue, 12 Feb 2013 20:12:20 +0000 (15:12 -0500)]
UPSTREAM: PM: make VT switching to the suspend console optional

KMS drivers can potentially restore the display configuration without
userspace help.  Such drivers can can call a new funciton,
pm_vt_switch_required(false) if they support this feature.  In that
case, the PM layer won't VT switch to the suspend console at suspend
time and then back to the original VT on resume, but rather leave things
alone for a nicer looking suspend and resume sequence.

BUG=chromium-os:38536
TEST=Tested on snow, verified no VT switch on powerd_suspend

Change-Id: Id392b1ea14a0fef165b75d3caa4a9fa9e593740f
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43117
Reviewed-by: Benson Leung <bleung@chromium.org>
12 years agoCHROMIUM: atkbd: workaround for ChromeOS EC keyboard enable bug
Luigi Semenzato [Mon, 11 Feb 2013 19:47:48 +0000 (11:47 -0800)]
CHROMIUM: atkbd: workaround for ChromeOS EC keyboard enable bug

The ChromeOS EC enables keystrokes too early, and the driver
can get scancodes when it's expecting a response from the
GETID request.  The workaround consists of repeating the request
a few times if it fails.

BUG=chrome-os-partner:17005
TEST=verified that the workaround works around the bug
BRANCH=none

Signed-off-by: Luigi Semenzato <semenzato@chromium.org>
Change-Id: Ica4ad7ed1564c07ab196b302d1a33732a48c680f
Reviewed-on: https://gerrit.chromium.org/gerrit/43049
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>

12 years agoCHROMIUM: ALSA: hda - Hack in a delay when turning codec on.
Dylan Reid [Wed, 13 Feb 2013 03:11:47 +0000 (19:11 -0800)]
CHROMIUM: ALSA: hda - Hack in a delay when turning codec on.

Add a 10msec delay before and after powering on the codec.  It might
make link more likely to produce audio.

BUG=chrome-os-partner:17393
TEST=modified loopback test for 20 hours without losing audio.

Change-Id: I62822ae47b8a538c9537be42f8d6b3f3852dbb11
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43162
Commit-Queue: Trond Wuellner <trond@chromium.org>
Commit-Queue: Puneet Kumar <puneetster@chromium.org>
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
12 years agoCHROMIUM: mmc: card: add a quirk for Kingston eMMC
Vincent Palatin [Wed, 13 Feb 2013 00:20:12 +0000 (16:20 -0800)]
CHROMIUM: mmc: card: add a quirk for Kingston eMMC

The Kingston eMMC 16GB is sometimes freezing (not answering to the
request) when doing a multiple read (CMD18).
With this workaround, I'm no longer encountering the issue.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17397
TEST=on Spring with unreliable Kingston eMMC, /usr/sbin/chromeos-install,
then boot the board from eMMC and see both steps succeeding without freeze.

Change-Id: If22613093debafeb90ecdc90b8ad5373d2050de9
Reviewed-on: https://gerrit.chromium.org/gerrit/43149
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoRevert "CHROMIUM: USB: add quirk for Novatel Wireless E362 modem"
Ben Chan [Wed, 13 Feb 2013 02:24:03 +0000 (18:24 -0800)]
Revert "CHROMIUM: USB: add quirk for Novatel Wireless E362 modem"

This reverts commit 4c1721759b9744d82c85926a188efcbd023df1e5

Change-Id: Ib6655f7980b66de712eaf6e475121d8fcd4ca8b9
Reviewed-on: https://gerrit.chromium.org/gerrit/43158
Commit-Queue: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
12 years agoCHROMIUM: USB: add quirk for Novatel Wireless E362 modem
Ben Chan [Tue, 12 Feb 2013 02:23:58 +0000 (18:23 -0800)]
CHROMIUM: USB: add quirk for Novatel Wireless E362 modem

BUG=chrome-os-partner:17609
TEST=Tested the following:
1. Leave the Chromebook on battery and verify that the USB auto-suspend
   is enabled on the E362 modem.
2. Repeatedly suspend and resume the Chromebook.

Change-Id: Ic9f0b82e6092f50b4e1f06192c29a1f3f4aa1326
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43125
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
12 years agoCHROMIUM: BACKPORT: regulator: s5m8767: fix stack corruption.
Todd Broch [Tue, 12 Feb 2013 21:27:01 +0000 (13:27 -0800)]
CHROMIUM: BACKPORT: regulator: s5m8767: fix stack corruption.

This CL fixes same stack corruption identified by the following commit

     commit 3ef303988cfcb35922f550892cf476e861377f0b
     Author: Inderpal Singh <inderpal.singh@linaro.org>
     Date:   Wed Dec 12 08:57:00 2012 +0530

 regulator: s5m8767: Fix probe failure due to stack corruption

Prior to the upstream fix, the failure manifested itself as kernel
Oops.  In CHROMIUM kernel (3.4) it quietly overwrote the i2c register
index to '0' (PMIC_ID) which led to successful return but without
writing the new voltage value.

This changelist mimics the upstream patch and can be dropped once
we've moved to 3.8 kernel.

BUG=chrome-os-partner:16430, chromium-os:38853
TEST=build & boot.  See voltage levels change based on cpufreq.

Signed-off-by: Todd Broch <tbroch@chromium.org>
Change-Id: I620f1a0487f0cce409e9fc223fb964a076e024d1
Reviewed-on: https://gerrit.chromium.org/gerrit/43129
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: HID: multitouch: Add advanced silicon cooltouch 2303 controller
Bernie Thompson [Mon, 11 Feb 2013 20:04:53 +0000 (12:04 -0800)]
CHROMIUM: HID: multitouch: Add advanced silicon cooltouch 2303 controller

Based on 9d8e6e by dparker@chromium.org.

BUG=None
TEST=Boot kernel on machine with cooltouch controller attached.
Verify hid_multitouch module is loaded for the USB device.

Change-Id: Iab7b36fc7c41d6bed40f65c0a04e8ea9d011e3eb
Signed-off-by: Bernie Thompson <bhthompson@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43060
Reviewed-by: Olof Johansson <olofj@chromium.org>
12 years agoCHROMIUM: spring: dts: update Wifi 32Khz clock declaration
Vincent Palatin [Sat, 9 Feb 2013 01:57:06 +0000 (17:57 -0800)]
CHROMIUM: spring: dts: update Wifi 32Khz clock declaration

On SLSI S5M8767 PMIC, the fixed regulator for the 32Khz clock for
Wifi/Bluetooth is called en32khz_bt.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17512
TEST=on Spring with S5M8767 PMIC, boot and see Wifi coming up properly

Change-Id: I0224d866bd59a242b77db28ec985d7a1f0fad589
Reviewed-on: https://gerrit.chromium.org/gerrit/42977
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: regulator: s5m8767: add support for 32Khz clocks
Vincent Palatin [Sat, 9 Feb 2013 01:57:06 +0000 (17:57 -0800)]
CHROMIUM: regulator: s5m8767: add support for 32Khz clocks

Present the 32Khz clocks as fixed regulators.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:17512
TEST=on Spring with S5M8767 PMIC, boot and see Wifi coming up properly

Change-Id: I51ff3adcacc2ea442c7a73aac0ab914767b2f8ce
Reviewed-on: https://gerrit.chromium.org/gerrit/42976
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: spring: dts: Cleanup regulator op_modes for s5m8767.
Todd Broch [Fri, 8 Feb 2013 22:30:16 +0000 (14:30 -0800)]
CHROMIUM: spring: dts: Cleanup regulator op_modes for s5m8767.

Changes were:
  ldo6: should be on in S0
  ldo17: can be turned off
  buck6: can be turned off
  emmc VR was moved to buck9

BUG=chrome-os-partner:16430
TEST=compile & boot kernel on spring
Run following and see properly configured opmodes for various VRs
     i=1
     for reg in 0x32 0x34 0x3d 0x46 0x4f 0x54 0x56 0x58 0x5a ; do
 a=$(( $(( $(i2cget -y -f 0 0x66 $reg) & 0xc0 )) >> 6 ))
 echo "${reg} :: buck${i} op_mode:${a}"
 i=$(( $i + 1))
     done

     i=1
     for reg in 0x5c 0x5d `seq 0x61 0x7a`; do
 a=$(( $(( $(i2cget -y -f 0 0x66 $reg) & 0xc0 )) >> 6 ))
 printf "0x%02x :: ldo${i} op_mode:%d\n" $reg $a
 i=$(( $i + 1))
     done

Signed-off-by: Todd Broch <tbroch@chromium.org>
Change-Id: I1d4093da9528beae4ff1be9f85e7d6b03d1fd713
Reviewed-on: https://gerrit.chromium.org/gerrit/42954
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: regulator: s5m8767: Enable configureable opmodes.
Todd Broch [Fri, 8 Feb 2013 22:21:53 +0000 (14:21 -0800)]
CHROMIUM: regulator: s5m8767: Enable configureable opmodes.

Allow the voltage regulators operating mode to be configured via
device tree node 'reg_op_mode'.  Previously operating modes were set
to 0x3 (always on) which is still the default for systems not using
device tree.

BUG=chrome-os-partner:16430
TEST=compile & boot kernel

Signed-off-by: Todd Broch <tbroch@chromium.org>
Change-Id: I474d92330854251dfc47a45a14eb0bc5af3e7889
Reviewed-on: https://gerrit.chromium.org/gerrit/42953
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: dts: Add node for MAX77686 RTC
Simon Glass [Sun, 3 Feb 2013 22:26:25 +0000 (14:26 -0800)]
CHROMIUM: dts: Add node for MAX77686 RTC

We will use this timer for the charger manager, so add a phandle for it.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
Use a pr_info() statement to check that the node is found in the driver on
boot.

Change-Id: I3239c108ce5b65c1c02ac328e27b7d5009d20c62
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42576

12 years agoCHROMIUM: power: max77686: Add basic device tree binding
Simon Glass [Sun, 3 Feb 2013 22:17:35 +0000 (14:17 -0800)]
CHROMIUM: power: max77686: Add basic device tree binding

This chip has an RTC within it, so define an "rtc" subnode. So far there
are no properties, but the existence of the node is enough to make it
accessible via a phandle.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
With later commits, see that we can find this node in the rtc driver.

Change-Id: Ia6d3fdb22b77b17bc4887ff3671b711f2969a251
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42575

12 years agoCHROMIUM: power: sbs: Warning on register read failure
Simon Glass [Sat, 2 Feb 2013 05:51:15 +0000 (21:51 -0800)]
CHROMIUM: power: sbs: Warning on register read failure

Warn when we fail to read from the battery.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
Disconnect battery and see that we start getting kernel warnings.

Change-Id: I6ad787be5bc4937df6bbcfe6f0af5a4b3ea91272
Reviewed-on: https://gerrit.chromium.org/gerrit/42574
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
12 years agoCHROMIUM: charger-manager: Allow battery to provide temperature
Simon Glass [Sun, 17 Jun 2012 17:38:45 +0000 (10:38 -0700)]
CHROMIUM: charger-manager: Allow battery to provide temperature

In some systems the we cannot obtain the cell temperature using the charger
or an ADC; we must ask the battery (fuel cell) since it has thermistors
which are closer to the battery and thus give a more accurate reading.

Add this feature to charger-manager.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
See that we obtain the correct temperature now (from the battery)

Change-Id: I2f2844632b7ef7b1179878cc769bcbe751c4c708
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/40169
Reviewed-by: Sameer Nanda <snanda@chromium.org>
12 years agoCHROMIUM: charger-manager: Show current state in status message
Simon Glass [Mon, 4 Feb 2013 23:04:27 +0000 (15:04 -0800)]
CHROMIUM: charger-manager: Show current state in status message

Charger-manager prints a status debug message each time it checks the
system. Adjust this so that it also prints the current charging state,
and tidy up the uevent emission code at the same time.

Keep a count of how many monitor cycles have been completed.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
See that a debug message appears every 10 seconds, showing the current
charge state.

Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: Ia45d3489031fb79ca765206a7b56b4a82c7fab59
Reviewed-on: https://gerrit.chromium.org/gerrit/42573
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
12 years agoregulator: tps65090: dts: Add binding documentation
Simon Glass [Sun, 17 Jun 2012 17:22:46 +0000 (10:22 -0700)]
regulator: tps65090: dts: Add binding documentation

The binding is fairly simple but we should still have documentation for it.

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on daisy

Change-Id: I817d6934e38a963c24334c9512a8fbe8daea077a
Signed-off-by: Simon Glass <sjg@chromium.org>
BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow
Reviewed-on: https://gerrit.chromium.org/gerrit/40165
Reviewed-by: Sameer Nanda <snanda@chromium.org>
12 years agoCHERRY-PICK: ARM: EXYNOS4: Enable Suspend/Resume of MCT.
MyungJoo Ham [Wed, 2 May 2012 02:17:11 +0000 (11:17 +0900)]
CHERRY-PICK: ARM: EXYNOS4: Enable Suspend/Resume of MCT.

Suspend/Resume has been failing because of MCT after introducing EXT-GIC
to EXYNOS4. This patch allows MCT's PM to work properly.

Change-Id: I562dbd1a7e8b7f99e50b03dcb102e351617796ac
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
(cherry picked from commits f20446c7cd2138ec53428151988b223f3a99b1b4
and 6c34b32be3e9ca8c1d3b5bd303cb54063d1454fc
in branch charger-manager-for-next of
git://git.infradead.org/users/kmpark/linux-2.6-samsung)

Modified by sjg@chromium.org to build without warnings

BUG=chrome-os-partner:10617
TEST=build and boot to kernel prompt on snow

Change-Id: I164d119b9c1a82b72e79bafe75d26fe89b0bc736
Reviewed-on: https://gerrit.chromium.org/gerrit/42572
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
12 years agoWake up DP sinks for DPCD read-based detection.
Stuart Abercrombie [Wed, 6 Feb 2013 22:39:59 +0000 (14:39 -0800)]
Wake up DP sinks for DPCD read-based detection.

When in DPMS sleep state the Apple mini DP->VGA adapter doesn't respond.
This led to no external display on boot.

v2: Avoid DPCD check and keep AUX awake for EDID read.

BUG=chrome-os-partner:17063
TEST=Straight DP and various adapters on mini-DP and DP platforms.

Change-Id: I90bea73006ae9c99464b0b5bc57f3803918313a8
Reviewed-on: https://gerrit.chromium.org/gerrit/42583
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: Stuart Abercrombie <sabercrombie@chromium.org>
Tested-by: Stuart Abercrombie <sabercrombie@chromium.org>
12 years agoCHROMIUM: msr: whitelist the i915 thermal control for wrmsr
Kees Cook [Fri, 8 Feb 2013 01:01:21 +0000 (17:01 -0800)]
CHROMIUM: msr: whitelist the i915 thermal control for wrmsr

Deny all userspace MSR writes except those explicitly whitelisted for
i915 thermal controls. Without this, processes with CAP_SYS_RAWIO can
run arbitrary kernel code via MSR writing.

BUG=chromium-os:38756
TEST=link build, wrmsr works only on i915 thermal registers

Change-Id: Iff5b9a466dbddd5d94e9246ff99b63a21c975406
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42910
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoUPSTREAM: x86/msr: Add capabilities check
Alan Cox [Thu, 15 Nov 2012 13:06:22 +0000 (13:06 +0000)]
UPSTREAM: x86/msr: Add capabilities check

At the moment the MSR driver only relies upon file system
checks. This means that anything as root with any capability set
can write to MSRs. Historically that wasn't very interesting but
on modern processors the MSRs are such that writing to them
provides several ways to execute arbitary code in kernel space.
Sample code and documentation on doing this is circulating and
MSR attacks are used on Windows 64bit rootkits already.

In the Linux case you still need to be able to open the device
file so the impact is fairly limited and reduces the security of
some capability and security model based systems down towards
that of a generic "root owns the box" setup.

Therefore they should require CAP_SYS_RAWIO to prevent an
elevation of capabilities. The impact of this is fairly minimal
on most setups because they don't have heavy use of
capabilities. Those using SELinux, SMACK or AppArmor rules might
want to consider if their rulesets on the MSR driver could be
tighter.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Horses <stable@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
BUG=chromium-os:38633
TEST=link build, reading MSR correctly fails as uid 0 without caps:
 (can't use iotools with minijail because iotools is statically linked)
 `minijail0 -c 0 /usr/local/bin/python -c 'from struct import *; \
    m = open("/dev/cpu/0/msr"); m.seek(0x3a); \
    print "0x%016x" % (unpack("Q", m.read(8)))'`

(cherry picked from upstream commit c903f0456bc69176912dee6dd25c6a66ee1aed00)
Change-Id: I9d636ff7baac98a4243392428b48c0730600c7bc
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42684
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoCHROMIUM: config: enable CGROUP_FREEZER
Mandeep Singh Baines [Wed, 6 Feb 2013 22:22:38 +0000 (14:22 -0800)]
CHROMIUM: config: enable CGROUP_FREEZER

This change is need for work on idle enhancements.

The overhead is negligible. Just calls to cgroup_freezing() in
freezing_slow_path(). cgroup_freezing() is a very low
overhead call.

BUG=chromium-os:38701
TEST=Compile. Boot.

Change-Id: I8df3e19c1bc9a45c7fef0ec014db294c00ab34fc
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42797
Reviewed-by: Sameer Nanda <snanda@chromium.org>
12 years agoCHROMIUM: spring: dts: Instantiate s5m8767 PMIC.
Todd Broch [Wed, 6 Feb 2013 19:57:54 +0000 (11:57 -0800)]
CHROMIUM: spring: dts: Instantiate s5m8767 PMIC.

Note, this will enumerate multiple PMICs for the same design as the
max77686 PMIC is also enumerated via cros5250-common.dtsi.  This is
remedied by the firmware (u-boot) at boot time by pruning the
non-existent PMIC.

  See: https://gerrit.chromium.org/gerrit/#/c/41993/ for details.

CL also disables ADC node for Spring which is unused.

BUG=chrome-os-partner:16430
TEST=kernel compiles for BOARD=daisy_spring

Change-Id: Ic1070b3001b20b4825582f10bd039051a61c7459
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42798
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: spring: add DT support for s5m8767.
Todd Broch [Sat, 26 Jan 2013 02:41:30 +0000 (18:41 -0800)]
CHROMIUM: spring: add DT support for s5m8767.

Add minimal device tree support for mfd/s5m-core and associated
s5m8767 PMIC.

BUG=chrome-os-partner:16430
TEST=kernel compiles

Signed-off-by: Todd Broch <tbroch@chromium.org>
Change-Id: Ieb74abb8ae061b727523c1b3010b354ce6023fe7
Reviewed-on: https://gerrit.chromium.org/gerrit/42202
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
12 years agoCHROMIUM: exynos: enable ADCs only if there are used
Vincent Palatin [Wed, 6 Feb 2013 19:05:28 +0000 (11:05 -0800)]
CHROMIUM: exynos: enable ADCs only if there are used

Check the presence of an ADC node in the device tree before activating
the ADCs and the NTP thermistors connected to them.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:16430
TEST=on Spring with SLSI PMIC, boot with adc node de-activated and
doesn't see any ADC related panic.
on Snow, boot and check the thermistor temperatures in sysfs.

Change-Id: I1603d78805a8d0877c137b92bcd2c64cbb32564d
Reviewed-on: https://gerrit.chromium.org/gerrit/42868
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
12 years agoCHROMIUM: gobi: check for overflow in buffer_new()
Elly Fong-Jones [Tue, 5 Feb 2013 19:59:07 +0000 (14:59 -0500)]
CHROMIUM: gobi: check for overflow in buffer_new()

The size passed into buffer_new() can overflow. This isn't exploitable, since
all the calling paths check this, but still. Belt and suspenders and all that.

BUG=chromium-os:38211
TEST=adhoc

Change-Id: I3f19ec85db502c9ce56c9bae9e80d393cd5c5972
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42636

12 years agoCHROMIUM: s5p-mfc: enable NV12M/NV21M decoder output.
John Sheu [Wed, 6 Feb 2013 20:26:40 +0000 (12:26 -0800)]
CHROMIUM: s5p-mfc: enable NV12M/NV21M decoder output.

These two formats work on hardware; there is no need to disable them.
Enable them so we can have linear multiplanar YUV output support.

Signed-off-by: John Sheu <sheu@google.com>
BUG=chromium-os:38376
BUG=chromium:167417
TEST=local build, run on snow
Change-Id: Ic4889ca26555b067e7faadf9027e789633622dee
Reviewed-on: https://gerrit.chromium.org/gerrit/42761
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Tested-by: John Sheu <sheu@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>

12 years agoUPSTREAM: ext4: ignore last group w/o enough space when resizing instead of BUG'ing
Yongqiang Yang [Wed, 5 Sep 2012 05:21:50 +0000 (01:21 -0400)]
UPSTREAM: ext4: ignore last group w/o enough space when resizing instead of BUG'ing

If the last group does not have enough space for group tables, ignore
it instead of calling BUG_ON().

Reported-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
BUG=chromium-os:36118
TEST=link build, resize still works

(cherry picked from upstream commit 03c1c29053f678234dbd51bf3d65f3b7529021de)
Change-Id: I3a7274b6bd72346652b9e7f68b53674684764de7
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42679
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoCHROMIUM: v4l2: dmabuf: update VIDIOC_EXPBUF interface to upstream
John Sheu [Thu, 31 Jan 2013 02:39:36 +0000 (18:39 -0800)]
CHROMIUM: v4l2: dmabuf: update VIDIOC_EXPBUF interface to upstream

<UPSTREAM MERGE NOT REQUIRED>

Backport the VIDIOC_EXPBUF interface from upstream kernels.

Signed-off-by: John Sheu <sheu@google.com>
BUG=chromium-os:38376
BUG=chromium:167417
TEST=local build, run on snow
Change-Id: Ia5cae1636b85d2c716188ff510a83a04b9cd8bc9
Reviewed-on: https://gerrit.chromium.org/gerrit/42374
Tested-by: John Sheu <sheu@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>

12 years agoCHROMIUM: dma-buf: restore args on failure of dma_buf_mmap
John Sheu [Wed, 30 Jan 2013 10:04:36 +0000 (02:04 -0800)]
CHROMIUM: dma-buf: restore args on failure of dma_buf_mmap

Callers to dma_buf_mmap expect to fput() the vma struct's vm_file
themselves on failure.  Not restoring the struct's data on failure
causes a double-decrement of the vm_file's refcount.

Signed-off-by: John Sheu <sheu@google.com>
BUG=chromium-os:38376
BUG=chromium:167417
TEST=local build, run on snow

Change-Id: I868696d5f67235b9ca7d2599eac733438387e82b
Reviewed-on: https://gerrit.chromium.org/gerrit/42295
Tested-by: John Sheu <sheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Queue: John Sheu <sheu@chromium.org>

12 years agoCHROMIUM: gobi: fix integer wraparound bug
Elly Fong-Jones [Mon, 4 Feb 2013 22:13:35 +0000 (17:13 -0500)]
CHROMIUM: gobi: fix integer wraparound bug

All the sizes here are bounded on the wire by 16 bits, to switch to size_t and
check for wraparound more carefully.

BUG=chromium-os:38210
TEST=adhoc
build, boot, see if the gobi still shows up

Change-Id: I492e632722714b1a869929d03c33a4fc12995120
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42559
Reviewed-by: Kees Cook <keescook@chromium.org>
12 years agoUPSTREAM: introduce SIZE_MAX
Xi Wang [Thu, 31 May 2012 23:26:04 +0000 (16:26 -0700)]
UPSTREAM: introduce SIZE_MAX

ULONG_MAX is often used to check for integer overflow when calculating
allocation size.  While ULONG_MAX happens to work on most systems, there
is no guarantee that `size_t' must be the same size as `long'.

This patch introduces SIZE_MAX, the maximum value of `size_t', to improve
portability and readability for allocation size validation.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Acked-by: Alex Elder <elder@dreamhost.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit a3860c1c5dd1137db23d7786d284939c5761d517)

Change-Id: Ic87ed61f0bbcd4d92ab3c8e898d0519d4d905ffb
BUG=chromium-os:38211
TEST=adhoc
build, boot, test for gobi presence

Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Change-Id: I82b6bf09368b7cc6a1ea1d2813f482cdf4fab424
Reviewed-on: https://gerrit.chromium.org/gerrit/42742
Reviewed-by: Kees Cook <keescook@chromium.org>
12 years agoUPSTREAM: debugfs: convert gid= argument from decimal, not octal
Dave Reisner [Wed, 2 Jan 2013 13:54:37 +0000 (08:54 -0500)]
UPSTREAM: debugfs: convert gid= argument from decimal, not octal

This patch technically breaks userspace, but I suspect that anyone who
actually used this flag would have encountered this brokenness, declared
it lunacy, and already sent a patch.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Reviewed-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
BUG=chromium-os:23758
TEST=link build, debugfs mount options work with decimal for gid

Change-Id: I4a37f3bd13da0ced916bde8038de16ebc3504d5e
(cherry picked from upstream commit f1688e0431d3a395388e70fe21da89ed0de0c323)
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42650
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
12 years agoCHROMIUM: sysrq-x: killall chrome process not just first one
Mandeep Singh Baines [Tue, 5 Feb 2013 22:55:38 +0000 (14:55 -0800)]
CHROMIUM: sysrq-x: killall chrome process not just first one

Currently, sysrq-x just kills the first chrome process it finds.
We've seen in at least one occassion where there may be a stale
chrome process from a previous session. The fix is to kill all
processes we find that meet our criteria.

I also modified the printk to print the pid of the process
that is killed. Previously we were printing the pid of
session_manager which is not as useful.

BUG=chrome-os-partner:17522
TEST=manual (debugging feature):
 hold down alt-volup then x - chrome should crash
 repeat immediately afterward - session should restart
 repeat and machine should reboot

2013-02-05T13:28:37.425355-08:00 localhost crash_reporter[2829]: Received crash notification for chrome[963] sig 6 (ignoring - chrome crash)
2013-02-05T13:28:37.557482-08:00 localhost session_manager: [0205/132837:INFO:session_manager_service.cc(523)] Handling child process exit: 963
2013-02-05T13:28:37.557537-08:00 localhost session_manager: [0205/132837:INFO:session_manager_service.cc(525)]   Exited with signal 6

Change-Id: Id039df7386cf7cccf42e0861bc2ab6f653147605
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42658
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>