[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] x86/PV: issue branch prediction barrier when switching 64-bit guest to kernel mode


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 13 Sep 2022 18:05:30 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Vj1hov6fb5jl/tl44YCiMk4xrRK/PezhTGj9DusRxbI=; b=k/Df3TzgK6QZpGTvCvCiIjVjl5/kWX8uqUFKYQqFULtc+Hh627ORCL6AoMWK3K95wwZ+lhN8X14z01N2CtlDMXy5FAF4vPjmyM/w618QIceorP6+0EOop9VsDS9oZN+O7WcnAYp1KKEqcfGQMJIrEQM3lLWeFQLT0919pOhFzBc7N8qYJcr11gg2a5Tn+6RsfFDqEylJLm07VfPfcxoHeXljiMchBIFoe2L9NdRsFctMJxvohHcpx55yVt5TcJaqzCS6NxxolRQaRnh3EN6W8wSjz/02+yeHOFiJZrbcsouf4LnbTLIFa2LciqN0U+bbu6QTrcFTB5KeI542fE/Sgg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hXHbWun0SNX/d0TasIRlMI209ilhKtKMWOdB8yAoQw3IJaLCbUzBDaSNv2k0hlsNtVBl6StHm7kh1frCDVMbGLUUivc6vNMDCaNmCW2IstBWbQlsylXRbRz9lO49X6gDuYqTvkGMu0ai3QLqQdHhvTP/0pXEX9mvZKQub4G0S5I+P2d2EBlz/cA3W37Ue4GTaeFKxK39TdpoqMrM0JI3AIPdGRzyZHBRLeaM3JE+ZNv0sApbyKFHYropXC31eYr1sAptabs9edoSJO0bpznw/sUj2zCMgN0au3XTb7U4kOSs666oPYKB6zIrEccq4zwyFTamWlKDTlcrU7mUCfcm2w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 13 Sep 2022 16:05:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.09.2022 17:41, Roger Pau Monné wrote:
> On Tue, Jul 19, 2022 at 02:55:17PM +0200, Jan Beulich wrote:
>> Since both kernel and user mode run in ring 3, they run in the same
>> "predictor mode". While the kernel could take care of this itself, doing
>> so would be yet another item distinguishing PV from native. Additionally
>> we're in a much better position to issue the barrier command, and we can
>> save a #GP (for privileged instruction emulation) this way.
>>
>> To allow to recover performance, introduce a new VM assist allowing the guest
>> kernel to suppress this barrier.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>> ---
>> v2: Leverage entry-IBPB. Add VM assist. Re-base.
>> ---
>> I'm not entirely happy with re-using opt_ibpb_ctxt_switch here (it's a
>> mode switch after all, but v1 used opt_ibpb here), but it also didn't
>> seem very reasonable to introduce yet another command line option. The
>> only feasible alternative I would see is to check the CPUID bits directly.
> 
> Likely needs a mention in xen-command-line.md that the `ibpb` option
> also controls whether a barrier is executed by Xen in PV vCPU context
> switches from user-space to kernel.  The current text only mentions
> vCPU context switches.

Andrew and I actually discussed this perhaps better having a separate
control.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.