]> xenbits.xensource.com Git - people/sstabellini/linux-pvhvm-deprecated.git/log
people/sstabellini/linux-pvhvm-deprecated.git
12 years agoxen/arm: compile blkfront and blkback stefano/xenarmv7-3
Stefano Stabellini [Tue, 3 Jul 2012 17:12:35 +0000 (17:12 +0000)]
xen/arm: compile blkfront and blkback

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen: allow privcmd for hvm guests
Stefano Stabellini [Tue, 3 Jul 2012 17:12:17 +0000 (17:12 +0000)]
xen: allow privcmd for hvm guests

Ian's initial XENMAPSPACE_gmfn_foreign implementation is enough to get
privcmd mmap to work for XENFEAT_auto_translated_physmap guests.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen/arm: implement alloc/free_xenballooned_pages with alloc_pages/kfree
Stefano Stabellini [Wed, 4 Jul 2012 10:21:34 +0000 (10:21 +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>
12 years agoxen/arm: set xen_platform_pci_unplug to XEN_UNPLUG_ALL
Stefano Stabellini [Tue, 3 Jul 2012 17:13:59 +0000 (17:13 +0000)]
xen/arm: set xen_platform_pci_unplug to XEN_UNPLUG_ALL

Set xen_platform_pci_unplug to XEN_UNPLUG_ALL by default to make
blkfront happy. The parameter doesn't make sense on ARM and should be
removed.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen/arm: initialize grant_table on ARM
Stefano Stabellini [Wed, 4 Jul 2012 10:20:59 +0000 (10:20 +0000)]
xen/arm: initialize grant_table on ARM

Initialize the grant table mapping it at HVM_PARAM_GRANT_START_PFN.
After the grant table is initialized, call xenbus_probe (if not dom0).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen/arm: enable evtchn irqs
Stefano Stabellini [Fri, 22 Jun 2012 14:58:52 +0000 (14:58 +0000)]
xen/arm: enable evtchn irqs

On ARM irqs are not enabled by default:

- call enable_percpu_irq for IRQ_EVTCHN_CALLBACK;

- set the IRQF_VALID flag for the other irqs bound to evtchns. It causes
IRQ_NOAUTOEN to be set and as a consequence irq_unmask is going to be
called when a xenbus driver calls request_irq.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen: fix unmask_evtchn for HVM guests
Stefano Stabellini [Fri, 22 Jun 2012 15:12:19 +0000 (15:12 +0000)]
xen: fix unmask_evtchn for HVM guests

When unmask_evtchn is called, if we already have an event pending, we
just set evtchn_pending_sel waiting for irq to be re-enabled. That is
because x86 pv guests overwrite the irq_enable pvops with
xen_irq_enable_direct that also handles pending events.

However x86 HVM guests and ARM guests do not change or do not have the
irq_enable pvop, so this scheme doesn't work properly for them.
Considering that having a pending irq when unmask_evtchn is called is
not very common, and it is better to keep the native_irq_enable
implementation for HVM guests and ARM guests, the best thing to do is
just using the EVTCHNOP_unmask callback (Xen re-injects pending
events in response).

Considering that this patch fixes a bug on x86 for current PV on HVM
guests, I'll resend it separately.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen/arm: implement hvm_op
Stefano Stabellini [Fri, 22 Jun 2012 13:52:00 +0000 (13:52 +0000)]
xen/arm: implement hvm_op

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen/arm: get privilege status
Stefano Stabellini [Fri, 22 Jun 2012 13:51:42 +0000 (13:51 +0000)]
xen/arm: get privilege status

Use Xen features to figure out if we are privileged.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen/arm: Introduce xen_guest_init
Stefano Stabellini [Fri, 22 Jun 2012 15:30:30 +0000 (15:30 +0000)]
xen/arm: Introduce xen_guest_init

We used to rely on a core_initcall to initialize Xen on ARM, however
core_initcalls are actually called after early consoles are initialized.
That means that hvc_xen.c is going to be initialized before Xen.

Given the lack of a better alternative, just call a new Xen
initialization function (xen_guest_init) from xen_cons_init.

xen_guest_init has to be arch independant, so write both an ARM and an
x86 implementation. The x86 implementation is currently empty because we
can be sure that xen_hvm_guest_init is called early enough.

Probably we can get rid of this as soon as we have better DT support.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen/arm: fix the shared_info and vcpu_info structs
Stefano Stabellini [Fri, 22 Jun 2012 13:48:27 +0000 (13:48 +0000)]
xen/arm: fix the shared_info and vcpu_info structs

Fix the shared_info and vcpu_info struct definitions to match the ones
in Xen.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoHACK: make xenboot_write_console always call dom0_write_console
Stefano Stabellini [Fri, 22 Jun 2012 15:32:08 +0000 (15:32 +0000)]
HACK: make xenboot_write_console always call dom0_write_console

We don't have a working early_con for HVM and ARM guests, so force
xenboot_write_console to call dom0_write_console for now.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen/blkback: Enable blkback on HVM guests
Daniel De Graaf [Mon, 28 Nov 2011 16:49:05 +0000 (11:49 -0500)]
xen/blkback: Enable blkback on HVM guests

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

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/netback: Enable netback on HVM guests
Daniel De Graaf [Wed, 14 Dec 2011 20:12:13 +0000 (15:12 -0500)]
xen/netback: Enable netback on HVM guests

Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/grant-table: Support mappings required by blkback
Daniel De Graaf [Wed, 14 Dec 2011 20:12:11 +0000 (15:12 -0500)]
xen/grant-table: Support mappings required by blkback

Add support for mappings without GNTMAP_contains_pte. This was not
supported because the unmap operation assumed that this flag was being
used; adding a parameter to the unmap operation to allow the PTE
clearing to be disabled is sufficient to make unmap capable of
supporting either mapping type.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
[v1: Fix cleanpatch warnings]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxenbus: Use grant-table wrapper functions
Daniel De Graaf [Wed, 14 Dec 2011 20:12:10 +0000 (15:12 -0500)]
xenbus: Use grant-table wrapper functions

For xenbus_{map,unmap}_ring to work on HVM, the grant table operations
must be set up using the gnttab_set_{map,unmap}_op functions instead of
directly populating the fields of gnttab_map_grant_ref. These functions
simply populate the structure on paravirtualized Xen; however, on HVM
they must call __pa() on vaddr when populating op->host_addr because the
hypervisor cannot directly interpret guest-virtual addresses.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
[v1: Fixed cleanpatch error]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxenbus: Support HVM backends
Daniel De Graaf [Mon, 19 Dec 2011 19:55:14 +0000 (14:55 -0500)]
xenbus: Support HVM backends

Add HVM implementations of xenbus_(map,unmap)_ring_v(alloc,free) so
that ring mappings can be done without using GNTMAP_contains_pte which
is not supported on HVM.  This also removes the need to use vmlist_lock
on PV by tracking the allocated xenbus rings.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
[v1: Fix compile error when XENBUS_FRONTEND is defined as module]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoxen/granttable: Keep code format clean
Annie Li [Tue, 22 Nov 2011 01:59:56 +0000 (09:59 +0800)]
xen/granttable: Keep code format clean

Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Annie Li <annie.li@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agohvc_xen: introduce HVC_XEN_FRONTEND
Stefano Stabellini [Tue, 21 Feb 2012 11:30:42 +0000 (11:30 +0000)]
hvc_xen: introduce HVC_XEN_FRONTEND

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

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

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

Changes in v3:

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

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

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoXen: consolidate and simplify struct xenbus_driver instantiation
Jan Beulich [Thu, 22 Dec 2011 09:08:13 +0000 (09:08 +0000)]
Xen: consolidate and simplify struct xenbus_driver instantiation

The 'name', 'owner', and 'mod_name' members are redundant with the
identically named fields in the 'driver' sub-structure. Rather than
switching each instance to specify these fields explicitly, introduce
a macro to simplify this.

Eliminate further redundancy by allowing the drvname argument to
DEFINE_XENBUS_DRIVER() to be blank (in which case the first entry from
the ID table will be used for .driver.name).

Also eliminate the questionable xenbus_register_{back,front}end()
wrappers - their sole remaining purpose was the checking of the
'owner' field, proper setting of which shouldn't be an issue anymore
when the macro gets used.

v2: Restore DRV_NAME for the driver name in xen-pciback.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agoHACK: hacks -- many and varied
Ian Campbell [Thu, 1 Mar 2012 16:22:16 +0000 (16:22 +0000)]
HACK: hacks -- many and varied

12 years agoHACK: ARM: arch_timer optionally use virtual rather than physical timer.
Ian Campbell [Fri, 1 Jun 2012 16:22:32 +0000 (17:22 +0100)]
HACK: ARM: arch_timer optionally use virtual rather than physical timer.

Disable.

Hardcode the interrupts for now.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoHACK: initial (very hacky) XENMAPSPACE_gmfn_foreign
Ian Campbell [Fri, 24 Feb 2012 08:47:00 +0000 (08:47 +0000)]
HACK: initial (very hacky) XENMAPSPACE_gmfn_foreign

12 years agoARM: enable earlyprintk="xen"
Ian Campbell [Fri, 1 Jun 2012 16:21:19 +0000 (17:21 +0100)]
ARM: enable earlyprintk="xen"

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoARM: 7205/2: sched_clock: allow sched_clock to be selected at runtime
Marc Zyngier [Thu, 15 Dec 2011 11:19:23 +0000 (12:19 +0100)]
ARM: 7205/2: sched_clock: allow sched_clock to be selected at runtime

sched_clock() is yet another blocker on the road to the single
image. This patch implements an idea by Russell King:

http://www.spinics.net/lists/linux-omap/msg49561.html

Instead of asking the platform to implement both sched_clock()
itself and the rollover callback, simply register a read()
function, and let the ARM code care about sched_clock() itself,
the conversion to ns and the rollover. sched_clock() uses
this read() function as an indirection to the platform code.
If the platform doesn't provide a read(), the code falls back
to the jiffy counter (just like the default sched_clock).

This allow some simplifications and possibly some footprint gain
when multiple platforms are compiled in. Among the drawbacks,
the removal of the *_fixed_sched_clock optimization which could
negatively impact some platforms (sa1100, tegra, versatile
and omap).

Tested on 11MPCore, OMAP4 and Tegra.

Cc: Imre Kaloz <kaloz@openwrt.org>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Colin Cross <ccross@android.com>
Cc: Erik Gilling <konkers@android.com>
Cc: Olof Johansson <olof@lixom.net>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Alessandro Rubini <rubini@unipv.it>
Cc: STEricsson <STEricsson_nomadik_linux@list.st.com>
Cc: Lennert Buytenhek <kernel@wantstofly.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Tested-by: Jamie Iles <jamie@jamieiles.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Krzysztof Halasa <khc@pm.waw.pl>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
12 years agoARM: architected timers: add support for UP timer
Marc Zyngier [Fri, 20 Jan 2012 12:05:09 +0000 (12:05 +0000)]
ARM: architected timers: add support for UP timer

If CONFIG_LOCAL_TIMERS is not defined, let the architected timer
driver register a single clock_event_device that is used as a
global timer.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
12 years agoARM: architected timers: add DT support
Marc Zyngier [Fri, 20 Jan 2012 12:05:08 +0000 (12:05 +0000)]
ARM: architected timers: add DT support

Add runtime DT support and documentation for the Cortex A7/A15
architected timers.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
12 years agoARM: architected timers: Add A15 specific sched_clock implementation
Marc Zyngier [Fri, 20 Jan 2012 12:05:07 +0000 (12:05 +0000)]
ARM: architected timers: Add A15 specific sched_clock implementation

Provide an A15 sched_clock implementation using the virtual counter,
which is thought to be more useful than the physical one in a
virtualised environment, as it can offset the time spent in another
VM or the hypervisor.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
12 years agoARM: local timers: Add A15 architected timer support
Marc Zyngier [Fri, 20 Jan 2012 12:05:06 +0000 (12:05 +0000)]
ARM: local timers: Add A15 architected timer support

Add support for the A15 generic timer and clocksource.
As the timer generates interrupts on a different PPI depending
on the execution mode (normal or secure), it is possible to
register two different PPIs.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
12 years agoxen/arm: use r12 to pass the hypercall number to the hypervisor
Stefano Stabellini [Thu, 23 Feb 2012 17:48:22 +0000 (17:48 +0000)]
xen/arm: 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.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: kvm@vger.kernel.org
12 years agoRevert "HACK! call flush_cache_all() after updating translation table entries"
David Vrabel [Fri, 17 Feb 2012 12:39:10 +0000 (12:39 +0000)]
Revert "HACK! call flush_cache_all() after updating translation table entries"

This reverts commit 0cd39ddc20a2bbb8ebc4ed48638f30344fd9a808.

This workaround didn't work for all cases (userspace still segfaulted)
and there is now a better workaround.

12 years agoHACK! arm: set v7 translation table entries as uncachable
David Vrabel [Fri, 17 Feb 2012 12:35:48 +0000 (12:35 +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.

12 years agopatch debug_dbt
Stefano Stabellini [Fri, 25 May 2012 15:48:35 +0000 (15:48 +0000)]
patch debug_dbt

13 years agoxen/arm: receive Xen events through PPI 31
Stefano Stabellini [Fri, 2 Mar 2012 14:04:57 +0000 (14:04 +0000)]
xen/arm: receive Xen events through PPI 31

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoxen/arm: compile grant-table features events and xenbus, do not compile pci
Stefano Stabellini [Thu, 23 Feb 2012 14:18:08 +0000 (14:18 +0000)]
xen/arm: compile grant-table features events and xenbus, do not compile pci

Also select XEN_DOM0 by default.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen/arm: compile and run xenbus
Stefano Stabellini [Fri, 25 May 2012 12:38:10 +0000 (12:38 +0000)]
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,
and do not call xs_reset_watches at boot.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoxen/arm: Introduce xen_pfn_t for pfn and mfn types
Stefano Stabellini [Tue, 21 Feb 2012 12:00:13 +0000 (12:00 +0000)]
xen/arm: 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>
13 years agoxen/arm: empty implementation of xen_remap_domain_mfn_range
Stefano Stabellini [Thu, 23 Feb 2012 14:17:14 +0000 (14:17 +0000)]
xen/arm: empty implementation of xen_remap_domain_mfn_range

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoxen/arm: shared_info and start_info
Stefano Stabellini [Thu, 23 Feb 2012 14:16:32 +0000 (14:16 +0000)]
xen/arm: shared_info and start_info

Allow xen_hvm_domain's to be xen_initial_domain.

Set xen_domain_type to XEN_HVM_DOMAIN.

Set xen_start_info to an empty struct, set flags to SIF_INITDOMAIN and
SIF_PRIVILEGED so that we identify as initial domain by default.

Map the real shared info page using XENMEM_add_to_physmap with
XENMAPSPACE_shared_info.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoxen/arm: fix arm xen guest handle definitions
Stefano Stabellini [Tue, 21 Feb 2012 13:38:10 +0000 (13:38 +0000)]
xen/arm: fix arm xen guest handle definitions

__XEN__ is never defined in Linux: remove non-relevant functions and
macros

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoxen/arm: receive xen events on arm
Stefano Stabellini [Tue, 21 Feb 2012 15:00:38 +0000 (15:00 +0000)]
xen/arm: receive xen events on arm

Compile events.c and use IRQ 32 to receive events notifications.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoxen/arm: missing includes
Stefano Stabellini [Wed, 22 Feb 2012 14:57:20 +0000 (14:57 +0000)]
xen/arm: missing includes

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoxen/arm: empty implementation of grant_table arch specific functions
Stefano Stabellini [Tue, 21 Feb 2012 13:36:22 +0000 (13:36 +0000)]
xen/arm: empty implementation of grant_table arch specific functions

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoxen/arm: sync_bitops
Stefano Stabellini [Tue, 21 Feb 2012 13:35:57 +0000 (13:35 +0000)]
xen/arm: sync_bitops

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

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoxen/arm: mmu.h and page.h related definitions
Stefano Stabellini [Tue, 21 Feb 2012 11:55:07 +0000 (11:55 +0000)]
xen/arm: mmu.h and page.h related definitions

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoxen/arm: introduce privcmp, physdev_op and memory_op hypercalls.
Stefano Stabellini [Thu, 23 Feb 2012 14:20:53 +0000 (14:20 +0000)]
xen/arm: introduce privcmp, physdev_op and memory_op hypercalls.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoxen/arm: use r12 to pass the hypercall number to the hypervisor
Stefano Stabellini [Thu, 23 Feb 2012 15:08:43 +0000 (15:08 +0000)]
xen/arm: 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.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: catalin.marinas@arm.com
CC: kvm@vger.kernel.org
13 years agoarm: vexpress: increase RAM in AEM device tree
David Vrabel [Wed, 8 Feb 2012 15:58:29 +0000 (15:58 +0000)]
arm: vexpress: increase RAM in AEM device tree

The versatile express model has 4 GiB of RAM of which 2 GiB is
accessible to non-LPAE kernels.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
13 years agoHACK! fixup UART address used by zImage decompressor
David Vrabel [Tue, 10 Jan 2012 16:21:18 +0000 (16:21 +0000)]
HACK! fixup UART address used by zImage decompressor

13 years agoARM: vexpress: rename device tree "memory@..." nodes to "memory"
David Vrabel [Mon, 9 Jan 2012 16:13:19 +0000 (16:13 +0000)]
ARM: vexpress: rename device tree "memory@..." nodes to "memory"

If CONFIG_ARM_ATAG_DTB_COMPAT enabled it expects the memory
information to be in a node named "memory".  If the memory is
described in a different node, the device tree will end up with two
nodes describing the memory.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
13 years agoMerge branch 'xen-arm' into vexpress-dt
David Vrabel [Mon, 9 Jan 2012 14:24:53 +0000 (14:24 +0000)]
Merge branch 'xen-arm' into vexpress-dt

13 years agoHACK! call flush_cache_all() after updating translation table entries
David Vrabel [Thu, 22 Dec 2011 15:32:56 +0000 (15:32 +0000)]
HACK! call flush_cache_all() after updating translation table entries

Updates to translation tables aren't working right when running as a
Xen guest unless the cache is flushed.  This is very much a big hammer
to crack a small nut.

13 years agoarm: vexpress: add device tree for v7A envelope model
David Vrabel [Fri, 6 Jan 2012 16:50:37 +0000 (16:50 +0000)]
arm: vexpress: add device tree for v7A envelope model

Add the device tree for the Versatile Express RTSM with the ARM
Envelope Model of a v7A processor.  This is based off the Cortex A15
device tree with the peripherals that aren't modelled removed and only
a single CPU.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
13 years agoHACK: fix DEBUG_LL macros for Cortex A15
David Vrabel [Wed, 4 Jan 2012 16:38:16 +0000 (16:38 +0000)]
HACK: fix DEBUG_LL macros for Cortex A15

13 years agoARM: LPAE: add ISBs around MMU enabling code
Will Deacon [Tue, 22 Nov 2011 17:30:28 +0000 (17:30 +0000)]
ARM: LPAE: add ISBs around MMU enabling code

Before we enable the MMU, we must ensure that the TTBR registers contain
sane values. After the MMU has been enabled, we jump to the *virtual*
address of the following function, so we also need to ensure that the
SCTLR write has taken effect.

This patch adds ISB instructions around the SCTLR write to ensure the
visibility of the above.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
13 years agoFixup Makefile.
David Vrabel [Thu, 22 Dec 2011 15:09:05 +0000 (15:09 +0000)]
Fixup Makefile.

13 years agoARM: vexpress: Add Device Tree for V2P-CA15 core tile (TC1 variant)
Pawel Moll [Thu, 15 Dec 2011 10:57:28 +0000 (10:57 +0000)]
ARM: vexpress: Add Device Tree for V2P-CA15 core tile (TC1 variant)

This patch adds Device Tree file for the CoreTile Express A15x2
(V2P-CA15) with Test Chip 1.

As the chip's GIC has 160 interrupt inputs and equivalent SMM
(FPGA) has GIC synthesised with 256 interrupts, NR_IRQS is
increased.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
13 years agoARM: vexpress: Add Device Tree for V2P-CA9 core tile
Pawel Moll [Fri, 9 Dec 2011 18:40:31 +0000 (18:40 +0000)]
ARM: vexpress: Add Device Tree for V2P-CA9 core tile

This patch adds Device Tree file for the CoreTile Express A9x4 (V2P-CA9).

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
13 years agoARM: vexpress: Add Device Tree for V2P-CA5s core tile
Pawel Moll [Fri, 9 Dec 2011 18:41:27 +0000 (18:41 +0000)]
ARM: vexpress: Add Device Tree for V2P-CA5s core tile

This patch adds Device Tree file for the CoreTile Express A5x2 (V2P-CA5s).

Tested-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
13 years agoARM: vexpress: Motherboard RS1 memory map support
Pawel Moll [Fri, 9 Dec 2011 18:47:39 +0000 (18:47 +0000)]
ARM: vexpress: Motherboard RS1 memory map support

This patch adds support for RS1 memory map based Versatile Express
motherboard.

Tested-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
13 years agoARM: vexpress: Add Device Tree support
Pawel Moll [Fri, 9 Dec 2011 18:32:48 +0000 (18:32 +0000)]
ARM: vexpress: Add Device Tree support

This patch adds generic Versatile Express DT machine description,
Device Tree description for the motherboard and documentation for
the bindings.

Tested-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
13 years agoARM: vexpress: Use FDT data in platform SMP calls
Pawel Moll [Fri, 9 Dec 2011 18:25:14 +0000 (18:25 +0000)]
ARM: vexpress: Use FDT data in platform SMP calls

If ct_desc is not set (so a board was booted with DT machine ID)
try to look for "arm,cortex-a9-scu" node and initialize the SCU
using base address in "reg" property.

Otherwise assume that there is no special SCU initialization
required and initialize CPUs basing on numbers of "cpu" type
devices in "cpus" node of the Device Tree.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
13 years agoARM: versatile: Map local timers using Device Tree when possible
Pawel Moll [Thu, 15 Dec 2011 10:44:25 +0000 (10:44 +0000)]
ARM: versatile: Map local timers using Device Tree when possible

Try to map TWD registers basing on a "arm,smp-twd" Device Tree
node (compatible value as used in Highbank's DT). This overrides
existing twd_base value.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
13 years agoxen/arm: hypercall.h fixes and cleanups
Stefano Stabellini [Thu, 29 Sep 2011 09:55:41 +0000 (10:55 +0100)]
xen/arm: hypercall.h fixes and cleanups

- the imm is actually 16 bits not 12 (mask 0xff00 should be 0xfff00);

- we can omit __HYPERVISOR_ in the users of hypercallN so that the
static inline hypercall implementations look like the x86 counterparts;

- do not bother with compat hypercalls.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoxen/arm: use as to calculate the HVC word
Stefano Stabellini [Wed, 28 Sep 2011 17:18:06 +0000 (18:18 +0100)]
xen/arm: use as to calculate the HVC word

Use as to calculate the HVC word plus the argument, rather than
manually encoding the number for each hypercall.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoxen: initial ARM support
Stefano Stabellini [Wed, 28 Sep 2011 16:14:58 +0000 (17:14 +0100)]
xen: initial ARM support

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
13 years agoARM: vexpress: Get rid of MMIO_P2V
Pawel Moll [Thu, 8 Dec 2011 18:17:31 +0000 (18:17 +0000)]
ARM: vexpress: Get rid of MMIO_P2V

This patch gets rid of the MMIO_P2V and __MMIO_P2V macros,
defining constant virtual base for motherboard and tile
peripherals instead.

Additionally, in preparation for the new motherboard memory
map, the motherboard peripherals are using base pointers
calculated in runtime, instead of compile-time calculated
values.

Tested-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
13 years agoARM: versatile: Add missing ENDPROC to headsmp.S
Pawel Moll [Thu, 15 Dec 2011 11:00:45 +0000 (11:00 +0000)]
ARM: versatile: Add missing ENDPROC to headsmp.S

Once the ENDPROC is in place, BSYM() in not longer necessary
to get correct pointer to versatile_secondary_startup().

Tested-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
13 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Thu, 15 Dec 2011 03:45:40 +0000 (19:45 -0800)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/radeon/kms: add some new pci ids

13 years agoMerge tag 'tytso-for-linus-20111214' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 15 Dec 2011 02:25:58 +0000 (18:25 -0800)]
Merge tag 'tytso-for-linus-20111214' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

* tag 'tytso-for-linus-20111214' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: handle EOF correctly in ext4_bio_write_page()
  ext4: remove a wrong BUG_ON in ext4_ext_convert_to_initialized
  ext4: correctly handle pages w/o buffers in ext4_discard_partial_buffers()
  ext4: avoid potential hang in mpage_submit_io() when blocksize < pagesize
  ext4: avoid hangs in ext4_da_should_update_i_disksize()
  ext4: display the correct mount option in /proc/mounts for [no]init_itable
  ext4: Fix crash due to getting bogus eh_depth value on big-endian systems
  ext4: fix ext4_end_io_dio() racing against fsync()

.. using the new signed tag merge of git that now verifies the gpg
signature automatically.  Yay.  The branchname was just 'dev', which is
prettier.  I'll tell Ted to use nicer tag names for future cases.

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi...
Linus Torvalds [Thu, 15 Dec 2011 02:23:35 +0000 (18:23 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
  fuse: llseek fix race
  fuse: fix llseek bug
  fuse: fix fuse_retrieve

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Thu, 15 Dec 2011 02:22:55 +0000 (18:22 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  fs/ncpfs: fix error paths and goto statements in ncp_fill_super()
  configfs: register_filesystem() called too early
  fuse: register_filesystem() called too early
  ubifs: too early register_filesystem()
  ... and the same kind of leak for mqueue
  procfs: fix a vfsmount longterm reference leak

13 years agodrm/radeon/kms: add some new pci ids
Alex Deucher [Mon, 12 Dec 2011 14:23:48 +0000 (09:23 -0500)]
drm/radeon/kms: add some new pci ids

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=43739

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agofs/ncpfs: fix error paths and goto statements in ncp_fill_super()
Djalal Harouni [Tue, 13 Dec 2011 01:47:29 +0000 (02:47 +0100)]
fs/ncpfs: fix error paths and goto statements in ncp_fill_super()

The label 'out_bdi' should be followed by bdi_destroy() instead of
fput() which should be after the 'out_fput' label.

If bdi_setup_and_register() fails then jump to the 'out_fput' label
instead of the 'out_bdi' one.

If fget(data.info_fd) fails then jump to the previously fixed 'out_bdi'
label to call bdi_destroy() otherwise the bdi object will not be
destroyed.

Compile tested only.

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoext4: handle EOF correctly in ext4_bio_write_page()
Yongqiang Yang [Wed, 14 Dec 2011 03:29:12 +0000 (22:29 -0500)]
ext4: handle EOF correctly in ext4_bio_write_page()

We need to zero out part of a page which beyond EOF before setting uptodate,
otherwise, mapread or write will see non-zero data beyond EOF.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
13 years agoext4: remove a wrong BUG_ON in ext4_ext_convert_to_initialized
Yongqiang Yang [Wed, 14 Dec 2011 03:13:42 +0000 (22:13 -0500)]
ext4: remove a wrong BUG_ON in ext4_ext_convert_to_initialized

If a file is fallocated on a hole, map->m_lblk + map->m_len may be greater
than ee_block + ee_len.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
13 years agoext4: correctly handle pages w/o buffers in ext4_discard_partial_buffers()
Yongqiang Yang [Wed, 14 Dec 2011 03:05:05 +0000 (22:05 -0500)]
ext4: correctly handle pages w/o buffers in ext4_discard_partial_buffers()

If a page has been read into memory and never been written, it has no
buffers, but we should handle the page in truncate or punch hole.

VFS code of writing operations has handled holes correctly, so this
patch removes the code handling holes in writing operations.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
13 years agoext4: avoid potential hang in mpage_submit_io() when blocksize < pagesize
Yongqiang Yang [Wed, 14 Dec 2011 02:51:55 +0000 (21:51 -0500)]
ext4: avoid potential hang in mpage_submit_io() when blocksize < pagesize

If there is an unwritten but clean buffer in a page and there is a
dirty buffer after the buffer, then mpage_submit_io does not write the
dirty buffer out.  As a result, da_writepages loops forever.

This patch fixes the problem by checking dirty flag.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
13 years agoext4: avoid hangs in ext4_da_should_update_i_disksize()
Andrea Arcangeli [Wed, 14 Dec 2011 02:41:15 +0000 (21:41 -0500)]
ext4: avoid hangs in ext4_da_should_update_i_disksize()

If the pte mapping in generic_perform_write() is unmapped between
iov_iter_fault_in_readable() and iov_iter_copy_from_user_atomic(), the
"copied" parameter to ->end_write can be zero. ext4 couldn't cope with
it with delayed allocations enabled. This skips the i_disksize
enlargement logic if copied is zero and no new data was appeneded to
the inode.

 gdb> bt
 #0  0xffffffff811afe80 in ext4_da_should_update_i_disksize (file=0xffff88003f606a80, mapping=0xffff88001d3824e0, pos=0x1\
 08000, len=0x1000, copied=0x0, page=0xffffea0000d792e8, fsdata=0x0) at fs/ext4/inode.c:2467
 #1  ext4_da_write_end (file=0xffff88003f606a80, mapping=0xffff88001d3824e0, pos=0x108000, len=0x1000, copied=0x0, page=0\
 xffffea0000d792e8, fsdata=0x0) at fs/ext4/inode.c:2512
 #2  0xffffffff810d97f1 in generic_perform_write (iocb=<value optimized out>, iov=<value optimized out>, nr_segs=<value o\
 ptimized out>, pos=0x108000, ppos=0xffff88001e26be40, count=<value optimized out>, written=0x0) at mm/filemap.c:2440
 #3  generic_file_buffered_write (iocb=<value optimized out>, iov=<value optimized out>, nr_segs=<value optimized out>, p\
 os=0x108000, ppos=0xffff88001e26be40, count=<value optimized out>, written=0x0) at mm/filemap.c:2482
 #4  0xffffffff810db5d1 in __generic_file_aio_write (iocb=0xffff88001e26bde8, iov=0xffff88001e26bec8, nr_segs=0x1, ppos=0\
 xffff88001e26be40) at mm/filemap.c:2600
 #5  0xffffffff810db853 in generic_file_aio_write (iocb=0xffff88001e26bde8, iov=0xffff88001e26bec8, nr_segs=<value optimi\
 zed out>, pos=<value optimized out>) at mm/filemap.c:2632
 #6  0xffffffff811a71aa in ext4_file_write (iocb=0xffff88001e26bde8, iov=0xffff88001e26bec8, nr_segs=0x1, pos=0x108000) a\
 t fs/ext4/file.c:136
 #7  0xffffffff811375aa in do_sync_write (filp=0xffff88003f606a80, buf=<value optimized out>, len=<value optimized out>, \
 ppos=0xffff88001e26bf48) at fs/read_write.c:406
 #8  0xffffffff81137e56 in vfs_write (file=0xffff88003f606a80, buf=0x1ec2960 <Address 0x1ec2960 out of bounds>, count=0x4\
 000, pos=0xffff88001e26bf48) at fs/read_write.c:435
 #9  0xffffffff8113816c in sys_write (fd=<value optimized out>, buf=0x1ec2960 <Address 0x1ec2960 out of bounds>, count=0x\
 4000) at fs/read_write.c:487
 #10 <signal handler called>
 #11 0x00007f120077a390 in __brk_reservation_fn_dmi_alloc__ ()
 #12 0x0000000000000000 in ?? ()
 gdb> print offset
 $22 = 0xffffffffffffffff
 gdb> print idx
 $23 = 0xffffffff
 gdb> print inode->i_blkbits
 $24 = 0xc
 gdb> up
 #1  ext4_da_write_end (file=0xffff88003f606a80, mapping=0xffff88001d3824e0, pos=0x108000, len=0x1000, copied=0x0, page=0\
 xffffea0000d792e8, fsdata=0x0) at fs/ext4/inode.c:2512
 2512                    if (ext4_da_should_update_i_disksize(page, end)) {
 gdb> print start
 $25 = 0x0
 gdb> print end
 $26 = 0xffffffffffffffff
 gdb> print pos
 $27 = 0x108000
 gdb> print new_i_size
 $28 = 0x108000
 gdb> print ((struct ext4_inode_info *)((char *)inode-((int)(&((struct ext4_inode_info *)0)->vfs_inode))))->i_disksize
 $29 = 0xd9000
 gdb> down
 2467            for (i = 0; i < idx; i++)
 gdb> print i
 $30 = 0xd44acbee

This is 100% reproducible with some autonuma development code tuned in
a very aggressive manner (not normal way even for knumad) which does
"exotic" changes to the ptes. It wouldn't normally trigger but I don't
see why it can't happen normally if the page is added to swap cache in
between the two faults leading to "copied" being zero (which then
hangs in ext4). So it should be fixed. Especially possible with lumpy
reclaim (albeit disabled if compaction is enabled) as that would
ignore the young bits in the ptes.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
13 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 13 Dec 2011 23:02:31 +0000 (15:02 -0800)]
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  Revert "x86, efi: Calling __pa() with an ioremap()ed address is invalid"
  x86, efi: Make efi_call_phys_{prelog,epilog} CONFIG_RELOCATABLE-aware

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
Linus Torvalds [Tue, 13 Dec 2011 22:59:42 +0000 (14:59 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  ceph: add missing spin_unlock at ceph_mdsc_build_path()
  ceph: fix SEEK_CUR, SEEK_SET regression
  crush: fix mapping calculation when force argument doesn't exist
  ceph: use i_ceph_lock instead of i_lock
  rbd: remove buggy rollback functionality
  rbd: return an error when an invalid header is read
  ceph: fix rasize reporting by ceph_show_options

13 years agoMerge branch 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 13 Dec 2011 22:58:56 +0000 (14:58 -0800)]
Merge branch 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux

* 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
  writeback: set max_pause to lowest value on zero bdi_dirty
  writeback: permit through good bdi even when global dirty exceeded
  writeback: comment on the bdi dirty threshold
  fs: Make write(2) interruptible by a fatal signal
  writeback: Fix issue on make htmldocs

13 years agoceph: add missing spin_unlock at ceph_mdsc_build_path()
Yehuda Sadeh [Tue, 13 Dec 2011 17:57:44 +0000 (09:57 -0800)]
ceph: add missing spin_unlock at ceph_mdsc_build_path()

one of the paths was missing spin_unlock

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
13 years agoconfigfs: register_filesystem() called too early
Al Viro [Tue, 13 Dec 2011 17:32:42 +0000 (12:32 -0500)]
configfs: register_filesystem() called too early

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agofuse: register_filesystem() called too early
Al Viro [Tue, 13 Dec 2011 17:25:27 +0000 (12:25 -0500)]
fuse: register_filesystem() called too early

same story as with ubifs

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoubifs: too early register_filesystem()
Al Viro [Tue, 13 Dec 2011 04:58:21 +0000 (23:58 -0500)]
ubifs: too early register_filesystem()

doing that before you are ready to handle mount() is a Bad Idea(tm)...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 years agoMerge branch 'fixes' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur...
Linus Torvalds [Tue, 13 Dec 2011 17:28:23 +0000 (09:28 -0800)]
Merge branch 'fixes' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm

* 'fixes' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm:
  ARM: 7204/1: arch/arm/kernel/setup.c: initialize arm_dma_zone_size earlier
  ARM: 7185/1: perf: don't assign platform_device on unsupported CPUs
  ARM: 7187/1: fix unwinding for XIP kernels
  ARM: 7186/1: fix Kconfig issue with PHYS_OFFSET and !MMU

13 years agoceph: fix SEEK_CUR, SEEK_SET regression
Sage Weil [Tue, 13 Dec 2011 17:19:26 +0000 (09:19 -0800)]
ceph: fix SEEK_CUR, SEEK_SET regression

Commit 06222e491e663dac939f04b125c9dc52126a75c4 got the if wrong so that
it always evaluates as true.  This is semantically harmless, but makes
SEEK_CUR and SEEK_SET needlessly query the server.

Rewrite the if to explicitly enumerate the cases we DO need a valid i_size
to make this code less fragile.

Reported-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
13 years agofuse: llseek fix race
Miklos Szeredi [Tue, 13 Dec 2011 10:40:59 +0000 (11:40 +0100)]
fuse: llseek fix race

Fix race between lseek(fd, 0, SEEK_CUR) and read/write.  This was fixed in
generic code by commit 5b6f1eb97d (vfs: lseek(fd, 0, SEEK_CUR) race condition).

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
13 years agofuse: fix llseek bug
Roel Kluin [Tue, 13 Dec 2011 09:37:00 +0000 (10:37 +0100)]
fuse: fix llseek bug

The test in fuse_file_llseek() "not SEEK_CUR or not SEEK_SET" always evaluates
to true.

This was introduced in 3.1 by commit 06222e49 (fs: handle SEEK_HOLE/SEEK_DATA
properly in all fs's that define their own llseek) and changed the behavior of
SEEK_CUR and SEEK_SET to always retrieve the file attributes.  This is a
performance regression.

Fix the test so that it makes sense.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: stable@vger.kernel.org
CC: Josef Bacik <josef@redhat.com>
CC: Al Viro <viro@zeniv.linux.org.uk>
13 years agofuse: fix fuse_retrieve
Miklos Szeredi [Tue, 13 Dec 2011 09:36:59 +0000 (10:36 +0100)]
fuse: fix fuse_retrieve

Fix two bugs in fuse_retrieve():

 - retrieving more than one page would yield repeated instances of the
   first page

 - if more than FUSE_MAX_PAGES_PER_REQ pages were requested than the
   request page array would overflow

fuse_retrieve() was added in 2.6.36 and these bugs had been there since the
beginning.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: stable@vger.kernel.org
13 years agolinux/log2.h: Fix rounddown_pow_of_two(1)
Linus Torvalds [Tue, 13 Dec 2011 06:06:55 +0000 (22:06 -0800)]
linux/log2.h: Fix rounddown_pow_of_two(1)

Exactly like roundup_pow_of_two(1), the rounddown version was buggy for
the case of a compile-time constant '1' argument.  Probably because it
originated from the same code, sharing history with the roundup version
from before the bugfix (for that one, see commit 1a06a52ee1b0: "Fix
roundup_pow_of_two(1)").

However, unlike the roundup version, the fix for rounddown is to just
remove the broken special case entirely.  It's simply not needed - the
generic code

    1UL << ilog2(n)

does the right thing for the constant '1' argment too.  The only reason
roundup needed that special case was because rounding up does so by
subtracting one from the argument (and then adding one to the result)
causing the obvious problems with "ilog2(0)".

But rounddown doesn't do any of that, since ilog2() naturally truncates
(ie "rounds down") to the right rounded down value.  And without the
ilog2(0) case, there's no reason for the special case that had the wrong
value.

tl;dr: rounddown_pow_of_two(1) should be 1, not 0.

Acked-by: Dmitry Torokhov <dtor@vmware.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
Linus Torvalds [Tue, 13 Dec 2011 04:08:27 +0000 (20:08 -0800)]
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (jz4740) Staticise jz4740_hwmon_driver
  hwmon: (jz4740) fix signedness bug

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
Linus Torvalds [Tue, 13 Dec 2011 04:06:13 +0000 (20:06 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
  mmc: core: Fix deadlock when the CONFIG_MMC_UNSAFE_RESUME is not defined
  mmc: sdhci-s3c: Remove old and misprototyped suspend operations
  mmc: tmio: fix clock gating on platforms with a .set_pwr() method
  mmc: sh_mmcif: fix clock gating on platforms with a .down_pwr() method
  mmc: core: Fix typo at mmc_card_sleep
  mmc: core: Fix power_off_notify during suspend
  mmc: core: Fix setting power notify state variable for non-eMMC
  mmc: core: Add quirk for long data read time
  mmc: Add module.h include to sdhci-cns3xxx.c
  mmc: mxcmmc: fix falling back to PIO
  mmc: omap_hsmmc: DMA unmap only once in case of MMC error

13 years agoext4: display the correct mount option in /proc/mounts for [no]init_itable
Theodore Ts'o [Tue, 13 Dec 2011 03:06:18 +0000 (22:06 -0500)]
ext4: display the correct mount option in /proc/mounts for [no]init_itable

/proc/mounts was showing the mount option [no]init_inode_table when
the correct mount option that will be accepted by parse_options() is
[no]init_itable.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
13 years agoRevert "x86, efi: Calling __pa() with an ioremap()ed address is invalid"
Keith Packard [Mon, 12 Dec 2011 00:12:42 +0000 (16:12 -0800)]
Revert "x86, efi: Calling __pa() with an ioremap()ed address is invalid"

This hangs my MacBook Air at boot time; I get no console
messages at all. I reverted this on top of -rc5 and my machine
boots again.

This reverts commit e8c7106280a305e1ff2a3a8a4dfce141469fb039.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Huang Ying <huang.ying.caritas@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/1321621751-3650-1-git-send-email-matt@console
Signed-off-by: Ingo Molnar <mingo@elte.hu>
13 years agocrush: fix mapping calculation when force argument doesn't exist
Sage Weil [Wed, 7 Dec 2011 17:10:26 +0000 (09:10 -0800)]
crush: fix mapping calculation when force argument doesn't exist

If the force argument isn't valid, we should continue calculating a
mapping as if it weren't specified.

Signed-off-by: Sage Weil <sage@newdream.net>