Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/broadcom Invalidate the cache just before tryin...



details:   https://anonhg.NetBSD.org/src/rev/ea3e47978663
branches:  trunk
changeset: 967976:ea3e47978663
user:      skrll <skrll%NetBSD.org@localhost>
date:      Mon Dec 30 16:06:29 2019 +0000

description:
Invalidate the cache just before trying to read the results from the
firmware as RPI4 A72s can fill the cache with speculation

diffstat:

 sys/arch/arm/broadcom/bcm283x_platform.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r d0606913ba30 -r ea3e47978663 sys/arch/arm/broadcom/bcm283x_platform.c
--- a/sys/arch/arm/broadcom/bcm283x_platform.c  Mon Dec 30 16:05:15 2019 +0000
+++ b/sys/arch/arm/broadcom/bcm283x_platform.c  Mon Dec 30 16:06:29 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm283x_platform.c,v 1.29 2019/12/30 15:36:37 skrll Exp $      */
+/*     $NetBSD: bcm283x_platform.c,v 1.30 2019/12/30 16:06:29 skrll Exp $      */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.29 2019/12/30 15:36:37 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.30 2019/12/30 16:06:29 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_bcm283x.h"
@@ -744,6 +744,13 @@
 
        bcm2835_mbox_read(iot, ioh, BCMMBOX_CHANARM2VC, &res);
 
+       /*
+        * RPI4 has Cortex A72 processors which do speculation, so
+        * we need to invalidate the cache for an updates done by
+        * the firmware
+        */
+       cpu_dcache_inv_range((vaddr_t)&vb, sizeof(vb));
+
        if (!vcprop_buffer_success_p(&vb.vb_hdr)) {
                bootconfig.dramblocks = 1;
                bootconfig.dram[0].address = 0x0;



Home | Main Index | Thread Index | Old Index