public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Palmer Dabbelt <palmer@rivosinc.com>
Cc: linux-riscv@lists.infradead.org
Subject: Re: [PATCH v1 4/5] RISC-V: hwprobe: Support probing of misaligned accesss performance
Date: Tue, 29 Nov 2022 23:10:02 +0100	[thread overview]
Message-ID: <5662455.1IzOArtZ34@diego> (raw)
In-Reply-To: <mhng-e4edd80d-2aa6-4a56-a13d-2d75d7ddd82f@palmer-ri-x1c9a>

Am Dienstag, 29. November 2022, 22:18:18 CET schrieb Palmer Dabbelt:
> On Tue, 29 Nov 2022 13:09:49 PST (-0800), heiko@sntech.de wrote:
> > Am Donnerstag, 13. Oktober 2022, 18:35:50 CET schrieb Palmer Dabbelt:
> >> This allows userspace to select various routines to use based on the
> >> performance of misaligned access on the target hardware.
> >>
> >> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
> >
> > [...]
> >
> >> diff --git a/arch/riscv/include/asm/cpufeature.h b/arch/riscv/include/asm/cpufeature.h
> >> index cbda062de9bd..54bdcf9a5049 100644
> >> --- a/arch/riscv/include/asm/cpufeature.h
> >> +++ b/arch/riscv/include/asm/cpufeature.h
> >> @@ -18,4 +18,6 @@ struct riscv_cpuinfo {
> >>
> >>  DECLARE_PER_CPU(struct riscv_cpuinfo, riscv_cpuinfo);
> >>
> >> +DECLARE_PER_CPU(long, misaligned_access_speed);
> >
> > just my 2ct ... wouldn't it make sense to have struct riscv_cpuinfo
> > as the central instance for all cpu-related stuff, so
> > misaligned_access_speed could also be part of it?
> 
> I remember going through this one a few times and ending up here despite 
> some cleaner-looking ways of doing it.  That way does look cleaner, 
> though, so I'll give it a shot and we'll see what happens...
> 
> >> diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
> >> index 553d755483ed..1599e40cd170 100644
> >> --- a/arch/riscv/kernel/cpufeature.c
> >> +++ b/arch/riscv/kernel/cpufeature.c
> >> @@ -222,6 +226,22 @@ void __init riscv_fill_hwcap(void)
> >>  			bitmap_copy(riscv_isa, this_isa, RISCV_ISA_EXT_MAX);
> >>  		else
> >>  			bitmap_and(riscv_isa, riscv_isa, this_isa, RISCV_ISA_EXT_MAX);
> >> +
> >> +		/*
> >> +		 * Check for the performance of misaligned accesses.
> >> +		 */
> >> +		cpu = hartid_to_cpuid_map(hartid);
> >> +		if (cpu < 0)
> >> +			continue;
> >> +
> >> +		if (of_property_read_string(node, "riscv,misaligned-access-performance", &misaligned)) {
> >
> > I think this wants a "!" in front :-) .
> >
> > of_property_read_string() returns 0 on success, so running this
> > results in a nullptr right now.
> 
> Thanks.  I'd not gotten around to actually running this so I bet it's 
> broken in a bunch of ways.  Did you try it out?  I was really hoping to 
> find some time to get at least the simple stuff in for this cycle, but 
> too many things keep coming up.

I ran the code today, so bumped into the "!" issue.
I'm not yet "using" it, but that will come in the next days.

And no worries about that time-thingy, your series already provides
a nice pointer for the general direction to with things, so that is helpful
in its own right.

I will simply report any brokeness I find when it happens ;-) .


Heiko




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

  reply	other threads:[~2022-11-29 22:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13 16:35 [PATCH v1 0/5] RISC-V Hardware Probing User Interface Palmer Dabbelt
2022-10-13 16:35 ` [PATCH v1 1/5] RISC-V: Add a syscall for HW probing Palmer Dabbelt
2022-10-20  8:24   ` Christoph Hellwig
2022-10-13 16:35 ` [PATCH v1 2/5] RISC-V: hwprobe: Add support for RISCV_HWPROBE_BASE_BEHAVIOR_IMA Palmer Dabbelt
2022-10-13 16:35 ` [PATCH v1 3/5] dt-bindings: Add RISC-V misaligned access performance Palmer Dabbelt
2022-10-13 16:35 ` [PATCH v1 4/5] RISC-V: hwprobe: Support probing of misaligned accesss performance Palmer Dabbelt
2022-11-29 21:09   ` Heiko Stübner
2022-11-29 21:18     ` Palmer Dabbelt
2022-11-29 22:10       ` Heiko Stübner [this message]
2022-11-29 22:44         ` Palmer Dabbelt
2022-10-13 16:35 ` [PATCH v1 5/5] selftests: Test the new RISC-V hwprobe interface Palmer Dabbelt
2022-12-01 16:06 ` [PATCH v1 0/5] RISC-V Hardware Probing User Interface Andrew Jones
2023-01-09 18:47   ` Conor Dooley
2023-01-09 19:50     ` Heiko Stübner
2023-01-10 19:12       ` Conor Dooley

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=5662455.1IzOArtZ34@diego \
    --to=heiko@sntech.de \
    --cc=linux-riscv@lists.infradead.org \
    --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