* [RESEND] [PATCH] x86, microcode rework, v2, renaming
[not found] <b647ffbd0809230212s41d2ef90u2915e40128b254e3@mail.gmail.com>
@ 2008-09-17 13:05 ` Peter Oruba
2008-09-17 13:39 ` [RESEND] [PATCH] x86, microcode rework, v2, renaming cont Peter Oruba
1 sibling, 0 replies; 3+ messages in thread
From: Peter Oruba @ 2008-09-17 13:05 UTC (permalink / raw)
To: Ingo Molnar, Dmitry Adamushko; +Cc: LKML
Renaming based on patch from Dmitry Adamushko.
Made code more readable by renaming define and variables related
to microcode _container_file_ header to make it distinguishable from
microcode _patch_ header.
Signed-off-by: Peter Oruba <peter.oruba@amd.com>
---
arch/x86/kernel/microcode_amd.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 48aec9f..8d97840 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -274,12 +274,12 @@ static void * get_next_ucode(u8 *buf, unsigned int size,
static int install_equiv_cpu_table(u8 *buf,
int (*get_ucode_data)(void *, const void *, size_t))
{
-#define UCODE_HEADER_SIZE 12
- u8 *hdr[UCODE_HEADER_SIZE];
- unsigned int *buf_pos = (unsigned int *)hdr;
+#define UCODE_CONTAINER_HEADER_SIZE 12
+ u8 *container_hdr[UCODE_CONTAINER_HEADER_SIZE];
+ unsigned int *buf_pos = (unsigned int *)container_hdr;
unsigned long size;
- if (get_ucode_data(&hdr, buf, UCODE_HEADER_SIZE))
+ if (get_ucode_data(&container_hdr, buf, UCODE_CONTAINER_HEADER_SIZE))
return 0;
size = buf_pos[2];
@@ -296,14 +296,14 @@ static int install_equiv_cpu_table(u8 *buf,
return 0;
}
- buf += UCODE_HEADER_SIZE;
+ buf += UCODE_CONTAINER_HEADER_SIZE;
if (get_ucode_data(equiv_cpu_table, buf, size)) {
vfree(equiv_cpu_table);
return 0;
}
- return size + UCODE_HEADER_SIZE; /* add header length */
-#undef UCODE_HEADER_SIZE
+ return size + UCODE_CONTAINER_HEADER_SIZE; /* add header length */
+#undef UCODE_CONTAINER_HEADER_SIZE
}
static void free_equiv_cpu_table(void)
--
1.5.4.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [RESEND] [PATCH] x86, microcode rework, v2, renaming cont.
[not found] <b647ffbd0809230212s41d2ef90u2915e40128b254e3@mail.gmail.com>
2008-09-17 13:05 ` [RESEND] [PATCH] x86, microcode rework, v2, renaming Peter Oruba
@ 2008-09-17 13:39 ` Peter Oruba
2008-09-23 14:12 ` Ingo Molnar
1 sibling, 1 reply; 3+ messages in thread
From: Peter Oruba @ 2008-09-17 13:39 UTC (permalink / raw)
To: Ingo Molnar, Dmitry Adamushko; +Cc: LKML
Renaming based on patch from Dmitry Adamushko.
Further clarification by renaming define and variable related to
microcode container file.
Signed-off-by: Peter Oruba <peter.oruba@amd.com>
---
arch/x86/kernel/microcode_amd.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 8d97840..113be63 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -233,21 +233,20 @@ static void * get_next_ucode(u8 *buf, unsigned int size,
unsigned int *mc_size)
{
unsigned int total_size;
-#define UCODE_UNKNOWN_HDR 8
- u8 hdr[UCODE_UNKNOWN_HDR];
+#define UCODE_CONTAINER_SECTION_HDR 8
+ u8 section_hdr[UCODE_CONTAINER_SECTION_HDR];
void *mc;
- if (get_ucode_data(hdr, buf, UCODE_UNKNOWN_HDR))
+ if (get_ucode_data(section_hdr, buf, UCODE_CONTAINER_SECTION_HDR))
return NULL;
- if (hdr[0] != UCODE_UCODE_TYPE) {
+ if (section_hdr[0] != UCODE_UCODE_TYPE) {
printk(KERN_ERR "microcode: error! "
"Wrong microcode payload type field\n");
return NULL;
}
- /* FIXME! dimm: Why not by means of get_totalsize(hdr)? */
- total_size = (unsigned long) (hdr[4] + (hdr[5] << 8));
+ total_size = (unsigned long) (section_hdr[4] + (section_hdr[5] << 8));
printk(KERN_INFO "microcode: size %u, total_size %u\n",
size, total_size);
@@ -260,13 +259,13 @@ static void * get_next_ucode(u8 *buf, unsigned int size,
mc = vmalloc(UCODE_MAX_SIZE);
if (mc) {
memset(mc, 0, UCODE_MAX_SIZE);
- if (get_ucode_data(mc, buf + UCODE_UNKNOWN_HDR, total_size)) {
+ if (get_ucode_data(mc, buf + UCODE_CONTAINER_SECTION_HDR, total_size)) {
vfree(mc);
mc = NULL;
} else
- *mc_size = total_size + UCODE_UNKNOWN_HDR;
+ *mc_size = total_size + UCODE_CONTAINER_SECTION_HDR;
}
-#undef UCODE_UNKNOWN_HDR
+#undef UCODE_CONTAINER_SECTION_HDR
return mc;
}
--
1.5.4.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RESEND] [PATCH] x86, microcode rework, v2, renaming cont.
2008-09-17 13:39 ` [RESEND] [PATCH] x86, microcode rework, v2, renaming cont Peter Oruba
@ 2008-09-23 14:12 ` Ingo Molnar
0 siblings, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2008-09-23 14:12 UTC (permalink / raw)
To: Peter Oruba, Arjan van de Ven; +Cc: Dmitry Adamushko, LKML
* Peter Oruba <peter.oruba@amd.com> wrote:
> Renaming based on patch from Dmitry Adamushko.
>
> Further clarification by renaming define and variable related to
> microcode container file.
>
> Signed-off-by: Peter Oruba <peter.oruba@amd.com>
applied to tip/x86/microcode, thanks Peter!
Arjan: could you check whether latest tip/master fixes the microcode
initrd problem you reported?
Ingo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-09-23 14:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <b647ffbd0809230212s41d2ef90u2915e40128b254e3@mail.gmail.com>
2008-09-17 13:05 ` [RESEND] [PATCH] x86, microcode rework, v2, renaming Peter Oruba
2008-09-17 13:39 ` [RESEND] [PATCH] x86, microcode rework, v2, renaming cont Peter Oruba
2008-09-23 14:12 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome