|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 2 of 2 V4] x86/kexec: Change NMI and MCE handling on kexec path
On 11/12/12 15:58, Jan Beulich wrote: On 11.12.12 at 16:34, Andrew Cooper<andrew.cooper3@xxxxxxxxxx> wrote: Ok + _set_gate_lower(&idt_tables[i][TRAP_nmi], 14, 0,&trap_nop);No need for the extra& on functions and arrays. I was continuing the prevailing style from traps.c Personally, I prefer the & notation for function pointers, to be consistent with regular pointers, even though I am aware that it is not strictly needed. I am not fussed if you wish to insist on one style, but we do have mixed styles across the codebase. + set_ist(&idt_tables[i][TRAP_machine_check], IST_NONE); + } + else + /* Do not update stack table for other pcpus. */ + _update_gate_addr_lower(&idt_tables[i][TRAP_nmi],&nmi_crash); + } + ... +/* Write the lower 64 bits of an IDT Entry. This relies on the upper 32 + * bits of the address not changing, which is a safe aumption until ourassumption+ * code size exceeds 4GB.1Gb.+ * + * Ideally, we would use cmpxchg16b, but this is not supported on some + * old AMD 64bit capable processors, and has no safe equivelent.equivalent+ */ +static inline void _write_gate_lower(idt_entry_t * gate, idt_entry_t * new)static inline void _write_gate_lower(idt_entry_t *gate, idt_entry_t *new) (similar extra blanks elsewhere) Also, to make clear which of the two is the entry written, const- qualifying the other one might be a good idea. Ok
I was looking to avoid having the compiler inline this function and decide that it can merge *gate_addr and idte together, resulting in multiple writes to gate_addr. Without the volatile, the compiler is free to make this optimization, which puts us back with the racy case we are trying to avoid. The reason for avoiding the volatile function parameter is so the assertion equality can be optimized where possible.
Where possible, I prefer static inline in preference to macros because of the added type checking etc. _set_gate_lower is based on _set_gate, so I used the _set_gate style.Again, I am not overly fussed if you have a strong preference for style. (Both of these styles are mixed across the codebase and have no indication of preference in CODING_STYLE) ~Andrew
_______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |