Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1305157

Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling options

From Brian Gerst <brgerst@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling options
Date 2016-01-09 04:50 +0100
Message-ID <qOSHo-88e-5@gated-at.bofh.it> (permalink)
References <qOPq9-5WM-3@gated-at.bofh.it> <qOPq9-5WM-11@gated-at.bofh.it> <qOQYV-6P7-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Jan 8, 2016 at 8:52 PM, Andy Lutomirski <luto@amacapital.net> wrote:
> On Fri, Jan 8, 2016 at 12:49 PM, Tony Luck <tony.luck@intel.com> wrote:
>> Huge amounts of help from  Andy Lutomirski and Borislav Petkov to
>> produce this. Andy provided the inspiration to add classes to the
>> exception table with a clever bit-squeezing trick, Boris pointed
>> out how much cleaner it would all be if we just had a new field.
>>
>> Linus Torvalds blessed the expansion with:
>>   I'd rather not be clever in order to save just a tiny amount of space
>>   in the exception table, which isn't really criticial for anybody.
>>
>> The third field is a simple integer indexing into an array of handler
>> functions (I thought it couldn't be a relative pointer like the other
>> fields because a module may have its ex_table loaded more than 2GB away
>> from the handler function - but that may not be actually true. But the
>> integer is pretty flexible, we are only really using low two bits now).
>>
>> We start out with three handlers:
>>
>> 0: Legacy - just jumps the to fixup IP
>> 1: Fault - provide the trap number in %ax to the fixup code
>> 2: Cleaned up legacy for the uaccess error hack
>
> I think I preferred the relative function pointer approach.
>
> Also, I think it would be nicer if the machine check code would invoke
> the handler regardless of which handler (or class) is selected.  Then
> the handlers that don't want to handle #MC can just reject them.
>
> Also, can you make the handlers return bool instead of int?

I'm hashing up an idea that could eliminate alot of text in the .fixup
section, but it needs the integer handler method to work.  We have
alot of fixup code that does "mov $-EFAULT, reg; jmp xxxx".  If we
encode the register in the third word, the handler can be generic and
no fixup code for each user access would be needed.  That would
recover alot of the memory used by expanding the exception table.

--
Brian Gerst

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v8 0/3] Machine check recovery when kernel accesses poison Tony Luck <tony.luck@intel.com> - 2016-01-09 01:20 +0100
  [PATCH v8 1/3] x86: Expand exception table to allow new handling  options Tony Luck <tony.luck@intel.com> - 2016-01-09 01:20 +0100
    Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling options Andy Lutomirski <luto@amacapital.net> - 2016-01-09 03:00 +0100
      Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling options Brian Gerst <brgerst@gmail.com> - 2016-01-09 04:50 +0100
        Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling options Brian Gerst <brgerst@gmail.com> - 2016-01-09 05:40 +0100
          Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling options Andy Lutomirski <luto@amacapital.net> - 2016-01-09 07:40 +0100
            Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling options Brian Gerst <brgerst@gmail.com> - 2016-01-12 00:10 +0100
              Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling options Andy Lutomirski <luto@amacapital.net> - 2016-01-12 00:30 +0100
              RE: [PATCH v8 1/3] x86: Expand exception table to allow new  handling options "Luck, Tony" <tony.luck@intel.com> - 2016-01-12 00:50 +0100
      Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling options Tony Luck <tony.luck@gmail.com> - 2016-01-09 18:50 +0100
        Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling options Andy Lutomirski <luto@amacapital.net> - 2016-01-09 19:10 +0100
          Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling options Tony Luck <tony.luck@gmail.com> - 2016-01-09 21:00 +0100
            Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling options Andy Lutomirski <luto@amacapital.net> - 2016-01-09 23:40 +0100
              Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling options Tony Luck <tony.luck@gmail.com> - 2016-01-10 02:20 +0100
      Re: [PATCH v8 1/3] x86: Expand exception table to allow new handling  options "Luck, Tony" <tony.luck@intel.com> - 2016-01-11 01:30 +0100
  [PATCH v8 2/3] x86, mce: Check for faults tagged in  EXTABLE_CLASS_FAULT exception table entries Tony Luck <tony.luck@intel.com> - 2016-01-09 01:20 +0100

csiph-web