Skip to content

Commit fcb45a2

Browse files
committed
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar: "A handful of fixes: a kexec linking fix, an AMD MWAITX fix, a vmware guest support fix when built under Clang, and new CPU model number definitions" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpu: Add Comet Lake to the Intel CPU models header lib/string: Make memzero_explicit() inline instead of external x86/cpu/vmware: Use the full form of INL in VMWARE_PORT x86/asm: Fix MWAITX C-state hint value
2 parents e9ec358 + 8d7c6ac commit fcb45a2

File tree

6 files changed

+27
-26
lines changed

6 files changed

+27
-26
lines changed

arch/x86/include/asm/intel-family.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@
8383
#define INTEL_FAM6_TIGERLAKE_L 0x8C
8484
#define INTEL_FAM6_TIGERLAKE 0x8D
8585

86+
#define INTEL_FAM6_COMETLAKE 0xA5
87+
#define INTEL_FAM6_COMETLAKE_L 0xA6
88+
8689
/* "Small Core" Processors (Atom) */
8790

8891
#define INTEL_FAM6_ATOM_BONNELL 0x1C /* Diamondville, Pineview */

arch/x86/include/asm/mwait.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#define MWAIT_ECX_INTERRUPT_BREAK 0x1
2222
#define MWAITX_ECX_TIMER_ENABLE BIT(1)
2323
#define MWAITX_MAX_LOOPS ((u32)-1)
24-
#define MWAITX_DISABLE_CSTATES 0xf
24+
#define MWAITX_DISABLE_CSTATES 0xf0
2525

2626
static inline void __monitor(const void *eax, unsigned long ecx,
2727
unsigned long edx)

arch/x86/kernel/cpu/vmware.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
#define VMWARE_CMD_VCPU_RESERVED 31
5050

5151
#define VMWARE_PORT(cmd, eax, ebx, ecx, edx) \
52-
__asm__("inl (%%dx)" : \
52+
__asm__("inl (%%dx), %%eax" : \
5353
"=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \
5454
"a"(VMWARE_HYPERVISOR_MAGIC), \
5555
"c"(VMWARE_CMD_##cmd), \

arch/x86/lib/delay.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ static void delay_mwaitx(unsigned long __loops)
113113
__monitorx(raw_cpu_ptr(&cpu_tss_rw), 0, 0);
114114

115115
/*
116-
* AMD, like Intel, supports the EAX hint and EAX=0xf
117-
* means, do not enter any deep C-state and we use it
116+
* AMD, like Intel's MWAIT version, supports the EAX hint and
117+
* EAX=0xf0 means, do not enter any deep C-state and we use it
118118
* here in delay() to minimize wakeup latency.
119119
*/
120120
__mwaitx(MWAITX_DISABLE_CSTATES, delay, MWAITX_ECX_TIMER_ENABLE);

include/linux/string.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,26 @@ static inline bool strstarts(const char *str, const char *prefix)
227227
}
228228

229229
size_t memweight(const void *ptr, size_t bytes);
230-
void memzero_explicit(void *s, size_t count);
230+
231+
/**
232+
* memzero_explicit - Fill a region of memory (e.g. sensitive
233+
* keying data) with 0s.
234+
* @s: Pointer to the start of the area.
235+
* @count: The size of the area.
236+
*
237+
* Note: usually using memset() is just fine (!), but in cases
238+
* where clearing out _local_ data at the end of a scope is
239+
* necessary, memzero_explicit() should be used instead in
240+
* order to prevent the compiler from optimising away zeroing.
241+
*
242+
* memzero_explicit() doesn't need an arch-specific version as
243+
* it just invokes the one of memset() implicitly.
244+
*/
245+
static inline void memzero_explicit(void *s, size_t count)
246+
{
247+
memset(s, 0, count);
248+
barrier_data(s);
249+
}
231250

232251
/**
233252
* kbasename - return the last part of a pathname.

lib/string.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -748,27 +748,6 @@ void *memset(void *s, int c, size_t count)
748748
EXPORT_SYMBOL(memset);
749749
#endif
750750

751-
/**
752-
* memzero_explicit - Fill a region of memory (e.g. sensitive
753-
* keying data) with 0s.
754-
* @s: Pointer to the start of the area.
755-
* @count: The size of the area.
756-
*
757-
* Note: usually using memset() is just fine (!), but in cases
758-
* where clearing out _local_ data at the end of a scope is
759-
* necessary, memzero_explicit() should be used instead in
760-
* order to prevent the compiler from optimising away zeroing.
761-
*
762-
* memzero_explicit() doesn't need an arch-specific version as
763-
* it just invokes the one of memset() implicitly.
764-
*/
765-
void memzero_explicit(void *s, size_t count)
766-
{
767-
memset(s, 0, count);
768-
barrier_data(s);
769-
}
770-
EXPORT_SYMBOL(memzero_explicit);
771-
772751
#ifndef __HAVE_ARCH_MEMSET16
773752
/**
774753
* memset16() - Fill a memory area with a uint16_t

0 commit comments

Comments
 (0)