Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755544AbcJFMOQ convert rfc822-to-8bit (ORCPT ); Thu, 6 Oct 2016 08:14:16 -0400 Received: from prv-mh.provo.novell.com ([137.65.248.74]:58864 "EHLO prv-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751591AbcJFMOI (ORCPT ); Thu, 6 Oct 2016 08:14:08 -0400 Message-Id: <57F65C2C02000078001155BB@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.1 Date: Thu, 06 Oct 2016 06:14:04 -0600 From: "Jan Beulich" To: "Boris Ostrovsky" Cc: , , , "Juergen Gross" , , Subject: Re: [Xen-devel] [PATCH] xen/x86: Update topology map for PV VCPUs References: <1475687373-14589-1-git-send-email-boris.ostrovsky@oracle.com> In-Reply-To: <1475687373-14589-1-git-send-email-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 836 Lines: 19 >>> On 05.10.16 at 19:09, wrote: > Early during boot topology_update_package_map() computes > logical_pkg_ids for all present processors. > > Later, when processors are brought up, identify_cpu() updates > these values based on phys_pkg_id which is a function of > initial_apicid. On PV guests the latter may point to a > non-existing node, causing logical_pkg_ids to be set to -1. > > Intel's RAPL uses logical_pkg_id (as topology_logical_package_id()) > to index its arrays and therefore in this case will point to index > 65535 (since logical_pkg_id is a u16). This could lead to either a > crash or may actually access random memory location. Another clear indication that such fields should never be touched (and hence consumers either be fixed or disabled) when running as PV guest under Xen. Jan