Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1971338rdg; Sun, 13 Aug 2023 04:08:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLuUrvBQfuRclM3VEY5LOoPwsOeSmtiZ3rq+l6OP72J6JwHcKpuZ4znM+TmdMGKtlfXyiU X-Received: by 2002:a05:6a20:3d95:b0:13e:43df:d043 with SMTP id s21-20020a056a203d9500b0013e43dfd043mr7267273pzi.9.1691924935625; Sun, 13 Aug 2023 04:08:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691924935; cv=none; d=google.com; s=arc-20160816; b=beQ6l5ZPVYO5BA43CwkHwEBzA9G3pV/+7fW5KWjKmhlW86JTkn9KcYmt3ZXSAje/nu 9mk3HkcqhFrW6R+Do4jBa1TqEmZ78HOpGM9bTPlN/S/V10Ro7JeOty6ekKMfjLeubroL 97XA3VMp4S2d0WLqcglIgdfyk26gjDp0IwC7wq9s3JCoJTHF9Y9OQbd2Nx4HwNR6n168 egwH5im8DCOh3bq9YYb3VHjWzvuPzEAr08jBI2KzssezCP+hrfZTdPECNXx/h3aqdeJ0 mIkEjipq1gQQfEnOPVFrULNS2xGd8Cf1tSc7Po7LXqa1n7plThx3DhnRMjKia8fjR0/G L3wg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5jP41Q4Vr+7H7XwGqAj1QKEni1G/GvoMbtbYY6td0wM=; fh=o4ocl7M6wwzFplZFgyQ1vRQVmBcm9jp/U8HM00c8OpM=; b=n0IqD96a7UsmzVl62EkpqbO6yaLJ0pgFKvlez1mdzrF+cBv4aPkx4IqP3GyFVsOoxB 3/k9KOg38TUgfHj+cb6OS7gY8brFYhOHbQP3D3LvKtcq3bBQMXtOm39b11zmhhSc0hv6 KsHQwBlvLb2+2oECJFN2TaodCiZsSz8q/GyuGcYJzstfzFwWdsFd9MQq6ZGobtQDVjy9 zDLbFQyL6wwbEvpK+LhF7WOIKNTJHBQhwpEeVqe4Woj4TiVAcbDONx0YaXSylce7E1r3 rfCx+xnfJPDW7t2ToYbGhOC3+spM3JnKf3aZc6bFZFu3Jt9/kQ1wL2av4lzMCLwFY8yW MQFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=Q4MgC1vO; 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 m11-20020a056a00080b00b006871817f76dsi6494536pfk.202.2023.08.13.04.08.42; Sun, 13 Aug 2023 04:08:55 -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=alien8 header.b=Q4MgC1vO; 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 S229799AbjHMKhN (ORCPT + 99 others); Sun, 13 Aug 2023 06:37:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjHMKhM (ORCPT ); Sun, 13 Aug 2023 06:37:12 -0400 Received: from mail.alien8.de (mail.alien8.de [IPv6:2a01:4f9:3051:3f93::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6B811709 for ; Sun, 13 Aug 2023 03:37:14 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 0853640E0195; Sun, 13 Aug 2023 10:37:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id kZ0SZAdvw8Qf; Sun, 13 Aug 2023 10:37:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1691923029; bh=5jP41Q4Vr+7H7XwGqAj1QKEni1G/GvoMbtbYY6td0wM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q4MgC1vOTfOasLwcyhQaC57uQc5tIJ0FMVvEOgILPVoyT3QAx8C1PGXjhs7O/bH+V uEWo9MO7TTWf5gdEugHL5oWbyEsihR05apf8bFXfwPlzVuhY8Wfq4n3agA0iQNOatt 9rf3XqgUcQgqakaoI1nuNc0plvTR8xfkaKreydokR90jQ1wmD4Hx85pw8fF6VqcySK 1tR9ia/hV6cmS+gADRPFxYLJtvjZa5U6A5LhC2rdJTXKIA3LfBfaIxScEgFra6oYJ5 y/v8eUbKG9Bz8iAgC3MRlL31RScEIJBtbiIBMFXsQJsHHTmsSFlR6mkY8IedoHnspO amiSnQnyCLpnAcwvsrIwwawlW+vditnhVLFRgCkmsj5Dhp+0wHQ6yPJoV/zQFTQl/o MpOP8TbY+RjKdIDAAPdTrnEaRuNdq2PP00xZg3YxXjCVCSAuV/nqslxNeuYXL+vHYt pViSkGyJTZwVh5LZGFBtKV80upgoXhurx9OSjJX8iUZyC611T6QfWUAphMQQuIqjZ3 6gfkpYW6s7UsbzN4jAStc5hVW8TR23sQOokENXDyOVtgiObND31mki9VUBROc/gUx1 9XQphUVJ4z3qJQsmIwHZ1H+ufxO5lOhJYJQt8X6YM3LGh6KlInq1NP+UnIdC8v9wSY WB35CxhIxH6GiILgYZdjy8D4= Received: from zn.tnic (pd9530d32.dip0.t-ipconnect.de [217.83.13.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 20F3C40E00B0; Sun, 13 Aug 2023 10:37:02 +0000 (UTC) Date: Sun, 13 Aug 2023 12:36:57 +0200 From: Borislav Petkov To: Peter Zijlstra Cc: x86@kernel.org, linux-kernel@vger.kernel.org, David.Kaplan@amd.com, Andrew.Cooper3@citrix.com, jpoimboe@kernel.org, gregkh@linuxfoundation.org Subject: Re: [RFC][PATCH 07/17] x86/cpu/kvm: Provide UNTRAIN_RET_VM Message-ID: <20230813103657.GCZNiySRVa8TcT7SAW@fat_crate.local> References: <20230809071218.000335006@infradead.org> <20230809072200.922634286@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230809072200.922634286@infradead.org> 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 Wed, Aug 09, 2023 at 09:12:25AM +0200, Peter Zijlstra wrote: > With the difference being that UNTRAIN_RET_VM uses > X86_FEATURE_IBPB_ON_VMEXIT instead of X86_FEATURE_ENTRY_IBPB. > > This cures VMEXIT doing potentially unret+IBPB or double IBPB. Can't - I have a separate flag for that and I set it only when !IBPB: case SRSO_CMD_IBPB_ON_VMEXIT: if (IS_ENABLED(CONFIG_CPU_SRSO)) { if (!boot_cpu_has(X86_FEATURE_ENTRY_IBPB) && has_microcode) { setup_force_cpu_cap(X86_FEATURE_IBPB_ON_VMEXIT); But I like the separate macro. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette