All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@sous-sol.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Chris Wright <chrisw@sous-sol.org>,
	virtualization@lists.osdl.org, Andi Kleen <ak@muc.de>
Subject: Re: [PATCH 1/5] Skip timer works.patch
Date: Thu, 16 Nov 2006 02:28:46 -0800	[thread overview]
Message-ID: <20061116102846.GC1397@sequoia.sous-sol.org> (raw)
In-Reply-To: <20061115210630.94bf8824.akpm@osdl.org>

* Andrew Morton (akpm@osdl.org) wrote:
> wtf?  How come patches leave here in working order and keep arriving broken?

I think the trees are in sync, and it's actually a bug that's .config
dependent.  Basically, the STI_STRING and CLI_STRING are not useable
the way they get used:

#define CLI_STRING paravirt_alt("pushl %ecx; pushl %edx;"		\
		     "call *paravirt_ops+PARAVIRT_irq_disable;"		\
		     "popl %edx; popl %ecx",				\
		     PARAVIRT_IRQ_DISABLE, CLBR_EAX)

#define STI_STRING paravirt_alt("pushl %ecx; pushl %edx;"		\
		     "call *paravirt_ops+PARAVIRT_irq_enable;"		\
		     "popl %edx; popl %ecx",				\
		     PARAVIRT_IRQ_ENABLE, CLBR_EAX)

#ifndef CONFIG_PROVE_LOCKING <-- that's part of the problem (must be
                                 on in most configs)
static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags)
{
	asm volatile(
		"\n1:\t"
		LOCK_PREFIX " ; decb %0\n\t"  <-- here the operand is 
                                                  numerically referred to
		"jns 5f\n"
		"2:\t"
		"testl $0x200, %1\n\t"
		"jz 4f\n\t"
		STI_STRING "\n"  <-- here we have code that does 
                                     "pushl %ecx; pushl %edx;", not %%ecx
		"3:\t"
		"rep;nop\n\t"
		"cmpb $0, %0\n\t"
		"jle 3b\n\t"
		CLI_STRING "\n\t"
		"jmp 1b\n"
		"4:\t"
		"rep;nop\n\t"
		"cmpb $0, %0\n\t"
		"jg 1b\n\t"
		"jmp 4b\n"
		"5:\n\t"
		: "+m" (lock->slock)
		: "r" (flags)
		: "memory" CLI_STI_CLOBBERS);
}
#endif

So, Andi's patch, is needed and correct AFAICT.  Fixes all ff, mm, pv trees...

thanks,
-chris


i386: Get paravirt ops to compile

TBD should be folded into the original patches

Signed-off-by: Andi Kleen <ak@suse.de>

===================================================================
--- linux.orig/include/asm-i386/paravirt.h
+++ linux/include/asm-i386/paravirt.h
@@ -454,16 +454,20 @@ static inline unsigned long __raw_local_
 	return f;
 }
 
-#define CLI_STRING paravirt_alt("pushl %ecx; pushl %edx;"		\
-		     "call *paravirt_ops+PARAVIRT_irq_disable;"		\
-		     "popl %edx; popl %ecx",				\
+#define CLI_STRING paravirt_alt("pushl %%ecx; pushl %%edx;"		\
+		     "call *paravirt_ops+%c[irq_disable];"		\
+		     "popl %%edx; popl %%ecx",				\
 		     PARAVIRT_IRQ_DISABLE, CLBR_EAX)
 
-#define STI_STRING paravirt_alt("pushl %ecx; pushl %edx;"		\
-		     "call *paravirt_ops+PARAVIRT_irq_enable;"		\
-		     "popl %edx; popl %ecx",				\
+#define STI_STRING paravirt_alt("pushl %%ecx; pushl %%edx;"		\
+		     "call *paravirt_ops+%c[irq_enable];"		\
+		     "popl %%edx; popl %%ecx",				\
 		     PARAVIRT_IRQ_ENABLE, CLBR_EAX)
 #define CLI_STI_CLOBBERS , "%eax"
+#define CLI_STI_INPUT_ARGS \
+	,								\
+	[irq_disable] "i" (offsetof(struct paravirt_ops, irq_disable)),	\
+	[irq_enable] "i" (offsetof(struct paravirt_ops, irq_enable))
 
 #else  /* __ASSEMBLY__ */
 
Index: linux/include/asm-i386/spinlock.h
===================================================================
--- linux.orig/include/asm-i386/spinlock.h
+++ linux/include/asm-i386/spinlock.h
@@ -13,6 +13,7 @@
 #define CLI_STRING	"cli"
 #define STI_STRING	"sti"
 #define CLI_STI_CLOBBERS
+#define CLI_STI_INPUT_ARGS
 #endif /* CONFIG_PARAVIRT */
 
 /*
@@ -58,26 +59,27 @@ static inline void __raw_spin_lock_flags
 {
 	asm volatile(
 		"\n1:\t"
-		LOCK_PREFIX " ; decb %0\n\t"
+		LOCK_PREFIX " ; decb %[slock]\n\t"
 		"jns 5f\n"
 		"2:\t"
-		"testl $0x200, %1\n\t"
+		"testl $0x200, %[flags]\n\t"
 		"jz 4f\n\t"
 		STI_STRING "\n"
 		"3:\t"
 		"rep;nop\n\t"
-		"cmpb $0, %0\n\t"
+		"cmpb $0, %[slock]\n\t"
 		"jle 3b\n\t"
 		CLI_STRING "\n\t"
 		"jmp 1b\n"
 		"4:\t"
 		"rep;nop\n\t"
-		"cmpb $0, %0\n\t"
+		"cmpb $0, %[slock]\n\t"
 		"jg 1b\n\t"
 		"jmp 4b\n"
 		"5:\n\t"
-		: "+m" (lock->slock)
-		: "r" (flags)
+		: [slock] "+m" (lock->slock)
+		: [flags] "r" (flags)
+	 	  CLI_STI_INPUT_ARGS
 		: "memory" CLI_STI_CLOBBERS);
 }
 #endif

  parent reply	other threads:[~2006-11-16 10:28 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-20  0:09 [PATCH 1/5] Skip timer works.patch Zachary Amsden
2006-10-27 14:56 ` Andi Kleen
2006-10-27 14:56   ` Andi Kleen
2006-10-27 19:09   ` Zachary Amsden
2006-10-27 21:16     ` Andi Kleen
2006-10-30 20:54       ` Zachary Amsden
2006-10-30 20:54         ` Zachary Amsden
2006-10-30 22:50         ` Andi Kleen
2006-10-30 23:09           ` Zachary Amsden
2006-10-30 23:12             ` Andi Kleen
2006-10-30 23:24               ` Zachary Amsden
2006-10-30 23:50                 ` Andi Kleen
2006-11-15  8:03           ` Chris Wright
2006-11-15  8:21             ` Zachary Amsden
2006-11-15 22:40               ` Chris Wright
2006-11-15 22:54                 ` Chris Wright
2006-11-16  3:27                 ` Andi Kleen
2006-11-16  3:37                   ` Chris Wright
2006-11-16  3:37                     ` Andi Kleen
2006-11-16  5:06                   ` Andrew Morton
2006-11-16  6:13                     ` Zachary Amsden
2006-11-16  7:23                       ` Andi Kleen
2006-11-16  7:02                     ` Andi Kleen
2006-11-16  7:16                       ` Chris Wright
2006-11-16  8:26                         ` Chris Wright
2006-11-16 10:28                     ` Chris Wright [this message]
2006-11-16 13:16                       ` Andi Kleen
2006-11-16 19:03                         ` Chris Wright
2006-11-16 19:46                           ` Andi Kleen
2006-11-16 20:24                             ` Chris Wright
2006-11-17  4:47                               ` Andi Kleen
2006-11-17  7:33                                 ` Chris Wright
2006-11-17  7:38                                   ` Andi Kleen
2006-11-16 22:53 ` Andrew Morton
2006-11-16 22:53   ` Andrew Morton
2006-11-16 23:08   ` Zachary Amsden
2006-11-16 23:08     ` Zachary Amsden
2006-11-16 23:10   ` Chris Wright
2006-11-16 23:10     ` Chris Wright
2006-11-17  5:05   ` Andi Kleen
2006-11-17  5:05     ` Andi Kleen

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=20061116102846.GC1397@sequoia.sous-sol.org \
    --to=chrisw@sous-sol.org \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=virtualization@lists.osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.