From: Charlie Jenkins <charlie@rivosinc.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Helge Deller <deller@gmx.de>,
David Laight <David.Laight@aculab.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Andrew Morton <akpm@linux-foundation.org>,
Parisc List <linux-parisc@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 2/2] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests
Date: Fri, 16 Feb 2024 01:13:55 -0500 [thread overview]
Message-ID: <Zc79I5VDSaFnb4xj@ghost> (raw)
In-Reply-To: <6aaa4b89-a967-4b19-b4bf-a1ad5c8e9faa@roeck-us.net>
On Thu, Feb 15, 2024 at 10:09:42PM -0800, Guenter Roeck wrote:
> On 2/15/24 21:54, Helge Deller wrote:
> [ ... ]
> >
> > Can you please give a pointer to this test code?
> > I'm happy to try it on real hardware.
> >
> You should also see the problem if you use v7 of Charlie's checksum
> unit test fixes.
>
> I submitted the qemu fix (or at least what I think the fix should be)
> a couple of minutes ago.
>
> https://patchwork.kernel.org/project/qemu-devel/patch/20240216053415.2163286-1-linux@roeck-us.net/
>
> > > It is quite easy to show that carry is always set after executing ldd
> > > on an unaligned address. That is also why I know for sure that the
> > > problem is not seen with ldw on unaligned addresses.
> > Interesting.
>
> Ultimately it wasn't surprising, with the unusual carry bit
> implementation on hppa. The upper 8 carry bits were not masked
> correctly when returning from a trap or interrupt.
Tangential question, but why does Linux need to save and restore the PSW
if that is already handled by the hardware? I am missing something.
- Charlie
>
> > In general I think it's quite important to differentiate between
> > running on qemu or running on physical hardware.
>
> I know, that makes testing always tricky (not just with this
> architecture) because it is often not obvious if the problem
> is a problem in the tested code or a problem in the emulation.
>
> > Qemu just recently got 64-bit support, and it's not yet behaving
> > like real hardware. One thing I noticed is, that read hardware
> > does not seem to jump into the exception handler twice, while
> > qemu does. So, if you run into an exception (e.g. unaligned ldd)
> > then if a second exception happens in the fault handler (e.g. second
> > unaligned ldd to resolve wrongly-coded code lookup), you will
> > get different behaviour between hardware and emulation.
>
> Hmm, interesting. Makes me wonder how the real hardware handles such
> double traps.
>
> > This is also the reason why qemu still fails to emulate newer
> > 64-bit Linux kernels which uses kernel modules.
> >
> I don't use modules in my testing, so I'll leave that alone for
> anther day.
>
> Cheers,
> Guenter
>
next prev parent reply other threads:[~2024-02-16 6:13 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 21:41 [PATCH v8 0/2] lib: checksum: Fix issues with checksum tests Charlie Jenkins
2024-02-14 21:41 ` [PATCH v8 1/2] lib: checksum: Fix type casting in checksum kunits Charlie Jenkins
2024-02-14 21:41 ` [PATCH v8 2/2] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests Charlie Jenkins
2024-02-14 23:03 ` Guenter Roeck
2024-02-15 1:30 ` Charlie Jenkins
2024-02-15 1:58 ` Guenter Roeck
2024-02-15 3:00 ` John David Anglin
2024-02-15 3:35 ` Charlie Jenkins
2024-02-15 4:11 ` Charlie Jenkins
2024-02-15 8:56 ` Guenter Roeck
2024-02-15 15:36 ` Charlie Jenkins
2024-02-15 16:30 ` Guenter Roeck
2024-02-15 16:51 ` Charlie Jenkins
2024-02-15 17:13 ` John David Anglin
2024-02-15 17:29 ` Guenter Roeck
2024-02-15 15:22 ` Guenter Roeck
2024-02-16 5:54 ` Helge Deller
2024-02-16 5:25 ` Guenter Roeck
2024-02-16 7:31 ` Helge Deller
2024-02-16 6:58 ` Guenter Roeck
2024-02-16 6:09 ` Guenter Roeck
2024-02-16 6:13 ` Charlie Jenkins [this message]
2024-02-16 12:05 ` Helge Deller
2024-02-16 18:22 ` John David Anglin
2024-02-15 10:27 ` David Laight
2024-02-15 15:44 ` Guenter Roeck
2024-02-15 16:51 ` John David Anglin
2024-02-15 17:06 ` Guenter Roeck
2024-02-15 17:25 ` John David Anglin
2024-02-15 18:17 ` Guenter Roeck
2024-02-15 18:56 ` John David Anglin
2024-02-15 21:00 ` Guenter Roeck
2024-02-15 21:08 ` John David Anglin
2024-02-15 18:42 ` Guenter Roeck
2024-02-15 19:41 ` David Laight
2024-02-15 19:42 ` Charlie Jenkins
2024-02-16 5:00 ` Guenter Roeck
2024-02-15 1:24 ` Guenter Roeck
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=Zc79I5VDSaFnb4xj@ghost \
--to=charlie@rivosinc.com \
--cc=David.Laight@aculab.com \
--cc=akpm@linux-foundation.org \
--cc=deller@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=palmer@dabbelt.com \
--cc=viro@zeniv.linux.org.uk \
/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.