Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1166530pxy; Fri, 23 Apr 2021 01:38:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8kcq+6dpDIut5ZA+4TrSRf2yveN3ydjeDuC0Eu/Ya7fMZqM6eEwjptx0kVI/xjfJthiYl X-Received: by 2002:a17:902:8a8a:b029:ec:857a:4d51 with SMTP id p10-20020a1709028a8ab02900ec857a4d51mr2897117plo.68.1619167113117; Fri, 23 Apr 2021 01:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619167113; cv=none; d=google.com; s=arc-20160816; b=cVAcnaEYE0cP6UAWZkHEy5xa8PCsOGdf9ZISfKEEXEByEHir2clJeQmfU2pTuWzCYx ufBc9MIyXjYhDshENgOjtMQYwWK5SMiy6pNl99arC+JWqLZiRHN1nFvs/5iirEOsa1Tu WFxb94GZJecTfMwLsRedk5eNAQImRJAS5pQ5l2YM3VIE9I1HLNCyqz/iBhrj8Osgpz3K gUh4f8/Qna5zeNspgMbTG3Zdteq4JDgJy8rZoPe4irJpv3DKoxj1I24Tw2mB34lA5U32 floHU4DVfHsd4KLQGiC/qZHzWEnfR++FzadFPtwiaVJodQ13iibTW+As7YHtBv5A3UrU en3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=8U3rcB+Q9yZ2WnidDfmaiDsiZHkhyItX3WlZksHmevA=; b=Dedq1MemTrz+VD7yexpjMtDXM7jCxs1Ld6tscbeFCpJKmpVi3jPYn0+DvXmXzhYowG Se/xVy51zGy+w4eUlZQcM5RPWobWz0USG7z/Nh+c5mEpHYgwZ5Ebh6Aw18ycEFG+bS4c Cxbcw1JK2C7/FcZrF5Leeex8V1pCqAVZBlctJyXt9rKKS+MNfX8kFRA3ZszWxkhkbyz9 R5DuoWrr+WgDkIhq6Qz5VeG2vnZeP+6WB2H6Z2OkT4YJ2qG/O/TccikXxupyAQxrjRic 6rVZ99wXEYj92Izm9XBvkUdeSzOOIClkkRVjMWSaqi9iOG5AsI5dqtw0RqdPUuNH/gJz /b4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BQ2XacMi; dkim=neutral (no key) header.i=@linutronix.de header.b=1c3NzoPQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gp19si8681696pjb.48.2021.04.23.01.38.20; Fri, 23 Apr 2021 01:38:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BQ2XacMi; dkim=neutral (no key) header.i=@linutronix.de header.b=1c3NzoPQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230525AbhDWIiH (ORCPT + 99 others); Fri, 23 Apr 2021 04:38:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230100AbhDWIiH (ORCPT ); Fri, 23 Apr 2021 04:38:07 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C29BC061574 for ; Fri, 23 Apr 2021 01:37:31 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1619167047; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8U3rcB+Q9yZ2WnidDfmaiDsiZHkhyItX3WlZksHmevA=; b=BQ2XacMiUhjfF8iECoMGcLGZdLSoqWyu3vw/2PdlU67y6VZpoupuH6IEYdV/MYI8IgFzGv UuosIYSUAgXaPDULfsj/wHzl6IDHSL3Saz6qcLfybu8cAwE62i2En2EimwSb74K+z3uduL uzbnoMXcqE5IMjDBcG3hfDfEF/qJH0MAPQrHbPDNiV2l/XYLOZnADfTAFxeImGFWXdJjrt Lh8zHv/Wbx7QjjbMOhYBJPrOG3P34ILcedt3BRdC3HHNP2NS4C3KINjjJpl8Z9xZZ44M0N Fbo/xXuMykIVtRyR13Ua+1R0iu9QYe/9MObAYDwO1slW4yB19agg5PIRQmUFig== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1619167047; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8U3rcB+Q9yZ2WnidDfmaiDsiZHkhyItX3WlZksHmevA=; b=1c3NzoPQAxa/hdZ4ussrM0zrFLuR775gn19NiQ0DBDFbsKZzr3qAKJwpGNkt9lh7v6qNKV Ns42EBSRkQTNKbAg== To: Xu Yihang Cc: mingo@kernel.org, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dwmw@amazon.co.uk, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] x86/apic: Force logial APIC ID in range from 0 to 8 In-Reply-To: <20210423075324.133463-1-xuyihang@huawei.com> References: <20210423075324.133463-1-xuyihang@huawei.com> Date: Fri, 23 Apr 2021 10:37:26 +0200 Message-ID: <87czulwg55.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 23 2021 at 15:53, Xu Yihang wrote: > According to Intel 64 and IA-32 Architectures Software Developer=E2=80=99= s Manuals > Vol. 3A 10.6.2.2, Logical APIC ID locates on bit 24 to 31, can only > support up to 8 local APIC under flat mode. Also C99 says left shift exce= eding > maximum value representable in the result type is undefined behavior. But > under x86 architecture, it seems doesn't do any actual damage. > > There is KASAN warning on a 80 cores machine after booting #64 CPU. > ``` > [ 1.681097] UBSAN: Undefined behaviour in arch/x86/kernel/apic/apic_fl= at_64.c:51:11 > [ 1.688739] shift exponent 64 is too large for 64-bit type 'long unsig= ned int' > ``` This function should not be invoked on a 80 core machine at all. Can you please add 'apic=3Dverbose' to the kernel command line and provide a full boot log? Thanks, tglx