# Re: \[PATCH v3 2/4\] x86/syscalls: Specific usage of verify\_pre\_usermode\_state

- From: H. Peter Anvin \<hpa@zytor.com\>
- Date: 2017-03-14 17:53:36 
- List: linux-api
- Page: https://ratatoskr.run/linux-api/2017/03/13329529
- Thread: https://ratatoskr.run/linux-api/2017/03/13329513/t.md

```text
On 03/14/17 09:51, Thomas Garnier wrote:
>>
>> I wanted to comment on that thing: why on earth isn't
>> verify_pre_usermode_state() an inline?  Making it an out-of-line
>> function adds pointless extra overhead to the C code when we are talking
>> about a few instructions.
> 
> Because outside of arch specific implementation it is called by each
> syscall handler. it will increase the code size a lot.
> 

Don't assume that.  On a lot of architectures a function call can be
more expensive than a simple compare and branch, because the compiler
has to assume a whole bunch of registers are lost at that point.

Either way, don't penalize the common architectures for it.  Not okay.

	-hpa
```
