Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6346332pxb; Mon, 8 Nov 2021 07:10:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzI+DQf9m5CWrE/6u7htEScQ/QwMEf/H+FjyGQ8touTfcJpfvl96Qu51FFJFn3JKa4gNwFw X-Received: by 2002:aa7:ccd8:: with SMTP id y24mr424365edt.76.1636384219627; Mon, 08 Nov 2021 07:10:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636384219; cv=none; d=google.com; s=arc-20160816; b=zBl1mKyhgag8shpUk8wQWbwOjI+RRwxm1a1yDKCHwvpQ6Smbr2TMbjccHcRiOI9h98 VcjgJVh5quKbZwp0cy63wAdJeiwfpB/RcGuIBItn1/CxX/5Mmvnry9nhVK/hdWbwJ3NI gNlVtwiww1BIUpTpEQxbqc/ZyWZQZxKjmIO1kPpWyOil/m2nGGzP8V7TsGX/MLvkgBc0 C39Ve2NbUKpE9a5gJFa626XSFi7aHfO1tpZ3bJxdLu5YGHxEleAsIuSl9cG1t7DF8yPf UnKBjjHYPlHPZcRuCMDv2f7rvrzFV9s+YqOc/Sx92/ht6YPjnuXAJcFBsCwZyzrrX7Xi zvMQ== 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=ub9xr57vKaY6xpdzhQZflA5j+rF66tmX+JMBydz9q6U=; b=plN9iflx/8BkCoTnkj40V0KKFUunCjADHFwjx+NDRqVMdXARL++f2S18eA3VuGrqzH wHxEnDdD5gyHyhJZwXGMr9zBOCn+adUMsHEZz9LnanKyy32Y40BAV4yLs7mxUom/qaeb VoNtJYqUXIYN3Mpxb+LyxOOTyua4Mnnzk61SVSJCR9pDLiNhyPQ9AGMQW0VZeclBA2eT tD+z0hcnESRWeVH4qaRfd4JpOhJ1O9Q70Ns0pfzPffgXjwllzdtxMU68MIh3efaXOPD/ KacGoe61/r8SOvEGf9pqrMTsrl22RTL/DD8RBiiBnyTjHwctHDZrVuYheYF58n9lP/p4 93Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=qMxBVMii; 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 dt15si36776312ejc.564.2021.11.08.07.09.53; Mon, 08 Nov 2021 07:10:19 -0800 (PST) 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=qMxBVMii; 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 S231292AbhKHK0U (ORCPT + 99 others); Mon, 8 Nov 2021 05:26:20 -0500 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:38231 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235081AbhKHK0R (ORCPT ); Mon, 8 Nov 2021 05:26:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1636367013; x=1667903013; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ub9xr57vKaY6xpdzhQZflA5j+rF66tmX+JMBydz9q6U=; b=qMxBVMiiDhmszB4TxCK7ZtHXdKfecZ3M3EQnaA8qNFlLVJqDCvrQDSOH g+oDvFTrYnJILm4C4e1+yE0JoY0M84hVjn7sPOqhi62KYknuCSgxgLd9S Tem043PyzjLwFCAfuCObLiU1I16yz4a6hkI6TV0k6vs22cVai7Yoz5GN3 8=; X-IronPort-AV: E=Sophos;i="5.87,218,1631577600"; d="scan'208";a="153426499" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-pdx-2b-28a78e3f.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-6002.iad6.amazon.com with ESMTP; 08 Nov 2021 10:23:21 +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-28a78e3f.us-west-2.amazon.com (Postfix) with ESMTPS id B4540A2C0B; Mon, 8 Nov 2021 10:23:20 +0000 (UTC) Received: from [192.168.16.189] (10.43.162.153) by EX13D16EUB003.ant.amazon.com (10.43.166.99) with Microsoft SMTP Server (TLS) id 15.0.1497.24; Mon, 8 Nov 2021 10:23:13 +0000 Message-ID: <440f5a46-8704-18ee-06a9-483898ef0139@amazon.com> Date: Mon, 8 Nov 2021 12:23:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH v5 1/4] nitro_enclaves: Merge contiguous physical memory regions Content-Language: en-US To: "Longpeng(Mike)" CC: , , , , , , , , , , References: <20211107140918.2106-1-longpeng2@huawei.com> <20211107140918.2106-2-longpeng2@huawei.com> From: "Paraschiv, Andra-Irina" In-Reply-To: <20211107140918.2106-2-longpeng2@huawei.com> X-Originating-IP: [10.43.162.153] X-ClientProxiedBy: EX13D20UWA001.ant.amazon.com (10.43.160.34) 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-M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bWVtX3JlZ2lvbik7Cj4gQEAgLTg2Niw5ICs5MDMsMTAgQEAgc3Rh dGljIGludCBuZV9zZXRfdXNlcl9tZW1vcnlfcmVnaW9uX2lvY3RsKHN0cnVjdCBuZV9lbmNsYXZl ICpuZV9lbmNsYXZlLAo+ICAgICAgICAgICAgICAgICAgZ290byBmcmVlX21lbV9yZWdpb247Cj4g ICAgICAgICAgfQo+IAo+IC0gICAgICAgcGh5c19jb250aWdfbWVtX3JlZ2lvbnMgPSBrY2FsbG9j KG1heF9ucl9wYWdlcywgc2l6ZW9mKCpwaHlzX2NvbnRpZ19tZW1fcmVnaW9ucyksCj4gLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7Cj4gLSAgICAg ICBpZiAoIXBoeXNfY29udGlnX21lbV9yZWdpb25zKSB7Cj4gKyAgICAgICBwaHlzX2NvbnRpZ19t ZW1fcmVnaW9ucy5yZWdpb25zID0ga2NhbGxvYyhtYXhfbnJfcGFnZXMsCj4gKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoKnBoeXNfY29udGln X21lbV9yZWdpb25zLnJlZ2lvbnMpLAo+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7Cj4gKyAgICAgICBpZiAoIXBoeXNfY29udGln X21lbV9yZWdpb25zLnJlZ2lvbnMpIHsKPiAgICAgICAgICAgICAgICAgIHJjID0gLUVOT01FTTsK PiAKPiAgICAgICAgICAgICAgICAgIGdvdG8gZnJlZV9tZW1fcmVnaW9uOwo+IEBAIC05MDEsMjYg KzkzOSwxNiBAQCBzdGF0aWMgaW50IG5lX3NldF91c2VyX21lbW9yeV9yZWdpb25faW9jdGwoc3Ry dWN0IG5lX2VuY2xhdmUgKm5lX2VuY2xhdmUsCj4gICAgICAgICAgICAgICAgICBpZiAocmMgPCAw KQo+ICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIHB1dF9wYWdlczsKPiAKPiAtICAgICAg ICAgICAgICAgLyoKPiAtICAgICAgICAgICAgICAgICogVE9ETzogVXBkYXRlIG9uY2UgaGFuZGxl ZCBub24tY29udGlndW91cyBtZW1vcnkgcmVnaW9ucwo+IC0gICAgICAgICAgICAgICAgKiByZWNl aXZlZCBmcm9tIHVzZXIgc3BhY2Ugb3IgY29udGlndW91cyBwaHlzaWNhbCBtZW1vcnkgcmVnaW9u cwo+IC0gICAgICAgICAgICAgICAgKiBsYXJnZXIgdGhhbiAyIE1pQiBlLmcuIDggTWlCLgo+IC0g ICAgICAgICAgICAgICAgKi8KPiAtICAgICAgICAgICAgICAgcGh5c19jb250aWdfbWVtX3JlZ2lv bnNbaV0gPSBuZV9tZW1fcmVnaW9uLT5wYWdlc1tpXTsKPiArICAgICAgICAgICAgICAgbmVfbWVy Z2VfcGh5c19jb250aWdfbWVtb3J5X3JlZ2lvbnMoJnBoeXNfY29udGlnX21lbV9yZWdpb25zLAo+ ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdl X3RvX3BoeXMobmVfbWVtX3JlZ2lvbi0+cGFnZXNbaV0pLAo+ICsgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlX3NpemUobmVfbWVtX3JlZ2lvbi0+ cGFnZXNbaV0pKTsKPiAKPiAgICAgICAgICAgICAgICAgIG1lbW9yeV9zaXplICs9IHBhZ2Vfc2l6 ZShuZV9tZW1fcmVnaW9uLT5wYWdlc1tpXSk7Cj4gCj4gICAgICAgICAgICAgICAgICBuZV9tZW1f cmVnaW9uLT5ucl9wYWdlcysrOwo+ICAgICAgICAgIH0gd2hpbGUgKG1lbW9yeV9zaXplIDwgbWVt X3JlZ2lvbi5tZW1vcnlfc2l6ZSk7Cj4gCj4gLSAgICAgICAvKgo+IC0gICAgICAgICogVE9ETzog VXB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ewo+ICAgICAgICAgICAgICAgICAgc3RydWN0IG5lX3BjaV9kZXZfY21kX3JlcGx5IGNtZF9y ZXBseSA9IHt9Owo+ICAgICAgICAgICAgICAgICAgc3RydWN0IHNsb3RfYWRkX21lbV9yZXEgc2xv dF9hZGRfbWVtX3JlcSA9IHt9Owo+IAo+ICAgICAgICAgICAgICAgICAgc2xvdF9hZGRfbWVtX3Jl cS5zbG90X3VpZCA9IG5lX2VuY2xhdmUtPnNsb3RfdWlkOwo+IC0gICAgICAgICAgICAgICBzbG90 X2FkZF9tZW1fcmVxLnBhZGRyID0gcGFnZV90b19waHlzKHBoeXNfY29udGlnX21lbV9yZWdpb25z W2ldKTsKPiAtICAgICAgICAgICAgICAgc2xvdF9hZGRfbWVtX3JlcS5zaXplID0gcGFnZV9zaXpl KHBoeXNfY29udGlnX21lbV9yZWdpb25zW2ldKTsKPiArICAgICAgICAgICAgICAgc2xvdF9hZGRf bWVtX3JlcS5wYWRkciA9IHBoeXNfY29udGlnX21lbV9yZWdpb25zLnJlZ2lvbnNbaV0uc3RhcnQ7 Cj4gKyAgICAgICAgICAgICAgIHNsb3RfYWRkX21lbV9yZXEuc2l6ZSA9IHJhbmdlX2xlbigmcGh5 c19jb250aWdfbWVtX3JlZ2lvbnMucmVnaW9uc1tpXSk7Cj4gCj4gICAgICAgICAgICAgICAgICBy YyA9IG5lX2RvX3JlcXVlc3QocGRldiwgU0xPVF9BRERfTUVNLAo+ICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICZzbG90X2FkZF9tZW1fcmVxLCBzaXplb2Yoc2xvdF9hZGRfbWVt X3JlcSksCj4gQEAgLTk3NCw3ICsxMDAyLDcgQEAgc3RhdGljIGludCBuZV9zZXRfdXNlcl9tZW1v cnlfcmVnaW9uX2lvY3RsKHN0cnVjdCBuZV9lbmNsYXZlICpuZV9lbmNsYXZlLAo+ICAgICAgICAg ICAgICAgICAgICAgICAgICBkZXZfZXJyX3JhdGVsaW1pdGVkKG5lX21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