Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1787477iob; Fri, 29 Apr 2022 12:53:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRTzrlj78aw4RCalXOOPLp5gdQfkCLi1rr930hWsRpybBROg/nBdLYU603Y6ifydFQtYfp X-Received: by 2002:a05:6512:c01:b0:448:6aec:65c5 with SMTP id z1-20020a0565120c0100b004486aec65c5mr590188lfu.193.1651262021665; Fri, 29 Apr 2022 12:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651262021; cv=none; d=google.com; s=arc-20160816; b=Vf0yTKM/ArG1wdlsnTynLcg5utPosgFNtiRI0LQ5qgg4R/+78s8Cd5iVlEyxx1LDAT yMcnsEYc0mz5WuvzXcxuiB99SJerhEU6CXbDl10c4d5z1alfsryLvrNw0Pk7Nqu2MbSj 6SFmCtixrLr/EZ6k5aXOhAOB2ijWAWWPvDZYQiJuM438o+IwZDxmLeXyFNLWUCIj2pJR /a+tEey2+oKSdPh32cCRZBFfL7PC5sEuX5PMlYLFkea0PQc9PmI09s/iyfIylSYdfYnb JmFaJPaXuRLEb9UwD3XmVxTiq6lmGfVByrsGzw7tqEPD8cCWUfaB0l7FjLYhXexRJuss LIRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nna9CBQPo5PQdjexXCZm9F8VHeCuCj+Y77aOAoFRonk=; b=S7ct+RRUXdCWKiZx5sOO059bLziyIQNPz5Ka2nnHtTflHkGr9Ept3xui04p/LaamDd frIvjzvgpS1PJCpoT3AhYHjxKIuT1WfuMdRs3htIU6zrF38UWlIFCGJ47G7bf9/OSV40 GDCAK+l/Nuq9xX8bfRfR91pwV82flhJt32wd0gYus0YQzEU2N5j/vFDUGiJzZ+AdW6av e6sGMUMkUteWyyLzNGYRWx+kw3ExFVR/fYWgX048Dvvy2/HVYqqOTPbwSUhBBaakSUaD RCk2reMI1bPsjlqnlMQiuPW5lvO32VWlLGgQtnMnd8xa5iRoqJGdZBQYt8myAKO+n+uG i0xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=pxCCzpFB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a05651c055000b0024b662591c2si9258661ljp.16.2022.04.29.12.53.12; Fri, 29 Apr 2022 12:53:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=pxCCzpFB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380336AbiD2TgE (ORCPT + 99 others); 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> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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