From patchwork Fri Feb 21 11:20:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11396293 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 749A21892 for ; Fri, 21 Feb 2020 11:22:23 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 51471222C4 for ; Fri, 21 Feb 2020 11:22:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="sNfadk8N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51471222C4 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j56N1-00056H-FD; Fri, 21 Feb 2020 11:21:23 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j56Mz-00055s-Nq for xen-devel@lists.xenproject.org; Fri, 21 Feb 2020 11:21:21 +0000 X-Inumbo-ID: 493e19aa-549c-11ea-aa99-bc764e2007e4 Received: from smtp-fw-9101.amazon.com (unknown [207.171.184.25]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 493e19aa-549c-11ea-aa99-bc764e2007e4; Fri, 21 Feb 2020 11:21:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1582284081; x=1613820081; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GB4XwziE0lqzSohlKaFns9MyRRAZWesKJLI6Qeng2ds=; b=sNfadk8N27ld6QL1HJNJX52GuNaE06ZzwbpEWLLagZCDmV4sDZUAOfv8 ajxfS/gke3gVpWBvADmgpjhEuBPPPsrSz8diFwZSBZM/EHc7ezTLEYqQ9 ruUdVOcK/CGCuX69Zv3mh2hVs4KdF4S5WmqA2RErXclGBmCW0KrTjI1Jn 8=; IronPort-SDR: kCIYRKRwxnU/8UNxJMRwnDMpan+xXqe3DoBMzExl37lqZ/rDnUjeCcaRmoI+LTefa0+0Aof6mB 4taxp/OhtB7w== X-IronPort-AV: E=Sophos;i="5.70,468,1574121600"; d="scan'208";a="18290060" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 21 Feb 2020 11:21:20 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com (Postfix) with ESMTPS id E74D3A289D; Fri, 21 Feb 2020 11:21:16 +0000 (UTC) Received: from EX13D32EUC002.ant.amazon.com (10.43.164.94) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Fri, 21 Feb 2020 11:21:03 +0000 Received: from EX13MTAUEB002.ant.amazon.com (10.43.60.12) by EX13D32EUC002.ant.amazon.com (10.43.164.94) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 21 Feb 2020 11:21:02 +0000 Received: from u2f063a87eabd5f.cbg10.amazon.com (10.125.106.135) by mail-relay.amazon.com (10.43.60.234) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Fri, 21 Feb 2020 11:21:00 +0000 From: Paul Durrant To: Date: Fri, 21 Feb 2020 11:20:46 +0000 Message-ID: <20200221112049.3077-4-pdurrant@amazon.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200221112049.3077-1-pdurrant@amazon.com> References: <20200221112049.3077-1-pdurrant@amazon.com> MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH v7 3/6] public/xen.h: add a definition for a 'valid domid' mask X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Paul Durrant , Ian Jackson , Jan Beulich Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" A subsequent patch will modify libxl to allow selection of a random domid value when creating domains. Valid values are limited to a width of 15 bits, so add an appropriate mask definition to the public header. NOTE: It is reasonable for this mask definition to be in a Xen public header rather than in, say, a libxenctrl header since it relates to the validity of a value passed to XEN_DOMCTL_createdomain. This new definition is placed in xen.h rather than domctl.h only to co-locate it with other domid-related defitions. Signed-off-by: Paul Durrant Reviewed-by: Ian Jackson Acked-by: Julien Grall --- Cc: Andrew Cooper Cc: George Dunlap Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Wei Liu v6: - New in v6 (split out from another patch) --- xen/include/public/xen.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index d2198dffad..75b1619d0d 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -614,6 +614,9 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t); /* Idle domain. */ #define DOMID_IDLE xen_mk_uint(0x7FFF) +/* Mask for valid domain id values */ +#define DOMID_MASK xen_mk_uint(0x7FFF) + #ifndef __ASSEMBLY__ typedef uint16_t domid_t;