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 X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12093C43441 for ; Mon, 26 Nov 2018 15:08:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C685A20663 for ; Mon, 26 Nov 2018 15:08:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="DV5Dg7Ks" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C685A20663 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726315AbeK0CCm (ORCPT ); Mon, 26 Nov 2018 21:02:42 -0500 Received: from mail.skyhub.de ([5.9.137.197]:34012 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbeK0CCm (ORCPT ); Mon, 26 Nov 2018 21:02:42 -0500 Received: from zn.tnic (p200300EC2BDEFE00DCA0409AA15535E1.dip0.t-ipconnect.de [IPv6:2003:ec:2bde:fe00:dca0:409a:a155:35e1]) (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 C51801EC0980; Mon, 26 Nov 2018 16:08:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1543244897; 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:in-reply-to:in-reply-to: references:references; bh=0B4k60X2iPgUHMKZQvXqrQRn/lmwDacYCZf326c3lh0=; b=DV5Dg7Ks+EAwchmuynyYMThYws4toLoqnvN9ibxYELc9dQJ5D/uh5KgdMRMAoK0i0BwwDZ VYtVBFPwEnnWvL7AgKwes/uMi6jM9hvjzZNc90BluYoCMYJWJUAtAKuQHx91Tu5iPlRTWs ZzvMbqSnyhoYbgRCSfdPqKty36rV43o= Date: Mon, 26 Nov 2018 16:08:17 +0100 From: Borislav Petkov To: Thomas Gleixner Cc: LKML , x86@kernel.org, Peter Zijlstra , Andy Lutomirski , Linus Torvalds , Jiri Kosina , Tom Lendacky , Josh Poimboeuf , Andrea Arcangeli , David Woodhouse , Tim Chen , Andi Kleen , Dave Hansen , Casey Schaufler , Asit Mallick , Arjan van de Ven , Jon Masters , Waiman Long , Greg KH , Dave Stewart , Kees Cook Subject: Re: [patch V2 04/28] x86/speculation: Reorganize cpu_show_common() Message-ID: <20181126150817.GD4843@zn.tnic> References: <20181125183328.318175777@linutronix.de> <20181125185003.874479208@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181125185003.874479208@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 25, 2018 at 07:33:32PM +0100, Thomas Gleixner wrote: > The Spectre V2 printout in cpu_show_common() handles conditionals for the > various mitigation methods directly in the sprintf() argument list. That's > hard to read and will become unreadable if more complex decisions need to > be made for a particular method. > > Move the conditionals for STIBP and IBPB string selection into helper > functions, so they can be extended later on. > > Signed-off-by: Tim Chen > Signed-off-by: Thomas Gleixner > > --- > arch/x86/kernel/cpu/bugs.c | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) Just a nitpick: That subject should probably be more like: "x86/speculation: Move cpu_show_common() string generation in separate functions" or so, as it is not really reorganizing - just carving out functionality. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.