Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10527178imu; Thu, 6 Dec 2018 02:39:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/V59zn7uPATbf9ggPVsBZ4zDAieukmGiNv+xrtS/Dwnr/cqhqlIPJb0sDJQjo+fFLXO7Tj2 X-Received: by 2002:a17:902:7481:: with SMTP id h1mr28078049pll.341.1544092751238; Thu, 06 Dec 2018 02:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544092751; cv=none; d=google.com; s=arc-20160816; b=jdA9h/W2qosuW0eQbyo/vgQ7BFyFDTgdagMpTLXzNVV7nlnegCHRYxaSL9zH0I1dBx H6e3JCyEnm6PjWU+dQAlWqFNfcW/gALzyhU9NlPr6JYcUkb/ybEAUg/joJ21LPNUAHX/ QF2k48hzQl3CB0WI3BlJm0dgLA0xRrUeFndodM+wA8GSHzwHklZmu1YnluBQJUYugSZS 1S0+8Y0XOkee4VjQmXX+y19aZ4X+HflYtJQPe/bvGWLtn7wZiPyLOr2DFfaVOHR4yXQW SEjEmjjZkxfNlIzOTk+qR2YXgpojT5A2gnrfubmIl/LKsJ8JZuKej0rbrm1mo7aoH/7W kQUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=u5UUzIH7VB2FoNOGeXijpzRxoUl7CMpM8T+GixeGMdI=; b=sI2ssICKugRdj9XfNcx1gDGcf93Rc696/IH/bvgig0BazyIwwesYUsQEd5sA2y5PSi MDerFL4WUjo1ak76lH8SoXR27VIR4CWaaGRb9WO6EVYG3I0s0UtmcyO+ADg/u22WfG3S gw3yH0A1R64mZnzB9DyMkdcU4nCDkDc/O8nghwtrSf7pcN/7Nv/JMxs1aiJ5B0H0YtoR iWqziVVE4AektbbmY1kcdlz75CIM2Hpwd71zePWXN2cwNP38szTPHUFE4nMbkc5t+P5s gXfk8g9UdTI/kOlOU1ZvBKAVhja9576ZlH23pSKeHQdKziBNDfXQdP1eXVwEz3vGwExA pUuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=G0Vhiq4+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m64si23475525pfb.224.2018.12.06.02.38.54; Thu, 06 Dec 2018 02:39:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=G0Vhiq4+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729395AbeLFKhp (ORCPT + 99 others); Thu, 6 Dec 2018 05:37:45 -0500 Received: from mail.skyhub.de ([5.9.137.197]:53762 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727763AbeLFKhp (ORCPT ); Thu, 6 Dec 2018 05:37:45 -0500 Received: from zn.tnic (p200300EC2BCE8F00DD72F512FF71F350.dip0.t-ipconnect.de [IPv6:2003:ec:2bce:8f00:dd72:f512:ff71:f350]) (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 D99E61EC03D4; Thu, 6 Dec 2018 11:37:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1544092664; 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=u5UUzIH7VB2FoNOGeXijpzRxoUl7CMpM8T+GixeGMdI=; b=G0Vhiq4+DpFDKoeEfmha5vusxMQJAiurE+Rfos/Wy/pGkSbT+wy6N5ShzaNfiOeMgxzSNf 7abb6YFFcAO99+CH1C8BhihPSMod81mlTr6VH9p0w3iWgF1xPSiI/B24cKq/1Grl0t1+07 bigfsTd218XRwS8VB8SIOcAkJMzmLkU= Date: Thu, 6 Dec 2018 11:37:36 +0100 From: Borislav Petkov To: Pu Wen Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH RESEND] x86/cpu: Avoid endless loop to get the number of cache leaves Message-ID: <20181206103736.GA3986@zn.tnic> References: <1544081173-25059-1-git-send-email-puwen@hygon.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1544081173-25059-1-git-send-email-puwen@hygon.cn> 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 Thu, Dec 06, 2018 at 03:26:13PM +0800, Pu Wen wrote: > To get the number of cache leaves on AMD or Hygon platform, it should > get the value of cpuid leaf 0x8000001d. But on certain broken platform > such as a not fullly implemented virtual platform(for example Xen), > the value of the cpuid leaf will nerver be CTYPE_NULL, so the kernel > will run into an endless loop. > > To fix this problem, add a new enum type CTYPE_MAX to limit the maximum > cpuid accessing. > > Signed-off-by: Pu Wen > --- > arch/x86/kernel/cpu/cacheinfo.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) Did you not see my reply to this last time? https://lkml.kernel.org/r/20181115172155.GB25056@zn.tnic -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.