# Re: \[PATCH v4 6/9\] x86: prevent inline distortion by paravirt ops

- From: Juergen Gross \<jgross@suse.com\>
- Date: 2018-06-19 15:09:32 
- List: virtualization
- Page: https://ratatoskr.run/virtualization/2018/06/5311486
- Thread: https://ratatoskr.run/lkml/2018/06/5306347/t.md

```text
On 12/06/18 13:50, Nadav Amit wrote:
> GCC considers the number of statements in inlined assembly blocks,
> according to new-lines and semicolons, as an indication to the cost of
> the block in time and space. This data is distorted by the kernel code,
> which puts information in alternative sections. As a result, the
> compiler may perform incorrect inlining and branch optimizations.
> 
> The solution is to set an assembly macro and call it from the inlined
> assembly block. As a result GCC considers the inline assembly block as
> a single instruction.
> 
> The effect of the patch is a more aggressive inlining, which also
> causes a size increase of kernel.
> 
>    text	   data	    bss	    dec	    hex	filename
> 18147336 10226688 2957312 31331336 1de1408 ./vmlinux before
> 18162555 10226288 2957312 31346155 1de4deb ./vmlinux after (+14819)
> 
> Static text symbols:
> Before:	40053
> After:	39942	(-111)
> 
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Alok Kataria <redacted>
> Cc: Thomas Gleixner <redacted>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: <redacted>
> 
> Signed-off-by: Nadav Amit <redacted>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen
```
