All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <ajones@ventanamicro.com>
To: Conor.Dooley@microchip.com
Cc: heiko@sntech.de, linux-riscv@lists.infradead.org,
	anup@brainfault.org, palmer@rivosinc.com, lkp@intel.com
Subject: Re: [PATCH v2] RISC-V: Clean up the Zicbom block size probing
Date: Tue, 6 Sep 2022 08:08:52 +0200	[thread overview]
Message-ID: <20220906060852.rwofqr4qifpy5chb@kamzik> (raw)
In-Reply-To: <34dd1ff3-7202-d6dc-55b8-fe2830902995@microchip.com>

On Fri, Sep 02, 2022 at 09:55:27AM +0000, Conor.Dooley@microchip.com wrote:
> On 01/09/2022 16:57, Heiko Stübner wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> > 
> > 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>
> 
> With all of the above, it'd also be:
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

I needed these fixes for a patch series enabling KVM guests to use Zicbom
so I've gone ahead and made Conor's and Heiko's changes [1]. I rebased
Anup's moving patch on top of that [2]. I'll go ahead and post this patch
separately in case that makes things easier.

[1] https://github.com/jones-drew/linux/commit/af361283ec3129846307f787a3ebb19bd4a9c421
[2] https://github.com/jones-drew/linux/commit/61c404299c63c8706c129d2a67071f5aae94594f

(I forgot Conor's r-b on this patch in the branch, but I'll pick it up now
while posting.)

Thanks,
drew

> 
> > 
> > 
> > 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

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

      reply	other threads:[~2022-09-06  6:09 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
2022-09-02  9:55   ` Conor.Dooley
2022-09-06  6:08     ` Andrew Jones [this message]

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=20220906060852.rwofqr4qifpy5chb@kamzik \
    --to=ajones@ventanamicro.com \
    --cc=Conor.Dooley@microchip.com \
    --cc=anup@brainfault.org \
    --cc=heiko@sntech.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.