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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 06BE1C43333 for ; Tue, 19 Jan 2021 10:57:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D390C2075F for ; Tue, 19 Jan 2021 10:57:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404578AbhASKxk (ORCPT ); Tue, 19 Jan 2021 05:53:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389212AbhASKlV (ORCPT ); Tue, 19 Jan 2021 05:41:21 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0640DC061573 for ; Tue, 19 Jan 2021 02:40:14 -0800 (PST) Received: from zn.tnic (p200300ec2f0bca00c2aa0e949335efb7.dip0.t-ipconnect.de [IPv6:2003:ec:2f0b:ca00:c2aa:e94:9335:efb7]) (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 7C19F1EC05DD; Tue, 19 Jan 2021 11:40:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1611052813; 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=iDFwGIcQPnMopYu+OH7oLQlopHvKPf6mFKRQgATdpdE=; b=N/J3cbYK5bqF73UtFDywBSYyl/p0TMxFncjtfCSY216HieNkodQw0EDXvNM/3Be2fXwJTs /QaC6WCpGUj9ZpWggbugzctFuyhL8zLStaa9LI3KSmVqzsiZT0I/hqno+5c8xoifrcxPXG dbcwaov+hcV6OZVKPHsnM6oZoqTaem4= Date: Tue, 19 Jan 2021 11:40:07 +0100 From: Borislav Petkov To: Peter Zijlstra Cc: Andy Lutomirski , Masami Hiramatsu , X86 ML , LKML Subject: Re: [PATCH v1 06/19] perf/x86/intel/ds: Check insn_get_length() retval Message-ID: <20210119104007.GE27433@zn.tnic> References: <20201223174233.28638-1-bp@alien8.de> <20201223174233.28638-7-bp@alien8.de> <20210104131919.GN3021@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210104131919.GN3021@hirez.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 04, 2021 at 02:19:19PM +0100, Peter Zijlstra wrote: > Do we really still need the !insn.length? That is, it *should* be > impossible to not fail insn_get_length() and still have a 0 length, > seeing how x86 doesn't have 0 length instructions. I was responding to the "doubly important" thing in the comment scarying me about an infinite loop and thus left the length check in, in case the insn decoder would have a bug and return success but still have insn.length 0. With the length check the endless loop won't happen but let's be brave here ... :-) So removed. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette