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=-3.8 required=3.0 tests=BAYES_00, 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 93D11C433B4 for ; Fri, 23 Apr 2021 14:29:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5965E61460 for ; Fri, 23 Apr 2021 14:29:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239667AbhDWOac (ORCPT ); Fri, 23 Apr 2021 10:30:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:45478 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbhDWOab (ORCPT ); Fri, 23 Apr 2021 10:30:31 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 55D45B133; Fri, 23 Apr 2021 14:29:53 +0000 (UTC) Date: Fri, 23 Apr 2021 16:29:41 +0200 From: Borislav Petkov To: Calvin Walton Cc: Chen Yu , Terry Bowman , lenb@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, wei.huang2@amd.com, aros@gmx.com, rui.zhang@intel.com Subject: Re: [PATCH v2] tools/power turbostat: Fix RAPL summary collection on AMD processors Message-ID: References: <20210419195812.147710-1-terry.bowman@amd.com> <20210420020336.GA386151@chenyu-desktop> <20210420080701.GA2326@zn.tnic> <20210420131541.GA388877@chenyu-desktop> <4cbb1eff77de1e843912267ade4686cfa1acd610.camel@kepstin.ca> <20210420143754.GA390118@chenyu-desktop> <5cf35f3742d1181421d955174b1aa9434d042c96.camel@kepstin.ca> <20210423121607.GA426003@chenyu-desktop> <20210423121934.GC24710@zn.tnic> <23f75aaf3d37cbad6f8ed7bd970434e4a2dc388e.camel@kepstin.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <23f75aaf3d37cbad6f8ed7bd970434e4a2dc388e.camel@kepstin.ca> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 23, 2021 at 10:00:14AM -0400, Calvin Walton wrote: > So, there's two problems with that: > 1. This function needs to be able to return an error value that cannot be > confused with a valid MSR. This is currently done by returning a > negative number. If an unsigned value is used, a different way of > indicating errors needs to be written. > 2. We are not using CPU instructions to access MSRs direction. Instead > they are being read from /dev/msr. So the "offset" value is actually a > seek into the /dev/msr file (using pread), and thus is of type off_t. Ah right, that's the /dev/msr thing. Then off_t is correct, forget what I said. Thx. -- Regards/Gruss, Boris. SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg