mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@suse.de>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Tony Luck <tony.luck@intel.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	the arch/x86 maintainers <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Question Regarding ERMS memcpy
Date: Sat, 4 Mar 2017 23:43:41 +0100	[thread overview]
Message-ID: <20170304224341.zfp4fl37ypt57amg@pd.tnic> (raw)
In-Reply-To: <e3e805ee-dc81-55f3-46e6-e3c7430096c3@deltatee.com>

On Sat, Mar 04, 2017 at 01:08:15PM -0700, Logan Gunthorpe wrote:
> So my question is: how do I find out what version of memcpy my actual
> machine is using and fix it if it is wrong?

You can boot with "debug-alternative" and look for those strings where
it says "feat:"

[    0.261386] apply_alternatives: feat: 3*32+18, old: (ffffffff8101e3c4, len: 3), repl: (ffffffff81de4e7a, len: 3), pad: 3
					 ^^^^^^^

[    0.264003] ffffffff8101e3c4: old_insn: 0f 1f 00
[    0.265235] ffffffff81de4e7a: rpl_insn: 0f ae e8
[    0.266469] ffffffff8101e3c4: final_insn: 0f ae e8

if it says 9*32+9 there, then it really does patch in the ERMS variant.

If it says 3*32+16 and it patches a NOP, i.e., something like this:

[    2.022665] apply_alternatives: feat: 3*32+16, old: (ffffffff812dbfe0, len: 5), repl: (ffffffff81de5336, len: 0), pad: 3
[    2.024003] ffffffff812dbfe0: old_insn: eb 0e 90 90 90
[    2.025332] ffffffff812dbfe0: final_insn: 0f 1f 44 00 00
					     ^^^^ NOP

then, you're using the rep; movsq variant.

Also, do

make <path-to-file>.s

of the file where it does memcpy_fromio() and attach it here. I'd like to see
what the compiler generates.

HTH.

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

  reply	other threads:[~2017-03-04 22:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-04 20:08 Logan Gunthorpe
2017-03-04 22:43 ` Borislav Petkov [this message]
     [not found]   ` <c675a6c8-e87a-ece2-2350-cdd079b1b610@deltatee.com>
2017-03-04 23:55     ` hpa
2017-03-05  0:14       ` Borislav Petkov
2017-03-05  0:23         ` hpa
2017-03-05  0:33           ` Borislav Petkov
2017-03-05  0:56             ` hpa
2017-03-05  9:50               ` Borislav Petkov
2017-03-05 11:18                 ` Borislav Petkov
2017-03-05 13:05                   ` Borislav Petkov
2017-03-05 19:19                 ` Linus Torvalds
2017-03-05 19:54                   ` Borislav Petkov
2017-03-05 20:19                     ` Linus Torvalds
2017-03-06  7:01                     ` Logan Gunthorpe
2017-03-06  7:28                       ` H. Peter Anvin
2017-03-06 17:12                         ` Logan Gunthorpe
2017-03-06 18:53                           ` hpa
2017-03-06 13:33                       ` Borislav Petkov
2017-03-06 13:41                         ` hpa
2017-03-06 14:00                           ` Borislav Petkov
2017-03-05  4:58             ` Logan Gunthorpe
2017-03-05  9:54               ` Borislav Petkov

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=20170304224341.zfp4fl37ypt57amg@pd.tnic \
    --to=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=logang@deltatee.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=x86@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 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®