public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Borislav Petkov <borislav.petkov@amd.com>
Cc: greg@kroah.com, mingo@elte.hu, norsk5@yahoo.com,
	tglx@linutronix.de, hpa@zytor.com, mchehab@redhat.com,
	aris@redhat.com, edt@aei.ca, linux-kernel@vger.kernel.org,
	randy.dunlap@oracle.com
Subject: Re: [PATCH 0/4] amd64_edac: misc fixes
Date: Fri, 29 May 2009 13:01:15 -0700	[thread overview]
Message-ID: <20090529130115.a44efaee.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090529103329.GB23530@aftab>

On Fri, 29 May 2009 12:33:29 +0200
Borislav Petkov <borislav.petkov@amd.com> wrote:

> Hi,
> 
> On Thu, May 28, 2009 at 04:47:20PM -0700, Andrew Morton wrote:
> > On Wed, 20 May 2009 20:43:53 +0200
> > Borislav Petkov <borislav.petkov@amd.com> wrote:
> > 
> > > here are some minor fixlets which came up lately. I'm sending them
> > > separately as an offset from the rest of the patchset since nothing has
> > > changed there. For details, see
> > > 
> > > git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git for-next
> > 
> > My linux-next x86_64 allmodconfig fails to build drivers/edac/amd64_edac.o:
> > 
> > {standard input}: Assembler messages:
> > {standard input}:3026: Error: no such instruction: `popcnt %eax,%ecx'
> 
> I guess this is a rather old(er) toolchain you got there. What do
> 
> as --version
> gcc --version
> 
> say?

gcc-4.0.2, gas-2.16.1

Here's your sent-off-list patch (please don't do that):

diff -puN drivers/edac/amd64_edac.c~edac-build-fix drivers/edac/amd64_edac.c
--- a/drivers/edac/amd64_edac.c~edac-build-fix
+++ a/drivers/edac/amd64_edac.c
@@ -1419,7 +1419,7 @@ static u32 f10_determine_channel(struct 
 		if (dct_sel_interleave_addr(pvt) == 0)
 			cs = sys_addr >> 6 & 1;
 		else if ((dct_sel_interleave_addr(pvt) >> 1) & 1) {
-			temp = popcnt((u32) ((sys_addr >> 16) & 0x1F)) % 2;
+			temp = hweight_long((u32) ((sys_addr >> 16) & 0x1F)) % 2;
 
 			if (dct_sel_interleave_addr(pvt) & 1)
 				cs = (sys_addr >> 9 & 1) ^ temp;
diff -puN drivers/edac/amd64_edac.h~edac-build-fix drivers/edac/amd64_edac.h
--- a/drivers/edac/amd64_edac.h~edac-build-fix
+++ a/drivers/edac/amd64_edac.h
@@ -443,19 +443,6 @@ enum {
 #define K8_MSR_MC4STAT			0x0411
 #define K8_MSR_MC4ADDR			0x0412
 
-/*
- * popcnt - count the set bits in a bit vector.
- * @vec - bit vector
- *
- * This instruction is supported only on F10h and later CPUs.
- */
-#define popcnt(x)						\
-({								\
-	typeof(x) __ret;					\
-	__asm__("popcnt %1, %0" : "=r" (__ret) : "r" (x));	\
-	__ret;							\
-})
-
 /* AMD sets the first MC device at device ID 0x18. */
 static inline int get_mc_node_id_from_pdev(struct pci_dev *pdev)
 {
_

That'll work.

A suitable way to solve all this would be to arrange for x86's hweight()
to use the popcnt instruction, where that makes sense.


  reply	other threads:[~2009-05-29 20:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20 18:43 [PATCH 0/4] amd64_edac: misc fixes Borislav Petkov
2009-05-20 18:43 ` [PATCH 1/4] x86: msr.h: fix build error Borislav Petkov
2009-05-20 18:43 ` [PATCH 2/4] amd64_edac: do not enable module by default Borislav Petkov
2009-05-20 18:43 ` [PATCH 3/4] EDAC: do not enable modules " Borislav Petkov
2009-05-20 18:43 ` [PATCH 4/4] amd64_edac: add MAINTAINERS entry Borislav Petkov
2009-05-20 21:41 ` [PATCH 0/4] amd64_edac: misc fixes Randy Dunlap
2009-05-28 23:47 ` Andrew Morton
2009-05-29 10:33   ` Borislav Petkov
2009-05-29 20:01     ` Andrew Morton [this message]
2009-05-30  8:19       ` Borislav Petkov
2009-05-30  8:40         ` Andrew Morton
2009-05-30 10:31           ` Borislav Petkov
2009-05-30 19:22           ` H. Peter Anvin
2009-06-01 14:53             ` Borislav Petkov
2009-06-01 16:54               ` H. Peter Anvin
2009-06-01 17:02                 ` H. Peter Anvin
2009-06-01 17:31                   ` H.J. Lu
2009-06-01 18:12                 ` Borislav Petkov
2009-06-01 18:57                   ` H. Peter Anvin
2009-06-03 18:20                     ` 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=20090529130115.a44efaee.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=aris@redhat.com \
    --cc=borislav.petkov@amd.com \
    --cc=edt@aei.ca \
    --cc=greg@kroah.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=mingo@elte.hu \
    --cc=norsk5@yahoo.com \
    --cc=randy.dunlap@oracle.com \
    --cc=tglx@linutronix.de \
    /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