From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6369C433EF for ; Fri, 29 Apr 2022 19:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380338AbiD2TgE (ORCPT ); Fri, 29 Apr 2022 15:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380316AbiD2TgA (ORCPT ); Fri, 29 Apr 2022 15:36:00 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 415587560B; Fri, 29 Apr 2022 12:32:41 -0700 (PDT) Received: from zn.tnic (p5de8eeb4.dip0.t-ipconnect.de [93.232.238.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id CE5891EC04AD; Fri, 29 Apr 2022 21:32:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1651260755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nna9CBQPo5PQdjexXCZm9F8VHeCuCj+Y77aOAoFRonk=; b=pxCCzpFBWH45lDHBL3Agrpu0tz38S5FnS1E78+JDahCXr/AgakNfG0sBAwOPK/CFqBO9f3 HiHwX/vdJLn5HhsC3Ja9Z7e8LId9cSnw+SAHZKIWIyfso/bwol5nBhgqsBitYowZy6uG5J iVce5CBstNkh+56eEW28YQwI/7k6jk0= Date: Fri, 29 Apr 2022 21:32:33 +0200 From: Borislav Petkov To: Jon Kohler Cc: Thomas Gleixner , Ingo Molnar , Dave Hansen , "x86@kernel.org" , "H. Peter Anvin" , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Josh Poimboeuf , Peter Zijlstra , Balbir Singh , Kim Phillips , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , Andrea Arcangeli , Kees Cook , Waiman Long Subject: Re: [PATCH v3] x86/speculation, KVM: only IBPB for switch_mm_always_ibpb on vCPU load Message-ID: References: <20220422162103.32736-1-jon@nutanix.com> <645E4ED5-F6EE-4F8F-A990-81F19ED82BFA@nutanix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <645E4ED5-F6EE-4F8F-A990-81F19ED82BFA@nutanix.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 29, 2022 at 05:31:16PM +0000, Jon Kohler wrote: > Selftests IIUC, but there may be other VMMs that do funny stuff. Said > another way, I don’t think we actively restrict user space from doing > this as far as I know. "selftests", "there may be"?! This doesn't sound like a real-life use case to me and we don't do changes just because. Sorry. > The paranoid aspect here is KVM is issuing an *additional* IBPB on > top of what already happens in switch_mm(). Yeah, I know how that works. > IMHO KVM side IBPB for most use cases isn’t really necessarily but > the general concept is that you want to protect vCPU from guest A > from guest B, so you issue a prediction barrier on vCPU switch. > > *however* that protection already happens in switch_mm(), because > guest A and B are likely to use different mm_struct, so the only point > of having this support in KVM seems to be to “kill it with fire” for > paranoid users who might be doing some tomfoolery that would > somehow bypass switch_mm() protection (such as somehow > sharing a struct). Yeah, no, this all sounds like something highly hypothetical or there's a use case of which you don't want to talk about publicly. Either way, from what I'm reading I'm not in the least convinced that this is needed. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette