Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6531304pxv; Thu, 29 Jul 2021 17:36:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6ZQzF2ydY3yhkF9JF8sbd2bi/RS4HXfSWdTiaMPmGCs0B66s7NTAgDJQOhM7qz7LBK/O7 X-Received: by 2002:a17:906:45b:: with SMTP id e27mr21096eja.375.1627605392840; Thu, 29 Jul 2021 17:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627605392; cv=none; d=google.com; s=arc-20160816; b=LCr79tAdRApneSbgTNWT0cquQ1j5noNmoX8NcujOXxNeAo8zHxJuipLMyRBtEG2o1+ CApMR/Xe31MN2GZJCIlXOXn9xgN5YM+53OK4KW/UNvvPZHHIXbMeJ0CuOtvxUGHZmSQT jUTkhBP5X20r8fruGSg9M8s3GjT+JkvTgRkPiTxIXF5P0piCsl8EE67iImt6vKRNCwnj WOqOfi0buqQgD4djba605cZcT6S91bfxOxJIKjfwweAZbwopEdF2LAxcwpAvFeQ9273b 4RCJmWoixe2XcsSbvxv6Qfsbg6g5zJch2RovEF3ndFKQ/WWHbFqyG+9q1TLHRZo9nTgB EqyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=n3TOfoR3BVLcdYVDtR/V8xZbbXHTiv/5QOFp8fXQWuE=; b=QEtAn53CN5wuHqesZ7SOrYHj3dyDQKsANLTCSJv5CJmcRxT9QOfA09fNbed4isggZJ 7AlbNLm5JI42DLjEEmstWEw9dKqYfWQSJA1OuEKReQYZbZGNAgwH8/jUcWeCZStKbGKH bkbPm8NNwVn8T7WSyq5LzGXbAKMhhmcYQzmYt2Es4QGeBwAHRvActPUKyQs6sc/klaLi xmsd0auYwmNd4vOZZVJjIWz6yF6MkJlX2J6rYNRWIwTRFDL05RwuPcx+WyPsvX6vXWRy FsmK9qZAD5Xu9mLmL88N8agp4ZFxC1pmtTZgNnR9XaUCdkSroE/9GkX1/ullvIxMLsDC n/8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="p/7ffPdI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq4si4397edb.74.2021.07.29.17.36.09; Thu, 29 Jul 2021 17:36:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="p/7ffPdI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231942AbhG3Aen (ORCPT + 99 others); Thu, 29 Jul 2021 20:34:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:59204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbhG3Aen (ORCPT ); Thu, 29 Jul 2021 20:34:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E147860F21; Fri, 30 Jul 2021 00:34:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627605279; bh=1wQmyo8eNOcr9cXmmngpz+YRFMvD4gq8n8FjNL7Mh4M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p/7ffPdIbPw9cBZ0xWmJskPPSVAYGuOH4E3AaydpccM5z3j0zSy0l/pFemGUM/BH7 mqdDemT4r0tAiU6NFYuJoIr2oKPgH6JPlsgSoOcS6fwywvWHSRB6xGefFwotFUdvPf EWDWTv2j82iGq0UDBl5WmV4ZmAn98nHXlWNUV7+eHQmEi8kbcQjvy1Eh/xeNgF00/q TWjzAGq6xvao+G33m09gX1wBNH3IBnChc9CDqah0QR+dbg+VE2sAb+aGhPWwqLJkX2 S1lK21i9ZySVy4VykoiwI/HcGFi9ypkZz/oIS+g3s1FK7pYpn7f7NAEHuJg7w0A61c bRfYa5+2Eqhyg== Date: Fri, 30 Jul 2021 03:34:35 +0300 From: Jarkko Sakkinen To: "Luck, Tony" Cc: "Hansen, Dave" , Sean Christopherson , "x86@kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 1/7] x86/sgx: Provide indication of life-cycle of EPC pages Message-ID: <20210730003435.bge53hlxpzpijdw7@kernel.org> References: <20210719182009.1409895-1-tony.luck@intel.com> <20210728204653.1509010-1-tony.luck@intel.com> <20210728204653.1509010-2-tony.luck@intel.com> <17054ca5-0ef7-4b28-ab26-b1b96aa7403f@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 28, 2021 at 10:57:07PM +0000, Luck, Tony wrote: > > Wouldn't it be safer to do something like: > > > > page->owner = owner ? owner : (void *)-1; > > > > -1 is non-NULL, but also invalid, which makes it harder for us to poke > > ourselves in the eye. > > Does Linux have some #define INVALID_POINTER thing that > provides a guaranteed bad (e.g. non-canonical) value? > > (void *)-1 seems hacky. > > -Tony MAP_FAILED? /Jarkko