mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luis Henriques <luis.henriques@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	kernel-team@lists.ubuntu.com
Cc: Will Deacon <will.deacon@arm.com>,
	Russell King <rmk+kernel@arm.linux.org.uk>,
	Luis Henriques <luis.henriques@canonical.com>
Subject: [PATCH 3.5 03/62] ARM: 7953/1: mm: ensure TLB invalidation is complete before enabling MMU
Date: Wed,  5 Mar 2014 14:36:07 +0000	[thread overview]
Message-ID: <1394030226-26652-4-git-send-email-luis.henriques@canonical.com> (raw)
In-Reply-To: <1394030226-26652-1-git-send-email-luis.henriques@canonical.com>

3.5.7.32 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: Will Deacon <will.deacon@arm.com>

commit bae0ca2bc550d1ec6a118fb8f2696f18c4da3d8e upstream.

During __v{6,7}_setup, we invalidate the TLBs since we are about to
enable the MMU on return to head.S. Unfortunately, without a subsequent
dsb instruction, the invalidation is not guaranteed to have completed by
the time we write to the sctlr, potentially exposing us to junk/stale
translations cached in the TLB.

This patch reworks the init functions so that the dsb used to ensure
completion of cache/predictor maintenance is also used to ensure
completion of the TLB invalidation.

Reported-by: Albin Tonnerre <Albin.Tonnerre@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mm/proc-v6.S | 3 ++-
 arch/arm/mm/proc-v7.S | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 897486c..4d2e447 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -202,7 +202,6 @@ __v6_setup:
 	mcr	p15, 0, r0, c7, c14, 0		@ clean+invalidate D cache
 	mcr	p15, 0, r0, c7, c5, 0		@ invalidate I cache
 	mcr	p15, 0, r0, c7, c15, 0		@ clean+invalidate cache
-	mcr	p15, 0, r0, c7, c10, 4		@ drain write buffer
 #ifdef CONFIG_MMU
 	mcr	p15, 0, r0, c8, c7, 0		@ invalidate I + D TLBs
 	mcr	p15, 0, r0, c2, c0, 2		@ TTB control register
@@ -212,6 +211,8 @@ __v6_setup:
 	ALT_UP(orr	r8, r8, #TTB_FLAGS_UP)
 	mcr	p15, 0, r8, c2, c0, 1		@ load TTB1
 #endif /* CONFIG_MMU */
+	mcr	p15, 0, r0, c7, c10, 4		@ drain write buffer and
+						@ complete invalidations
 	adr	r5, v6_crval
 	ldmia	r5, {r5, r6}
 #ifdef CONFIG_CPU_ENDIAN_BE8
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index c2e2b66..fb489cc 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -246,7 +246,6 @@ __v7_setup:
 
 3:	mov	r10, #0
 	mcr	p15, 0, r10, c7, c5, 0		@ I+BTB cache invalidate
-	dsb
 #ifdef CONFIG_MMU
 	mcr	p15, 0, r10, c8, c7, 0		@ invalidate I + D TLBs
 	v7_ttb_setup r10, r4, r8, r5		@ TTBCR, TTBRx setup
@@ -255,6 +254,7 @@ __v7_setup:
 	mcr	p15, 0, r5, c10, c2, 0		@ write PRRR
 	mcr	p15, 0, r6, c10, c2, 1		@ write NMRR
 #endif
+	dsb					@ Complete invalidations
 #ifndef CONFIG_ARM_THUMBEE
 	mrc	p15, 0, r0, c0, c1, 0		@ read ID_PFR0 for ThumbEE
 	and	r0, r0, #(0xf << 12)		@ ThumbEE enabled field
-- 
1.9.0


  parent reply	other threads:[~2014-03-05 15:00 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 14:36 [3.5.y.z extended stable] Linux 3.5.7.32 stable review Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 01/62] ata: enable quirk from jmicron JMB350 for JMB394 Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 02/62] sata_sil: apply MOD15WRITE quirk to TOSHIBA MK2561GSYN Luis Henriques
2014-03-05 14:36 ` Luis Henriques [this message]
2014-03-05 14:36 ` [PATCH 3.5 04/62] x86: dma-mapping: fix GFP_ATOMIC macro usage Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 05/62] SUNRPC: Fix races in xs_nospace() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 06/62] ext4: don't try to modify s_flags if the the file system is read-only Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 07/62] drm/i915/dp: increase native aux defer retry timeout Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 08/62] drm/i915/dp: add native aux defer retry limit Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 09/62] rtlwifi: rtl8192ce: Fix too long disable of IRQs Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 10/62] rtlwifi: Fix incorrect return from rtl_ps_enable_nic() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 11/62] rtl8187: fix regression on MIPS without coherent DMA Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 12/62] PCI: Enable INTx if BIOS left them disabled Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 13/62] cifs: ensure that uncached writes handle unmapped areas correctly Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 14/62] ext4: fix online resize with a non-standard blocks per group setting Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 15/62] ext4: don't leave i_crtime.tv_sec uninitialized Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 16/62] ALSA: usb-audio: work around KEF X300A firmware bug Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 17/62] avr32: fix missing module.h causing build failure in mimc200/fram.c Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 18/62] avr32: Makefile: add '-D__linux__' flag for gcc-4.4.7 use Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 19/62] ARM: 7957/1: add DSB after icache flush in __flush_icache_all() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 20/62] ahci: disable NCQ on Samsung pci-e SSDs on macbooks Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 21/62] USB: serial: option: blacklist interface 4 for Cinterion PHS8 and PXS8 Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 22/62] workqueue: ensure @task is valid across kthread_stop() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 23/62] cgroup: update cgroup_enable_task_cg_lists() to grab siglock Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 24/62] hwmon: (max1668) Fix writing the minimum temperature Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 25/62] cpufreq: powernow-k8: Initialize per-cpu data-structures properly Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 26/62] ACPI / video: Filter the _BCL table for duplicate brightness values Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 27/62] perf tools: Remove extraneous newline when parsing hardware cache events Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 28/62] perf tools: Fix cache event name generation Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 29/62] net: fix 'ip rule' iif/oif device rename Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 30/62] tg3: Fix deadlock in tg3_change_mtu() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 31/62] bonding: 802.3ad: make aggregator_identifier bond-private Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 32/62] usbnet: remove generic hard_header_len check Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 33/62] net: sctp: fix sctp_connectx abi for ia32 emulation/compat mode Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 34/62] net: add and use skb_gso_transport_seglen() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 35/62] net: ip, ipv6: handle gso skbs in forwarding path Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 36/62] net: asix: handle packets crossing URB boundaries Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 37/62] net: asix: add missing flag to struct driver_info Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 38/62] fs/proc/proc_devtree.c: remove empty /proc/device-tree when no openfirmware exists Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 39/62] Input: elantech - improve clickpad detection Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 40/62] KVM: MMU: handle invalid root_hpa at __direct_map Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 41/62] KVM: VMX: fix use after free of vmx->loaded_vmcs Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 42/62] e100: Fix "disabling already-disabled device" warning Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 43/62] dma: ste_dma40: don't dereference free:d descriptor Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 44/62] ASoC: sta32x: Fix array access overflow Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 45/62] ASoC: wm8770: Fix wrong number of enum items Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 46/62] SELinux: bigendian problems with filename trans rules Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 47/62] quota: Fix race between dqput() and dquot_scan_active() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 48/62] qla2xxx: Fix kernel panic on selective retransmission request Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 49/62] ASoC: wm8958-dsp: Fix firmware block loading Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 50/62] i7core_edac: Fix PCI device reference count Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 51/62] i7300_edac: Fix " Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 52/62] ipc,mqueue: remove limits for the amount of system-wide queues Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 53/62] dm mpath: fix stalls when handling invalid ioctls Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 54/62] ACPI / processor: Rework processor throttling with work_on_cpu() Luis Henriques
2014-03-05 14:36 ` [PATCH 3.5 55/62] USB: ftdi_sio: add Cressi Leonardo PID Luis Henriques
2014-03-05 14:37 ` [PATCH 3.5 56/62] usb: ehci: fix deadlock when threadirqs option is used Luis Henriques
2014-03-05 14:37 ` [PATCH 3.5 57/62] ASoC: sta32x: Fix wrong enum for limiter2 release rate Luis Henriques
2014-03-05 14:37 ` [PATCH 3.5 58/62] perf/x86: Fix event scheduling Luis Henriques
2014-03-05 14:37 ` [PATCH 3.5 59/62] perf: Fix hotplug splat Luis Henriques
2014-03-05 14:37 ` [PATCH 3.5 60/62] kvm: x86: fix emulator buffer overflow (CVE-2014-0049) Luis Henriques
2014-03-05 14:37 ` [PATCH 3.5 61/62] powerpc/le: Ensure that the 'stop-self' RTAS token is handled correctly Luis Henriques
2014-03-06 13:14   ` Luís Henriques
2014-03-05 14:37 ` [PATCH 3.5 62/62] powerpc/crashdump : Fix page frame number check in copy_oldmem_page Luis Henriques

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394030226-26652-4-git-send-email-luis.henriques@canonical.com \
    --to=luis.henriques@canonical.com \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=stable@vger.kernel.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®