Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3325810imm; Thu, 17 May 2018 07:05:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpMXzGDvR983CuVTT/ixUxiRgYWxYIzPKYAe6LtynmTZjQ/D4EC9H3/cKUVAC4M5b1CT9wi X-Received: by 2002:a17:902:31a4:: with SMTP id x33-v6mr5358310plb.355.1526565946337; Thu, 17 May 2018 07:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526565946; cv=none; d=google.com; s=arc-20160816; b=PJ1GYXP8ZTLECWKDY+41LU3BHD8r4a1dFUHXzjGY3Y+uqytbUDCSptLVPWBahLJh3o IIDUG5fSFSPMWV1ikQrUoSWk/Y6jA9WJKspBcwucsr/BMwbkarEGVCTXD+vzZsERtLqQ 4ZG+rcCaaQScDT1AIYmtuv0h5JzsmkLhVIn1Pi3CcU4r5q9gm3MESVrVCTrRuIdOZtZ7 mCnzrusBfq7OONG/a8gX43/499gZsOI69DlDLw/NX60jheCiXcNVN95Ese9u/TP809HP OreIfq7/y/XFculZTRzJdYlcDnPyXpf6T2IaINsOjZ5o3gur25O65LSdZ+PC5hocnq50 WhaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=pknKVHisbBCRREQzoGUPv/jF9HPo9QErZlV4OMlMuME=; b=VzJ7hAvCDeOolhCJKHy6MGUY+Hy3G+H9p0swGV+sxFcs6Vm693eL7GIRWdCEMDpUTC 4oqvnYSobfQMaSodVSLuXxANwhHyI6eFNRyMwtIG6Dx70RMjUrnn2QWbWJsywBmR0L7n qqgTyoPtXv/0q7GJQ1Q7vuOktmkOk4c/HB+Ap+wSbzwRoMFfdO802lWnVzRhNzEsH8cw fcJS11iQFgfjx2NFZeI7WGLce28MLoGgTJECffLlDJoyYGADuLu74lxYVa4ZPy3GULUs 5KrFqoe+oGSI1B88UWIPqgze/YTe3/L4CtiUv/uJHjoLQXTtiNpSb1vXApk+cjiMBEXg 3sMg== 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 b14-v6si4109731pgr.689.2018.05.17.07.05.16; Thu, 17 May 2018 07:05:46 -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 S1752224AbeEQODG (ORCPT + 99 others); Thu, 17 May 2018 10:03:06 -0400 Received: from ozlabs.org ([203.11.71.1]:52367 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750825AbeEQODE (ORCPT ); Thu, 17 May 2018 10:03:04 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 40mtLG6GjNz9s3M; Fri, 18 May 2018 00:03:02 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Thiago Jung Bauermann , linuxppc-dev@lists.ozlabs.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Ram Pai , Thiago Jung Bauermann Subject: Re: [PATCH 1/2] selftests/powerpc: Add ptrace tests for Protection Key registers In-Reply-To: <20180223183344.21038-1-bauerman@linux.vnet.ibm.com> References: <20180223183344.21038-1-bauerman@linux.vnet.ibm.com> Date: Fri, 18 May 2018 00:03:01 +1000 Message-ID: <87tvr6mlbe.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thiago Jung Bauermann writes: > This test exercises read and write access to the AMR, IAMR and UAMOR. > > Signed-off-by: Thiago Jung Bauermann > --- > tools/testing/selftests/powerpc/include/reg.h | 1 + > tools/testing/selftests/powerpc/ptrace/Makefile | 5 +- > tools/testing/selftests/powerpc/ptrace/child.h | 130 ++++++++ > .../testing/selftests/powerpc/ptrace/ptrace-pkey.c | 326 +++++++++++++++++++++ This is failing on machines without pkeys: test: ptrace_pkey tags: git_version:52e7d87 [FAIL] Test FAILED on line 117 [FAIL] Test FAILED on line 191 failure: ptrace_pkey I think the first fail is in the child here: int ptrace_read_regs(pid_t child, unsigned long type, unsigned long regs[], int n) { struct iovec iov; long ret; FAIL_IF(start_trace(child)); iov.iov_base = regs; iov.iov_len = n * sizeof(unsigned long); ret = ptrace(PTRACE_GETREGSET, child, type, &iov); FAIL_IF(ret != 0); Which makes sense. The test needs to skip if pkeys are not available/enabled. Using the availability of the REGSET might actually be a nice way to detect that, because it's read-only. cheers