public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] x86, microcode: Do Intel microcode revision check signed v2
@ 2014-01-24 21:18 Andi Kleen
  2014-01-24 21:18 ` [PATCH 2/2] x86, microcode: Add option to allow downgrading of microcode Andi Kleen
  0 siblings, 1 reply; 9+ messages in thread
From: Andi Kleen @ 2014-01-24 21:18 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

The Intel SDM Vol 3 9.11.1 Microcode update states that
the update revision field is signed. However we do the comparison
unsigned, as the comparison gets promoted. Change the field
to be signed, so that comparision is really signed.

v2: Change field.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/microcode_intel.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/microcode_intel.h b/arch/x86/include/asm/microcode_intel.h
index 9067166..ed1884b 100644
--- a/arch/x86/include/asm/microcode_intel.h
+++ b/arch/x86/include/asm/microcode_intel.h
@@ -5,7 +5,7 @@
 
 struct microcode_header_intel {
 	unsigned int            hdrver;
-	unsigned int            rev;
+	int	                rev;
 	unsigned int            date;
 	unsigned int            sig;
 	unsigned int            cksum;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH 1/2] x86, microcode: Do Intel microcode revision check signed v2
@ 2013-12-12 23:57 Andi Kleen
  2013-12-12 23:57 ` [PATCH 2/2] x86, microcode: Add option to allow downgrading of microcode Andi Kleen
  0 siblings, 1 reply; 9+ messages in thread
From: Andi Kleen @ 2013-12-12 23:57 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

The Intel SDM Vol 3 9.11.1 Microcode update states that
the update revision field is signed. However we do the comparison
unsigned, as the comparison gets promoted. Change the field
to be signed, so that comparision is really signed.

v2: Change field.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/microcode_intel.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/microcode_intel.h b/arch/x86/include/asm/microcode_intel.h
index 9067166..ed1884b 100644
--- a/arch/x86/include/asm/microcode_intel.h
+++ b/arch/x86/include/asm/microcode_intel.h
@@ -5,7 +5,7 @@
 
 struct microcode_header_intel {
 	unsigned int            hdrver;
-	unsigned int            rev;
+	int	                rev;
 	unsigned int            date;
 	unsigned int            sig;
 	unsigned int            cksum;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH 1/2] x86, microcode: Do Intel microcode revision check signed
@ 2013-12-06 21:04 Andi Kleen
  2013-12-06 21:04 ` [PATCH 2/2] x86, microcode: Add option to allow downgrading of microcode Andi Kleen
  0 siblings, 1 reply; 9+ messages in thread
From: Andi Kleen @ 2013-12-06 21:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86, Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

The Intel SDM Vol 3 9.11.1 Microcode update states that
the update revision field is signed. However we do the comparison
unsigned, as the comparison gets promoted.

Use a cast to really do a signed comparison of the microcode
revision.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/kernel/microcode_intel_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/microcode_intel_lib.c b/arch/x86/kernel/microcode_intel_lib.c
index ce69320..68503d1 100644
--- a/arch/x86/kernel/microcode_intel_lib.c
+++ b/arch/x86/kernel/microcode_intel_lib.c
@@ -41,7 +41,7 @@ update_match_cpu(unsigned int csig, unsigned int cpf,
 int
 update_match_revision(struct microcode_header_intel *mc_header, int rev)
 {
-	return (mc_header->rev <= rev) ? 0 : 1;
+	return ((int)mc_header->rev <= rev) ? 0 : 1;
 }
 
 int microcode_sanity_check(void *mc, int print_err)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-01-28 10:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-24 21:18 [PATCH 1/2] x86, microcode: Do Intel microcode revision check signed v2 Andi Kleen
2014-01-24 21:18 ` [PATCH 2/2] x86, microcode: Add option to allow downgrading of microcode Andi Kleen
2014-01-25 16:35   ` Henrique de Moraes Holschuh
2014-01-25 18:14     ` Andi Kleen
2014-01-28 10:26       ` Henrique de Moraes Holschuh
  -- strict thread matches above, loose matches on Subject: below --
2013-12-12 23:57 [PATCH 1/2] x86, microcode: Do Intel microcode revision check signed v2 Andi Kleen
2013-12-12 23:57 ` [PATCH 2/2] x86, microcode: Add option to allow downgrading of microcode Andi Kleen
2013-12-06 21:04 [PATCH 1/2] x86, microcode: Do Intel microcode revision check signed Andi Kleen
2013-12-06 21:04 ` [PATCH 2/2] x86, microcode: Add option to allow downgrading of microcode Andi Kleen
2013-12-13 21:00   ` Henrique de Moraes Holschuh
2013-12-15  0:40     ` Henrique de Moraes Holschuh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox