Received: by 10.213.65.68 with SMTP id h4csp835365imn; Wed, 28 Mar 2018 13:48:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+tjnzwNyxVcVs6fkKrPp7OQPRwH1mdZ0akDdC9J7CYYxJXsEI4f8UZuSomcd6W1j7chwcB X-Received: by 2002:a17:902:158b:: with SMTP id m11-v6mr5259854pla.300.1522270112805; Wed, 28 Mar 2018 13:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522270112; cv=none; d=google.com; s=arc-20160816; b=UovR0vKAnjpm3SI0BNSGrb9GXOBnM6brYHNqAeu+7MC3dtNUOM9LlHIrC9xGEs0voB di7cZDiUW1x+g+OcU9fZStLLT2WRQFexrNA5UufupwHrNKlqssU2eIOwswrHexuCuKX2 1sZgnEhZWQhMdEar7qWYHpObYlnCJmg5JeOTDLUZY9n8XAi0L0EV8digZV3q89uOdS16 GBVM3HPndW2fHSflG/Un2AtrfKF1etXLf/gXz/KBwlLWoxXWUUfUtIxxDDWZ2mDHrynk K7k6Q/OpG/lvnrqL6hBbkPXR0i7WAN1l3VykUJ8ipBO3C4Vf31ghG8O/+bQEJljH/EcX 4z5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:date:in-reply-to :subject:cc:to:from:user-agent:references:arc-authentication-results; bh=+ZSWv+7G3ICaLHDGktNEgF6UqXa7jlJHml9bV8eKzYY=; b=ZT1Q/gwm+w4eZCfFJZKImDZMqpHZCghYwIQ0u+wRMnr03luPk5eO0Cc0rFxo2WGBlL RO5AEnE3zEX8mI5avCf9Vv2FstkW/X0rJbbHTY0FvgVyM9mO6CLNxy7KBuDOUG4Y/xBF 9iLcnMyr8LT1HU0flQXyHr7+axBLrAmWD/kaqJ2DoxluSbnZ0pNeKh7Y95XBKzKy9ZCk ia0Cep91ijcD3BGmCfztCg+QyqwPLInoUP3l6+IeNDex9lJfSLpt0MJEStGKNbLL6Rv/ FMsc58F3aWP2HgHU87a/5LvjctfHSEbfwbLmXVL4gH138oxjHZhPFVSl5MAg7vQsGLWP NEpg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10-v6si4282433pll.237.2018.03.28.13.48.18; Wed, 28 Mar 2018 13:48:32 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753073AbeC1Ur0 (ORCPT + 99 others); Wed, 28 Mar 2018 16:47:26 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34842 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752832AbeC1UrX (ORCPT ); Wed, 28 Mar 2018 16:47:23 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2SKic9K128939 for ; Wed, 28 Mar 2018 16:47:23 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0b-001b2d01.pphosted.com with ESMTP id 2h0hwc14vu-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Wed, 28 Mar 2018 16:47:22 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 28 Mar 2018 14:47:22 -0600 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 28 Mar 2018 14:47:17 -0600 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2SKlG2E13566460; Wed, 28 Mar 2018 13:47:16 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 966C4BE038; Wed, 28 Mar 2018 14:47:16 -0600 (MDT) Received: from morokweng.localdomain (unknown [9.85.167.176]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTPS id 18CFFBE03B; Wed, 28 Mar 2018 14:47:10 -0600 (MDT) References: <1519264541-7621-1-git-send-email-linuxram@us.ibm.com> <1519264541-7621-8-git-send-email-linuxram@us.ibm.com> User-agent: mu4e 1.0; emacs 25.3.1 From: Thiago Jung Bauermann To: Dave Hansen Cc: Ram Pai , shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, akpm@linux-foundation.org, benh@kernel.crashing.org, paulus@samba.org, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, hbabu@us.ibm.com, mhocko@kernel.org, ebiederm@xmission.com, arnd@arndb.de Subject: Re: [PATCH v12 07/22] selftests/vm: fixed bugs in pkey_disable_clear() In-reply-to: Date: Wed, 28 Mar 2018 17:47:04 -0300 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 18032820-0028-0000-0000-0000095D5E44 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008760; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000255; SDB=6.01009784; UDB=6.00514431; IPR=6.00789066; MB=3.00020296; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-28 20:47:21 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18032820-0029-0000-0000-00003A268C07 Message-Id: <87muys3p2v.fsf@morokweng.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-28_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803280212 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dave Hansen writes: > On 02/21/2018 05:55 PM, Ram Pai wrote: >> --- a/tools/testing/selftests/vm/protection_keys.c >> +++ b/tools/testing/selftests/vm/protection_keys.c >> @@ -461,7 +461,7 @@ void pkey_disable_clear(int pkey, int flags) >> pkey, pkey, pkey_rights); >> pkey_assert(pkey_rights >= 0); >> >> - pkey_rights |= flags; >> + pkey_rights &= ~flags; >> >> ret = pkey_set(pkey, pkey_rights, 0); >> /* pkey_reg and flags have the same format */ >> @@ -475,7 +475,7 @@ void pkey_disable_clear(int pkey, int flags) >> dprintf1("%s(%d) pkey_reg: 0x%016lx\n", __func__, >> pkey, rdpkey_reg()); >> if (flags) >> - assert(rdpkey_reg() > orig_pkey_reg); >> + assert(rdpkey_reg() < orig_pkey_reg); >> } >> >> void pkey_write_allow(int pkey) > > This seems so horribly wrong that I wonder how it worked in the first > place. Any idea? The code simply wasn't used. pkey_disable_clear() is called by pkey_write_allow() and pkey_access_allow(), but before this patch series nothing called either of these functions. -- Thiago Jung Bauermann IBM Linux Technology Center