Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1049237pxb; Sat, 16 Oct 2021 00:00:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJIssB7RDILwxKbTaqfDulGSLcimgXEqzCwB6Q07CzQReEe6ubXfjkojPQnDjgITPUo7Fy X-Received: by 2002:a05:6402:26d1:: with SMTP id x17mr24685719edd.367.1634367620603; Sat, 16 Oct 2021 00:00:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634367620; cv=none; d=google.com; s=arc-20160816; b=BoYOiVjlNyDYdI1U1GgibWu4VnIrX7oJaq/dHeWy3dJttSAm6wxlGiMfE0fUGXMp7f jgr8uDDKN+R4ql54tasgNE/6Xoz4siJpg6v8j/By0+xEIdZZlqFrbo+kcQa6wvFGXFXW lHqE0joMcRsIz0T3NOMkdZpDSX2Y5ofFsOzYoprA0BPr3cnlKLTKjb2bhU7kMA1RByJ1 BlCygXfao3af24ABnEYqrTQmQNhX3E/j1DA/O4kR6vtjjWpvj0gApphRjAFqYn3CurOY h9d09MDoRpdDHjQG/Y+3VXKDTNDS6NT5ygaEOR/ZRLvncZxiy4+1vKP5zyNBBII+BMX+ vB1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=3WrWEyC3NpcOqvwtjFuA3J4oagVzf2lIRs1A+Djun7w=; b=Y+dSMAQI6QJ1+sybkLlpwURT6jE3T+Ej58HydrdKFhRRZkqirTEFz4pgXWonUvQ5jl xQWviBoZzHfvBNXyYoMRvUETrAY1idizQmcZydkapvx5VOxUuCx9PS3IknFlopXaafda Q65LH4ATfKG8nm7AYprrrO/uYq3Yp9g9ahWRvUeejTAVvSHk3rTO8sg/jvZPV0izlJao lyKqyCos+HLktHfpxzHIVgWv8+mVOwaQe6Chi0VXiLgcEEkkacTOzL2oYHInV9A7nnZ2 g5+oVhjK7vtyAUkIGRdpjvf91WIodOhNoY3+vVg7fWbnC6W2TZWDlhlAbNCTJRs+hX1U 4jRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="s/VxrvND"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u2si9755991edy.335.2021.10.15.23.59.57; Sat, 16 Oct 2021 00:00:20 -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=@amazon.com header.s=amazon201209 header.b="s/VxrvND"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235984AbhJONgI (ORCPT + 99 others); Fri, 15 Oct 2021 09:36:08 -0400 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:62697 "EHLO smtp-fw-2101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234697AbhJONgH (ORCPT ); Fri, 15 Oct 2021 09:36:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1634304841; x=1665840841; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=3WrWEyC3NpcOqvwtjFuA3J4oagVzf2lIRs1A+Djun7w=; b=s/VxrvNDtC5IqYhVbLCcSI3JsqMRXChjHLFvHPpGsLVeNKOeJmQ9Fybe Osnr5P6WEDbmQxMW61BFJREoGe1IlHlC/hGpcKInGqb76jPVApd/idO4J /ZkymKqH1OZ/zDQNR+mIELsj6+N9KC1TojY2YJ6XRI15P4/Dcy/bQ0d08 c=; X-IronPort-AV: E=Sophos;i="5.85,375,1624320000"; d="scan'208";a="144931510" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-pdx-2b-0085f2c8.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-2101.iad2.amazon.com with ESMTP; 15 Oct 2021 13:33:53 +0000 Received: from EX13D16EUB003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-pdx-2b-0085f2c8.us-west-2.amazon.com (Postfix) with ESMTPS id 5A0E241C04; Fri, 15 Oct 2021 13:33:52 +0000 (UTC) Received: from [10.85.100.8] (10.43.160.215) by EX13D16EUB003.ant.amazon.com (10.43.166.99) with Microsoft SMTP Server (TLS) id 15.0.1497.24; Fri, 15 Oct 2021 13:33:45 +0000 Message-ID: <21f6433d-b116-2e27-90b0-16122106fbf0@amazon.com> Date: Fri, 15 Oct 2021 16:33:32 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v3 1/4] nitro_enclaves: Merge contiguous physical memory regions Content-Language: en-US To: "Longpeng(Mike)" CC: , , , , , , , , , , References: <20211009013248.1174-1-longpeng2@huawei.com> <20211009013248.1174-2-longpeng2@huawei.com> From: "Paraschiv, Andra-Irina" In-Reply-To: <20211009013248.1174-2-longpeng2@huawei.com> X-Originating-IP: [10.43.160.215] X-ClientProxiedBy: EX13D44UWB001.ant.amazon.com (10.43.161.32) To EX13D16EUB003.ant.amazon.com (10.43.166.99) Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X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