From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752173AbcFFPsB (ORCPT ); Mon, 6 Jun 2016 11:48:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40203 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805AbcFFPsA (ORCPT ); Mon, 6 Jun 2016 11:48:00 -0400 Subject: Re: [PATCH 1/2] x86/entry: Avoid interrupt flag save and restore To: Andy Lutomirski References: <1464611414-12379-1-git-send-email-pbonzini@redhat.com> <1464611414-12379-2-git-send-email-pbonzini@redhat.com> Cc: Thomas Gleixner , "linux-kernel@vger.kernel.org" , Ingo Molnar , "H. Peter Anvin" , X86 ML , Rik van Riel , Peter Zijlstra From: Paolo Bonzini Message-ID: <0e02e304-a226-a35c-1109-25a35d4eae67@redhat.com> Date: Mon, 6 Jun 2016 17:47:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 06 Jun 2016 15:47:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/06/2016 07:07, Andy Lutomirski wrote: > On May 30, 2016 5:30 AM, "Paolo Bonzini" wrote: >> >> 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. > >> +/* Called with interrupts disabled. */ >> +static inline void __user_enter(void) >> +{ >> + if (context_tracking_is_enabled()) >> + __context_tracking_enter(CONTEXT_USER); >> + >> +} > > Would user_enter_irqs_off be a better name? I'm just mimicking __context_tracking_enter and vs. context_tracking_enter. So it is at least consistent with those functions. The guest ones are not quite as consistent. I can fix that later, there's no reason also to have guest context tracking split between include/linux/context_tracking.h and include/linux/kvm_host.h. Thanks, Paolo