From: Masami Hiramatsu <mhiramat@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Randy Dunlap <rdunlap@infradead.org>,
Borislav Petkov <bp@alien8.de>, Juergen Gross <jgross@suse.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Stefano Stabellini <sstabellini@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH -tip v3 1/2] x86: xen: insn: Decode Xen and KVM emulate-prefix signature
Date: Fri, 6 Sep 2019 19:28:22 +0900 [thread overview]
Message-ID: <20190906192822.21afa68b557463fdc7b1cc81@kernel.org> (raw)
In-Reply-To: <20190906073436.GS2349@hirez.programming.kicks-ass.net>
On Fri, 6 Sep 2019 09:34:36 +0200
Peter Zijlstra <peterz@infradead.org> wrote:
> On Fri, Sep 06, 2019 at 10:45:48AM +0900, Masami Hiramatsu wrote:
>
> > diff --git a/arch/x86/include/asm/xen/interface.h b/arch/x86/include/asm/xen/interface.h
> > index 62ca03ef5c65..fe33a9798708 100644
> > --- a/arch/x86/include/asm/xen/interface.h
> > +++ b/arch/x86/include/asm/xen/interface.h
> > @@ -379,12 +379,15 @@ struct xen_pmu_arch {
> > * Prefix forces emulation of some non-trapping instructions.
> > * Currently only CPUID.
> > */
> > +#include <asm/xen/prefix.h>
> > +
> > #ifdef __ASSEMBLY__
> > -#define XEN_EMULATE_PREFIX .byte 0x0f,0x0b,0x78,0x65,0x6e ;
> > +#define XEN_EMULATE_PREFIX .byte __XEN_EMULATE_PREFIX ;
> > #define XEN_CPUID XEN_EMULATE_PREFIX cpuid
> > #else
> > -#define XEN_EMULATE_PREFIX ".byte 0x0f,0x0b,0x78,0x65,0x6e ; "
> > +#define XEN_EMULATE_PREFIX ".byte " __XEN_EMULATE_PREFIX_STR " ; "
> > #define XEN_CPUID XEN_EMULATE_PREFIX "cpuid"
> > +
> > #endif
>
> Possibly you can do something like:
>
> #define XEN_EMULATE_PREFIX __ASM_FORM(.byte __XEN_EMULATE_PREFIX ;)
> #define XEN_CPUID XEN_EMULATE_PREFIX __ASM_FORM(cpuid)
Oops, this doesn't work, since __ASM_FORM(x) uses #x directly
# define __ASM_FORM(x) " " #x " "
which doesn't expand "x" if x is a macro. We have to use __stringify
like
# include <linux/stringify.h>
# define __ASM_FORM(x) " " __stringify(x) " "
So this needs aonther patch in the series :)
Thank you,
--
Masami Hiramatsu <mhiramat@kernel.org>
next prev parent reply other threads:[~2019-09-06 10:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-06 1:45 [PATCH -tip v3 0/2] x86: kprobes: Prohibit kprobes on Xen/KVM emulate prefixes Masami Hiramatsu
2019-09-06 1:45 ` [PATCH -tip v3 1/2] x86: xen: insn: Decode Xen and KVM emulate-prefix signature Masami Hiramatsu
2019-09-06 7:34 ` Peter Zijlstra
2019-09-06 8:45 ` Masami Hiramatsu
2019-09-06 8:51 ` Masami Hiramatsu
2019-09-06 9:15 ` Peter Zijlstra
2019-09-06 10:28 ` Masami Hiramatsu [this message]
2019-09-06 1:45 ` [PATCH -tip v3 2/2] x86: kprobes: Prohibit probing on instruction which has emulate prefix Masami Hiramatsu
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=20190906192822.21afa68b557463fdc7b1cc81@kernel.org \
--to=mhiramat@kernel.org \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=jgross@suse.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.org \
--cc=sstabellini@kernel.org \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.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