Skip to content

Commit

Permalink
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/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
  • Loading branch information
Linus Torvalds committed Feb 17, 2019
2 parents dd6f29d + f331e76 commit 8d33316
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
6 changes: 4 additions & 2 deletions arch/x86/ia32/ia32_aout.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static unsigned long get_dr(int n)
/*
* fill in the user structure for a core dump..
*/
static void dump_thread32(struct pt_regs *regs, struct user32 *dump)
static void fill_dump(struct pt_regs *regs, struct user32 *dump)
{
u32 fs, gs;
memset(dump, 0, sizeof(*dump));
Expand Down Expand Up @@ -157,10 +157,12 @@ static int aout_core_dump(struct coredump_params *cprm)
fs = get_fs();
set_fs(KERNEL_DS);
has_dumped = 1;

fill_dump(cprm->regs, &dump);

strncpy(dump.u_comm, current->comm, sizeof(current->comm));
dump.u_ar0 = offsetof(struct user32, regs);
dump.signal = cprm->siginfo->si_signo;
dump_thread32(cprm->regs, &dump);

/*
* If the size of the dump file exceeds the rlimit, then see
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/include/asm/intel-family.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@

#define INTEL_FAM6_CANNONLAKE_MOBILE 0x66

#define INTEL_FAM6_ICELAKE_MOBILE 0x7E

/* "Small Core" Processors (Atom) */

#define INTEL_FAM6_ATOM_BONNELL 0x1C /* Diamondville, Pineview */
Expand Down
8 changes: 7 additions & 1 deletion arch/x86/include/asm/uv/bios.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ enum {
BIOS_STATUS_SUCCESS = 0,
BIOS_STATUS_UNIMPLEMENTED = -ENOSYS,
BIOS_STATUS_EINVAL = -EINVAL,
BIOS_STATUS_UNAVAIL = -EBUSY
BIOS_STATUS_UNAVAIL = -EBUSY,
BIOS_STATUS_ABORT = -EINTR,
};

/* Address map parameters */
Expand Down Expand Up @@ -167,4 +168,9 @@ extern long system_serial_number;

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

/*
* EFI runtime lock; cf. firmware/efi/runtime-wrappers.c for details
*/
extern struct semaphore __efi_uv_runtime_lock;

#endif /* _ASM_X86_UV_BIOS_H */
23 changes: 21 additions & 2 deletions arch/x86/platform/uv/bios_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@

struct uv_systab *uv_systab;

s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
static s64 __uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
u64 a4, u64 a5)
{
struct uv_systab *tab = uv_systab;
s64 ret;
Expand All @@ -51,6 +52,19 @@ s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)

return ret;
}

s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
{
s64 ret;

if (down_interruptible(&__efi_uv_runtime_lock))
return BIOS_STATUS_ABORT;

ret = __uv_bios_call(which, a1, a2, a3, a4, a5);
up(&__efi_uv_runtime_lock);

return ret;
}
EXPORT_SYMBOL_GPL(uv_bios_call);

s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
Expand All @@ -59,10 +73,15 @@ s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
unsigned long bios_flags;
s64 ret;

if (down_interruptible(&__efi_uv_runtime_lock))
return BIOS_STATUS_ABORT;

local_irq_save(bios_flags);
ret = uv_bios_call(which, a1, a2, a3, a4, a5);
ret = __uv_bios_call(which, a1, a2, a3, a4, a5);
local_irq_restore(bios_flags);

up(&__efi_uv_runtime_lock);

return ret;
}

Expand Down
7 changes: 7 additions & 0 deletions drivers/firmware/efi/runtime-wrappers.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ void efi_call_virt_check_flags(unsigned long flags, const char *call)
*/
static DEFINE_SEMAPHORE(efi_runtime_lock);

/*
* Expose the EFI runtime lock to the UV platform
*/
#ifdef CONFIG_X86_UV
extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock);
#endif

/*
* Calls the appropriate efi_runtime_service() with the appropriate
* arguments.
Expand Down

0 comments on commit 8d33316

Please sign in to comment.