[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 5/5] x86/traps: Clean up diagnostics



On 22/11/2021 09:08, Jan Beulich wrote:
> On 19.11.2021 19:21, Andrew Cooper wrote:
>> do{_reserved,}_trap() should use fatal_trap() rather than opencoding part of
> Nit: That's do{_unhandled,}_trap() now.

Ah yes.  Will fix.

>> --- a/xen/arch/x86/traps.c
>> +++ b/xen/arch/x86/traps.c
>> @@ -759,21 +759,7 @@ static int nmi_show_execution_state(const struct 
>> cpu_user_regs *regs, int cpu)
>>      return 1;
>>  }
>>  
>> -const char *trapstr(unsigned int trapnr)
>> -{
>> -    static const char * const strings[] = {
>> -        "divide error", "debug", "nmi", "bkpt", "overflow", "bounds",
>> -        "invalid opcode", "device not available", "double fault",
>> -        "coprocessor segment", "invalid tss", "segment not found",
>> -        "stack error", "general protection fault", "page fault",
>> -        "spurious interrupt", "coprocessor error", "alignment check",
>> -        "machine check", "simd error", "virtualisation exception"
>> -    };
>> -
>> -    return trapnr < ARRAY_SIZE(strings) ? strings[trapnr] : "???";
>> -}
>> -
>> -static const char *vec_name(unsigned int vec)
>> +const char *vec_name(unsigned int vec)
> Is this perhaps too ambiguous a name for a non-static function? exn_vec_name()
> at least, maybe?

"exception" has the same problem that "trap" has.  It's actively
incorrect naming.

vec_name() is already less bad as a global than trapstr() was, so I
don't consider this an issue.  I could expand it to vector_name(), but
that would gain several more hunks in the patch.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.