2004-11-19 10:04:32

by Manfred Schwarb

[permalink] [raw]
Subject: [PATCH 2.4.28] backport sigmatch() issue in microcode.c

Hi,

some weeks ago, Tigran Aivazian sent this patch to Marcelo
in a private email, I am unaware of the reasons why it is not included.

Just for public documentation, here is the 2.6.7 backport of the patch, which
allows the use of microcode updates also for old Pentium II machines.

Original explanation from Tigran:
[PATCH] fix to microcode driver for the old CPUs.

Here is a patch against Linux 2.6.7 which fixes the sigmatch() macro to
work for the relatively old processors as well, which have 'pf == 0'
(processor flags as read from MSR 0x17), For example, the processors
failing without this patch are Pentium II 300 MHz (Klamath) with
family/model/stepping 6/3/4 and 6/3/3.

It works for me.
Regards,
Manfred


--- linux-2.4.28/arch/i386/kernel/microcode.c.orig 2004-09-11 15:30:13.000000000 +0200
+++ linux-2.4.28/arch/i386/kernel/microcode.c 2004-09-11 16:36:43.000000000 +0200
@@ -109,7 +109,10 @@
#define get_datasize(mc) \
(((microcode_t *)mc)->hdr.datasize ? \
((microcode_t *)mc)->hdr.datasize : DEFAULT_UCODE_DATASIZE)
-#define sigmatch(s1, s2, p1, p2) (((s1) == (s2)) && ((p1) & (p2)))
+
+#define sigmatch(s1, s2, p1, p2) \
+ (((s1) == (s2)) && (((p1) & (p2)) || (((p1) == 0) && ((p2) == 0))))
+
#define exttable_size(et) ((et)->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE)

/* serialize access to the physical write to MSR 0x79 */


2004-11-25 01:40:20

by Marcelo Tosatti

[permalink] [raw]
Subject: Re: [PATCH 2.4.28] backport sigmatch() issue in microcode.c

On Fri, Nov 19, 2004 at 05:04:04AM -0500, Manfred Schwarb wrote:
> Hi,
>
> some weeks ago, Tigran Aivazian sent this patch to Marcelo
> in a private email, I am unaware of the reasons why it is not included.

Badness on my part, applied now.

Next time add me to CC when you resend.