Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933702AbeAIQBg (ORCPT + 1 other); Tue, 9 Jan 2018 11:01:36 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:58694 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932718AbeAIQBc (ORCPT ); Tue, 9 Jan 2018 11:01:32 -0500 MIME-Version: 1.0 Message-ID: <8c497050-e425-49ea-b07c-b86575b9c63e@default> Date: Tue, 9 Jan 2018 08:01:13 -0800 (PST) From: Liran Alon To: Cc: , , , , , , , Subject: Re: [PATCH 6/7] x86/svm: Set IBPB when running a different VCPU X-Mailer: Zimbra on Oracle Beehive Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8768 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801090226 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: ----- arjan@linux.intel.com wrote: > >> I'm sorry I'm not familiar with your L0/L1/L2 terminology > >> (maybe it's before coffee has had time to permeate the brain) > > > > These are standard terminology for guest levels: > > L0 == hypervisor that runs on bare-metal > > L1 == hypervisor that runs as L0 guest. > > L2 == software that runs as L1 guest. > > (We are talking about nested virtualization here) > > 1. I really really hope that the guests don't use IBRS but use > retpoline. At least for Linux that is going to be the prefered > approach. > > 2. For the CPU, there really is only "bare metal" vs "guest"; all > guests are "guests" no matter how deeply nested. So for the language > of privilege domains etc, > nested guests equal their parent. So in the scenario I mentioned above, would L1 use BTB/BHB entries inserted by L2? To me it seems that it would if IBRS takes prediction-mode into consideration. And therefore, we must issue IBPB when switching between L1 & L2. Same as happen on nVMX when switching between vmcs01 & vmcs02. -Liran