[SRU,xenial] LP#1758856 -- retpoline hinting support
mbox series

Message ID 20180326150817.GG4775@brain
State New
Headers show
Series
  • [SRU,xenial] LP#1758856 -- retpoline hinting support
Related show

Pull-request

git://git.launchpad.net/~apw/ubuntu/+source/linux/+git/review retpoline-hints/xenial

Message

Andy Whitcroft March 26, 2018, 3:08 p.m. UTC
We have been having horrible problems with the retpoline information as
recorded in the ABI changing on every update.  The below pull-request
brings in some new support utilising the upstream retpoline annotations.
As well as bringing in some new annotations where needed.

This should in time bring us to the situation where the retpoline
information for every branch is empty.  Where unannotated entries remain
they are in review and will be coverered off in later updates.  These
are not regressions.

Proposing for SRU to xenial.

-apw


The following changes since commit fc74a5c4a98418105b4b246b935e3be90d6a635c:

  UBUNTU: Ubuntu-4.4.0-117.141 (2018-03-13 11:57:37 +0100)

are available in the Git repository at:

  git://git.launchpad.net/~apw/ubuntu/+source/linux/+git/review retpoline-hints/xenial

for you to fetch changes up to 91dbb39acb847daedd4de4f34308e674ce8e3f4b:

  UBUNTU: [Config] retpoine -- switch to new format (2018-03-26 11:48:04 +0100)

----------------------------------------------------------------
  * retpoline hints: primary infrastructure and initial hints (LP: #1758856)
    - [Packaging] retpoline-extract: flag *0xNNN(%reg) branches
    - x86/speculation, objtool: Annotate indirect calls/jumps for objtool
    - x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32bit
    - x86/paravirt, objtool: Annotate indirect calls
    - x86/asm: Stop depending on ptrace.h in alternative.h
    - [Packaging] retpoline -- add safe usage hint support
    - [Packaging] retpoline-check -- only report additions
    - [Packaging] retpoline -- widen indirect call/jmp detection
    - [Packaging] retpoline -- elide %rip relative indirections
    - [Packaging] retpoline -- clear hint information from packages
    - SAUCE: modpost: add discard to non-allocatable whitelist
    - KVM: x86: Make indirect calls in emulator speculation safe
    - KVM: VMX: Make indirect call speculation safe
    - x86/boot, objtool: Annotate indirect jump in secondary_startup_64()
    - SAUCE: early/late -- annotate indirect calls in early/late initialisation
      code
    - SAUCE: vga_set_mode -- avoid jump tables
    - [Config] retpoine -- switch to new format

  * retpoline: ignore %cs:0xNNN constant indirections (LP: #1752655)
    - [Packaging] retpoline -- elide %cs:0xNNNN constants on i386

Comments

Juerg Haefliger March 28, 2018, 3:55 p.m. UTC | #1
On 03/26/2018 05:08 PM, Andy Whitcroft wrote:
> We have been having horrible problems with the retpoline information as
> recorded in the ABI changing on every update.  The below pull-request
> brings in some new support utilising the upstream retpoline annotations.
> As well as bringing in some new annotations where needed.
> 
> This should in time bring us to the situation where the retpoline
> information for every branch is empty.  Where unannotated entries remain
> they are in review and will be coverered off in later updates.  These
> are not regressions.

Tried this on top of the current update to stable 4.4.118. Had to
massage some of the patches (see below). Successfully built binary test
packages for all architectures.


> Proposing for SRU to xenial.
> 
> -apw
> 
> 
> The following changes since commit fc74a5c4a98418105b4b246b935e3be90d6a635c:
> 
>   UBUNTU: Ubuntu-4.4.0-117.141 (2018-03-13 11:57:37 +0100)
> 
> are available in the Git repository at:
> 
>   git://git.launchpad.net/~apw/ubuntu/+source/linux/+git/review retpoline-hints/xenial
> 
> for you to fetch changes up to 91dbb39acb847daedd4de4f34308e674ce8e3f4b:
> 
>   UBUNTU: [Config] retpoine -- switch to new format (2018-03-26 11:48:04 +0100)
> 
> ----------------------------------------------------------------
>   * retpoline hints: primary infrastructure and initial hints (LP: #1758856)
>     - [Packaging] retpoline-extract: flag *0xNNN(%reg) branches
>     - x86/speculation, objtool: Annotate indirect calls/jumps for objtool
>     - x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32bit
>     - x86/paravirt, objtool: Annotate indirect calls
>     - x86/asm: Stop depending on ptrace.h in alternative.h
>     - [Packaging] retpoline -- add safe usage hint support
>     - [Packaging] retpoline-check -- only report additions
>     - [Packaging] retpoline -- widen indirect call/jmp detection
>     - [Packaging] retpoline -- elide %rip relative indirections
>     - [Packaging] retpoline -- clear hint information from packages

Replaced: ... | xargs rm -> ... | xargs rm -f


>     - SAUCE: modpost: add discard to non-allocatable whitelist
>     - KVM: x86: Make indirect calls in emulator speculation safe

Skipped. Already applied via a stable update.


>     - KVM: VMX: Make indirect call speculation safe

Skipped. Already applied via a stable update.


>     - x86/boot, objtool: Annotate indirect jump in secondary_startup_64()
>     - SAUCE: early/late -- annotate indirect calls in early/late initialisation
>       code
>     - SAUCE: vga_set_mode -- avoid jump tables
>     - [Config] retpoine -- switch to new format

Typo in subject: repoline -> retpoline
Plus adjusted the <foo>.retpoline files for the the 4.4.0-117.141 abi (I
already have the start-release commit in my branch).

If you want to look at my branch:
git://git.launchpad.net/~juergh/+git/xenial-linux update-4.4.118

...Juerg

> 
>   * retpoline: ignore %cs:0xNNN constant indirections (LP: #1752655)
>     - [Packaging] retpoline -- elide %cs:0xNNNN constants on i386
>
Stefan Bader March 28, 2018, 4:03 p.m. UTC | #2
On 26.03.2018 17:08, Andy Whitcroft wrote:
> We have been having horrible problems with the retpoline information as
> recorded in the ABI changing on every update.  The below pull-request
> brings in some new support utilising the upstream retpoline annotations.
> As well as bringing in some new annotations where needed.
> 
> This should in time bring us to the situation where the retpoline
> information for every branch is empty.  Where unannotated entries remain
> they are in review and will be coverered off in later updates.  These
> are not regressions.
> 
> Proposing for SRU to xenial.
> 
> -apw
> 
> 
> The following changes since commit fc74a5c4a98418105b4b246b935e3be90d6a635c:
> 
>   UBUNTU: Ubuntu-4.4.0-117.141 (2018-03-13 11:57:37 +0100)
> 
> are available in the Git repository at:
> 
>   git://git.launchpad.net/~apw/ubuntu/+source/linux/+git/review retpoline-hints/xenial
> 
> for you to fetch changes up to 91dbb39acb847daedd4de4f34308e674ce8e3f4b:
> 
>   UBUNTU: [Config] retpoine -- switch to new format (2018-03-26 11:48:04 +0100)
> 
> ----------------------------------------------------------------
>   * retpoline hints: primary infrastructure and initial hints (LP: #1758856)
>     - [Packaging] retpoline-extract: flag *0xNNN(%reg) branches
>     - x86/speculation, objtool: Annotate indirect calls/jumps for objtool
>     - x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32bit
>     - x86/paravirt, objtool: Annotate indirect calls
>     - x86/asm: Stop depending on ptrace.h in alternative.h
>     - [Packaging] retpoline -- add safe usage hint support
>     - [Packaging] retpoline-check -- only report additions
>     - [Packaging] retpoline -- widen indirect call/jmp detection
>     - [Packaging] retpoline -- elide %rip relative indirections
>     - [Packaging] retpoline -- clear hint information from packages
>     - SAUCE: modpost: add discard to non-allocatable whitelist
>     - KVM: x86: Make indirect calls in emulator speculation safe
>     - KVM: VMX: Make indirect call speculation safe
>     - x86/boot, objtool: Annotate indirect jump in secondary_startup_64()
>     - SAUCE: early/late -- annotate indirect calls in early/late initialisation
>       code
>     - SAUCE: vga_set_mode -- avoid jump tables
>     - [Config] retpoine -- switch to new format
> 
>   * retpoline: ignore %cs:0xNNN constant indirections (LP: #1752655)
>     - [Packaging] retpoline -- elide %cs:0xNNNN constants on i386
> 
Test builds with the updated xargs rm -> xargs rm -f and updated retpoline file
updates (because -117 i386 had now content) looks good.

Acked-by: Stefan Bader <stefan.bader@canonical.com>
Juerg Haefliger April 3, 2018, 7:42 a.m. UTC | #3
Applied to xenial/master-next.

On 03/26/2018 05:08 PM, Andy Whitcroft wrote:
> We have been having horrible problems with the retpoline information as
> recorded in the ABI changing on every update.  The below pull-request
> brings in some new support utilising the upstream retpoline annotations.
> As well as bringing in some new annotations where needed.
> 
> This should in time bring us to the situation where the retpoline
> information for every branch is empty.  Where unannotated entries remain
> they are in review and will be coverered off in later updates.  These
> are not regressions.
> 
> Proposing for SRU to xenial.
> 
> -apw
> 
> 
> The following changes since commit fc74a5c4a98418105b4b246b935e3be90d6a635c:
> 
>   UBUNTU: Ubuntu-4.4.0-117.141 (2018-03-13 11:57:37 +0100)
> 
> are available in the Git repository at:
> 
>   git://git.launchpad.net/~apw/ubuntu/+source/linux/+git/review retpoline-hints/xenial
> 
> for you to fetch changes up to 91dbb39acb847daedd4de4f34308e674ce8e3f4b:
> 
>   UBUNTU: [Config] retpoine -- switch to new format (2018-03-26 11:48:04 +0100)
> 
> ----------------------------------------------------------------
>   * retpoline hints: primary infrastructure and initial hints (LP: #1758856)
>     - [Packaging] retpoline-extract: flag *0xNNN(%reg) branches
>     - x86/speculation, objtool: Annotate indirect calls/jumps for objtool
>     - x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32bit
>     - x86/paravirt, objtool: Annotate indirect calls
>     - x86/asm: Stop depending on ptrace.h in alternative.h
>     - [Packaging] retpoline -- add safe usage hint support
>     - [Packaging] retpoline-check -- only report additions
>     - [Packaging] retpoline -- widen indirect call/jmp detection
>     - [Packaging] retpoline -- elide %rip relative indirections
>     - [Packaging] retpoline -- clear hint information from packages
>     - SAUCE: modpost: add discard to non-allocatable whitelist
>     - KVM: x86: Make indirect calls in emulator speculation safe
>     - KVM: VMX: Make indirect call speculation safe
>     - x86/boot, objtool: Annotate indirect jump in secondary_startup_64()
>     - SAUCE: early/late -- annotate indirect calls in early/late initialisation
>       code
>     - SAUCE: vga_set_mode -- avoid jump tables
>     - [Config] retpoine -- switch to new format
> 
>   * retpoline: ignore %cs:0xNNN constant indirections (LP: #1752655)
>     - [Packaging] retpoline -- elide %cs:0xNNNN constants on i386
>