linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/microcode: Remove ->request_microcode_user()
@ 2022-08-25  7:54 Borislav Petkov
  2022-08-25 11:33 ` Ashok Raj
  2022-08-26 10:05 ` [tip: x86/microcode] " tip-bot2 for Borislav Petkov
  0 siblings, 2 replies; 3+ messages in thread
From: Borislav Petkov @ 2022-08-25  7:54 UTC (permalink / raw)
  To: X86 ML; +Cc: LKML

From: Borislav Petkov <bp@suse.de>

  181b6f40e9ea ("x86/microcode: Rip out the OLD_INTERFACE")

removed the old microcode loading interface but forgot to remove the
related ->request_microcode_user() functionality which it uses.

Rip it out now too.

Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/include/asm/microcode.h      |  3 ---
 arch/x86/kernel/cpu/microcode/amd.c   |  7 -------
 arch/x86/kernel/cpu/microcode/intel.c | 17 -----------------
 3 files changed, 27 deletions(-)

diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
index 0c3d3440fe27..7f7800e15ed0 100644
--- a/arch/x86/include/asm/microcode.h
+++ b/arch/x86/include/asm/microcode.h
@@ -32,9 +32,6 @@ enum ucode_state {
 };
 
 struct microcode_ops {
-	enum ucode_state (*request_microcode_user) (int cpu,
-				const void __user *buf, size_t size);
-
 	enum ucode_state (*request_microcode_fw) (int cpu, struct device *,
 						  bool refresh_fw);
 
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index 8b2fcdfa6d31..5f38dd75cbc5 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -924,12 +924,6 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device,
 	return ret;
 }
 
-static enum ucode_state
-request_microcode_user(int cpu, const void __user *buf, size_t size)
-{
-	return UCODE_ERROR;
-}
-
 static void microcode_fini_cpu_amd(int cpu)
 {
 	struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
@@ -938,7 +932,6 @@ static void microcode_fini_cpu_amd(int cpu)
 }
 
 static struct microcode_ops microcode_amd_ops = {
-	.request_microcode_user           = request_microcode_user,
 	.request_microcode_fw             = request_microcode_amd,
 	.collect_cpu_info                 = collect_cpu_info_amd,
 	.apply_microcode                  = apply_microcode_amd,
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index 025c8f0cd948..1fcbd671f1df 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -916,24 +916,7 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device,
 	return ret;
 }
 
-static enum ucode_state
-request_microcode_user(int cpu, const void __user *buf, size_t size)
-{
-	struct iov_iter iter;
-	struct iovec iov;
-
-	if (is_blacklisted(cpu))
-		return UCODE_NFOUND;
-
-	iov.iov_base = (void __user *)buf;
-	iov.iov_len = size;
-	iov_iter_init(&iter, WRITE, &iov, 1, size);
-
-	return generic_load_microcode(cpu, &iter);
-}
-
 static struct microcode_ops microcode_intel_ops = {
-	.request_microcode_user		  = request_microcode_user,
 	.request_microcode_fw             = request_microcode_fw,
 	.collect_cpu_info                 = collect_cpu_info,
 	.apply_microcode                  = apply_microcode_intel,
-- 
2.35.1


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

* Re: [PATCH] x86/microcode: Remove ->request_microcode_user()
  2022-08-25  7:54 [PATCH] x86/microcode: Remove ->request_microcode_user() Borislav Petkov
@ 2022-08-25 11:33 ` Ashok Raj
  2022-08-26 10:05 ` [tip: x86/microcode] " tip-bot2 for Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: Ashok Raj @ 2022-08-25 11:33 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: X86 ML, LKML, Ashok Raj

On Thu, Aug 25, 2022 at 09:54:45AM +0200, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
> 
>   181b6f40e9ea ("x86/microcode: Rip out the OLD_INTERFACE")
> 
> removed the old microcode loading interface but forgot to remove the
> related ->request_microcode_user() functionality which it uses.
> 
> Rip it out now too.

Nice, I had this in my cleanup pile too :-)

> 
> Signed-off-by: Borislav Petkov <bp@suse.de>
> ---
>  arch/x86/include/asm/microcode.h      |  3 ---
>  arch/x86/kernel/cpu/microcode/amd.c   |  7 -------
>  arch/x86/kernel/cpu/microcode/intel.c | 17 -----------------
>  3 files changed, 27 deletions(-)
> 

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

* [tip: x86/microcode] x86/microcode: Remove ->request_microcode_user()
  2022-08-25  7:54 [PATCH] x86/microcode: Remove ->request_microcode_user() Borislav Petkov
  2022-08-25 11:33 ` Ashok Raj
@ 2022-08-26 10:05 ` tip-bot2 for Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Borislav Petkov @ 2022-08-26 10:05 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Borislav Petkov, x86, linux-kernel

The following commit has been merged into the x86/microcode branch of tip:

Commit-ID:     8c61eafd22d7207039bff85c6e1d386f15abd17e
Gitweb:        https://git.kernel.org/tip/8c61eafd22d7207039bff85c6e1d386f15abd17e
Author:        Borislav Petkov <bp@suse.de>
AuthorDate:    Thu, 25 Aug 2022 09:51:57 +02:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Fri, 26 Aug 2022 11:56:08 +02:00

x86/microcode: Remove ->request_microcode_user()

  181b6f40e9ea ("x86/microcode: Rip out the OLD_INTERFACE")

removed the old microcode loading interface but forgot to remove the
related ->request_microcode_user() functionality which it uses.

Rip it out now too.

Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20220825075445.28171-1-bp@alien8.de
---
 arch/x86/include/asm/microcode.h      |  3 ---
 arch/x86/kernel/cpu/microcode/amd.c   |  7 -------
 arch/x86/kernel/cpu/microcode/intel.c | 17 -----------------
 3 files changed, 27 deletions(-)

diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
index 0c3d344..7f7800e 100644
--- a/arch/x86/include/asm/microcode.h
+++ b/arch/x86/include/asm/microcode.h
@@ -32,9 +32,6 @@ enum ucode_state {
 };
 
 struct microcode_ops {
-	enum ucode_state (*request_microcode_user) (int cpu,
-				const void __user *buf, size_t size);
-
 	enum ucode_state (*request_microcode_fw) (int cpu, struct device *,
 						  bool refresh_fw);
 
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index 8b2fcdf..5f38dd7 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -924,12 +924,6 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device,
 	return ret;
 }
 
-static enum ucode_state
-request_microcode_user(int cpu, const void __user *buf, size_t size)
-{
-	return UCODE_ERROR;
-}
-
 static void microcode_fini_cpu_amd(int cpu)
 {
 	struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
@@ -938,7 +932,6 @@ static void microcode_fini_cpu_amd(int cpu)
 }
 
 static struct microcode_ops microcode_amd_ops = {
-	.request_microcode_user           = request_microcode_user,
 	.request_microcode_fw             = request_microcode_amd,
 	.collect_cpu_info                 = collect_cpu_info_amd,
 	.apply_microcode                  = apply_microcode_amd,
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index 025c8f0..1fcbd67 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -916,24 +916,7 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device,
 	return ret;
 }
 
-static enum ucode_state
-request_microcode_user(int cpu, const void __user *buf, size_t size)
-{
-	struct iov_iter iter;
-	struct iovec iov;
-
-	if (is_blacklisted(cpu))
-		return UCODE_NFOUND;
-
-	iov.iov_base = (void __user *)buf;
-	iov.iov_len = size;
-	iov_iter_init(&iter, WRITE, &iov, 1, size);
-
-	return generic_load_microcode(cpu, &iter);
-}
-
 static struct microcode_ops microcode_intel_ops = {
-	.request_microcode_user		  = request_microcode_user,
 	.request_microcode_fw             = request_microcode_fw,
 	.collect_cpu_info                 = collect_cpu_info,
 	.apply_microcode                  = apply_microcode_intel,

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

end of thread, other threads:[~2022-08-26 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25  7:54 [PATCH] x86/microcode: Remove ->request_microcode_user() Borislav Petkov
2022-08-25 11:33 ` Ashok Raj
2022-08-26 10:05 ` [tip: x86/microcode] " tip-bot2 for Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).