public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: linux-riscv@lists.infradead.org, anup@brainfault.org
Cc: Palmer Dabbelt <palmer@rivosinc.com>,
	kernel test robot <lkp@intel.com>,
	Palmer Dabbelt <palmer@rivosinc.com>,
	conor.dooley@microchip.com
Subject: Re: [PATCH v2] RISC-V: Clean up the Zicbom block size probing
Date: Thu, 01 Sep 2022 17:57:01 +0200	[thread overview]
Message-ID: <4581901.fW5hKsROvD@diego> (raw)
In-Reply-To: <20220812154010.18280-1-palmer@rivosinc.com>

Am Freitag, 12. August 2022, 17:40:10 CEST schrieb Palmer Dabbelt:
> This fixes two issues: I truncated the warning's hart ID when porting to
> the 64-bit hart ID code, and the original code's warning handling could
> fire on an uninitialized hart ID.
> 
> The biggest change here is that riscv_cbom_block_size is no longer
> initialized, as IMO the default isn't sane: there's nothing in the ISA
> that mandates any specific cache block size, so falling back to one will
> just silently produce the wrong answer on some systems.  This also
> changes the probing order so the cache block size is known before
> enabling Zicbom support.
> 
> Fixes: 3aefb2ee5bdd ("riscv: implement Zicbom-based CMO instructions + the t-head variant")
> Fixes: 1631ba1259d6 ("riscv: Add support for non-coherent devices using zicbom extension")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

With Conor's fixes folded in, this compiles and breaks the T-Head CMOs
as they rely on that default value :-) .

Can we do the following:

(1) pick Anup's patch moving the block-size init over to cacheflush [0]
(2) apply this patch (with Conor's fixes and adapted to the changed
    location) and add this one additional line:

diff --git a/arch/riscv/errata/thead/errata.c b/arch/riscv/errata/thead/errata.c
index d4b1526538ad..67fa078f303f 100644
--- a/arch/riscv/errata/thead/errata.c
+++ b/arch/riscv/errata/thead/errata.c
@@ -42,6 +42,7 @@ static bool errata_probe_cmo(unsigned int stage,
        if (stage == RISCV_ALTERNATIVES_EARLY_BOOT)
                return false;
 
+       riscv_cbom_block_size = L1_CACHE_BYTES;
        riscv_noncoherent_supported();
        return true;
 }


With that done everything works (again) and looks great, so would be
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Heiko Stuebner <heiko@sntech.de>


Heiko

[0] https://lore.kernel.org/r/20220830044642.566769-3-apatel@ventanamicro.com



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2022-09-01 15:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12 15:40 [PATCH v2] RISC-V: Clean up the Zicbom block size probing Palmer Dabbelt
2022-08-12 17:26 ` Conor.Dooley
2022-08-12 17:43 ` Atish Patra
2022-08-12 23:07   ` Palmer Dabbelt
2022-08-22 22:02     ` Conor.Dooley
2022-08-15 15:40 ` Nathan Chancellor
2022-08-15 17:36   ` Jessica Clarke
2022-08-15 18:16     ` Nathan Chancellor
2022-09-01 15:57 ` Heiko Stübner [this message]
2022-09-02  9:55   ` Conor.Dooley
2022-09-06  6:08     ` Andrew Jones

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=4581901.fW5hKsROvD@diego \
    --to=heiko@sntech.de \
    --cc=anup@brainfault.org \
    --cc=conor.dooley@microchip.com \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=palmer@rivosinc.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