Message ID | 20210802054112.461728-10-jniethe5@gmail.com |
---|---|
State | Superseded |
Headers | show
Return-Path: <pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=vdeteCAj; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GdTLr08NVz9t23 for <incoming@patchwork.ozlabs.org>; Mon, 2 Aug 2021 16:56:36 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GdTLq6WYPz30C6 for <incoming@patchwork.ozlabs.org>; Mon, 2 Aug 2021 16:56:35 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=vdeteCAj; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::102d; helo=mail-pj1-x102d.google.com; envelope-from=jniethe5@gmail.com; receiver=<UNKNOWN>) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=vdeteCAj; dkim-atps=neutral Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GdRhW44Gvz3022 for <pdbg@lists.ozlabs.org>; Mon, 2 Aug 2021 15:41:47 +1000 (AEST) Received: by mail-pj1-x102d.google.com with SMTP id ca5so23669999pjb.5 for <pdbg@lists.ozlabs.org>; Sun, 01 Aug 2021 22:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cUlxtdxmiJ77kEISjPwWSLLGRMWsA8qzaVVp2qn1j/4=; b=vdeteCAjvpSzXcUK5b5l0dZbyNzz20PrzbEyKez4pRHHh+891fdswDDX1Nbi7EpsnE buRxiWmLReB1A9XCm2J0GSwGjLBYbKEflsMmUxaOb+E8WhXaBgsRdZoaIeBy7adiPY37 vwyLweNlHYpDe546JSPcu9ay1JWAWAnauwGJAgRxIbJX9Tl9Ll2tuqeHBlVqcEoK3IM+ 4/qSvDzQV6KaBO8zy96L8EOl2cxnn5RWnzFA8834EQhe6oOSL61OK7JyiiVeeZai883l I2T0qs3xhxyUe/n3sWiLuwNJBHyjtoMHM9aAHLjU93y7rtwqeY0NDB2GokfzLzqjjXTM Iggg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cUlxtdxmiJ77kEISjPwWSLLGRMWsA8qzaVVp2qn1j/4=; b=QLEEA6ioZdqZ9Tm01478SfIjhEpRaLLhGZB4a8tW6w/FjqrqltGuN4bXXh1o7v2HsT VAY3anA57fIb//+0UR7OmVJVz7gDo8xuJ0bw8rlB5D3v1+q8mPAbG2Q1ipLiWL+Ilb4O oEpQ1fvnnBJAQvNRJAwCunsaqYMQFXzhmusgRDrNnpBrRGd6dXnpIcVIsVTk1JIw2Snp 1Ybwxu56Y4OZlXPUloORSRozGfwOJy80QaVGZNnPi727SvB2yM8rUdUZEEQZzg2zXnB/ ezOj+JU+TiDPhTquWjs9/gZVElYdU2QOJ1zE/EHL8dRtLhNBQrTokV2D1ZqhyPYgaixD xBJw== X-Gm-Message-State: AOAM5338hUhMKaG5NYqTwu5nLmIkmAo8348dvBSp3400wBEJoESnq7Dm V4OdS46opf/n5HVWTZgTajmo/KVlnpc= X-Google-Smtp-Source: ABdhPJxgmNIflc4qbJRGgbCmNtrV8EiVX3DVCX2h3k29ELk8bSkjdPgfFIoc+h2afClhViLHR6KPWQ== X-Received: by 2002:a17:902:7c8d:b029:12b:793e:9f26 with SMTP id y13-20020a1709027c8db029012b793e9f26mr146812pll.84.1627882904912; Sun, 01 Aug 2021 22:41:44 -0700 (PDT) Received: from tee480.ozlabs.ibm.com (159-196-117-139.9fc475.syd.nbn.aussiebb.net. [159.196.117.139]) by smtp.gmail.com with ESMTPSA id 189sm1741852pfx.135.2021.08.01.22.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Aug 2021 22:41:44 -0700 (PDT) From: Jordan Niethe <jniethe5@gmail.com> To: pdbg@lists.ozlabs.org Date: Mon, 2 Aug 2021 15:41:09 +1000 Message-Id: <20210802054112.461728-10-jniethe5@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210802054112.461728-1-jniethe5@gmail.com> References: <20210802054112.461728-1-jniethe5@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 02 Aug 2021 16:56:28 +1000 Subject: [Pdbg] [PATCH 09/12] main: Improve get_pir() error message X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" <pdbg.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/pdbg>, <mailto:pdbg-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/pdbg/> List-Post: <mailto:pdbg@lists.ozlabs.org> List-Help: <mailto:pdbg-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/pdbg>, <mailto:pdbg-request@lists.ozlabs.org?subject=subscribe> Cc: Jordan Niethe <jniethe5@gmail.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" <pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> |
Series |
P10 HTM Support
|
expand
|
diff --git a/src/main.c b/src/main.c index 4c117f68bab5..70e7b05b4321 100644 --- a/src/main.c +++ b/src/main.c @@ -178,8 +178,15 @@ int get_pir(int linux_cpu) file = fopen(filename, "r"); if (!file) { - PR_ERROR("Invalid Linux CPU number %" PRIi32 "\n", linux_cpu); - goto out2; + switch (errno) { + case ENOENT: + PR_ERROR("Invalid Linux CPU number %" PRIi32 "\n", linux_cpu); + goto out2; + case EACCES: + default: + PR_ERROR("Can't access %s. Try running as root\n", filename); + goto out2; + } } if(fscanf(file, "%" PRIx32 "\n", &pir) != 1) {
The error message from get_pir() can be misleading if not ran as root. That is you may be using a valid linux CPU number but simply lack the required permissions. Indicate this possiblity in the error message. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> --- src/main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)