[SRU,trusty] LP#1758856 -- retpoline hint support
mbox series

Message ID 20180326150823.GH4775@brain
State New
Headers show
Series
  • [SRU,trusty] LP#1758856 -- retpoline hint support
Related show

Pull-request

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

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 trusty.

-apw


The following changes since commit 6dfee0a4204e66f34efb55ac4a854859424eb8c6:

  UBUNTU: Ubuntu-3.13.0-144.193 (2018-03-15 17:13:36 +0100)

are available in the Git repository at:

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

for you to fetch changes up to a220af364c4c6f8ed6b66913a0d16aef412a005f:

  UBUNTU: [Config] retpoine -- switch to new format (2018-03-26 11:47:29 +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

Kleber Souza April 4, 2018, 11:05 a.m. UTC | #1
On 03/26/18 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 trusty.
> 
> -apw
> 
> 
> The following changes since commit 6dfee0a4204e66f34efb55ac4a854859424eb8c6:
> 
>   UBUNTU: Ubuntu-3.13.0-144.193 (2018-03-15 17:13:36 +0100)
> 
> are available in the Git repository at:
> 
>   git://git.launchpad.net/~apw/ubuntu/+source/linux/+git/review retpoline-hints/trusty
> 
> for you to fetch changes up to a220af364c4c6f8ed6b66913a0d16aef412a005f:
> 
>   UBUNTU: [Config] retpoine -- switch to new format (2018-03-26 11:47:29 +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

This commit has hit upstream with sha1
a14bff131108faf50cc0cf864589fd71ee216c96. We can fix the commit while
applying the patch.

>     - 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

There's a typo on the commit title, which can also be fixed.

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

Changes look good to me. Compiled tested with the follow-up fixes ("[SRU
trusty/xenial/artful/bionic/unstable] LP#1758856/LP#1760876 -- retpoline
hints cleanups") on all supported architectures.

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Stefan Bader April 5, 2018, 8:18 a.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 trusty.
> 
> -apw
> 
> 
> The following changes since commit 6dfee0a4204e66f34efb55ac4a854859424eb8c6:
> 
>   UBUNTU: Ubuntu-3.13.0-144.193 (2018-03-15 17:13:36 +0100)
> 
> are available in the Git repository at:
> 
>   git://git.launchpad.net/~apw/ubuntu/+source/linux/+git/review retpoline-hints/trusty
> 
> for you to fetch changes up to a220af364c4c6f8ed6b66913a0d16aef412a005f:
> 
>   UBUNTU: [Config] retpoine -- switch to new format (2018-03-26 11:47:29 +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
> 

Looks like the set seen for Xenial. Likely needs some refresh to adapt for file
changes.

Acked-by: Stefan Bader <stefan.bader@canonical.com>
Kleber Souza April 5, 2018, 10:12 a.m. UTC | #3
On 03/26/18 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 trusty.
> 
> -apw
> 
> 
> The following changes since commit 6dfee0a4204e66f34efb55ac4a854859424eb8c6:
> 
>   UBUNTU: Ubuntu-3.13.0-144.193 (2018-03-15 17:13:36 +0100)
> 
> are available in the Git repository at:
> 
>   git://git.launchpad.net/~apw/ubuntu/+source/linux/+git/review retpoline-hints/trusty
> 
> for you to fetch changes up to a220af364c4c6f8ed6b66913a0d16aef412a005f:
> 
>   UBUNTU: [Config] retpoine -- switch to new format (2018-03-26 11:47:29 +0100)
> 

Applied to trusty/master-next branch, with the following fixups:

> ----------------------------------------------------------------
>   * 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

Changed the commit message for the upstream one, and added a reference
to the upstream sha1.

>     - 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

I did a ff merge to master-next, which applied the above patch to the
correct path, which seems to have done the right thing and the content
of the files also looks correct. I also fixed the typo on the subject.

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


Thanks,
Kleber