Re: [PATCH 1/2] x86/mce: Only restart instruction after machinecheck recovery if it is safe

From: Borislav Petkov
Date: Sun May 13 2012 - 05:59:58 EST

On Thu, May 10, 2012 at 11:01:20AM -0700, Tony Luck wrote:
> Section of the software developer manual has this to say about the
> RIPV bit in the IA32_MCG_STATUS register:
> RIPV (restart IP valid) flag, bit 0 â Indicates (when set) that program
> execution can be restarted reliably at the instruction pointed to by the
> instruction pointer pushed on the stack when the machine-check exception
> is generated. When clear, the program cannot be reliably restarted at
> the pushed instruction pointer.
> We need to save the state of this bit in do_machine_check() and use it
> in mce_notify_process() to force a signal; even if memory_failure() says
> it made a complete recovery ... e.g. replaced a clean LRU page).
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---
> arch/x86/kernel/cpu/mcheck/mce.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
> diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
> index 66e1c51..3b8ebdc 100644
> --- a/arch/x86/kernel/cpu/mcheck/mce.c
> +++ b/arch/x86/kernel/cpu/mcheck/mce.c
> @@ -947,9 +947,10 @@ struct mce_info {
> atomic_t inuse;
> struct task_struct *t;
> __u64 paddr;
> + int restartable;

Is it me or does this look like a flag, or a bitfield? Instead of
wasting a whole integer for a single bit of information.

It will probably end up the same size though due to compiler padding
since this struct is currently 4 + 2*8 byte without the ->restartable


Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at