From: Sam Ravnborg <sam@ravnborg.org>
To: sparclinux@vger.kernel.org
Subject: Re: [PATCH] sparc64: Handle additional cases of no fault loads
Date: Fri, 08 Sep 2017 15:03:56 +0000 [thread overview]
Message-ID: <20170908150356.GA27966@ravnborg.org> (raw)
In-Reply-To: <1504827559-109802-1-git-send-email-rob.gardner@oracle.com>
Hi Rob.
> diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
> index ad31af1..c49949c 100644
> --- a/arch/sparc/kernel/traps_64.c
> +++ b/arch/sparc/kernel/traps_64.c
> @@ -265,6 +265,34 @@ void sun4v_insn_access_exception_tl1(struct pt_regs *regs, unsigned long addr, u
> sun4v_insn_access_exception(regs, addr, type_ctx);
> }
>
> +bool is_no_fault_exception(struct pt_regs *regs)
> +{
> + unsigned char asi;
> + u32 insn;
> +
> + if (get_user(insn, (u32 __user *)regs->tpc) = -EFAULT)
> + return false;
> +
> + if ((insn & 0xc0800000) = 0xc0800000) {
> + if (insn & 0x2000)
> + asi = (regs->tstate >> 24);
> + else
> + asi = (insn >> 5);
The constants used in the above code is pure magic
for peopel without any initimate knowledge of sparc.
Could at a abre minimum add a few comments that explains
what is going on.
> + if ((asi & 0xf2) = ASI_PNF) {
> + if (insn & 0x1000000) {
> + handle_ldf_stq(insn, regs);
> + return true;
> + } else if (insn & 0x200000) {
> + /* store instruction, do not handle */
> + return false;
> + }
Likewise
> + handle_ld_nf(insn, regs);
> + return true;
> + }
> + }
> + return false;
> +}
Sam
next prev parent reply other threads:[~2017-09-08 15:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-07 23:39 [PATCH] sparc64: Handle additional cases of no fault loads Rob Gardner
2017-09-08 15:03 ` Sam Ravnborg [this message]
2017-09-08 22:32 ` Rob Gardner
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=20170908150356.GA27966@ravnborg.org \
--to=sam@ravnborg.org \
--cc=sparclinux@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.