From patchwork Sun Dec 6 23:50:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 553216 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 902D31402BB for ; Mon, 7 Dec 2015 10:52:25 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=axtens.net header.i=@axtens.net header.b=dTx4Wpr1; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 6C9521A01DF for ; Mon, 7 Dec 2015 10:52:25 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=axtens.net header.i=@axtens.net header.b=dTx4Wpr1; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id E41FF1A01DF for ; Mon, 7 Dec 2015 10:51:10 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=axtens.net header.i=@axtens.net header.b=dTx4Wpr1; dkim-atps=neutral Received: by ozlabs.org (Postfix) id D12271402EC; Mon, 7 Dec 2015 10:51:10 +1100 (AEDT) Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [IPv6:2607:f8b0:400e:c03::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D731E1402DE for ; Mon, 7 Dec 2015 10:51:08 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=axtens.net header.i=@axtens.net header.b=dTx4Wpr1; dkim-atps=neutral Received: by pabfh17 with SMTP id fh17so118080135pab.0 for ; Sun, 06 Dec 2015 15:51:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id; bh=fNrFtMQYP3x+a8whek38ckj7B/yFj0Si0EwlfcVfk9A=; b=dTx4Wpr1zvi/5XTRsl5Tbwb2dLgcJPaFaQ3Qwisv8cingY5jCDH0ml6JmJ/H0rNxsZ owbQz1dWA3vS0kHzXkd1JKKERrKCP5l3MI0Pll1TxAbsHimnyCMfzaG6lNoh/N3XTc1i ScwOebeInXxojHU2g5pfhuQlVIFL+0VlEXrpg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fNrFtMQYP3x+a8whek38ckj7B/yFj0Si0EwlfcVfk9A=; b=BmPP1tIRT7dUlCwhESARmEeoRR13/n0nT6/RV0qDrqKFXkmCfbesQQJ7MLMmEmYGqk BsX0tYEIlF6e+w5uHFKKp5BIyB0kQ6YikPYgQly383Q8W4QFFICA6whKvNLEBvVLxqAB Yl0KsQustvtZqxLBD2d20bI2xmaIjCNr9YuA92vHCAtFycO2rDr8DD25yiKDLxomeJa+ nD0fUEARK8rVUKjGn4ib8zJmLlBHByOfaPZdYPFeg/WWrT44002kOGRxrpVu6nuopzoe GRXA7TG/Rqo6xToIxtvRAsYWeaLsKKtMIKfHcP1Xrd96qBFyQbmb6r8LNxAMtJ1X2XyA VrZg== X-Gm-Message-State: ALoCoQmCo4n5lhDEGG4WHqGn76yY0dxLlhuE9o5YOSB+5dC0PEUN2JMnDvrgDon4ykOn5rT/YZ+q X-Received: by 10.66.219.39 with SMTP id pl7mr39203905pac.88.1449445867511; Sun, 06 Dec 2015 15:51:07 -0800 (PST) Received: from gamma.au.ibm.com ([150.101.89.227]) by smtp.gmail.com with ESMTPSA id wo3sm30360426pab.25.2015.12.06.15.51.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 06 Dec 2015 15:51:06 -0800 (PST) From: Daniel Axtens To: linuxppc-dev@ozlabs.org Subject: [PATCH v2] selftests/powerpc: Add script to test HMI functionality Date: Mon, 7 Dec 2015 10:50:51 +1100 Message-Id: <1449445851-6822-1-git-send-email-dja@axtens.net> X-Mailer: git-send-email 2.6.2 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahesh J Salgaonkar , Daniel Axtens MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" HMIs (Hypervisor Management|Maintenance Interrupts) are a class of interrupt on POWER systems. HMI support has traditionally been exceptionally difficult to test, however Skiboot ships a tool that, with the correct magic numbers, will inject them. This, therefore, is a first pass at a script to inject HMIs and monitor Linux's response. It injects an HMI on each core on every chip in turn It then watches dmesg to see if it's acknowledged by Linux. On a Tuletta, I observed that we see 8 (or sometimes 9 or more) events per injection, regardless of SMT setting, so we wait for 8 before progressing. It sits in a new scripts/ directory in selftests/powerpc, because it's not designed to be run as part of the regular make selftests process. In particular, it is quite possibly going to end up garding lots of your CPUs, so it should only be run if you know how to undo that. CC: Mahesh J Salgaonkar Signed-off-by: Daniel Axtens --- v2: added copyright header --- tools/testing/selftests/powerpc/scripts/hmi.sh | 89 ++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100755 tools/testing/selftests/powerpc/scripts/hmi.sh diff --git a/tools/testing/selftests/powerpc/scripts/hmi.sh b/tools/testing/selftests/powerpc/scripts/hmi.sh new file mode 100755 index 000000000000..83fb253ae3bd --- /dev/null +++ b/tools/testing/selftests/powerpc/scripts/hmi.sh @@ -0,0 +1,89 @@ +#!/bin/sh +# +# Copyright 2015, Daniel Axtens, IBM Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + + +# do we have ./getscom, ./putscom? +if [ -x ./getscom ] && [ -x ./putscom ]; then + GETSCOM=./getscom + PUTSCOM=./putscom +elif which getscom > /dev/null; then + GETSCOM=$(which getscom) + PUTSCOM=$(which putscom) +else + cat < /dev/null; then + echo "Error injecting. Aborting!" + exit 1 + fi + + # now we want to wait for all the HMIs to be processed + # we expect one per thread on the core + i=0; + new_hmis=$(COUNT_HMIS) + while [ $new_hmis -lt $((old_hmis + expected_hmis)) ] && [ $i -lt 12 ]; do + echo "Seen $((new_hmis - old_hmis)) HMI(s) out of $expected_hmis expected, sleeping" + sleep 5; + i=$((i + 1)) + new_hmis=$(COUNT_HMIS) + done + if [ $i = 12 ]; then + echo "Haven't seen expected $expected_hmis recoveries after 1 min. Aborting." + exit 1 + fi + echo "Processed $expected_hmis events; presumed success. Check dmesg." + echo "" +done