From: Zhu Hengbo <zhuhengbo@iscas.ac.cn>
To: Matthew Wilcox <willy@infradead.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Andrew Morton <akpm@linux-foundation.org>,
Suren Baghdasaryan <surenb@google.com>,
Alexandre Ghiti <alexghiti@rivosinc.com>,
Kefeng Wang <wangkefeng.wang@huawei.com>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] riscv: add tracepoints for page fault
Date: Thu, 18 Jul 2024 09:29:48 +0800 [thread overview]
Message-ID: <ae740896-ca8c-482f-8b80-acc3fa60d0c3@iscas.ac.cn> (raw)
In-Reply-To: <ZpfbVzwT5flLqatZ@casper.infradead.org>
On 2024/7/17 22:55, Matthew Wilcox wrote:
> On Wed, Jul 17, 2024 at 08:27:19AM +0000, Zhu Hengbo wrote:
>> + TP_STRUCT__entry(
>> + __field(unsigned long, address)
>> + __field(unsigned long, epc)
>> + __field(unsigned long, cause)
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->address = regs->badaddr;
>> + __entry->epc = regs->epc;
>> + __entry->cause = regs->cause;
>> + ),
>> +
>> + TP_printk("user page fault, address=%ps epc=%ps cause=0x%lx",
>> + (void *)__entry->address, (void *)__entry->epc,
>> + __entry->cause)
> What is "epc"? You've made this gratuitously different from x86.
> Never do that. Always copy what somebody else has done unless you have
> a good reason to be different.
“epc” stands for Exception Program Counter, which keeps track of where the CPU is within the code. It is the same as the Instruction Pointer in x86.
For example, here is the encapsulation of accessing the instruction pointer in risc-v:
/* Helpers for working with the instruction pointer */
static inline unsigned long instruction_pointer(struct pt_regs *regs)
{
return regs->epc;
}
next prev parent reply other threads:[~2024-07-18 1:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-15 10:13 [PATCH] " Zhu Hengbo
2024-07-15 13:36 ` Matthew Wilcox
2024-07-17 8:27 ` [PATCH v2] " Zhu Hengbo
2024-07-17 14:55 ` Matthew Wilcox
2024-07-18 1:29 ` Zhu Hengbo [this message]
2024-07-18 1:34 ` Zhu Hengbo
2024-07-20 10:18 ` Jisheng Zhang
2024-07-22 3:21 ` Zhu Hengbo
2024-07-22 3:26 ` Zhu Hengbo
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=ae740896-ca8c-482f-8b80-acc3fa60d0c3@iscas.ac.cn \
--to=zhuhengbo@iscas.ac.cn \
--cc=akpm@linux-foundation.org \
--cc=alexghiti@rivosinc.com \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=surenb@google.com \
--cc=wangkefeng.wang@huawei.com \
--cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®