From: Helge Deller <deller@gmx.de>
To: John David Anglin <dave.anglin@bell.net>
Cc: debian-hppa@lists.debian.org, linux-parisc@vger.kernel.org
Subject: [RFC][PATCH] Fix HPMC handler by increasing size to multiple of 16 bytes
Date: Mon, 19 Mar 2018 23:23:53 +0100 [thread overview]
Message-ID: <20180319222353.GA28132@ls3530.fritz.box> (raw)
In-Reply-To: <81f118a7-5bc5-c6b2-eb10-a9c683c72a26@bell.net>
* John David Anglin <dave.anglin@bell.net>:
> On 2018-03-17 7:36 AM, Helge Deller wrote:
> > Can you maybe try to localize where in the drivers/ata/sata_via.c driver
> > triggers the HPMC ?
> >
> >
> > --- arch/parisc/kernel/hpmc.S 2018-01-28 22:20:33.000000000 +0100
> > +++ arch/parisc/kernel/hpmc.S 2018-03-15 14:13:46.611969815 +0100
> > @@ -308,4 +290,5 @@
> > .align 4
> > .export os_hpmc_size
> > os_hpmc_size:
> > - .word .os_hpmc_end-.os_hpmc
> > + /* .word .os_hpmc_end-.os_hpmc */
> > + .word (.os_hpmc_end - .os_hpmc) * 4 /* sizeof(u32) */
> >
> > This one seems wrong.
> > I think you just didn't hit a HPMC with your first patch, and as such
> > this patch has no influence...
> Helge, did you check that os_hpmc is correctly entered after you added
> the ".align 4" statement (e.g., trigger hpmc by accessing page 0 or
> such)? I looked at one of my builds and the size is correct as is.
> Is it possible that the length needs to be a multiple of 16? Current
> length is 0x194.
Good point. I changed that in the patch below.
> There are a couple of minor issues with assembly code. There are no .type
> and .size directives for os_hpmc_size.
Fixed as well.
> I think we should investigate further as I have never seen hpmc
> handler entered on rp3440 or c8000. On rp3440, there are messages
> about the branch failing in the SL log. However, this might have been
> fixed by your alignment fix.
No, the problem still exists in existing code.
Below patch is build-tested only.
[PATCH] Fix HPMC handler by increasing size to multiple of 16 bytes
Make sure that the HPMC handler is 16-byte aligned and that it's length
in the IVT is a multiple of 16 bytes. Otherwise PDC may decide not
to jump to HPMC handler.
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/arch/parisc/kernel/hpmc.S b/arch/parisc/kernel/hpmc.S
index 8d072c44f300..f09f54f8042e 100644
--- a/arch/parisc/kernel/hpmc.S
+++ b/arch/parisc/kernel/hpmc.S
@@ -84,6 +84,7 @@ END(hpmc_pim_data)
.text
.import intr_save, code
+ .align 16
ENTRY_CFI(os_hpmc)
.os_hpmc:
@@ -305,7 +306,9 @@ ENDPROC_CFI(os_hpmc)
__INITRODATA
+.globl os_hpmc_size
.align 4
- .export os_hpmc_size
+ .type os_hpmc_size, @object
+ .size os_hpmc_size, 4
os_hpmc_size:
.word .os_hpmc_end-.os_hpmc
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index c919e6c0a687..ca6e8722fffb 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -837,8 +837,8 @@ void __init initialize_ivt(const void *iva)
ivap[0] = instr;
/* Compute Checksum for HPMC handler */
- length = os_hpmc_size;
- ivap[7] = length;
+ length = ALIGN(os_hpmc_size, 16);
+ ivap[7] = length; /* length needs to be multiple of 16. */
hpmcp = (u32 *)os_hpmc;
next prev parent reply other threads:[~2018-03-19 22:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CA+QBN9DxM5PYCnPJCRtgxQ8xGk75=jAtsE+VibUfFOv+Yah6Og@mail.gmail.com>
[not found] ` <CA+QBN9D9vUA7Q=Sd=moi+bSAkQjGQ6nGa8wnb1=7qHudAY8L8g@mail.gmail.com>
2018-03-17 11:36 ` kernel 4.15.7/64bit, C3600 is unstable during heavy I/O on PCI Helge Deller
2018-03-17 16:12 ` Grant Grundler
[not found] ` <CA+QBN9Bd69whK14_0jT0m=5F4i2FxNPyEbMv3mgUsox9pX3fKA@mail.gmail.com>
2018-03-17 17:05 ` Grant Grundler
[not found] ` <CA+QBN9A_0x6_0Ayo6YtkdC=j1ssa9mD7NTzU5+Jie0dYabp3bQ@mail.gmail.com>
2018-03-19 19:37 ` Grant Grundler
2018-03-19 19:41 ` Grant Grundler
2018-03-17 17:47 ` John David Anglin
2018-03-19 19:30 ` Grant Grundler
[not found] ` <CA+QBN9DgtjA3vdE7WA36o8P585r8vMbR+s2zPAF+529HuEzzfw@mail.gmail.com>
[not found] ` <665cf5f2-35e4-f2ca-7b32-3e5f70ba7acd@bell.net>
[not found] ` <CA+QBN9A6vgzxvDtvKNqenxFCGOksjgcxo_NHaGLRPsFyfDzL1Q@mail.gmail.com>
[not found] ` <438edd73-e420-e3d9-df03-610e7dbc2e13@bell.net>
[not found] ` <CA+QBN9CS11tBCOMKyGvjGF+w9bnd-pvUioSJD=o3AT9pJC=OmA@mail.gmail.com>
2018-03-19 20:46 ` John David Anglin
[not found] ` <81f118a7-5bc5-c6b2-eb10-a9c683c72a26@bell.net>
2018-03-19 22:23 ` Helge Deller [this message]
2018-03-19 22:58 ` [RFC][PATCH] Fix HPMC handler by increasing size to multiple of 16 bytes John David Anglin
2018-03-24 20:18 ` [RFC][PATCH v2] " Helge Deller
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=20180319222353.GA28132@ls3530.fritz.box \
--to=deller@gmx.de \
--cc=dave.anglin@bell.net \
--cc=debian-hppa@lists.debian.org \
--cc=linux-parisc@vger.kernel.org \
/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.