[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: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Tue, 13 Sep 2022 18:14:37 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=lODT+xRofwDysBHrVHJIA4SslJBYbaTiJAewzTxPt/o=; b=V7jawNwLeitU1i5rXYxWcDm2MuIQkK6ttoBjgqlqbmM1bI60PIiv/xgaoMTkzPnbxdCE87K4SinkisRf/qJgU79V1osMNLjkeDPwNcZAajldYVnhB0dMcXq+MeWQ3dE9kMFAYlnVagV/o8BgKJubmbIfehxA/+wnv400qkQTw5iEIxR/X1N4wVzQpnqPgYQdy3xYyJNNgyRysImiFgIBmZ0FXA/+OqcUU+qFAkj6ueSkmUhyiidwSFVHBsCQNFVk/lvwM/HtL68cJde/vj3xUYCXQVXGERifTzjf0DnECanEXZ/ZohyT19dCOjFbXXqGZJB0snRH4Jf8F4f4jleHSw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LvzeQBFks8aF6QPWvZNc86Ubn6mpIWgmN0WnW7tqVXdyZueW+7W65I2VzX0LBee9k4h8SM8CZZKivVNX9LoFoZIXAU5fTrv96Rqynosev1qBOJg2Olxe61dXh2j/W8e6nELhb2c9IniP9gCCPyE7u8ivvxLNwF0zaGrE/13KsTLN+CSQPbBrrsu+z9eA8blFJeKxNLg5+rWkPjfb3wTRDVlSfinI7npJD9WYlDymgrvDF3eTkF/BRc5RHj9koqE8syZQU2RZDy4hbFrePNYpO75u7YRyfNsEHvWQ0UX5Zsg5TQijDE2x7OiPxgLYjbDjLibuwjSAJifjqDQ9fVTGGg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Tue, 13 Sep 2022 16:15:00 +0000
- Ironport-data: A9a23:Oj245KvvikftC5fNe4GKGNA+6OfnOphVZjiD+MifNrXfiWXw2xPKv3m3sVAiTtXTOunIiNcj/pQV0QW/FX7A0JDBsTlM4+R2O9Dsiwl4E/wTnNjGyDgUMwsuPx56qaV/emZZ+Jjuyk2ZKT6bzz/j6veV7bI5WEyD2FjwfmxG3eKY5KwXd1czhiPNOzqlfXysJFMH7M0/JMNjXWMAaMKX+WDX5YIwXOxuf7LIwZwrGtqwnwqIX9ZRK9nLgYEOOGlXOFT2flsYxv2tXyvWBwJlAMZ8yK7cxggc0XVX6vqZ7qee/fnbrZ2MWpWfJHPIg62OS82At9wtWSUBvQ3WYlDqjsDCmx05D/9sySEWtfheoSWmR5pEfadPJ4LyHT0BLw5vEOHwK4h+hQTbEhwx7rF52QmdeHg7tx1j9G1SbyYjEyqC4QZ4f9apBHgabr7TvJ7aP8JSQ8S0gpkjfh2uOWee4A6ZAZ2JYFyleyb8dC5ikRcH/tUGoTZ49aJN0hBtselWUcz/f8hC8BzvUwW1lqWqDeQZIhMyGQhy9wpJzUmyMDvYf/D2xJLityLA8cJ0KvgIR6J4AbNvpSynzo1DQ6ZI1D71CQZ98mdhGd79xlpQkRaiNkQ46qj5fLMzH6iinaavc/FtTpV6CdTq/w5zfQlGIn1eIYH1LCi+dAj5phbsEvmeg2Xcly8MZfGusuIXwHfIuImaOqtTB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c0/0z7XPdbzvxQDXSTSbM9bKuudRLR8GWPJM5pwaavFxnusll8yz9Jbh48xJMfftyofBvzcqRnTIREW4M04X7VYIieIbJm4kpUDG+EJt0tszwTjzPTvkpenZv7v1ffqiEeAzhvQTc4YdieyOgw40rtOfqk51WVhtrj9D+CMMNQP+WHgsbOK/gm1y+7hHGqSHRx6CV4GWIWB/yzlOusWQr1O/XGJsY4714wCTcRfhUMwsH3bZzliursNC6yumopR5Ow7KTSm/+tFwc7Ot0zFnP4/oWnZOcG3u75rVH3d3ZsVpwsXB5FaiBsV2Jb4vdgB/JyUk7cdiErDAJLhuinWb2vSE7zKBKmBtPHdN2QZbe2QlUq3YGyLWahKmeTgrtyMJMeT5wVtZPKXjZ7xjexYUXjR5HKT+CqCsoZgWgfg6vcjmLxWpxxBJXRgvPCMAZ+cfdD0kHCh1QY4qPZBY2m+ARYyF//EkdS0i93fQdX//59QHWzsGfGBGKal4jDhwlAe3+FS9ieacEG8yLOIJ+9a+dMV2GQZl1lO5p941B87HUapu3B6kFdcHe7oc8zZ59+9SGh0dY2Fodlixo4gr0e4w==
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Tue, Sep 13, 2022 at 06:05:30PM +0200, Jan Beulich wrote:
> 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.
OK, didn't know there was some feedback here already. A separate
control would indeed be clearer. I guess a new patch will appear
then?
Thanks, Roger.
|