From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 891E11B455 for ; Fri, 29 Jun 2018 02:14:37 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2018 17:14:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,285,1526367600"; d="scan'208,217";a="67241730" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 28 Jun 2018 17:14:36 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 28 Jun 2018 17:14:36 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 28 Jun 2018 17:14:35 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.51]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.87]) with mapi id 14.03.0319.002; Fri, 29 Jun 2018 08:12:40 +0800 From: "Zhang, Qi Z" To: Andrew Rybchenko , "thomas@monjalon.net" , "Burakov, Anatoly" CC: "Ananyev, Konstantin" , "dev@dpdk.org" , "Richardson, Bruce" , "Yigit, Ferruh" , "Shelton, Benjamin H" , "Vangati, Narender" Thread-Topic: [dpdk-dev] [PATCH v7 03/19] ethdev: enable hotplug on multi-process Thread-Index: AQHUDt99E0FvuQshK0GLoEsBUOKWoqR1V2SAgAECklA= Date: Fri, 29 Jun 2018 00:12:40 +0000 Message-ID: <039ED4275CED7440929022BC67E70611532415D5@SHSMSX103.ccr.corp.intel.com> References: <20180607123849.14439-1-qi.z.zhang@intel.com> <20180628125708.39610-1-qi.z.zhang@intel.com> <20180628125708.39610-4-qi.z.zhang@intel.com> <5a65b680-d732-dff1-6cd1-22e373a0f32e@solarflare.com> In-Reply-To: <5a65b680-d732-dff1-6cd1-22e373a0f32e@solarflare.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjhkYjI1ZGItMmY0ZC00Y2M5LTlkMWItNDc3MjQ0Njk1NTc4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibUZRbEZ6RDZ1U2RrNnJFdEw0dHI0OWFZdW9KdU9OTFgzcTVnRllOaWt1RnhHc2sxY3lJeW5CdkY5ZStMd25iNiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v7 03/19] ethdev: enable hotplug on multi-process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2018 00:14:43 -0000 DQoNCkZyb206IEFuZHJldyBSeWJjaGVua28gW21haWx0bzphcnliY2hlbmtvQHNvbGFyZmxhcmUu Y29tXQ0KU2VudDogRnJpZ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iAgIGJ5IGNvZGlu ZyBzdHlsZQ0KDQoNCg0KDQoNCit7DQoNCisgICAgICAgc3RydWN0IHJ0ZV9kZXZpY2UgKmRldjsN Cg0KKyAgICAgICBzdHJ1Y3QgcnRlX2J1cyAqYnVzOw0KDQorICAgICAgIGludCByZXQgPSAwOw0K DQorDQoNCisgICAgICAgaWYgKHJ0ZV9ldGhfZGV2aWNlc1twb3J0X2lkXS5zdGF0ZSA9PSBSVEVf RVRIX0RFVl9VTlVTRUQpIHsNCg0KKyAgICAgICAgICAgICAgIGV0aGRldl9sb2coRVJSLCAiZGV0 YWNoIG9uIHNlY29uZGFyeTogaW52YWxpZCBwb3J0ICVkXG4iLA0KDQorICAgICAgICAgICAgICAg ICAgICAgICAgICBwb3J0X2lkKTsNCg0KKyAgICAgICAgICAgICAgIHJldHVybiAtRU5PREVWOw0K DQorICAgICAgIH0NCg0KKw0KDQorICAgICAgIGRldiA9IHJ0ZV9ldGhfZGV2aWNlc1twb3J0X2lk XS5kZXZpY2U7DQoNCisgICAgICAgaWYgKGRldiA9PSBOVUxMKQ0KDQorICAgICAgICAgICAgICAg cmV0dXJuIC1FSU5WQUw7DQoNCisNCg0KKyAgICAgICBidXMgPSBydGVfYnVzX2ZpbmRfYnlfZGV2 aWNlKGRldik7DQoNCisgICAgICAgaWYgKGJ1cyA9PSBOVUxMKQ0KDQorICAgICAgICAgICAgICAg cmV0dXJuIC1FTk9FTlQ7DQoNCisNCg0KKyAgICAgICByZXQgPSBydGVfZWFsX2hvdHBsdWdfcmVt b3ZlKGJ1cy0+bmFtZSwgZGV2LT5uYW1lKTsNCg0KKyAgICAgICBpZiAocmV0KSB7DQoNCisgICAg ICAgICAgICAgICBldGhkZXZfbG9nKEVSUiwgImZhaWxlZCB0byBob3QgdW5wbHVnIGJ1czogJXMs IGRldmljZTolc1xuIiwNCg0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgYnVzLT5uYW1lLCBk ZXYtPm5hbWUpOw0KDQorICAgICAgICAgIC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g ICBpZiAocmV0KSB7DQoNCisgICAgICAgICAgICAgICBldGhkZXZfbG9nKEVSUiwgImZhaWxlZCB0 byBob3RwbHVnIGJ1czolcywgZGV2aWNlOiVzXG4iLA0KDQorICAgICAgICAgICAgICAgICAgICAg ICAgICBkYS5idXMtPm5hbWUsIGRhLm5hbWUpOw0KDQorICAgICAgICAgICAgICAgZnJlZShkYS5h cmdzKTsNCg0KKyAgICAgICAgICAgICAgIHJldHVybiByZXQ7DQoNCisgICAgICAgfQ0KDQorDQoN CisgICAgICAgaWYgKHJ0ZV9ldGhfZGV2aWNlc1twb3J0X2lkXS5zdGF0ZSA9PSBSVEVfRVRIX0RF Vl9VTlVTRUQpIHsNCg0KKyAgICAgICAgICAgICAgIGV0aGRldl9sb2coRVJSLA0KDQorICAgICAg ICAgICAgICAgICAgICAgICAiZmFpbGVkIHRvIGF0dGFjaCB0byBwb3J0ICVkLCB0aGlzIGlzIGEg cG1kIGlzc3VlXG4iLA0KDQorICAgICAgICAgICAgICAgICAgICAgICAgICBwb3J0X2lkKTsNCg0K KyAgICAgICAgICAgICAgIGZyZWUoZGEuYXJncyk7DQoNCisgICAgICAgICAgICAgICByZXR1cm4g LUVOT0RFVjsNCg0KKyAgICAgICB9DQoNCisgICAgICAgZnJlZShkYS5hcmdzKTsNCg0KKyAgICAg ICByZXR1cm4gMDsNCg0KK30NCg0KKw0KDQorc3RhdGljIGludA0KDQoraGFuZGxlX3NlY29uZGFy eV9yZXF1ZXN0KGNvbnN0IHN0cnVjdCBydGVfbXBfbXNnICptc2csIGNvbnN0IHZvaWQgKnBlZXIp DQoNCit7DQoNCisgICAgICAgUlRFX1NFVF9VU0VEKG1zZyk7DQoNCisgICAgICAgUlRFX1NFVF9V U0VEKHBlZXIpOw0KDQorICAgICAgIHJldHVybiAtRU5PVFNVUDsNCg0KK30NCg0KKw0KDQorc3Rh dGljIHZvaWQgX19oYW5kbGVfcHJpbWFyeV9yZXF1ZXN0KHZvaWQgKnBhcmFtKQ0KDQorew0KDQor ICAgICAgIHN0cnVjdCBtcF9yZXBseV9idW5kbGUgKmJ1bmRsZSA9IHBhcmFtOw0KDQorICAgICAg IHN0cnVjdCBydGVfbXBfbXNnICptc2cgPSAmYnVuZGxlLT5tc2c7DQoNCisgICAgICAgY29uc3Qg c3RydWN0IGV0aF9kZXZfbXBfcmVxICpyZXEgPQ0KDQorICAgICAgICAgICAgICAgKGNvbnN0IHN0 cnVjdCBldGhfZGV2X21wX3JlcSAqKW1zZy0+cGFyYW07DQoNCisgICAgICAgc3RydWN0IHJ0ZV9t cF9tc2cgbXBfcmVzcDsNCg0KKyAgICAgICBzdHJ1Y3QgZXRoX2Rldl9tcF9yZXEgKnJlc3AgPQ0K DQorICAgICAgICAgICAgICAgKHN0cnVjdCBldGhfZGV2X21wX3JlcSAqKW1wX3Jlc3AucGFyYW07 DQoNCisgICAgICAgaW50IHJldCA9IDA7DQoNCisNCg0KKyAgICAgICBtZW1zZXQoJm1wX3Jlc3As IDAsIHNpemVvZihtcF9yZXNwKSk7DQoNCisNCg0KKyAgICAgICBzd2l0Y2ggKHJlcS0+dCkgew0K DQorICAgICAgIGNhc2UgUkVRX1RZUEVfQVRUQUNIOg0KDQorICAgICAgICAgICAgICAgcmV0ID0g YXR0YWNoX29uX3NlY29uZGFyeShyZXEtPmRldmFyZ3MsIHJlcS0+cG9ydF9pZCk7DQoNCisgICAg ICAgICAgICAgICBicmVhazsNCg0KKyAgICAgICBjYXNlIFJFUV9UWVBFX1BSRV9ERVRBQ0g6DQoN CisgICAgICAgICAgICAgICByZXQgPSAwOw0KDQorICAgICAgICAgICAgICAgYnJlYWs7DQoNCisg ICAgICAgY2FzZSBSRVFfVFlQRV9ERVRBQ0g6DQoNCisgICAgICAgY2FzZSBSRVFfVFlQRV9BVFRB Q0hfUk9MTEJBQ0s6DQoNCisgICAgICAgICAgICAgICByZXQgPSBkZXRhY2hfb25fc2Vjb25kYXJ5 KHJlcS0+cG9ydF9pZCk7DQoNCisgICAgICAgICA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xLm5hbWUsIEVUSF9ERVZfTVBfQUNUSU9OX1JFUVVFU1QsIHNpemVvZihtcF9yZXEubmFtZSkp Ow0KDQorDQoNCisgICAgICAgcmV0ID0gcnRlX21wX3JlcXVlc3Rfc3luYygmbXBfcmVxLCAmbXBf cmVwbHksICZ0cyk7DQoNCisgICAgICAgaWYgKHJldCkgew0KDQorICAgICAgICAgICAgICAgZXRo ZGV2X2xvZyhFUlIsICJydGVfbXBfcmVxdWVzdF9zeW5jIGZhaWxlZFxuIik7DQoNCisgICAgICAg ICAgICAgICByZXR1cm4gcmV0Ow0KDQorICAgICAgIH0NCg0KKw0KDQorICAgICAgIGlmIChtcF9y ZXBseS5uYl9zZW50ICE9IG1wX3JlcGx5Lm5iX3JlY2VpdmVkKSB7DQoNCisgICAgICAgICAgICAg ICBldGhkZXZfbG9nKEVSUiwgIm5vdCBhbGwgc2Vjb25kYXJ5IHJlcGx5XG4iKTsNCg0KKyAgICAg ICAgICAgICAgIHJldHVybiAtMTsNCg0KKyAgICAgICB9DQoNCisNCg0KKyAgICAgICByZXEtPnJl c3VsdCA9IDA7DQoNCisgICAgICAgZm9yIChpID0gMDsgaSA8IG1wX3JlcGx5Lm5iX3JlY2VpdmVk OyBpKyspIHsNCg0KKyAgICAgICAgICAgICAgIHN0cnVjdCBldGhfZGV2X21wX3JlcSAqcmVzcCA9 DQoNCisgICAgICAgICAgICAgICAgICAgICAgIChzdHJ1Y3QgZXRoX2Rldl9tcF9yZXEgKiltcF9y ZXBseS5tc2dzW2ldLnBhcmFtOw0KDQorICAgICAgICAgICAgICAgaWYgKHJlc3AtPnJlc3VsdCkg ew0KDQorICAgICAgICAgICAgICAgICAgICAgICByZXEtPnJlc3VsdCA9IHJlc3AtPnJlc3VsdDsN Cg0KKyAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQoNCisgICAgICAgICAgICAgICB9DQoN CisgICAgICAgfQ0KDQorDQoNCisgICAgICAgcmV0dXJuIDA7DQoNCit9DQoNCisNCg0KK3N0YXRp YyBpbnQgb25fbXBfaW5pdCh2b2lkKQ0KDQorew0KDQorICAgICAgIGludCByZXQ7DQoNCisNCg0K KyAgICAgICBpZiAocnRlX2VhbF9wcm9jZXNzX3R5cGUoKSA9PSBSVEVfUFJPQ19QUklNQVJZKSB7 DQoNCisgICAgICAgICAgICAgICByZXQgPSBydGVfbXBfYWN0aW9uX3JlZ2lzdGVyKEVUSF9ERVZf TVBfQUNUSU9OX1JFUVVFU1QsDQoNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGhhbmRsZV9zZWNvbmRhcnlfcmVxdWVzdCk7DQoNCisgICAgICAgICAgICAgICBpZiAo cmV0KSB7DQoNCisgICAgICAgICAgICAgICAgICAgICAgIFJURV9MT0coRVJSLCBFQUwsICJDb3Vs ZG4ndCByZWdpc3RlciAnJXMnIGFjdGlvblxuIiwNCg0KKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIEVUSF9ERVZfTVBfQUNUSU9OX1JFUVVFU1QpOw0KDQorICAgICAgICAgICAgICAgICAg ICAgICByZXR1cm4gcmV0Ow0KDQorICAgICAgICAgICAgICAgfQ0KDQorICAgICAgIH0gZWxzZSB7 DQoNCisgICAgICAgICAgICAgICByZXQgPSBydGVfbXBfYWN0aW9uX3JlZ2lzdGVyKEVUSF9ERVZf TVBfQUNUSU9OX1JFUVVFU1QsDQoNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGhhbmRsZV9wcmltYXJ5X3JlcXVlc3QpOw0KDQorICAgICAgICAgICAgICAgaWYgKHJl dCkgew0KDQorICAgICAgICAgICAgICAgICAgICAgICBSVEVfTE9HKEVSUiwgRUFMLCAiQ291bGRu J3QgcmVnaXN0ZXIgJyVzJyBhY3Rpb25cbiIsDQoNCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBFVEhfREVWX01QX0FDVElPTl9SRVFVRVNUKTsNCg0KKyAgICAgICAgICAgICAgICAgICAg IC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ZXZpY2U7DQoNCisgICAgICAgaWYg KGRldiA9PSBOVUxMKQ0KDQorICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7DQoNCisNCg0K KyAgICAgICBidXMgPSBydGVfYnVzX2ZpbmRfYnlfZGV2aWNlKGRldik7DQoNCisgICAgICAgaWYg KGJ1cyA9PSBOVUxMKQ0KDQorICAgICAgICAgICAgICAgcmV0dXJuIC1FTk9FTlQ7DQoNCisNCg0K KyAgICAgICBpZiAocnRlX2VhbF9wcm9jZXNzX3R5cGUoKSA9PSBSVEVfUFJPQ19TRUNPTkRBUlkp IHsNCg0KKyAgICAgICAvKioNCg0KKyAgICAgICAgKiBBIHByaXZhdGUgZGV2aWNlIG9uIHNlY29u ZGFyeSBuZWVkDQoNCisgICAgICAgICogcnRlX2V0aF9kZXZfcmVsZWFzZV9wb3J0Lg0KDQorICAg ICAgICAqIDEpIG9ubHkgdmRldiBzdXBwb3J0IHByaXZhdGUgZGV2aWNlLg0KDQorICAgICAgICAq IDIpIHByaXZhdGUgZGV2aWNlIGhhcyBubyBlbXB0eSBkZXZhcmdzLg0KDQorICAgICAgICAqLw0K DQpJcyBhbGlnbm1lbnQgY29ycmVjdC9pbnRlbmRlZCBhYm92ZT8NCg0KW1FpXSBXaWxsIGZpeA0K DQoNCg0KDQoNCg0KKyAgICAgICAgICAgICAgIGlmICghc3RyY21wKGJ1cy0+bmFtZSwgInZkZXYi KSAmJg0KDQorICAgICAgICAgICAgICAgICAgICAgICBkZXYtPmRldmFyZ3MgIT0gTlVMTCAmJg0K DQorICAgICAgICAgICAgICAgICAgICAgICBzdHJsZW4oZGV2LT5kZXZhcmdzLT5hcmdzKSA+IDAp DQoNCisgICAgICAgICAgICAgICAgICAgICAgIHNvbGlkX3JlbGVhc2UgPSAxOw0KDQorICAgICAg ICAgICAgICAgZWxzZQ0KDQorICAgICAgICAgICAgICAgICAgICAgICBzb2xpZF9yZWxlYXNlID0g MDsNCg0KKyAgICAgICB9IGVsc2Ugew0KDQorICAgICAgICAgICAgICAgc29saWRfcmVsZWFzZSA9 IDA7DQoNCisgICAgICAgfQ0KDQorDQoNCisgICAgICAgcmV0ID0gcnRlX2VhbF9ob3RwbHVnX3Jl bW92ZShidXMtPm5hbWUsIGRldi0+bmFtZSk7DQoNCisgICAgICAgaWYgKHJldCA8IDApDQoNCisg ICAgICAgICAgICAgICByZXR1cm4gcmV0Ow0KDQorDQoNCisgICAgICAgaWYgKHNvbGlkX3JlbGVh c2UpDQoNCisgICAgICAgICAgICAgICByZXR1cm4gcnRlX2V0aF9kZXZfcmVsZWFzZV9wb3J0KCZy dGVfZXRoX2RldmljZXNbcG9ydF9pZF0pOw0KDQorICAgICAgIGVsc2UNCg0KKyAgICAgICAgICAg ICAgIHJldHVybiBydGVfZXRoX2Rldl9yZWxlYXNlX3BvcnRfcHJpdmF0ZSgNCg0KKyAgICAgICAg ICAgICAgICAgICAgICAgJnJ0ZV9ldGhfZGV2aWNlc1twb3J0X2lkXSk7DQoNCit9DQoNCisNCg0K Ky8qIGF0dGFjaCB0aGUgbmV3IGRldmljZSwgdGhlbiBzdG9yZSBwb3J0X2lkIG9mIHRoZSBkZXZp Y2UgKi8NCg0KK2ludA0KDQorcnRlX2V0aF9kZXZfYXR0YWNoKGNvbnN0IGNoYXIgKmRldmFyZ3Ms IHVpbnQxNl90ICpwb3J0X2lkKQ0KDQorew0KDQorICAgICAgIHN0cnVjdCBldGhfZGV2X21wX3Jl cSByZXE7DQoNCisgICAgICAgaW50IHJldDsNCg0KKw0KDQorICAgICAgIGlmIChydGVfZWFsX3By b2Nlc3NfdHlwZSgpICE9IFJURV9QUk9DX1BSSU1BUlkpIHsNCg0KKw0KDQorICAgICAgICAgICAg ICAgLyoqDQoNCisgICAgICAgICAgICAgICAgKiBJZiBzZWNvbmRhcnkgcHJvY2Vzcywgd2UganVz dCBzZW5kIHJlcXVlc3QgdG8gcHJpbWFyeQ0KDQorICAgICAgICAgICAgICAgICogdG8gc3RhcnQg dGhlIHByb2Nlc3MuDQoNCisgICAgICAgICAgICAgICAgKi8NCg0KKyAgICAgICAgICAgICAgIHJl cS50ID0gUkVRX1RZUEVfQVRUQUNIOw0KDQorICAgICAgICAgICAgICAgc3RybGNweShyZXEuZGV2 YXJncywgZGV2YXJncywgTUFYX0RFVl9BUkdTX0xFTik7DQoNCisNCg0KKyAgICAgICAgICAgICAg IHJldCA9IGV0aF9kZXZfcmVxdWVzdF90b19wcmltYXJ5KCZyZXEpOw0KDQorICAgICAgICAgICAg ICAgaWYgKHJldCkgew0KDQorICAgICAgICAgICAgICAgICAgICAgICBldGhkZXZfbG9nKEVSUiwN Cg0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJGYWlsZWQgdG8gc2VuZCBkZXZpY2Ug YXR0YWNoIHJlcXVlc3QgdG8gcHJpbWFyeVxuIik7DQoNCisgICAgICAgICAgICAgICAgICAgICAg IHJldHVybiByZXQ7DQoNCisgICAgICAgICAgICAgICB9DQoNCisNCg0KKyAgICAgICAgICAgICAg ICpwb3J0X2lkID0gcmVxLnBvcnRfaWQ7DQoNCisgICAgICAgICAgICAgICByZXR1cm4gcmVxLnJl c3VsdDsNCg0KKyAgICAgICB9DQoNCisNCg0KKyAgICAgICByZXQgPSBkb19ldGhfZGV2X2F0dGFj aChkZXZhcmdzLCBwb3J0X2lkKTsNCg0KKyAgICAgICBpZiAocmV0KQ0KDQorICAgICAgICAgICAg ICAgcmV0dXJuIHJldDsNCg0KKw0KDQorICAgICAgIC8qIHNlbmQgYXR0YWNoIHJlcXVlc3QgdG8g c2VvbmNhcnkgKi8NCg0KKyAgICAgICByZXEudCA9IFJFUV9UWVBFX0FUVEFDSDsNCg0KKyAgICAg ICBzdHJsY3B5KHJlcS5kZXZhcmdzLCBkZXZhcmdzLCBNQVhfREVWX0FSR1NfTEVOKTsNCg0KKyAg ICAgICByZXEucG9ydF9pZCA9ICpwb3J0X2lkOw0KDQorICAgICAgIHJldCA9IGV0aF9kZXZfcmVx dWVzdF90b19zZ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J1cyA9IHJ0ZV9idXNfZmluZF9ieV9kZXZpY2UoZGV2KTsNCg0KLSAgICAgICBp ZiAoYnVzID09IE5VTEwpDQoNCi0gICAgICAgICAgICAgICByZXR1cm4gLUVOT0VOVDsNCg0KKyAg ICAgICAgICAgICAgIC8qKg0KDQorICAgICAgICAgICAgICAgICogSWYgc2Vjb25kYXJ5IHByb2Nl c3MsIHdlIGp1c3Qgc2VuZCByZXF1ZXN0IHRvIHByaW1hcnkNCg0KKyAgICAgICAgICAgICAgICAq IHRvIHN0YXJ0IHRoZSBwcm9jZXNzLg0KDQorICAgICAgICAgICAgICAgICovDQoNCisgICAgICAg ICAgICAgICByZXQgPSBldGhfZGV2X3JlcXVlc3RfdG9fcHJpbWFyeSgmcmVxKTsNCg0KKyAgICAg ICAgICAgICAgIGlmIChyZXQpIHsNCg0KKyAgICAgICAgICAgICAgICAgICAgICAgZXRoZGV2X2xv ZyhFUlIsDQoNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIHNlbmQg ZGV2aWNlIGRldGFjaCByZXF1ZXN0IHRvIHByaW1hcnlcbiIpOw0KDQorICAgICAgICAgICAgICAg ICAgICAgICByZXR1cm4gcmV0Ow0KDQorICAgICAgICAgICAgICAgfQ0KDQoNCg0KLSAgICAgICBy ZXQgPSBydGVfZWFsX2hvdHBsdWdfcmVtb3ZlKGJ1cy0+bmFtZSwgZGV2LT5uYW1lKTsNCg0KLSAg ICAgICBpZiAocmV0IDwgMCkNCg0KKyAgICAgICAgICAgICAgIHJldHVybiByZXEucmVzdWx0Ow0K DQorICAgICAgIH0NCg0KKw0KDQorICAgICAgIC8qIGNoZWNrIHByZV9kZXRhY2ggKi8NCg0KKyAg ICAgICByZXEudCA9IFJFUV9UWVBFX1BSRV9ERVRBQ0g7DQoNCisgICAgICAgcmVxLnBvcnRfaWQg PSBwb3J0X2lkOw0KDQorICAgICAgIHJldCA9IGV0aF9kZXZfcmVxdWVzdF90b19zZWNvbmRhcnko JnJlcSk7DQoNCisgICAgICAgaWYgKHJldCkgew0KDQorICAgICAgICAgICAgICAgZXRoZGV2X2xv ZyhFUlIsDQoNCisgICAgICAgICAgICAgICAgICAgICAgICJGYWlsZWQgdG8gc2VuZCBkZXZpY2Ug cHJlLWRldGFjaCByZXF1ZXN0IHRvIHNlY29uZGFyeVxuIik7DQoNCisgICAgICAgICAgICAgICBy ZXR1cm4gcmV0Ow0KDQorICAgICAgIH0NCg0KKw0KDQorICAgICAgIGlmIChyZXEucmVzdWx0KSB7 DQoNCisgICAgICAgICAgICAgICBldGhkZXZfbG9nKEVSUiwNCg0KKyAgICAgICAgICAgICAgICAg ICAgICAiRGV2aWNlIGlzIGJ1c3kgb24gc2Vjb25kYXJ5LCBjYW4ndCBiZSBkZXRhY2hlZFxuIik7 DQoNCisgICAgICAgICAgICAgICByZXR1cm4gcmVxLnJlc3VsdDsNCg0KKyAgICAgICB9DQoNCisN Cg0KKyAgICAgICAvKiBkZXRhY2ggb24gc2Vjb25hcnkgZmlyc3QgKi8NCg0KKyAgICAgICByZXEu dCA9IFJFUV9UWVBFX0RFVEFDSDsNCg0KKyAgICAgICByZXQgPSBldGhfZGV2X3JlcXVlc3RfdG9f c2Vjb25kYXJ5KCZyZXEpOw0KDQorICAgICAgIGlmIChyZXQpIHsNCg0KKyAgICAgICAgICAgICAg IGV0aGRldl9sb2coRVJSLA0KDQorICAgICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIHNl bmQgZGV2aWNlIGRldGFjaCByZXF1ZXN0IHRvIHNlY29uZGFyeVxuIik7DQoNCisgICAgICAgICAg ICAgICByZXR1cm4gcmV0Ow0KDQorICAgICAgIH0NCg0KKw0KDQorICAgICAgIGlmIChyZXEucmVz dWx0KQ0KDQorICAgICAgICAgICAgICAgLyoqDQoNCisgICAgICAgICAgICAgICAgKiB0aGlzIHNo b3VsZCByYXJlbHkgaGFwcGVuLCBzb21ldGhpbmcgd3JvbmcgaW4gc2Vjb25kYXJ5DQoNCisgICAg ICAgICAgICAgICAgKiBwcm9jZXNzLCB3aWxsIG5vdCBibG9jayBwcmltYXJ5IGRldGFjaC4NCg0K KyAgICAgICAgICAgICAgICAqLw0KDQorICAgICAgICAgICAgICAgZXRoZGV2X2xvZyhFUlIsDQoN CisgICAgICAgICAgICAgICAgICAgICAgICJGYWlsZWQgdG8gZGV0YWNoIGRldmljZSBvbiBzZWNv bmRhcnkgcHJvY2Vzc1xuIik7DQoNCisNCg0KKyAgICAgICAvKiBkZXRhY2ggb24gcHJpbWFyeSAq Lw0KDQorICAgICAgIHJldCA9ICBkb19ldGhfZGV2X2RldGFjaChwb3J0X2lkKTsNCg0KKyAgICAg ICBpZiAocmV0KQ0KDQogICAgICAgICAgICAgICAgcmV0dXJuIHJldDsNCg0KDQoNCi0gICAgICAg cnRlX2V0aF9kZXZfcmVsZWFzZV9wb3J0KCZydGVfZXRoX2RldmljZXNbcG9ydF9pZF0pOw0KDQog ICAgICAgIHJldHVybiAwOw0KDQogfQ0KDQoNCg0KKy8qIGRldGFjaCB0aGUgZGV2aWNlLCB0aGVu IHN0b3JlIHRoZSBuYW1lIG9mIHRoZSBkZXZpY2UgKi8NCg0KK2ludA0KDQorcnRlX2V0aF9kZXZf ZGV0YWNoX3ByaXZhdGUodWludDE2X3QgcG9ydF9pZCwgY2hhciAqbmFtZSBfX3J0ZV91bnVzZWQp DQoNCit7DQoNCisgICAgICAgdWludDMyX3QgZGV2X2ZsYWdzOw0KDQorDQoNCisgICAgICAgaWYg KHJ0ZV9lYWxfcHJvY2Vzc190eXBlKCkgPT0gUlRFX1BST0NfUFJJTUFSWSkNCg0KKyAgICAgICAg ICAgICAgIHJldHVybiAtRU5PVFNVUDsNCg0KKw0KDQorICAgICAgIFJURV9FVEhfVkFMSURfUE9S VElEX09SX0VSUl9SRVQocG9ydF9pZCwgLUVJTlZBTCk7DQoNCisNCg0KKyAgICAgICBkZXZfZmxh Z3MgPSBydGVfZXRoX2RldmljZXNbcG9ydF9pZF0uZ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