mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] tip-queue 2016-02-16
@ 2016-02-16  8:43 Borislav Petkov
  2016-02-16  8:43 ` [PATCH 1/4] x86/microcode: Remove unnecessary paravirt_enabled check Borislav Petkov
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Borislav Petkov @ 2016-02-16  8:43 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: LKML

From: Borislav Petkov <bp@suse.de>

Hi,

just a bunch of small cleanups, the highlight being one less
paravirt_enabled() user. :)

Please apply,
thanks.

Andrzej Hajda (1):
  x86/microcode: Use kmemdup() rather than duplicating its
    implementation

Boris Ostrovsky (1):
  x86/microcode: Remove unnecessary paravirt_enabled check

Borislav Petkov (2):
  ftrace: Kill ftrace_caller_end label
  x86/msr: Document msr-index.h rule for addition

 arch/x86/include/asm/msr-index.h      |  7 ++++++-
 arch/x86/kernel/cpu/microcode/amd.c   |  4 +---
 arch/x86/kernel/cpu/microcode/core.c  |  2 +-
 arch/x86/kernel/cpu/microcode/intel.c |  4 +---
 arch/x86/kernel/ftrace.c              | 11 +++++------
 arch/x86/kernel/mcount_64.S           | 14 ++++++++------
 6 files changed, 22 insertions(+), 20 deletions(-)

-- 
2.3.5

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH 1/3] x86/microcode: Use kmemdup() rather than duplicating its implementation
@ 2015-08-10 10:19 Borislav Petkov
  2015-08-22 13:58 ` [tip:x86/microcode] " tip-bot for Andrzej Hajda
  0 siblings, 1 reply; 10+ messages in thread
From: Borislav Petkov @ 2015-08-10 10:19 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: LKML

From: Andrzej Hajda <a.hajda@samsung.com>

The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
Link: http://lkml.kernel.org/r/1438934377-4922-8-git-send-email-a.hajda@samsung.com
Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/kernel/cpu/microcode/amd.c         | 4 +---
 arch/x86/kernel/cpu/microcode/intel_early.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index c7d2415b8a24..be37f101ce5a 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -366,15 +366,13 @@ static int verify_and_add_patch(u8 family, u8 *fw, unsigned int leftover)
 		return -EINVAL;
 	}
 
-	patch->data = kzalloc(patch_size, GFP_KERNEL);
+	patch->data = kmemdup(fw + SECTION_HDR_SIZE, patch_size, GFP_KERNEL);
 	if (!patch->data) {
 		pr_err("Patch data allocation failure.\n");
 		kfree(patch);
 		return -EINVAL;
 	}
 
-	/* All looks ok, copy patch... */
-	memcpy(patch->data, fw + SECTION_HDR_SIZE, patch_size);
 	INIT_LIST_HEAD(&patch->plist);
 	patch->patch_id  = mc_hdr->patch_id;
 	patch->equiv_cpu = proc_id;
diff --git a/arch/x86/kernel/cpu/microcode/intel_early.c b/arch/x86/kernel/cpu/microcode/intel_early.c
index 8187b7247d1c..101f0ac5f6e1 100644
--- a/arch/x86/kernel/cpu/microcode/intel_early.c
+++ b/arch/x86/kernel/cpu/microcode/intel_early.c
@@ -207,13 +207,11 @@ save_microcode(struct mc_saved_data *mc_saved_data,
 		mc_hdr = &mc->hdr;
 		size   = get_totalsize(mc_hdr);
 
-		saved_ptr[i] = kmalloc(size, GFP_KERNEL);
+		saved_ptr[i] = kmemdup(mc, size, GFP_KERNEL);
 		if (!saved_ptr[i]) {
 			ret = -ENOMEM;
 			goto err;
 		}
-
-		memcpy(saved_ptr[i], mc, size);
 	}
 
 	/*
-- 
2.5.0.rc2.28.g6003e7f


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

end of thread, other threads:[~2016-02-17 12:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-16  8:43 [PATCH 0/4] tip-queue 2016-02-16 Borislav Petkov
2016-02-16  8:43 ` [PATCH 1/4] x86/microcode: Remove unnecessary paravirt_enabled check Borislav Petkov
2016-02-17 12:12   ` [tip:x86/microcode] " tip-bot for Boris Ostrovsky
2016-02-16  8:43 ` [PATCH 2/4] x86/microcode: Use kmemdup() rather than duplicating its implementation Borislav Petkov
2016-02-17 12:12   ` [tip:x86/microcode] " tip-bot for Andrzej Hajda
2016-02-16  8:43 ` [PATCH 3/4] ftrace: Kill ftrace_caller_end label Borislav Petkov
2016-02-17 12:13   ` [tip:x86/asm] x86/ftrace, x86/asm: " tip-bot for Borislav Petkov
2016-02-16  8:43 ` [PATCH 4/4] x86/msr: Document msr-index.h rule for addition Borislav Petkov
2016-02-17 12:13   ` [tip:x86/asm] " tip-bot for Borislav Petkov
  -- strict thread matches above, loose matches on Subject: below --
2015-08-10 10:19 [PATCH 1/3] x86/microcode: Use kmemdup() rather than duplicating its implementation Borislav Petkov
2015-08-22 13:58 ` [tip:x86/microcode] " tip-bot for Andrzej Hajda

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

all inboxes | Powered by JetHome®