linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zachary Amsden <zach@vmware.com>
To: Gerd Knorr <kraxel@suse.de>
Cc: linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Xen merge mainline list <xen-merge@lists.xensource.com>
Subject: Re: [Xen-merge] [patch] SMP alternatives for i386
Date: Tue, 13 Dec 2005 07:36:07 -0800	[thread overview]
Message-ID: <439EEA67.6010706@vmware.com> (raw)
In-Reply-To: <439EE742.5040909@suse.de>

Gerd Knorr wrote:

>+#ifdef CONFIG_SMP
>+#define alternative_smp(smpinstr, upinstr, args...) 	\
>+	asm volatile ("661:\n\t" smpinstr "\n662:\n" 		     \
>+		      ".section .smp_altinstructions,\"a\"\n"          \
>+		      "  .align 4\n"				       \
>+		      "  .long 661b\n"            /* label */          \
>+		      "  .long 663f\n"		  /* new instruction */ 	\
>+		      "  .byte 0x68\n"            /* X86_FEATURE_UP */    \
>+		      "  .byte 662b-661b\n"       /* sourcelen */      \
>+		      "  .byte 664f-663f\n"       /* replacementlen */ \
>+		      ".previous\n"						\
>+		      ".section .smp_altinstr_replacement,\"awx\"\n"   		\
>+		      "663:\n\t" upinstr "\n"     /* replacement */    \
>+		      "664:\n\t.fill 662b-661b,1,0x42\n" /* space for original */ \
>+		      ".previous" : args)
>+
>+#define LOCK_PREFIX \
>+		".section .smp_locks,\"a\"\n"	\
>+		"  .align 4\n"			\
>+		"  .long 661f\n" /* address */	\
>+		".previous\n"			\
>+	       	"661:\n\tlock; "
>+
>+#else /* ! CONFIG_SMP */
>+#define alternative_smp(smpinstr, upinstr, args...) \
>+	asm volatile (upinstr : args)
>+#define LOCK_PREFIX ""
>+#endif
>+
>+#endif /* _I386_ALTERNATIVE_H */
>  
>


Overall technically, I like this patch.  Philosophically, I agree with 
it as well - but might I strongly suggest that you avoid the .section 
.previous directives and use the nestable .pushsection, .popsection 
instead?  We are almost to the complexity point with fault handling and 
alternatives that we will need nested section overrides.

Zach

  reply	other threads:[~2005-12-13 15:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-13 15:22 [patch] SMP alternatives for i386 Gerd Knorr
2005-12-13 15:36 ` Zachary Amsden [this message]
2005-12-13 16:32   ` [Xen-merge] " Gerd Knorr
2005-12-13 15:58 ` Alan Cox
2005-12-14 19:35 ` Zwane Mwaikambo
2005-12-14 20:15   ` [Xen-merge] " Keir Fraser
2005-12-15  1:20     ` Zwane Mwaikambo
2005-12-15 13:44       ` Gerd Knorr

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=439EEA67.6010706@vmware.com \
    --to=zach@vmware.com \
    --cc=kraxel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-merge@lists.xensource.com \
    /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;
as well as URLs for NNTP newsgroup(s).