Skip to content

Commit 8d33316

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: "Three changes: - An UV fix/quirk to pull UV BIOS calls into the efi_runtime_lock locking regime. (This done by aliasing __efi_uv_runtime_lock to efi_runtime_lock, which should make the quirk nature obvious and maintain the general policy that the EFI lock (name...) isn't exposed to drivers.) - Our version of MAGA: Make a.out Great Again. - Add a new Intel model name enumerator to an upstream header to help reduce dependencies going forward" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/platform/UV: Use efi_runtime_lock to serialise BIOS calls x86/CPU: Add Icelake model number x86/a.out: Clear the dump structure initially
2 parents dd6f29d + f331e76 commit 8d33316

File tree

5 files changed

+41
-5
lines changed

5 files changed

+41
-5
lines changed

arch/x86/ia32/ia32_aout.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static unsigned long get_dr(int n)
5151
/*
5252
* fill in the user structure for a core dump..
5353
*/
54-
static void dump_thread32(struct pt_regs *regs, struct user32 *dump)
54+
static void fill_dump(struct pt_regs *regs, struct user32 *dump)
5555
{
5656
u32 fs, gs;
5757
memset(dump, 0, sizeof(*dump));
@@ -157,10 +157,12 @@ static int aout_core_dump(struct coredump_params *cprm)
157157
fs = get_fs();
158158
set_fs(KERNEL_DS);
159159
has_dumped = 1;
160+
161+
fill_dump(cprm->regs, &dump);
162+
160163
strncpy(dump.u_comm, current->comm, sizeof(current->comm));
161164
dump.u_ar0 = offsetof(struct user32, regs);
162165
dump.signal = cprm->siginfo->si_signo;
163-
dump_thread32(cprm->regs, &dump);
164166

165167
/*
166168
* If the size of the dump file exceeds the rlimit, then see

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252

5353
#define INTEL_FAM6_CANNONLAKE_MOBILE 0x66
5454

55+
#define INTEL_FAM6_ICELAKE_MOBILE 0x7E
56+
5557
/* "Small Core" Processors (Atom) */
5658

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

arch/x86/include/asm/uv/bios.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ enum {
4848
BIOS_STATUS_SUCCESS = 0,
4949
BIOS_STATUS_UNIMPLEMENTED = -ENOSYS,
5050
BIOS_STATUS_EINVAL = -EINVAL,
51-
BIOS_STATUS_UNAVAIL = -EBUSY
51+
BIOS_STATUS_UNAVAIL = -EBUSY,
52+
BIOS_STATUS_ABORT = -EINTR,
5253
};
5354

5455
/* Address map parameters */
@@ -167,4 +168,9 @@ extern long system_serial_number;
167168

168169
extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */
169170

171+
/*
172+
* EFI runtime lock; cf. firmware/efi/runtime-wrappers.c for details
173+
*/
174+
extern struct semaphore __efi_uv_runtime_lock;
175+
170176
#endif /* _ASM_X86_UV_BIOS_H */

arch/x86/platform/uv/bios_uv.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929

3030
struct uv_systab *uv_systab;
3131

32-
s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
32+
static s64 __uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
33+
u64 a4, u64 a5)
3334
{
3435
struct uv_systab *tab = uv_systab;
3536
s64 ret;
@@ -51,6 +52,19 @@ s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
5152

5253
return ret;
5354
}
55+
56+
s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
57+
{
58+
s64 ret;
59+
60+
if (down_interruptible(&__efi_uv_runtime_lock))
61+
return BIOS_STATUS_ABORT;
62+
63+
ret = __uv_bios_call(which, a1, a2, a3, a4, a5);
64+
up(&__efi_uv_runtime_lock);
65+
66+
return ret;
67+
}
5468
EXPORT_SYMBOL_GPL(uv_bios_call);
5569

5670
s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
@@ -59,10 +73,15 @@ s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
5973
unsigned long bios_flags;
6074
s64 ret;
6175

76+
if (down_interruptible(&__efi_uv_runtime_lock))
77+
return BIOS_STATUS_ABORT;
78+
6279
local_irq_save(bios_flags);
63-
ret = uv_bios_call(which, a1, a2, a3, a4, a5);
80+
ret = __uv_bios_call(which, a1, a2, a3, a4, a5);
6481
local_irq_restore(bios_flags);
6582

83+
up(&__efi_uv_runtime_lock);
84+
6685
return ret;
6786
}
6887

drivers/firmware/efi/runtime-wrappers.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,13 @@ void efi_call_virt_check_flags(unsigned long flags, const char *call)
146146
*/
147147
static DEFINE_SEMAPHORE(efi_runtime_lock);
148148

149+
/*
150+
* Expose the EFI runtime lock to the UV platform
151+
*/
152+
#ifdef CONFIG_X86_UV
153+
extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock);
154+
#endif
155+
149156
/*
150157
* Calls the appropriate efi_runtime_service() with the appropriate
151158
* arguments.

0 commit comments

Comments
 (0)