* Re: [PATCH] x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid()
[not found] ` <87mtsd6gr9.ffs@nanos.tec.linutronix.de>
@ 2021-06-02 10:14 ` Borislav Petkov
2021-06-02 10:20 ` Thomas Gleixner
2021-06-03 11:20 ` Vinod Koul
0 siblings, 2 replies; 6+ messages in thread
From: Borislav Petkov @ 2021-06-02 10:14 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Fenghua Yu, linux-kernel, x86, iommu, Ingo Molnar, H Peter Anvin,
Andy Lutomirski, Jean-Philippe Brucker, Christoph Hellwig,
Peter Zijlstra, David Woodhouse, Lu Baolu, Dave Hansen,
Tony Luck, Randy Dunlap, Ashok Raj, Jacob Jun Pan, Dave Jiang,
Sohil Mehta, Ravi V Shankar, Vinod Koul, dmaengine
On Sat, May 29, 2021 at 11:17:30AM +0200, Thomas Gleixner wrote:
> --- a/arch/x86/include/asm/disabled-features.h
> +++ b/arch/x86/include/asm/disabled-features.h
> @@ -56,11 +56,8 @@
> # define DISABLE_PTI (1 << (X86_FEATURE_PTI & 31))
> #endif
>
> -#ifdef CONFIG_IOMMU_SUPPORT
> -# define DISABLE_ENQCMD 0
> -#else
> -# define DISABLE_ENQCMD (1 << (X86_FEATURE_ENQCMD & 31))
> -#endif
> +/* Force disable because it's broken beyond repair */
> +#define DISABLE_ENQCMD (1 << (X86_FEATURE_ENQCMD & 31))
Yeah, for that to work we need:
---
From: Borislav Petkov <bp@suse.de>
Date: Wed, 2 Jun 2021 12:07:52 +0200
Subject: [PATCH] dmaengine: idxd: Use cpu_feature_enabled()
When testing x86 feature bits, use cpu_feature_enabled() so that
build-disabled features can remain off, regardless of what CPUID says.
Fixes: 8e50d392652f ("dmaengine: idxd: Add shared workqueue support")
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org>
---
drivers/dma/idxd/init.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index 2a926bef87f2..776fd44aff5f 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -745,12 +745,12 @@ static int __init idxd_init_module(void)
* If the CPU does not support MOVDIR64B or ENQCMDS, there's no point in
* enumerating the device. We can not utilize it.
*/
- if (!boot_cpu_has(X86_FEATURE_MOVDIR64B)) {
+ if (!cpu_feature_enabled(X86_FEATURE_MOVDIR64B)) {
pr_warn("idxd driver failed to load without MOVDIR64B.\n");
return -ENODEV;
}
- if (!boot_cpu_has(X86_FEATURE_ENQCMD))
+ if (!cpu_feature_enabled(X86_FEATURE_ENQCMD))
pr_warn("Platform does not have ENQCMD(S) support.\n");
else
support_enqcmd = true;
--
2.29.2
For the newly CCed parties, pls check
https://lkml.kernel.org/r/87mtsd6gr9.ffs@nanos.tec.linutronix.de
for more info.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid()
2021-06-02 10:14 ` [PATCH] x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid() Borislav Petkov
@ 2021-06-02 10:20 ` Thomas Gleixner
2021-06-03 11:20 ` Vinod Koul
1 sibling, 0 replies; 6+ messages in thread
From: Thomas Gleixner @ 2021-06-02 10:20 UTC (permalink / raw)
To: Borislav Petkov
Cc: Fenghua Yu, linux-kernel, x86, iommu, Ingo Molnar, H Peter Anvin,
Andy Lutomirski, Jean-Philippe Brucker, Christoph Hellwig,
Peter Zijlstra, David Woodhouse, Lu Baolu, Dave Hansen,
Tony Luck, Randy Dunlap, Ashok Raj, Jacob Jun Pan, Dave Jiang,
Sohil Mehta, Ravi V Shankar, Vinod Koul, dmaengine
On Wed, Jun 02 2021 at 12:14, Borislav Petkov wrote:
> On Sat, May 29, 2021 at 11:17:30AM +0200, Thomas Gleixner wrote:
>> --- a/arch/x86/include/asm/disabled-features.h
>> +++ b/arch/x86/include/asm/disabled-features.h
>> @@ -56,11 +56,8 @@
>> # define DISABLE_PTI (1 << (X86_FEATURE_PTI & 31))
>> #endif
>>
>> -#ifdef CONFIG_IOMMU_SUPPORT
>> -# define DISABLE_ENQCMD 0
>> -#else
>> -# define DISABLE_ENQCMD (1 << (X86_FEATURE_ENQCMD & 31))
>> -#endif
>> +/* Force disable because it's broken beyond repair */
>> +#define DISABLE_ENQCMD (1 << (X86_FEATURE_ENQCMD & 31))
>
> Yeah, for that to work we need:
>
> ---
> From: Borislav Petkov <bp@suse.de>
> Date: Wed, 2 Jun 2021 12:07:52 +0200
> Subject: [PATCH] dmaengine: idxd: Use cpu_feature_enabled()
>
> When testing x86 feature bits, use cpu_feature_enabled() so that
> build-disabled features can remain off, regardless of what CPUID says.
>
> Fixes: 8e50d392652f ("dmaengine: idxd: Add shared workqueue support")
> Signed-off-by: Borislav Petkov <bp@suse.de>
> Cc: <stable@vger.kernel.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Thanks for spotting this!
tglx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid()
2021-06-02 10:14 ` [PATCH] x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid() Borislav Petkov
2021-06-02 10:20 ` Thomas Gleixner
@ 2021-06-03 11:20 ` Vinod Koul
2021-06-03 11:42 ` Borislav Petkov
1 sibling, 1 reply; 6+ messages in thread
From: Vinod Koul @ 2021-06-03 11:20 UTC (permalink / raw)
To: Borislav Petkov
Cc: Thomas Gleixner, Fenghua Yu, linux-kernel, x86, iommu,
Ingo Molnar, H Peter Anvin, Andy Lutomirski,
Jean-Philippe Brucker, Christoph Hellwig, Peter Zijlstra,
David Woodhouse, Lu Baolu, Dave Hansen, Tony Luck, Randy Dunlap,
Ashok Raj, Jacob Jun Pan, Dave Jiang, Sohil Mehta,
Ravi V Shankar, dmaengine
On 02-06-21, 12:14, Borislav Petkov wrote:
> ---
> From: Borislav Petkov <bp@suse.de>
> Date: Wed, 2 Jun 2021 12:07:52 +0200
> Subject: [PATCH] dmaengine: idxd: Use cpu_feature_enabled()
>
> When testing x86 feature bits, use cpu_feature_enabled() so that
> build-disabled features can remain off, regardless of what CPUID says.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid()
2021-06-03 11:20 ` Vinod Koul
@ 2021-06-03 11:42 ` Borislav Petkov
2021-06-03 12:47 ` Vinod Koul
0 siblings, 1 reply; 6+ messages in thread
From: Borislav Petkov @ 2021-06-03 11:42 UTC (permalink / raw)
To: Vinod Koul
Cc: Thomas Gleixner, Fenghua Yu, linux-kernel, x86, iommu,
Ingo Molnar, H Peter Anvin, Andy Lutomirski,
Jean-Philippe Brucker, Christoph Hellwig, Peter Zijlstra,
David Woodhouse, Lu Baolu, Dave Hansen, Tony Luck, Randy Dunlap,
Ashok Raj, Jacob Jun Pan, Dave Jiang, Sohil Mehta,
Ravi V Shankar, dmaengine
On Thu, Jun 03, 2021 at 04:50:26PM +0530, Vinod Koul wrote:
> Applied, thanks
Actually, I'd prefer if I take it through the tip tree:
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=x86/urgent
because it is needed for the following patch by tglx:
6867ee8bcb75 x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid()
db099bafbf5e dmaengine: idxd: Use cpu_feature_enabled()
if you don't mind.
I'll be sending this to Linus this weekend.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid()
2021-06-03 11:42 ` Borislav Petkov
@ 2021-06-03 12:47 ` Vinod Koul
2021-06-03 14:33 ` Borislav Petkov
0 siblings, 1 reply; 6+ messages in thread
From: Vinod Koul @ 2021-06-03 12:47 UTC (permalink / raw)
To: Borislav Petkov
Cc: Thomas Gleixner, Fenghua Yu, linux-kernel, x86, iommu,
Ingo Molnar, H Peter Anvin, Andy Lutomirski,
Jean-Philippe Brucker, Christoph Hellwig, Peter Zijlstra,
David Woodhouse, Lu Baolu, Dave Hansen, Tony Luck, Randy Dunlap,
Ashok Raj, Jacob Jun Pan, Dave Jiang, Sohil Mehta,
Ravi V Shankar, dmaengine
On 03-06-21, 13:42, Borislav Petkov wrote:
> On Thu, Jun 03, 2021 at 04:50:26PM +0530, Vinod Koul wrote:
> > Applied, thanks
>
> Actually, I'd prefer if I take it through the tip tree:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=x86/urgent
>
> because it is needed for the following patch by tglx:
>
> 6867ee8bcb75 x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid()
> db099bafbf5e dmaengine: idxd: Use cpu_feature_enabled()
>
> if you don't mind.
>
> I'll be sending this to Linus this weekend.
Okay dropped now..
You can add:
Acked-By: Vinod Koul <vkoul@kernel.org>
--
~Vinod
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid()
2021-06-03 12:47 ` Vinod Koul
@ 2021-06-03 14:33 ` Borislav Petkov
0 siblings, 0 replies; 6+ messages in thread
From: Borislav Petkov @ 2021-06-03 14:33 UTC (permalink / raw)
To: Vinod Koul
Cc: Thomas Gleixner, Fenghua Yu, linux-kernel, x86, iommu,
Ingo Molnar, H Peter Anvin, Andy Lutomirski,
Jean-Philippe Brucker, Christoph Hellwig, Peter Zijlstra,
David Woodhouse, Lu Baolu, Dave Hansen, Tony Luck, Randy Dunlap,
Ashok Raj, Jacob Jun Pan, Dave Jiang, Sohil Mehta,
Ravi V Shankar, dmaengine
On Thu, Jun 03, 2021 at 06:17:04PM +0530, Vinod Koul wrote:
> You can add:
>
> Acked-By: Vinod Koul <vkoul@kernel.org>
Done.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-06-03 14:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1600187413-163670-1-git-send-email-fenghua.yu@intel.com>
[not found] ` <1600187413-163670-10-git-send-email-fenghua.yu@intel.com>
[not found] ` <87mtsd6gr9.ffs@nanos.tec.linutronix.de>
2021-06-02 10:14 ` [PATCH] x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid() Borislav Petkov
2021-06-02 10:20 ` Thomas Gleixner
2021-06-03 11:20 ` Vinod Koul
2021-06-03 11:42 ` Borislav Petkov
2021-06-03 12:47 ` Vinod Koul
2021-06-03 14:33 ` 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).