Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp616249imw; Fri, 15 Jul 2022 09:34:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v/BI/GRqqd53BzZmb1cr56h5Lb+7aX9M0NDFPCgSpp9p7L4iOMOVu2+ioCzshU3VHPvHQu X-Received: by 2002:a05:6402:3591:b0:43a:9076:e2be with SMTP id y17-20020a056402359100b0043a9076e2bemr20170949edc.171.1657902875739; Fri, 15 Jul 2022 09:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657902875; cv=none; d=google.com; s=arc-20160816; b=ehSAck/zS201u4Nov3rBldULB/UQqqFANLa6UQ+0uVWMD66znA6oqLZvUFVHL2u3l4 Pwoz8acCt6Jm32F7VCESbtUSqHHIPmPQ+ErhPF2fMNVobNVh4ha2BLlAI5mpug6CeKDm 920fjN2istClhWJ86sRQux9a29tU0gGzFXTMrydgYpvKVvA7sHxNOEjHljXL46bm+uaq KWEDGAggfMlvapWZM6IADJZdin4V0rnxZY1IXL73+ZeMTwx7hK25PS39HEqhiXUPhpH9 1S37uPid6VX/ok/hwyFXAGL8WRBEtkscnFuNZDdR9Ct+ctZ09uZM51R3sIPzLMjJeq6K XkdQ== 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:dkim-signature; bh=lrF0UTA3Ef9yvnb0oLwXwzJSpicZgGURdMHOPVAzQqM=; b=h8xGrrXCuZYTbNi5sWzHXpHTaXBOEXLV/KXkfEfhUqQb+9tP1pjmW06x4FUekV3Zoz HirOLyZvLEL6pmS9a7NT2C6nkgC21aFxhQcRkSL80VwGd6agiZpjVV2B3w4EqFC2RLaj s1FVLny9a5dBlQnrOAnA3jZIaT4vr+stvnGOHZl8L33GJNEii7rtktI+DbC9bIQcXHR0 8IthCeERshMIy+5xPV0aKpmbwAFAAyGMlyZ6oz9Ru5GhU2GtQfeeOOi8Q/Wz0QURLy3z bBvUumk/tsVPBZyX9H3tGSa4vL4NX4qhXKc9rvp/4AAQkU4Al9nffMlcRooWSVg4FItG Srpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MyheM1jZ; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r4-20020a50c004000000b0043aa8412572si5667162edb.257.2022.07.15.09.34.10; Fri, 15 Jul 2022 09:34:35 -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=@suse.de header.s=susede2_rsa header.b=MyheM1jZ; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233108AbiGOQbv (ORCPT + 99 others); Fri, 15 Jul 2022 12:31:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232754AbiGOQbt (ORCPT ); Fri, 15 Jul 2022 12:31:49 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8828FD13C; Fri, 15 Jul 2022 09:31:48 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 401732005B; Fri, 15 Jul 2022 16:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1657902707; h=from:from:reply-to: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=lrF0UTA3Ef9yvnb0oLwXwzJSpicZgGURdMHOPVAzQqM=; b=MyheM1jZdB7zhyU4p8/tTnFyNL8zYY2lMmrYuo/EbDaOYhAAHPSAnMK3uHFod2pl+e3A2d R0Igb+uEChD41vbKud4NI2wnXfDj9tTssn9T3xnFHUXFN8Z/vuxRgDMvEGDjqkir2LYQhE JCWVqDRkRSc3tzk+p2we2TAOYT5uXVc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1657902707; h=from:from:reply-to: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=lrF0UTA3Ef9yvnb0oLwXwzJSpicZgGURdMHOPVAzQqM=; b=Q0BWzNw5P/FusF5cWz01gg3OZNhsK5V8CDirztkQZkkgCjwn4EXf9OviQqKV7O3h6aj5u4 8kOC6KPMEPN5NoAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3373513754; Fri, 15 Jul 2022 16:31:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id NFKHDHOW0WJVcgAAMHmgww (envelope-from ); Fri, 15 Jul 2022 16:31:47 +0000 Date: Fri, 15 Jul 2022 18:31:43 +0200 From: Borislav Petkov To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org, peterz@infradead.org, Linus Torvalds Subject: Re: [PATCH] KVM: emulate: do not adjust size of fastop and setcc subroutines Message-ID: References: <20220715114927.1460356-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220715114927.1460356-1-pbonzini@redhat.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, Jul 15, 2022 at 07:49:27AM -0400, Paolo Bonzini wrote: > Instead of doing complicated calculations to find the size of the subroutines > (which are even more complicated because they need to be stringified into > an asm statement), just hardcode to 16. > > It is less dense for a few combinations of IBT/SLS/retbleed, but it has > the advantage of being really simple. > > Suggested-by: Linus Torvalds > Signed-off-by: Paolo Bonzini > --- > arch/x86/kvm/emulate.c | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) Acked-by: Borislav Petkov -- Regards/Gruss, Boris. SUSE Software Solutions Germany GmbH GF: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman (HRB 36809, AG Nürnberg)