* [PATCH 1/4] x86/xen/entry: Rename xenpv_exc_nmi to noist_exc_nmi [not found] <20210426230949.3561-1-jiangshanlai@gmail.com> @ 2021-04-26 23:09 ` Lai Jiangshan 2021-04-28 21:27 ` Steven Rostedt ` (2 more replies) 0 siblings, 3 replies; 7+ messages in thread From: Lai Jiangshan @ 2021-04-26 23:09 UTC (permalink / raw) To: linux-kernel Cc: Lai Jiangshan, Thomas Gleixner, Paolo Bonzini, Sean Christopherson, Steven Rostedt, Andi Kleen, Andy Lutomirski, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel, kvm, Josh Poimboeuf, Uros Bizjak, Maxim Levitsky, Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, Boris Ostrovsky, Juergen Gross, Stefano Stabellini, Peter Zijlstra, Alexandre Chartre, Joerg Roedel, Jian Cai, xen-devel From: Lai Jiangshan <laijs@linux.alibaba.com> There is no any functionality change intended. Just rename it and move it to arch/x86/kernel/nmi.c so that we can resue it later in next patch for early NMI and kvm. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Sean Christopherson <seanjc@google.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Vitaly Kuznetsov <vkuznets@redhat.com> Cc: Wanpeng Li <wanpengli@tencent.com> Cc: Jim Mattson <jmattson@google.com> Cc: Joerg Roedel <joro@8bytes.org> Cc: kvm@vger.kernel.org Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Uros Bizjak <ubizjak@gmail.com> Cc: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com> --- arch/x86/include/asm/idtentry.h | 2 +- arch/x86/kernel/nmi.c | 8 ++++++++ arch/x86/xen/enlighten_pv.c | 9 +++------ arch/x86/xen/xen-asm.S | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h index e35e342673c7..5b11d2ddbb5c 100644 --- a/arch/x86/include/asm/idtentry.h +++ b/arch/x86/include/asm/idtentry.h @@ -590,7 +590,7 @@ DECLARE_IDTENTRY_RAW(X86_TRAP_MC, xenpv_exc_machine_check); /* NMI */ DECLARE_IDTENTRY_NMI(X86_TRAP_NMI, exc_nmi); #ifdef CONFIG_XEN_PV -DECLARE_IDTENTRY_RAW(X86_TRAP_NMI, xenpv_exc_nmi); +DECLARE_IDTENTRY_RAW(X86_TRAP_NMI, noist_exc_nmi); #endif /* #DB */ diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c index bf250a339655..2b907a76d0a1 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c @@ -524,6 +524,14 @@ DEFINE_IDTENTRY_RAW(exc_nmi) mds_user_clear_cpu_buffers(); } +#ifdef CONFIG_XEN_PV +DEFINE_IDTENTRY_RAW(noist_exc_nmi) +{ + /* On Xen PV, NMI doesn't use IST. The C part is the same as native. */ + exc_nmi(regs); +} +#endif + void stop_nmi(void) { ignore_nmis++; diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 4f18cd9eacd8..5efbdb0905b7 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -565,12 +565,6 @@ static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum, void noist_exc_debug(struct pt_regs *regs); -DEFINE_IDTENTRY_RAW(xenpv_exc_nmi) -{ - /* On Xen PV, NMI doesn't use IST. The C part is the same as native. */ - exc_nmi(regs); -} - DEFINE_IDTENTRY_RAW_ERRORCODE(xenpv_exc_double_fault) { /* On Xen PV, DF doesn't use IST. The C part is the same as native. */ @@ -626,6 +620,9 @@ struct trap_array_entry { .xen = xen_asm_xenpv_##func, \ .ist_okay = ist_ok } +/* Alias to make TRAP_ENTRY_REDIR() happy for nmi */ +#define xen_asm_xenpv_exc_nmi xen_asm_noist_exc_nmi + static struct trap_array_entry trap_array[] = { TRAP_ENTRY_REDIR(exc_debug, true ), TRAP_ENTRY_REDIR(exc_double_fault, true ), diff --git a/arch/x86/xen/xen-asm.S b/arch/x86/xen/xen-asm.S index 1e626444712b..12e7cbbb2a8d 100644 --- a/arch/x86/xen/xen-asm.S +++ b/arch/x86/xen/xen-asm.S @@ -130,7 +130,7 @@ _ASM_NOKPROBE(xen_\name) xen_pv_trap asm_exc_divide_error xen_pv_trap asm_xenpv_exc_debug xen_pv_trap asm_exc_int3 -xen_pv_trap asm_xenpv_exc_nmi +xen_pv_trap asm_noist_exc_nmi xen_pv_trap asm_exc_overflow xen_pv_trap asm_exc_bounds xen_pv_trap asm_exc_invalid_op -- 2.19.1.6.gb485710b ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] x86/xen/entry: Rename xenpv_exc_nmi to noist_exc_nmi 2021-04-26 23:09 ` [PATCH 1/4] x86/xen/entry: Rename xenpv_exc_nmi to noist_exc_nmi Lai Jiangshan @ 2021-04-28 21:27 ` Steven Rostedt 2021-04-30 7:15 ` Paolo Bonzini 2021-05-03 19:05 ` Thomas Gleixner 2021-05-10 7:59 ` Juergen Gross 2 siblings, 1 reply; 7+ messages in thread From: Steven Rostedt @ 2021-04-28 21:27 UTC (permalink / raw) To: Lai Jiangshan Cc: linux-kernel, Lai Jiangshan, Thomas Gleixner, Paolo Bonzini, Sean Christopherson, Andi Kleen, Andy Lutomirski, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel, kvm, Josh Poimboeuf, Uros Bizjak, Maxim Levitsky, Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, Boris Ostrovsky, Juergen Gross, Stefano Stabellini, Peter Zijlstra, Alexandre Chartre, Joerg Roedel, Jian Cai, xen-devel On Tue, 27 Apr 2021 07:09:46 +0800 Lai Jiangshan <jiangshanlai@gmail.com> wrote: > From: Lai Jiangshan <laijs@linux.alibaba.com> > > There is no any functionality change intended. Just rename it and > move it to arch/x86/kernel/nmi.c so that we can resue it later in > next patch for early NMI and kvm. Nit, but in change logs, please avoid stating "next patch" as searching git history (via git blame or whatever) there is no such thing as "next patch". Just state: "so that we can reuse it for early NMI and KVM." I also just noticed the typo in "resue". Or maybe both NMI and KVM should be sued again ;-) -- Steve ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] x86/xen/entry: Rename xenpv_exc_nmi to noist_exc_nmi 2021-04-28 21:27 ` Steven Rostedt @ 2021-04-30 7:15 ` Paolo Bonzini 2021-04-30 12:05 ` Steven Rostedt 0 siblings, 1 reply; 7+ messages in thread From: Paolo Bonzini @ 2021-04-30 7:15 UTC (permalink / raw) To: Steven Rostedt, Lai Jiangshan Cc: linux-kernel, Lai Jiangshan, Thomas Gleixner, Sean Christopherson, Andi Kleen, Andy Lutomirski, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel, kvm, Josh Poimboeuf, Uros Bizjak, Maxim Levitsky, Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, Boris Ostrovsky, Juergen Gross, Stefano Stabellini, Peter Zijlstra, Alexandre Chartre, Joerg Roedel, Jian Cai, xen-devel On 28/04/21 23:27, Steven Rostedt wrote: > On Tue, 27 Apr 2021 07:09:46 +0800 > Lai Jiangshan <jiangshanlai@gmail.com> wrote: > >> From: Lai Jiangshan <laijs@linux.alibaba.com> >> >> There is no any functionality change intended. Just rename it and >> move it to arch/x86/kernel/nmi.c so that we can resue it later in >> next patch for early NMI and kvm. > > Nit, but in change logs, please avoid stating "next patch" as searching git > history (via git blame or whatever) there is no such thing as "next patch". Interesting, I use next patch(es) relatively often, though you're right that something like "in preparation for" works just as well. Yes, it's the previous in "git log", but you get what it's meant in practice. :) Paolo > Just state: "so that we can reuse it for early NMI and KVM." > > I also just noticed the typo in "resue". Or maybe both NMI and KVM should > be sued again ;-) > > -- Steve > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] x86/xen/entry: Rename xenpv_exc_nmi to noist_exc_nmi 2021-04-30 7:15 ` Paolo Bonzini @ 2021-04-30 12:05 ` Steven Rostedt 0 siblings, 0 replies; 7+ messages in thread From: Steven Rostedt @ 2021-04-30 12:05 UTC (permalink / raw) To: Paolo Bonzini Cc: Lai Jiangshan, linux-kernel, Lai Jiangshan, Thomas Gleixner, Sean Christopherson, Andi Kleen, Andy Lutomirski, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel, kvm, Josh Poimboeuf, Uros Bizjak, Maxim Levitsky, Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, Boris Ostrovsky, Juergen Gross, Stefano Stabellini, Peter Zijlstra, Alexandre Chartre, Joerg Roedel, Jian Cai, xen-devel On Fri, 30 Apr 2021 09:15:51 +0200 Paolo Bonzini <pbonzini@redhat.com> wrote: > > Nit, but in change logs, please avoid stating "next patch" as searching git > > history (via git blame or whatever) there is no such thing as "next patch". > > Interesting, I use next patch(es) relatively often, though you're right > that something like "in preparation for" works just as well. Yes, it's > the previous in "git log", but you get what it's meant in practice. :) It's not always the previous in a git log. Git log sorts by time, and if an unrelated commit was created in between those two patches, it will be in between them. -- Steve ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] x86/xen/entry: Rename xenpv_exc_nmi to noist_exc_nmi 2021-04-26 23:09 ` [PATCH 1/4] x86/xen/entry: Rename xenpv_exc_nmi to noist_exc_nmi Lai Jiangshan 2021-04-28 21:27 ` Steven Rostedt @ 2021-05-03 19:05 ` Thomas Gleixner 2021-05-03 19:41 ` Thomas Gleixner 2021-05-10 7:59 ` Juergen Gross 2 siblings, 1 reply; 7+ messages in thread From: Thomas Gleixner @ 2021-05-03 19:05 UTC (permalink / raw) To: Lai Jiangshan, linux-kernel Cc: Lai Jiangshan, Paolo Bonzini, Sean Christopherson, Steven Rostedt, Andi Kleen, Andy Lutomirski, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel, kvm, Josh Poimboeuf, Uros Bizjak, Maxim Levitsky, Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, Boris Ostrovsky, Juergen Gross, Stefano Stabellini, Peter Zijlstra, Alexandre Chartre, Joerg Roedel, Jian Cai, xen-devel On Tue, Apr 27 2021 at 07:09, Lai Jiangshan wrote: > From: Lai Jiangshan <laijs@linux.alibaba.com> > > There is no any functionality change intended. Just rename it and > move it to arch/x86/kernel/nmi.c so that we can resue it later in > next patch for early NMI and kvm. 'Reuse it later' is not really a proper explanation why this change it necessary. Also this can be simplified by using aliasing which keeps the name spaces intact. Thanks, tglx --- --- a/arch/x86/include/asm/idtentry.h +++ b/arch/x86/include/asm/idtentry.h @@ -135,6 +135,9 @@ static __always_inline void __##func(str #define DEFINE_IDTENTRY_RAW(func) \ __visible noinstr void func(struct pt_regs *regs) +#define DEFINE_IDTENTRY_RAW_ALIAS(alias, func) \ +__visible noinstr void func(struct pt_regs *regs) __alias(alias) + /** * DECLARE_IDTENTRY_RAW_ERRORCODE - Declare functions for raw IDT entry points * Error code pushed by hardware --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c @@ -524,6 +524,8 @@ DEFINE_IDTENTRY_RAW(exc_nmi) mds_user_clear_cpu_buffers(); } +DEFINE_IDTENTRY_RAW_ALIAS(exc_nmi, xenpv_exc_nmi); + void stop_nmi(void) { ignore_nmis++; --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -565,12 +565,6 @@ static void xen_write_ldt_entry(struct d void noist_exc_debug(struct pt_regs *regs); -DEFINE_IDTENTRY_RAW(xenpv_exc_nmi) -{ - /* On Xen PV, NMI doesn't use IST. The C part is the same as native. */ - exc_nmi(regs); -} - DEFINE_IDTENTRY_RAW_ERRORCODE(xenpv_exc_double_fault) { /* On Xen PV, DF doesn't use IST. The C part is the same as native. */ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] x86/xen/entry: Rename xenpv_exc_nmi to noist_exc_nmi 2021-05-03 19:05 ` Thomas Gleixner @ 2021-05-03 19:41 ` Thomas Gleixner 0 siblings, 0 replies; 7+ messages in thread From: Thomas Gleixner @ 2021-05-03 19:41 UTC (permalink / raw) To: Lai Jiangshan, linux-kernel Cc: Lai Jiangshan, Paolo Bonzini, Sean Christopherson, Steven Rostedt, Andi Kleen, Andy Lutomirski, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel, kvm, Josh Poimboeuf, Uros Bizjak, Maxim Levitsky, Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, Boris Ostrovsky, Juergen Gross, Stefano Stabellini, Peter Zijlstra, Alexandre Chartre, Joerg Roedel, Jian Cai, xen-devel On Mon, May 03 2021 at 21:05, Thomas Gleixner wrote: > On Tue, Apr 27 2021 at 07:09, Lai Jiangshan wrote: >> From: Lai Jiangshan <laijs@linux.alibaba.com> >> >> There is no any functionality change intended. Just rename it and >> move it to arch/x86/kernel/nmi.c so that we can resue it later in >> next patch for early NMI and kvm. > > 'Reuse it later' is not really a proper explanation why this change it > necessary. > > Also this can be simplified by using aliasing which keeps the name > spaces intact. Aside of that this is not required to be part of a fixes series which needs to be backported. Thanks, tglx ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] x86/xen/entry: Rename xenpv_exc_nmi to noist_exc_nmi 2021-04-26 23:09 ` [PATCH 1/4] x86/xen/entry: Rename xenpv_exc_nmi to noist_exc_nmi Lai Jiangshan 2021-04-28 21:27 ` Steven Rostedt 2021-05-03 19:05 ` Thomas Gleixner @ 2021-05-10 7:59 ` Juergen Gross 2 siblings, 0 replies; 7+ messages in thread From: Juergen Gross @ 2021-05-10 7:59 UTC (permalink / raw) To: Lai Jiangshan, linux-kernel Cc: Lai Jiangshan, Thomas Gleixner, Paolo Bonzini, Sean Christopherson, Steven Rostedt, Andi Kleen, Andy Lutomirski, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel, kvm, Josh Poimboeuf, Uros Bizjak, Maxim Levitsky, Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, Boris Ostrovsky, Stefano Stabellini, Peter Zijlstra, Alexandre Chartre, Joerg Roedel, Jian Cai, xen-devel [-- Attachment #1.1.1: Type: text/plain, Size: 969 bytes --] On 27.04.21 01:09, Lai Jiangshan wrote: > From: Lai Jiangshan <laijs@linux.alibaba.com> > > There is no any functionality change intended. Just rename it and > move it to arch/x86/kernel/nmi.c so that we can resue it later in > next patch for early NMI and kvm. > > Cc: Thomas Gleixner <tglx@linutronix.de> > Cc: Paolo Bonzini <pbonzini@redhat.com> > Cc: Sean Christopherson <seanjc@google.com> > Cc: Steven Rostedt <rostedt@goodmis.org> > Cc: Andi Kleen <ak@linux.intel.com> > Cc: Andy Lutomirski <luto@kernel.org> > Cc: Vitaly Kuznetsov <vkuznets@redhat.com> > Cc: Wanpeng Li <wanpengli@tencent.com> > Cc: Jim Mattson <jmattson@google.com> > Cc: Joerg Roedel <joro@8bytes.org> > Cc: kvm@vger.kernel.org > Cc: Josh Poimboeuf <jpoimboe@redhat.com> > Cc: Uros Bizjak <ubizjak@gmail.com> > Cc: Maxim Levitsky <mlevitsk@redhat.com> > Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com> Acked-by: Juergen Gross <jgross@suse.com> Juergen [-- Attachment #1.1.2: OpenPGP_0xB0DE9DD628BF132F.asc --] [-- Type: application/pgp-keys, Size: 3135 bytes --] [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 495 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-05-10 7:59 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20210426230949.3561-1-jiangshanlai@gmail.com> 2021-04-26 23:09 ` [PATCH 1/4] x86/xen/entry: Rename xenpv_exc_nmi to noist_exc_nmi Lai Jiangshan 2021-04-28 21:27 ` Steven Rostedt 2021-04-30 7:15 ` Paolo Bonzini 2021-04-30 12:05 ` Steven Rostedt 2021-05-03 19:05 ` Thomas Gleixner 2021-05-03 19:41 ` Thomas Gleixner 2021-05-10 7:59 ` Juergen Gross
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).