[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL715WKm4t=y_UZZSZkd2=QPwXL8n-KnWzBS4A-ZJLQaWb0RKQ@mail.gmail.com>
Date: Fri, 2 Jun 2023 13:58:05 -0700
From: Mingwei Zhang <mizhang@...gle.com>
To: Jim Mattson <jmattson@...gle.com>
Cc: Jon Kohler <jon@...anix.com>,
Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] KVM: x86: Use cpu_feature_enabled() for PKU instead of #ifdef
>
> As we move towards enabling PKRU on the host, due to some customer
> requests, I have to wonder if PKRU-disabled is the norm.
>
> In other words, is this a likely() or unlikely() optimization?
I think it should be likely() as PKU was introduced very early in the
Skylake-SP server cores many years ago. Today I think all recent
client CPUs should have PKU on default if I am not mistaken. So yeah,
adding a likely() probably should help prevent the compiler from
evicting this code chunk to the end of function.
Thanks.
-Mingwei
Powered by blists - more mailing lists