Commit 3eba620e authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'x86_cleanups_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 cleanups from Borislav Petkov:

 - The usual round of smaller fixes and cleanups all over the tree

* tag 'x86_cleanups_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/cpu: Include the header of init_ia32_feat_ctl()'s prototype
  x86/uaccess: Improve __try_cmpxchg64_user_asm() for x86_32
  x86: Fix various duplicate-word comment typos
  x86/boot: Remove superfluous type casting from arch/x86/boot/bitops.h
parents 193e2268 30ea703a
...@@ -19,13 +19,13 @@ ...@@ -19,13 +19,13 @@
static inline bool constant_test_bit(int nr, const void *addr) static inline bool constant_test_bit(int nr, const void *addr)
{ {
const u32 *p = (const u32 *)addr; const u32 *p = addr;
return ((1UL << (nr & 31)) & (p[nr >> 5])) != 0; return ((1UL << (nr & 31)) & (p[nr >> 5])) != 0;
} }
static inline bool variable_test_bit(int nr, const void *addr) static inline bool variable_test_bit(int nr, const void *addr)
{ {
bool v; bool v;
const u32 *p = (const u32 *)addr; const u32 *p = addr;
asm("btl %2,%1" CC_SET(c) : CC_OUT(c) (v) : "m" (*p), "Ir" (nr)); asm("btl %2,%1" CC_SET(c) : CC_OUT(c) (v) : "m" (*p), "Ir" (nr));
return v; return v;
......
...@@ -448,7 +448,7 @@ do { \ ...@@ -448,7 +448,7 @@ do { \
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
/* /*
* Unlike the normal CMPXCHG, hardcode ECX for both success/fail and error. * Unlike the normal CMPXCHG, use output GPR for both success/fail and error.
* There are only six GPRs available and four (EAX, EBX, ECX, and EDX) are * There are only six GPRs available and four (EAX, EBX, ECX, and EDX) are
* hardcoded by CMPXCHG8B, leaving only ESI and EDI. If the compiler uses * hardcoded by CMPXCHG8B, leaving only ESI and EDI. If the compiler uses
* both ESI and EDI for the memory operand, compilation will fail if the error * both ESI and EDI for the memory operand, compilation will fail if the error
...@@ -461,11 +461,12 @@ do { \ ...@@ -461,11 +461,12 @@ do { \
__typeof__(*(_ptr)) __new = (_new); \ __typeof__(*(_ptr)) __new = (_new); \
asm volatile("\n" \ asm volatile("\n" \
"1: " LOCK_PREFIX "cmpxchg8b %[ptr]\n" \ "1: " LOCK_PREFIX "cmpxchg8b %[ptr]\n" \
"mov $0, %%ecx\n\t" \ "mov $0, %[result]\n\t" \
"setz %%cl\n" \ "setz %b[result]\n" \
"2:\n" \ "2:\n" \
_ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, %%ecx) \ _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, \
: [result]"=c" (__result), \ %[result]) \
: [result] "=q" (__result), \
"+A" (__old), \ "+A" (__old), \
[ptr] "+m" (*_ptr) \ [ptr] "+m" (*_ptr) \
: "b" ((u32)__new), \ : "b" ((u32)__new), \
......
...@@ -53,7 +53,7 @@ static u32 *iommu_gatt_base; /* Remapping table */ ...@@ -53,7 +53,7 @@ static u32 *iommu_gatt_base; /* Remapping table */
* of only flushing when an mapping is reused. With it true the GART is * of only flushing when an mapping is reused. With it true the GART is
* flushed for every mapping. Problem is that doing the lazy flush seems * flushed for every mapping. Problem is that doing the lazy flush seems
* to trigger bugs with some popular PCI cards, in particular 3ware (but * to trigger bugs with some popular PCI cards, in particular 3ware (but
* has been also also seen with Qlogic at least). * has been also seen with Qlogic at least).
*/ */
static int iommu_fullflush = 1; static int iommu_fullflush = 1;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
/* /*
* Using 512M as goal, in case kexec will load kernel_big * Using 512M as goal, in case kexec will load kernel_big
* that will do the on-position decompress, and could overlap with * that will do the on-position decompress, and could overlap with
* with the gart aperture that is used. * the gart aperture that is used.
* Sequence: * Sequence:
* kernel_small * kernel_small
* ==> kexec (with kdump trigger path or gart still enabled) * ==> kexec (with kdump trigger path or gart still enabled)
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <linux/tboot.h> #include <linux/tboot.h>
#include <asm/cpu.h>
#include <asm/cpufeature.h> #include <asm/cpufeature.h>
#include <asm/msr-index.h> #include <asm/msr-index.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/vmx.h> #include <asm/vmx.h>
#include "cpu.h"
#undef pr_fmt #undef pr_fmt
#define pr_fmt(fmt) "x86/cpu: " fmt #define pr_fmt(fmt) "x86/cpu: " fmt
......
...@@ -2570,7 +2570,7 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, ...@@ -2570,7 +2570,7 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
* bits which we consider mandatory enabled. * bits which we consider mandatory enabled.
* The CR0_READ_SHADOW is what L2 should have expected to read given * The CR0_READ_SHADOW is what L2 should have expected to read given
* the specifications by L1; It's not enough to take * the specifications by L1; It's not enough to take
* vmcs12->cr0_read_shadow because on our cr0_guest_host_mask we we * vmcs12->cr0_read_shadow because on our cr0_guest_host_mask we
* have more bits than L1 expected. * have more bits than L1 expected.
*/ */
vmx_set_cr0(vcpu, vmcs12->guest_cr0); vmx_set_cr0(vcpu, vmcs12->guest_cr0);
......
...@@ -169,7 +169,7 @@ static void __init do_add_efi_memmap(void) ...@@ -169,7 +169,7 @@ static void __init do_add_efi_memmap(void)
} }
/* /*
* Given add_efi_memmap defaults to 0 and there there is no alternative * Given add_efi_memmap defaults to 0 and there is no alternative
* e820 mechanism for soft-reserved memory, import the full EFI memory * e820 mechanism for soft-reserved memory, import the full EFI memory
* map if soft reservations are present and enabled. Otherwise, the * map if soft reservations are present and enabled. Otherwise, the
* mechanism to disable the kernel's consideration of EFI_MEMORY_SP is * mechanism to disable the kernel's consideration of EFI_MEMORY_SP is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment