Files
OrangePi_CM5/include/linux
Paolo Bonzini 2e9d1e150a x86/entry: Avoid interrupt flag save and restore
Thanks to all the work that was done by Andy Lutomirski and others,
enter_from_user_mode() and prepare_exit_to_usermode() are now called only with
interrupts disabled.  Let's provide them a version of user_enter()/user_exit()
that skips saving and restoring the interrupt flag.

On an AMD-based machine I tested this patch on, with force-enabled
context tracking, the speed-up in system calls was 90 clock cycles or 6%,
measured with the following simple benchmark:

    #include <sys/signal.h>
    #include <time.h>
    #include <unistd.h>
    #include <stdio.h>

    unsigned long rdtsc()
    {
        unsigned long result;
        asm volatile("rdtsc; shl $32, %%rdx; mov %%eax, %%eax\n"
                     "or %%rdx, %%rax" : "=a" (result) : : "rdx");
        return result;
    }

    int main()
    {
        unsigned long tsc1, tsc2;
        int pid = getpid();
        int i;

        tsc1 = rdtsc();
        for (i = 0; i < 100000000; i++)
            kill(pid, SIGWINCH);
        tsc2 = rdtsc();

        printf("%ld\n", tsc2 - tsc1);
    }

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kvm@vger.kernel.org
Link: http://lkml.kernel.org/r/1466434712-31440-2-git-send-email-pbonzini@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-07-10 13:33:02 +02:00
..
…
2016-03-04 23:50:27 -06:00
…
…
…
…
…
…
…
…
2015-12-23 08:37:10 -07:00
…
…
…
…
…
…
…
…
…
…
2016-03-15 16:55:16 -07:00
…
…
…
…
2016-06-07 22:07:09 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
2016-02-16 13:04:58 -05:00
2016-06-01 14:56:57 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-05-31 22:12:43 +05:30
…
…
…
…
…
…
…
…
…
…
…
…
2016-05-17 15:48:12 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2015-12-28 13:41:50 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2015-11-25 09:22:00 -07:00
2016-04-06 13:18:19 +02:00
…
2016-03-11 14:58:58 -05:00
…
…
…
2015-10-23 05:44:28 -07:00
…
2016-02-11 09:59:22 -05:00
…
…
…
…
…
…
…
2016-03-22 15:36:02 -07:00
…
…
…
…
…
…
…
…
2016-05-11 19:31:40 -04:00
2016-05-11 22:37:54 +02:00
…
…
…
2016-01-28 14:19:12 -08:00
…
…
…
…
…
…
…
2016-03-22 15:36:02 -07:00
…
…
…
2016-03-22 15:36:02 -07:00
…
…
…
…
…
…
…
…
…
…
2016-01-15 17:56:32 -08:00
…
…
…
…
…
…
…
…
…
…
2016-03-09 15:43:42 -08:00
…
…
…
…
…
…
…
…
…
2016-05-03 15:07:35 -07:00
2016-01-15 17:56:32 -08:00
2016-05-19 19:12:14 -07:00
…
…
…
2015-10-27 18:55:31 -07:00
…
2016-05-26 15:35:44 -07:00
…
…
2015-10-20 22:10:45 +08:00
…
…
…
…
…
…
…
…
2016-05-17 15:48:12 -04:00
2016-05-17 15:47:55 -04:00
…
…
2016-05-23 17:04:14 -07:00
2016-04-25 15:09:11 -04:00
…
…
2016-02-16 13:04:58 -05:00
…
…
…
2016-05-02 09:00:56 -05:00
…
…
…
…
…
…
2016-05-23 17:04:14 -07:00
2016-05-19 19:12:14 -07:00
…
…
…
…
…
…
…
…
2016-02-11 18:35:48 -08:00
2016-02-11 18:35:48 -08:00
…
2016-03-14 15:43:11 -04:00
…
…
…
…
…
…
…
2016-02-16 13:04:58 -05:00
…
…
2015-10-22 08:59:18 -07:00
…
2016-06-23 18:37:05 +02:00
…
2016-03-17 15:09:34 -07:00
…
…
…
…
…
…
2016-03-22 15:36:02 -07:00
…
2016-03-22 15:36:02 -07:00
2016-03-22 15:36:02 -07:00
…
…
…
2016-01-10 22:13:15 -05:00
…
2016-05-26 00:04:58 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-01-04 16:11:11 -05:00
…
…
2016-05-19 19:12:14 -07:00
2016-05-19 19:12:14 -07:00
…
…
…
…
…
2016-05-08 23:46:14 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-05-20 17:58:30 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
2016-05-19 19:12:14 -07:00
…
…
…
…
2015-10-19 01:01:21 +02:00
…
2016-05-23 17:04:14 -07:00
…
2016-04-07 16:53:29 -04:00
…
2015-11-23 09:44:58 +01:00
…
…
…
2016-05-20 17:58:30 -07:00
…
2016-02-22 16:10:08 -07:00
…
…
…
…
…
…
…
…
…
2015-12-03 07:24:29 -08:00
…
…
…
…
…
…
…
…