Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4178235imm; Mon, 18 Jun 2018 10:22:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL0jB9JytkKfZfVX9DQ1DBJat0Vmc5Kaf2xjrUOtSXIcWQyzZq851ENDCSVGbFw5awhQGLY X-Received: by 2002:a65:6141:: with SMTP id o1-v6mr11650409pgv.409.1529342577765; Mon, 18 Jun 2018 10:22:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529342577; cv=none; d=google.com; s=arc-20160816; b=zGJ49f4hhUD1jWYbNgPUCl9z1ittDg7h9U0ceVnqGeNvcy+iCf/12MC3C1If+0cO9W hZ1hTypypjYKng4FvVq2lvxAQerpIx8iIm9WXleU5FAACpyD61HYqdB6xhviOiYhhpA+ o20WYDgMtzCslDHRL7y1fFUHrbUJ7dApAgmBA1IbEC5/obuaU5trwwk0wzAAEFK+T2gS /Jy15D+nDjoISfH/ql+HqIZvCDlhWz1aPOR/BXd5OQVAdbM+rqEZtnpq+69HibFatcfr SkRLZUv4tY+iWOfpDraropIYz/PR8Dga2GthqpgxkDTN5Y8oPjMb+iNGx4I//DxIpvP1 eMyQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=Q/KmTkhmyN8jRun0KNRhpTF3jBSzsDPj1Ib+kPVsmVA=; b=har2/EXFE30mDjMDu1VR1S56JatBT8BxpcZjf+f12hp8HFrxWp1ZR/nH+jBnb8qRk+ Jp1wkuWCdtQbcivyFowZA+mdUnY1Dzr3maWIUDMWwHa/g9BfuD02priAVkUD32k796pE QOvj6ny4A1Owu6cG6rL9LReSlkkrvahkAhnqipw+DszNn6qL19rxqwLZy+SD1ako7f2e Y1RLR//qHLcDfXE4ks/SLD3Poz6hzgRUHlefNRS10YLs4vTged6tTNb/+G2uOJ7zvgJQ BDO1caRlAa6XTGuI8TSxFxXkpDSCuDv8STnYf8QYHsurnutuVzFvDfwHiLjjYi9mJSxJ Wqxg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11-v6si12348710pgp.140.2018.06.18.10.22.44; Mon, 18 Jun 2018 10:22:57 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935389AbeFRRUz (ORCPT + 99 others); Mon, 18 Jun 2018 13:20:55 -0400 Received: from mail.skyhub.de ([5.9.137.197]:37000 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934215AbeFRRUx (ORCPT ); Mon, 18 Jun 2018 13:20:53 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id z1KBc7eWXqZ5; Mon, 18 Jun 2018 19:20:51 +0200 (CEST) Received: from zn.tnic (p200300EC2BE29C00329C23FFFEA6A903.dip0.t-ipconnect.de [IPv6:2003:ec:2be2:9c00:329c:23ff:fea6:a903]) (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 B6E701EC0299; Mon, 18 Jun 2018 19:20:51 +0200 (CEST) Date: Mon, 18 Jun 2018 19:20:48 +0200 From: Borislav Petkov To: Suravee Suthikulpanit Cc: x86@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com Subject: Re: [PATCH] x86/CPU/AMD: Fix LLC ID bit-shift calculation Message-ID: <20180618172048.GD24921@zn.tnic> References: <1528915390-30533-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1528915390-30533-1-git-send-email-suravee.suthikulpanit@amd.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 13, 2018 at 01:43:10PM -0500, Suravee Suthikulpanit wrote: > The current logic incorrectly calculates the LLC ID from the APIC ID. > Unless specified otherwise, the LLC ID should be calculated from > the count order of the number of threads sharing cache. Don't you mean: "... should be calculated by removing the Core and Thread ID bits"? here? I'm looking at "2.1.10.2.1.3 ApicId Enumeration Requirements ... Each Core::X86::Apic::ApicId[ApicId] register is preset as follows: • ApicId[6] = Socket ID. • ApicId[5:4] = Node ID. • ApicId[3] = Logical CCX L3 complex ID • ApicId[2:0]= (SMT) ? {LogicalCoreID[1:0],ThreadId} : {1'b0,LogicalCoreID[1:0]}. and in order to get a unique LLC ID, you simply need to shift out the CoreID and the ThreadId, right? Or am I misreading it? -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.