Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4605137rwb; Tue, 8 Aug 2023 10:50:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGu8cAL/ZQVHiWe20Wlb/HzAZjwS9FbDzluXnJ3Zsm5wKqw3X1Ol6P04LhPHYwD+klBCwCY X-Received: by 2002:a17:902:d4cb:b0:1b7:e646:4cc4 with SMTP id o11-20020a170902d4cb00b001b7e6464cc4mr444648plg.28.1691517055234; Tue, 08 Aug 2023 10:50:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1691517055; cv=pass; d=google.com; s=arc-20160816; b=MrV8WJKReElam2OpWyqWkIYlYw2qyt7OXHlGX+dhqBkd/OBEfsicDLPqIH+E+1Rqum eeEVsdbQt/JzdfE9pglLAgloHPG2UOj15OX6YMgtMFaP4LgAaTqpvdVAE3mWcOt70SAf ijlI7zDK5gJE20yoTOVCQGL1GW1c+nvaHkMnzxjkFMxXaV9+la0PqlM8QhLGQ6tF05c4 wUuebACPmY5mFCATQjR4WaO5hVEYBAASdqLnaCJ/9iYS+kOD4a1ukuuSGOi65w7KvwRE g50k7uC0IsgLCjpWamuKeOQp+BS/w3asGlQXQaLhI3X3g2nkiybVMwxjH3usw2NizcDO zkSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=6XUkCUXiInaIUGqFUQrvheJ+LyZWzvK+2sdRW4nyhl4=; fh=lNcmjqE97ykV1DkHzBVaNSWJXLvi1VDYf468QBhkTuQ=; b=QGnynYLbSYhL8MrcDBrlP/3kMnAkQGR5wR1gPjTwlyfl7MWZ33wDUD/HXLF+U9hCim anoQ+/NmgqjaNb3Fkm8XUuWwhdV+Pc9g8yOvhoaPUgbOLMIZhnC/4aSoS+j+Pp/68l9r 2r5xUwKVF5Rx/DJYQpU192ghIdnuIz5EXL/ggzQ9uz/7YX5lcE+k0GQJiG+dO+dtutZv WGODxD1OzenkgbAuaRsxawEET78np3y+ZIqxu3jHoPrsCcGzBFF5rjqop3Impdno6rxl d7dLzL7HkUznYORB/6oIwS6x2puGNfcJNGviTx2kRYFLOJ6aTxx1RgIBHXHqBRF6P+tk xRcQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=CH8pyqnc; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jy16-20020a17090342d000b001b89f653005si126680plb.394.2023.08.08.10.50.42; Tue, 08 Aug 2023 10:50:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=CH8pyqnc; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233419AbjHHQ7K (ORCPT + 99 others); Tue, 8 Aug 2023 12:59:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233777AbjHHQ6C (ORCPT ); Tue, 8 Aug 2023 12:58:02 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0622.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::622]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB0DB4C3D; Tue, 8 Aug 2023 08:42:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gXStPP4ko5h2bCxCus59rtJooAJXXsAt6t2kIrpJ+xbr+3olX4zJkLy7Ro0bG4jZ3elHwzFqTd/8bY/BMCJgtOiiY2afIBfl5cjUWXAbGnb0GMMKvNMd5ZS3ziKq67pxDnToqQn2P+zNkO/O7wJuDVahx6wJn+VIyrOkoPo929yFyjUKj4OLuhN7f5KEejqHuAXQHzFIHLBD7Hoc42vin+0j2yjTm1E5VJSpAghX/h4cNgB85ZMCsKKhmBqM0ovsOZBFe6uqLP2KsW4YrhPlcnI5bmpJ1EbCRT9aoeazX2g/Js4FxQYd70ZBKruj1hO+SdrufI46YwRBF9E6jMnHzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6XUkCUXiInaIUGqFUQrvheJ+LyZWzvK+2sdRW4nyhl4=; b=Nm6h2HmiiU67LeNLU2xDVSJl1xglKHNWPdD4PseB6YYNiUUkGpg/jOwxCjSKVfmU1lHlTKim5hA3TkY9qHAX3DuoF5cHmGq2flpNEbWZPZrD5rYl4pjWQ15QZJekIx7/lTeY//N4Pw33X+GKHZLqxKaigDc33qinlJFiQ07srGZ8QiKy0v1b6qB0qPOKaNJL7ROpE4KQY2FKzi6VxVEzjBh3N0z+e/GTS0Qja2BLjhl4KCCZPCw69wSNfFFIQZi8rsfnq4Dhch3eCwfLxnmFFjxU00ntYOjtNIvTReT2IObbNjk0eZB0grOnWC/cfd8jFE+ZHJ/WWY2p9aDWHEfBrA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6XUkCUXiInaIUGqFUQrvheJ+LyZWzvK+2sdRW4nyhl4=; b=CH8pyqnc3Wo7IzJk1O02ieJhAQ1WR6Dz3lwKD2z9/OvwfFk1zFvlV+pgGUXaoljq7cc1I7r7GYyepzp3Oi9iDTfgfQ0jK9hFsh6yIoSzYbx/Tff+8FzhMSk/pDY9KSOOO1mD6MyasN8Ga8DrlioSBA0RtudxkfMUFJpzgd+YHOk= Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by GVXPR04MB9829.eurprd04.prod.outlook.com (2603:10a6:150:116::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Tue, 8 Aug 2023 12:36:56 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::175:d311:2cb4:7915]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::175:d311:2cb4:7915%7]) with mapi id 15.20.6652.026; Tue, 8 Aug 2023 12:36:55 +0000 From: Pankaj Gupta To: Krzysztof Kozlowski , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "clin@suse.com" , "conor+dt@kernel.org" , "pierre.gondois@arm.com" , Jacky Bai , Clark Wang , Wei Fang , Peng Fan , Bough Chen , "festevam@gmail.com" , dl-linux-imx , "davem@davemloft.net" , "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Gaurav Jain , "alexander.stein@ew.tq-group.com" , Sahil Malhotra , Aisheng Dong , Varun Sethi CC: kernel test robot Subject: RE: [EXT] Re: [PATCH v4 6/7] firmware: imx: add driver for NXP EdgeLock Enclave Thread-Topic: [EXT] Re: [PATCH v4 6/7] firmware: imx: add driver for NXP EdgeLock Enclave Thread-Index: AQHZtLpKAfPHv7WBBUqYX9KZenNkwK+2e7wAgBOGnVA= Date: Tue, 8 Aug 2023 12:36:55 +0000 Message-ID: References: <20230712121219.2654234-1-pankaj.gupta@nxp.com> <20230712121219.2654234-7-pankaj.gupta@nxp.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DU2PR04MB8630:EE_|GVXPR04MB9829:EE_ x-ms-office365-filtering-correlation-id: 8ca31803-13aa-4452-9b5a-08db980c2654 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FDA61+bkZWHmeRqkrgXyXnUdBUBuR17RKsoVnQfcivgMQK2fmF5Tzwgjey8GTXhg8XxwNks6HhOGfAlmOkeWomHCDlKcn95snmFVoDZZPbl4AtnJ7lBPaOONGY0ltfGs9zclpX6p7j8GmdrCTrnN9+uWdzRBCR0OnlLcHb1eoVuGScwrvJcuOYTaz76ARMBcRqfe4wq6sY4e6bdyT+VZUPJoEGpLIUvwxMtyPnx5ys7pTacTkWap0VyBm/9kW1vNH0SohHM4dybuzq9xIEUh1rdETkJcc8dpYQuwsTPLvXtfHl6QP2ABm1ztpjBBX7L0Efol4kXV8vX9uTr7F9zuEiXWmsS3wwnv5cO4hNDEcvFheK0RmdHa+UzYCOlS/tCBq6qLgLV9zJlCAAzJOM3zFJX8LA5FnUDf2khJrM7+4i3H8/1YgYf6ggirhDjRWufwRdwwimpnhkoqgePL3vHIIbfJdqEo2wY/VCmKSdoTir/CiwkgPpamSA66kaOq0UuuQ8ccWqGu730V8H/7pMDtdQ2PhsPw4LlAB7odvZlT5oViZFwaG8FKwtA/Bcle7ZU+jDIOvE5HhPG8hXz06/A5oxqoCHKfeyIf/lqKGaFx9iuzyoDR1V//SsTekNo2BUBtOrIZkWhPt7gCVoUZBaOQnw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8630.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(366004)(346002)(376002)(136003)(451199021)(1800799003)(186006)(55016003)(4326008)(9686003)(38100700002)(316002)(921005)(86362001)(122000001)(6636002)(76116006)(110136005)(478600001)(66946007)(71200400001)(66446008)(66556008)(64756008)(66476007)(33656002)(53546011)(7696005)(6506007)(41300700001)(52536014)(38070700005)(8676002)(8936002)(2906002)(30864003)(83380400001)(7416002)(5660300002)(44832011)(579004)(559001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?SCt3d0k1bmowL0IxVzV2YjJZVGM2Z3FHRnlnWXY3emRUekF2UXJhVDRDampG?= =?utf-8?B?QWM3Q0NIUlo2bTM3L0ZmcFUwREJncTcxdTNRdGo4OEQweVFRbGN1RGdvK3dP?= =?utf-8?B?eGtqWUJLeUJCdWovNm93TWtGT0tadFE4Z3RndHFsTlplMlVBU29PWTFFamFD?= =?utf-8?B?UjM3Wm5Id2p3R05xbVhVdU1WNktvWjFFUWw3WnFWLzdNWWlRK1gwdVNicE1o?= =?utf-8?B?OGQ2QzBpbzJIRVBYR3FZN1hYREtkQ1ZwaGorOVRWWnZuM3htalRHUkQwTnd6?= =?utf-8?B?T0NhWE9MdTZHNHBrM2FvUFhLRy9QWlVxRlVhZ1ZBYmM2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MnVlMTFqVlZMK25vMW82Y2ZJL2FrWXdJQjJi?= =?utf-8?B?NGE1OWdXSUdkQnNGcHYrbWl0dWZVOUJubXExakFTVExubUFHakhIcDd1ODJX?= =?utf-8?B?ZzFBK3lWRXRKd0owUjV4Sm83bDc2Y3JVY0dySkFSejNYbndoaFQ1QjBiNlRG?= =?utf-8?B?U2xCVXlLd3Q0RDlNVzE4aHljTFk3emlSaWZCelQrRUJvWTA2dFBKT2p2dDhO?= =?utf-8?B?N0drOWF0SnpVbUExaGdRek14eW83ZU5zRUNRKzRvc0ZhWkpFQXM3UGFjVFZS?= =?utf-8?B?SnFZTTgwYzJ2UHNFZ1ZqNE42SlNvUGVWdzJHQnF0RlBSS2lYOVdkcDZ5SnAz?= =?utf-8?B?TFZlZHlYa01KdFZGeS9pUlVlRlorcXRLanp3TzRjL2RNNDhOcWtUbTQwTVY1?= =?utf-8?B?VDFiQ2gvTFlSazBDWll5NlFTNm16SS9PWDZQQmovOGNiemE3NnNIeWp0VE9q?= =?utf-8?B?U2tQOERkOTN6RTY1a20wWi9pQ3h2K3dMNkFVNHRIck5XcENqNkwveWNLd0do?= =?utf-8?B?bEJLQ29jK2VVeE56RTdJYU5QNTNHSkVSWU5WREhibHg2Wmx4L0xsc0QyeE9j?= =?utf-8?B?UWdnbXIyNHJ3azkvakZMaUZNMERWUkNGVFdjWUE1R2dtR1FUWjhBTUZqa1k5?= =?utf-8?B?OUluR1Zrb0FIZTA3Znp3Tm1oMUpONUNtV0RQOUY5SkgyQlJpcG9jTzlmOWZv?= =?utf-8?B?TGtmY1hZcWt1TWFHUGFSMm5QNGd3QkNmdE1RWHB4QjI0cVZGSmlEZHI3MmEy?= =?utf-8?B?VitlT3lBYXlrZHdFU2F3YkdUSWM4MVp4djJWMTdOZEFla2VDOFh6VDF2aG4w?= =?utf-8?B?eEFSMm1HSUR5M3RraW1pamsyNmRTaThTaWFaQT09?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ca31803-13aa-4452-9b5a-08db980c2654 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Aug 2023 12:36:55.2668 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gXzZN2mYXSyTxdNNb5sZiojtEmJ7M3Lq96vkY6r+XS05xyt2WJvLhBLaFzMnVVZx8m7fe8efzHqeXHsy8/ycfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9829 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,T_SPF_PERMERROR,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogS3J6eXN6dG9mIEtvemxv d3NraSA8a3J6eXN6dG9mLmtvemxvd3NraUBsaW5hcm8ub3JnPg0KPiBTZW50OiBUaHVyc2RheSwg SnVseSAxMywgMjAyMyAxMjoyNyBBTQ0KPiBUbzogUGFua2FqIEd1cHRhIDxwYW5rYWouZ3VwdGFA bnhwLmNvbT47IHNoYXduZ3VvQGtlcm5lbC5vcmc7DQo+IHMuaGF1ZXJAcGVuZ3V0cm9uaXguZGU7 IGtlcm5lbEBwZW5ndXRyb25pe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U0laRShwcml2LT5yeF9t c2cuaGVhZGVyKTsNCj4gPiArICAgICB2ZXIgPSBNU0dfVkVSKHByaXYtPnJ4X21zZy5oZWFkZXIp Ow0KPiA+ICsgICAgIHN0YXR1cyA9IFJFU19TVEFUVVMocHJpdi0+cnhfbXNnLmRhdGFbMF0pOw0K PiA+ICsgICAgIGlmICh0YWcgPT0gcHJpdi0+cnNwX3RhZyAmJg0KPiA+ICsgICAgICAgICBjb21t YW5kID09IEVMRV9HRVRfSU5GT19SRVEgJiYNCj4gPiArICAgICAgICAgc2l6ZSA9PSBFTEVfR0VU X0lORk9fUkVRX01TR19TWiAmJg0KPiA+ICsgICAgICAgICB2ZXIgPT0gRUxFX0JBU0VfQVBJX1ZF UlNJT04gJiYNCj4gPiArICAgICAgICAgc3RhdHVzID09IEVMRV9TVUNDRVNTX0lORCkNCj4gPiAr ICAgICAgICAgICAgIHJldHVybiAwOw0KPiA+ICsNCj4gPiArICAgICByZXR1cm4gLUVJTlZBTDsN Cj4gPiArfQ0KPiA+ICtFWFBPUlRfU1lNQk9MX0dQTChlbGVfZ2V0X2luZm8pOw0KPiA+ICsNCj4g PiArLyoNCj4gPiArICogZWxlX2dldF90cm5nX3N0YXRlKCkgLSBwcmVwYXJlIGFuZCBzZW5kIHRo ZSBjb21tYW5kIHRvIHJlYWQNCj4gPiArICogICAgICAgICAgICAgICAgICAgICAgICBjcnlwdG8g bGliIGFuZCBUUk5HIHN0YXRlDQo+ID4gKyAqIFRSTkcgc3RhdGUNCj4gPiArICogIDB4MSAgICAg ICAgICAgICAgVFJORyBpcyBpbiBwcm9ncmFtIG1vZGUNCj4gPiArICogIDB4MiAgICAgICAgICAg ICAgVFJORyBpcyBzdGlsbCBnZW5lcmF0aW5nIGVudHJvcHkNCj4gPiArICogIDB4MyAgICAgICAg ICAgICAgVFJORyBlbnRyb3B5IGlzIHZhbGlkIGFuZCByZWFkeSB0byBiZSByZWFkDQo+ID4gKyAq ICAweDQgICAgICAgICAgICAgIFRST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9ICgo dTggKiltc2cpW0NNRF9PRkZTRVRdOw0KPiA+ICsgICAgIGhlYWRlci5zaXplID0gKCh1OCAqKW1z ZylbU1pfT0ZGU0VUXTsNCj4gPiArICAgICBoZWFkZXIudmVyID0gKCh1OCAqKW1zZylbVkVSX09G RlNFVF07DQo+ID4gKw0KPiA+ICsgICAgIGRldl9kYmcoZGV2LCAiU2VsZWN0aW5nIGRldmljZVxu Iik7DQo+IA0KPiBEcm9wLCB1c2VsZXNzIGRlYnVnLg0KPiANCltBY2NlcHRlZC5dIHdpbGwgY29y cmVjdCBpbiBWNS4NCj4gPiArDQo+ID4gKyAgICAgLyogSW5jb21pbmcgY29tbWFuZDogd2FrZSB1 cCB0aGUgcmVjZWl2ZXIgaWYgYW55LiAqLw0KPiA+ICsgICAgIGlmIChoZWFkZXIudGFnID09IHBy aXYtPmNtZF90YWcpIHsNCj4gPiArICAgICAgICAgICAgIGRldl9kYmcoZGV2LCAiU2VsZWN0aW5n IGNtZCByZWNlaXZlclxuIik7DQo+ID4gKyAgICAgICAgICAgICBkZXZfY3R4ID0gcHJpdi0+Y21k X3JlY2VpdmVyX2RldjsNCj4gPiArICAgICB9IGVsc2UgaWYgKGhlYWRlci50YWcgPT0gcHJpdi0+ cnNwX3RhZykgew0KPiA+ICsgICAgICAgICAgICAgaWYgKHByaXYtPndhaXRpbmdfcnNwX2Rldikg ew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICBkZXZfZGJnKGRldiwgIlNlbGVjdGluZyByc3Ag d2FpdGVyXG4iKTsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgZGV2X2N0eCA9IHByaXYtPndh aXRpbmdfcnNwX2RldjsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgaXNfcmVzcG9uc2UgPSB0 cnVlOw0KPiA+ICsgICAgICAgICAgICAgfSBlbHNlIHsNCj4gPiArICAgICAgICAgICAgICAgICAg ICAgLyogUmVhZGluZyB0aGUgRWRnZUxvY2sgRW5jbGF2ZSByZXNwb25zZQ0KPiA+ICsgICAgICAg ICAgICAgICAgICAgICAgKiB0byB0aGUgY29tbWFuZCBzZW50IGJ5IG90aGVyDQo+ID4gKyAgICAg ICAgICAgICAgICAgICAgICAqIGxpbnV4IGtlcm5lbCBzZXJ2aWNlcy4NCj4gPiArICAgICAgICAg ICAgICAgICAgICAgICovDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgIHNwaW5fbG9jaygmcHJp di0+bG9jayk7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgIHByaXYtPnJ4X21zZyA9ICooc3Ry dWN0IGVsZV9hcGlfbXNnICopbXNnOw0KPiA+ICsgICAgICAgICAgICAgICAgICAgICBjb21wbGV0 ZSgmcHJpdi0+ZG9uZSk7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgIHNwaW5fdW5sb2NrKCZw cml2LT5sb2NrKTsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOw0KPiA+ICsgICAg ICAgICAgICAgfQ0KPiA+ICsgICAgIH0gZWxzZSB7DQo+ID4gKyAgICAgICAgICAgICBkZXZfZXJy KGRldiwgIkZhaWxlZCB0byBzZWxlY3QgYSBkZXZpY2UgZm9yIG1lc3NhZ2U6ICUuOHhcbiIsDQo+ ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKigodTMyICopICZoZWFkZXIpKTsNCj4g PiArICAgICAgICAgICAgIHJldHVybjsNCj4gPiArICAgICB9DQo+ID4gKw0KPiA+ICsgICAgIGlm ICghZGV2X2N0eCkgew0KPiA+ICsgICAgICAgICAgICAgZGV2X2VycihkZXYsICJObyBkZXZpY2Ug Y29udGV4dCBzZWxlY3RlZCBmb3IgbWVzc2FnZTogJS44eFxuIiwNCj4gPiArICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAqKCh1MzIgKikmaGVhZGVyKSk7DQo+ID4gKyAgICAgICAgICAgICBy ZXR1cm47DQo+ID4gKyAgICAgfQ0KPiA+ICsgICAgIC8qIEluaXQgcmVjZXB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luIVxuIik7DQo+IA0KPiBXaHk/IEhvdyB0byB0cnkgYWdhaW4/DQo+IA0KW1Bhbmthal0g QWNjZXB0ZWQuDQoNCj4gPiArDQo+ID4gKyAgICAgLyogcmVzY2hlZHVsZSB0aGUgZGVsYXkgd29y ayAqLw0KPiA+ICsgICAgIHNjaGVkdWxlX2RlbGF5ZWRfd29yayh0b19kZWxheWVkX3dvcmsod29y ayksIEVMRV9QSU5HX0lOVEVSVkFMKTsNCj4gPiArfSBzdGF0aWMgREVDTEFSRV9ERUxBWUVEX1dP UksoZWxlX3Bpbmdfd29yaywgZWxlX3BpbmdfaGFuZGxlcik7DQo+ID4gKw0KPiA+ICtzdGF0aWMg cGh5c19hZGRyX3QgZ2V0X3BoeV9idWZfbWVtX3Bvb2woc3RydWN0IGRldmljZV9ub2RlICpvZl9u b2RlLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhciAqbWVt X3Bvb2xfbmFtZSwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUz MiAqKmJ1ZiwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQz Ml90IHNpemUpIHsNCj4gPiArICAgICBzdHJ1Y3QgZ2VuX3Bvb2wgKm1lbV9wb29sID0gb2ZfZ2Vu X3Bvb2xfZ2V0KG9mX25vZGUsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBtZW1fcG9vbF9uYW1lLCAwKTsNCj4gPiArICAgICBpZiAoIW1lbV9w b29sKSB7DQo+ID4gKyAgICAgICAgICAgICBwcl9lcnIoIlVuYWJsZSB0byBnZXQgc3JhbSBwb29s XG4iKTsNCj4gPiArICAgICAgICAgICAgIHJldHVybiAwOw0KPiA+ICsgICAgIH0NCj4gPiArDQo+ ID4gKyAgICAgKmJ1ZiA9ICh1MzIgKilnZW5fcG9vbF9hbGxvYyhtZW1fc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cGxhdGZvcm1fZGV2aWNlICpwZGV2LA0KPiA+ICsgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBpbXhfaW5mbyAqaW5mbykgew0KPiA+ICsgICAg IHN0cnVjdCBzb2NfZGV2aWNlX2F0dHJpYnV0ZSAqYXR0cjsNCj4gPiArICAgICBzdHJ1Y3Qgc29j X2RldmljZSAqZGV2Ow0KPiA+ICsgICAgIHBoeXNfYWRkcl90IGdldF9pbmZvX2FkZHIgPSAwOw0K PiA+ICsgICAgIHUzMiAqZ2V0X2luZm9fZGF0YSA9IE5VTEw7DQo+ID4gKyAgICAgdTggbWFqb3Jf dmVyLCBtaW5vcl92ZXI7DQo+ID4gKyAgICAgaW50IGVycjsNCj4gPiArDQo+ID4gKyAgICAgaWYg KGluZm8tPnBvb2xfbmFtZSkgew0KPiA+ICsgICAgICAgICAgICAgZ2V0X2luZm9fYWRkciA9IGdl dF9waHlfYnVmX21lbV9wb29sKHBkZXYtPmRldi5vZl9ub2RlLA0KPiA+ICsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8tPnBvb2xfbmFtZSwNCj4g PiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZ2V0 X2luZm9fZGF0YSwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBERVZJQ0VfR0VUX0lORk9fU1opOw0KPiA+ICsgICAgIH0gZWxzZSB7DQo+ID4g KyAgICAgICAgICAgICBnZXRfaW5mb19kYXRhID0gZG1hbV9hbGxvY19jb2hlcmVudCgmcGRldi0+ ZGV2LA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgREVWSUNFX0dFVF9JTkZPX1NaLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJmdldF9pbmZvX2FkZHIsDQo+ID4gKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHRlBfS0VSTkVMKTsNCj4gPiArICAg ICB9DQo+ID4gKyAgICAgaWYgKCFnZXRfaW5mb19hZGRyKSB7DQo+ID4gKyAgICAgICAgICAgICBw cl9lcnIoIlVuYWJsZSB0byBhbGxvYyBidWZmZXIgZm9yIGRldmljZSBpbmZvLlxuIik7DQo+ID4g KyAgICAgICAgICAgICByZXR1cm4gLUVOT01FTTsNCj4gPiArICAgICB9DQo+ID4gKw0KPiA+ICsg ICAgIGF0dHIgPSBremFsbG9jKHNpemVvZigqYXR0ciksIEdGUF9LRVJORUwpOw0KPiA+ICsgICAg IGlmICghYXR0cikNCj4gPiArICAgICAgICAgICAgIHJldHVybiAtRU5PTUVNOw0KPiA+ICsNCj4g PiArICAgICBlcnIgPSBlbGVfZ2V0X2luZm8oZ2V0X2luZm9fYWRkciwgRUxFX0dFVF9JTkZPX1JF QURfU1opOw0KPiA+ICsgICAgIGlmIChlcnIpIHsNCj4gPiArICAgICAgICAgICAgIGF0dHItPnJl dmlzaW9uID0ga2FzcHJpbnRmKEdGUF9LRVJORUwsICJBMCIpOw0KPiA+ICsgICAgIH0gZWxzZSB7 DQo+ID4gKyAgICAgICAgICAgICBtYWpvcl92ZXIgPSAoZ2V0X2luZm9fZGF0YVtHRVRfSU5GT19T T0NfSU5GT19XT1JEX09GRlNFVF0NCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm IFNPQ19WRVJfTUFTSykgPj4gMjQ7DQo+ID4gKyAgICAgICAgICAgICBtaW5vcl92ZXIgPSAoKGdl dF9pbmZvX2RhdGFbR0VUX0lORk9fU09DX0lORk9fV09SRF9PRkZTRVRdDQo+ID4gKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiBTT0NfVkVSX01BU0spID4+IDE2KSAmIDB4RkY7DQo+ID4g KyAgICAgICAgICAgICBpZiAobWlub3JfdmVyKQ0KPiA+ICsgICAgICAgICAgICAgICAgICAgICBh dHRyLT5yZXZpc2lvbiA9IGthc3ByaW50ZihHRlBfS0VSTkVMLA0KPiA+ICsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJXguJXgiLA0KPiA+ICsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWpvcl92ZXIsDQo+ID4g KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pbm9yX3Zl cik7DQo+ID4gKyAgICAgICAgICAgICBlbHNlDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgIGF0 dHItPnJldmlzaW9uID0ga2FzcHJpbnRmKEdGUF9LRVJORUwsDQo+ID4gKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIleCIsDQo+ID4gKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ham9yX3Zlcik7DQo+ID4gKw0K PiA+ICsgICAgICAgICAgICAgc3dpdGNoIChnZXRfaW5mb19kYXRhW0dFVF9JTkZPX1NPQ19JTkZP X1dPUkRfT0ZGU0VUXQ0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYgU09DX0lE X01BU0spIHsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgY2FzZSBTT0NfSURfT0ZfSU1YOFVM UDoNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRyLT5zb2NfaWQgPSBrYXNw cmludGYoR0ZQX0tFUk5FTCwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgImkuTVg4VUxQIik7DQo+ID4gKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYnJlYWs7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgIGNhc2UgU09DX0lE X09GX0lNWDkz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lrZSBzb2MgcmV2aXNp b24gZXRjLCB3aGljaCBpcyBmZXRjaGVkIGFmdGVyIEFQSShHRVQtSU5GTykgZXhjaGFuZ2Ugd2l0 aCBGVy4NCj4gPiArDQo+ID4gKyAgICAgYXR0ci0+c2VyaWFsX251bWJlcg0KPiA+ICsgICAgICAg ICAgICAgPSBrYXNwcmludGYoR0ZQX0tFUk5FTCwgIiUwMTZsbFgiLA0KPiA+ICsgICAgICAgICAg ICAgICAgICAgICAgICAgKHU2NClnZXRfaW5mb19kYXRhW0dFVF9JTkZPX1NMX05VTV9NU0JfV09S RF9PRkZdDQo+IDw8IDMyDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICB8DQo+ID4gKyBn ZXRfaW5mb19kYXRhW0dFVF9JTkZPX1NMX05VTV9MU0JfV09SRF9PRkZdKTsNCj4gPiArDQo+ID4g KyAgICAgaWYgKGluZm8tPnBvb2xfbmFtZSkgew0KPiA+ICsgICAgICAgICAgICAgZnJlZV9waHli dWZfbWVtX3Bvb2wocGRldi0+ZGV2Lm9mX25vZGUsIGluZm8tPnBvb2xfbmFtZSwNCj4gPiArICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldF9pbmZvX2RhdGEsIERFVklDRV9HRVRf SU5GT19TWik7DQo+ID4gKyAgICAgfSBlbHNlIHsNCj4gPiArICAgICAgICAgICAgIGRtYW1fZnJl ZV9jb2hlcmVudCgmcGRldi0+ZGV2LA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIERFVklDRV9HRVRfSU5GT19TWiwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBnZXRfaW5mb19kYXRhLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGdldF9pbmZvX2FkZHIpOw0KPiA+ICsgICAgIH0NCj4gPiArDQo+ID4gKyAgICAgZGV2ID0gc29j X2RldmljZV9yZWdpc3RlcihhdHRyKTsNCj4gDQo+IE5vcGU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Uk5FTCk7DQo+ID4gKyAg ICAgaWYgKCFkZXZfY3R4LT5ub25fc2VjdXJlX21lbS5wdHIpIHsNCj4gPiArICAgICAgICAgICAg IGVyciA9IC1FTk9NRU07DQo+ID4gKyAgICAgICAgICAgICBkZXZjdHhfZXJyKGRldl9jdHgsICJG YWlsZWQgdG8gbWFwIHNoYXJlZCBtZW1vcnkgd2l0aCBTNDB4XG4iKTsNCj4gPiArICAgICAgICAg ICAgIGdvdG8gZXhpdDsNCj4gPiArICAgICB9DQo+ID4gKw0KPiA+ICsgICAgIGVyciA9IGVsZV9t dV9zZXR1cF9lbGVfbWVtX2FjY2VzcyhkZXZfY3R4LA0KPiA+ICsgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBkZXZfY3R4LT5ub25fc2VjdXJlX21lbS5kbWFfYWRkciwNCj4g PiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUFYX0RBVEFfU0laRV9Q RVJfVVNFUik7DQo+ID4gKyAgICAgaWYgKGVycikgew0KPiA+ICsgICAgICAgICAgICAgZXJyID0g LUVQRVJNOw0KPiA+ICsgICAgICAgICAgICAgZGV2Y3R4X2VycihkZXZfY3R4LA0KPiA+ICsgICAg ICAgICAgICAgICAgICAgICAgICAiRmFpbGVkIHRvIHNoYXJlIGFjY2VzcyB0byBzaGFyZWQgbWVt b3J5XG4iKTsNCj4gPiArICAgICAgICAgICAgIGdvdG8gZnJlZV9jb2hlcmVudDsNCj4gPiArICAg ICB9DQo+ID4gKw0KPiA+ICsgICAgIGRldl9jdHgtPm5vbl9zZWN1cmVfbWVtLnNpemUgPSBNQVhf REFUQV9TSVpFX1BFUl9VU0VSOw0KPiA+ICsgICAgIGRldl9jdHgtPm5vbl9zZWN1cmVfbWVtLnBv cyA9IDA7DQo+ID4gKyAgICAgZGV2X2N0eC0+c3RhdHVzID0gTVVfT1BFTkVEOw0KPiA+ICsNCj4g PiArICAgICBkZXZfY3R4LT5wZW5kaW5nX2h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0X2VudHJ5X29yX251bGwoJmRldl9jdHgtPnBlbmRpbmdfaW4sDQo+ID4gKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgZWxlX2J1Zl9kZXNjLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbGluayk7DQo+ID4gKyAgICAgICAgICAgICBlbHNlDQo+ID4g KyAgICAgICAgICAgICAgICAgICAgIGJfZGVzYyA9IGxpc3RfZmlyc3RfZW50cnlfb3JfbnVsbCgm ZGV2X2N0eC0+cGVuZGluZ19vdXQsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZWxlX2J1Zl9kZXNjLA0KPiA+ICsgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluayk7 DQo+ID4gKw0KPiA+ICsgICAgICAgICAgICAgaWYgKCFiX2Rlc2MpDQo+ID4gKyAgICAgICAgICAg ICAgICAgICAgIGNvbnRpbnVlOw0KPiA+ICsNCj4gPiArICAgICAgICAgICAgIGlmIChiX2Rlc2Mt PnNoYXJlZF9idWZfcHRyKQ0KPiA+ICsgICAgICAgICAgICAgICAgICAgICBtZW1zZXQoYl9kZXNj LT5zaGFyZWRfYnVmX3B0ciwgMCwgYl9kZXNjLT5zaXplKTsNCj4gPiArDQo+ID4gKyAgICAgICAg ICAgICBfX2xpc3RfZGVsX2VudHJ5KCZiX2Rlc2MtPmxpbmspOw0KPiA+ICsgICAgICAgICAgICAg ZGV2bV9rZnJlZShkZXZfY3R4LT5kZXYsIGJfZGVzYyk7DQo+ID4gKyAgICAgfQ0KPiA+ICsNCj4g PiArICAgICBkZXZfY3R4LT5zdGF0dXMgPSBNVV9GUkVFOw0KPiA+ICsNCj4gPiArZXhpdDoNCj4g PiArICAgICB1c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Y2VpdmVyX2RldiA9IGRldl9jdHg7 DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgIGVyciA9IDA7DQo+ID4gKyAgICAgICAgICAgICB9 Ow0KPiA+ICsgICAgICAgICAgICAgYnJlYWs7DQo+ID4gKyAgICAgY2FzZSBFTEVfTVVfSU9DVExf R0VUX01VX0lORk86DQo+ID4gKyAgICAgICAgICAgICBlcnIgPSBlbGVfbXVfaW9jdGxfZ2V0X211 X2luZm8oZGV2X2N0eCwgYXJnKTsNCj4gPiArICAgICAgICAgICAgIGJyZWFrOw0KPiA+ICsgICAg IGNhc2UgRUxFX01VX0lPQ1RMX1NIQVJFRF9CVUZfQ0ZHOg0KPiA+ICsgICAgICAgICAgICAgZGV2 Y3R4X2VycihkZXZfY3R4LA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAiRUxFX01VX0lP Q1RMX1NIQVJFRF9CVUZfQ0ZHIG5vdCBzdXBwb3J0ZWQgWzB4JXhdLlxuIiwNCj4gPiArICAgICAg ICAgICAgICAgICAgICAgICAgZXJyKTsNCj4gPiArICAgICAgICAgICAgIGJyZWFrOw0KPiA+ICsg ICAgIGNhc2UgRUxFX01VX0lPQ1RMX1NFVFVQX0lPQlVGOg0KPiA+ICsgICAgICAgICAgICAgZXJy ID0gZWxlX211X2lvY3RsX3NldHVwX2lvYnVmX2hhbmRsZXIoZGV2X2N0eCwgYXJnKTsNCj4gPiAr ICAgICAgICAgICAgIGJyZWFrOw0KPiA+ICsgICAgIGNhc2UgRUxFX01VX0lPQ1RMX1NJR05FRF9N RVNTQUdFOg0KPiA+ICsgICAgICAgICAgICAgZGV2Y3R4X2VycihkZXZfY3R4LA0KPiA+ICsgICAg ICAgICAgICAgICAgICAgICAgICAiRUxFX01VX0lPQ1RMX1NJR05FRF9NRVNTQUdFIG5vdCBzdXBw b3J0ZWQgWzB4JXhdLlxuIiwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgZXJyKTsNCj4g PiArICAgICAgICAgICAg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+ICsgICAgIH0NCj4gPiAr DQo+ID4gKyAgICAgaWYgKHByaXYtPnR4X2NoYW4pDQo+ID4gKyAgICAgICAgICAgICBtYm94X2Zy ZWVfY2hhbm5lbChwcml2LT50eF9jaGFuKTsNCj4gPiArICAgICBpZiAocHJpdi0+cnhfY2hhbikN Cj4gPiArICAgICAgICAgICAgIG1ib3hfZnJlZV9jaGFubmVsKHByaXYtPnJ4X2NoYW4pOw0KPiA+ ICsNCj4gPiArICAgICAvKiBmcmVlIHRoZSBidWZmZXIgaW4gZWxlLW11IHJlbW92ZSwgcHJldmlv dXNseSBhbGxvY2F0ZWQNCj4gPiArICAgICAgKiBpbiBlbGUtbXUgcHJvYmUgdG8gc3RvcmUgZW5j cnlwdGVkIElNRU0NCj4gPiArICAgICAgKi8NCj4gPiArICAgICBpZiAocHJpdi0+aW1lbS5idWYp IHsNCj4gPiArICAgICAgICAgICAgIGRtYW1fZnJlZV9jb2hlcmVudCgmcGRldi0+ZGV2LA0KPiA+ ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVMRV9JTUVNX1NJWkUsDQo+ID4gKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpdi0+aW1lbS5idWYsDQo+ID4gKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpdi0+aW1lbS5waHlhZGRyKTsNCj4gPiArICAg ICAgICAgICAgIHByaXYtPmltZW0uYnVmID0gTlVMTDsNCj4gPiArICAgICB9DQo+ID4gKw0KPiA+ ICsgICAgIGlmIChwcml2LT5mbGFncyAmIFJFU0VSVkVEX0RNQV9QT09MKSB7DQo+ID4gKyAgICAg ICAgICAgICBvZl9yZXNlcnZlZF9tZW1fZGV2aWNlX3JlbGVhc2UoZGV2KTsNCj4gPiArICAgICAg ICAgICAgIHByaXYtPmZsYWdzICY9ICh+UkVTRVJWRURfRE1BX1BPT0wpOw0KPiA+ICsgICAgIH0N Cj4gPiArICAgICBpZiAocHJpdi0+Y3R4cykgew0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JveCBjbGllbnQgY29uZmlndXJhdGlvbiAqLw0KPiA+ICsgICAgIHBy aXYtPmVsZV9tYl9jbC5kZXYgICAgICAgICAgICAgPSBkZXY7DQo+ID4gKyAgICAgcHJpdi0+ZWxl X21iX2NsLnR4X2Jsb2NrICAgICAgICA9IGZhbHNlOw0KPiA+ICsgICAgIHByaXYtPmVsZV9tYl9j bC5rbm93c190eGRvbmUgICAgPSB0cnVlOw0KPiA+ICsgICAgIHByaXYtPmVsZV9tYl9jbC5yeF9j YWxsYmFjayAgICAgPSBlbGVfbXVfcnhfY2FsbGJhY2s7DQo+ID4gKw0KPiA+ICsgICAgIHJldCA9 IGVsZV9tdV9yZXF1ZXN0X2NoYW5uZWwoZGV2LCAmcHJpdi0+dHhfY2hhbiwNCj4gPiArICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwcml2LT5lbGVfbWJfY2wsICJ0eCIpOw0KPiA+ ICsgICAgIGlmIChyZXQpIHsNCj4gPiArICAgICAgICAgICAgIGlmIChyZXQgIT0gLUVQUk9CRV9E RUZFUikNCj4gPiArICAgICAgICAgICAgICAgICAgICAgZGV2X2VycihkZXYsICJGYWlsZWQgdG8g cmVxdWVzdCB0eCBjaGFubmVsXG4iKTsNCj4gPiArDQo+ID4gKyAgICAgICAgICAgICBnb3RvIGV4 aXQ7DQo+ID4gKyAgICAgfQ0KPiA+ICsNCj4gPiArICAgICByZXQgPSBlbGVfbXVfcmVxdWVzdF9j aGFubmVsKGRldiwgJnByaXYtPnJ4X2NoYW4sDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmcHJpdi0+ZWxlX21iX2NsLCAicngiKTsNCj4gPiArICAgICBpZiAocmV0KSB7 DQo+ID4gKyAgICAgICAgICAgICBpZiAocmV0ICE9IC1FUFJPQkVfREVGRVIpDQo+ID4gKyAgICAg ICAgICAgICAgICAgICAgIGRldl9lcnIoZGV2LCAiRmFpbGVkIHRvIHJlcXVlc3QgcnggY2hhbm5l bFxuIik7DQo+ID4gKw0KPiA+ICsgICAgICAgICAgICAgZ290byBleGl0Ow0KPiA+ICsgICAgIH0N Cj4gPiArDQo+ID4gKyAgICAgcHJpdi0+Y3R4cyA9IGRldm1fa3phbGxvYyhkZXYsIHNpemVvZihk ZXZfY3R4KSAqIHByaXYtPm1heF9kZXZfY3R4LA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgR0ZQX0tFUk5FTCk7DQo+ID4gKw0KPiA+ICsgICAgIGlmICghcHJpdi0+Y3R4cykg ew0KPiA+ICsgICAgICAgICAgICAgcmV0ID0gLUVOT01FTTsNCj4gPiArICAgICAgICAgICAgIGRl dl9lcnIoZGV2LCAiRmFpbCBhbGxvY2F0ZSBtZW0gZm9yIHByaXZhdGUgZGV2LWN0eHMuXG4iKTsN Cj4gPiArICAgICAgICAgICAgIGdvdG8gZXhpdDsNCj4gPiArICAgICB9DQo+ID4gKw0KPiA+ICsg ICAgIC8qIENyZWF0ZSB1c2VycyAqLw0KPiA+ICsgICAgIGZvciAoaSA9IDA7IGkgPCBwcml2LT5t YXhfZGV2X2N0eDsgaSsrKSB7DQo+ID4gKyAgICAgICAgICAgICBkZXZfY3R4ID0gZGV2bV9remFs bG9jKGRldiwgc2l6ZW9mKCpkZXZfY3R4KSwgR0ZQX0tFUk5FTCk7DQo+ID4gKyAgICAgICAgICAg ICBpZiAoIWRldl9jdHgpIHsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgcmV0ID0gLUVOT01F TTsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgZGV2X2VycihkZXYsDQo+ID4gKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIkZhaWwgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBkZXZpY2Ug Y29udGV4dFxuIik7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgIGdvdG8gZXhpdDsNCj4gPiAr ICAgICAgICAgICAgIH0NCj4gPiArDQo+ID4gKyAgICAgICAgICAgICBkZXZfY3R4LT5kZXYgPSBk ZXY7DQo+ID4gKyAgICAgICAgICAgICBkZXZfY3R4LT5zdGF0dXMgPSBNVV9GUkVFOw0KPiA+ICsg ICAgICAgICAgICAgZGV2X2N0eC0+cHJpdiA9IHByaXY7DQo+ID4gKw0KPiA+ICsgICAgICAgICAg ICAgcHJpdi0+Y3R4c1tpXSA9IGRldl9jdHg7DQo+ID4gKw0KPiA+ICsgICAgICAgICAgICAgLyog RGVmYXVsdCB2YWx1ZSBpbnZhbGlkIGZvciBhbiBoZWFkZXIuICovDQo+ID4gKyAgICAgICAgICAg ICBpbml0X3dhaXRxdWV1ZV9oZWFkKCZkZXZfY3R4LT53cSk7DQo+ID4gKw0KPiA+ICsgICAgICAg ICAgICAgSU5JVF9MSVNUX0hFQUQoJmRldl9jdHgtPnBlbmRpbmdfb3V0KTsNCj4gPiArICAgICAg ICAgICAgIElOSVRfTElTVF9IRUFEKCZkZXZfY3R4LT5wZW5kaW5nX2luKTsNCj4gPiArICAgICAg ICAgICAgIHNlbWFfaW5pdCgmZGV2X2N0eC0+Zm9wc19sb2NrLCAxKTsNCj4gPiArDQo+ID4gKyAg ICAgICAgICAgICBkZXZuYW1lID0gZGV2bV9rYXNwcmludGYoZGV2LCBHRlBfS0VSTkVMLCAiZWxl X211JWRfY2glZCIsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cHJpdi0+ZWxlX211X2lkLCBpKTsNCj4gPiArICAgICAgICAgICAgIGlmICghZGV2bmFtZSkgew0K PiA+ICsgICAgICAgICAgICAgICAgICAgICByZXQgPSAtRU5PTUVNOw0KPiA+ICsgICAgICAgICAg ICAgICAgICAgICBkZXZfZXJyKGRldiwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAiRmFpbCB0byBhbGxvY2F0ZSBtZW1vcnkgZm9yIG1pc2MgZGV2IG5hbWVcbiIpOw0KPiA+ICsg ICAgICAgICAgICAgICAgICAgICBnb3RvIGV4aXQ7DQo+ID4gKyAgICAgICAgICAgICB9DQo+ID4g Kw0KPiA+ICsgICAgICAgICAgICAgZGV2X2N0eC0+bWlzY2Rldi5uYW1lID0gZGV2bmFtZTsNCj4g PiArICAgICAgICAgICAgIGRldl9jdHgtPm1pc2NkZXYubWlub3IgPSBNSVNDX0RZTkFNSUNfTUlO T1I7DQo+ID4gKyAgICAgICAgICAgICBkZXZfY3R4LT5taXNjZGV2LmZvcHMgPSAmZWxlX211X2Zv cHM7DQo+ID4gKyAgICAgICAgICAgICBkZXZfY3R4LT5taXNjZGV2LnBhcmVudCA9IGRldjsNCj4g PiArICAgICAgICAgICAgIHJldCA9IG1pc2NfcmVnaXN0ZXIoJmRldl9jdHgtPm1pc2NkZXYpOw0K PiA+ICsgICAgICAgICAgICAgaWYgKHJldCkgew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICBk ZXZfZXJyKGRldiwgImZhaWxlZCB0byByZWdpc3RlciBtaXNjIGRldmljZSAlZFxuIiwNCj4gPiAr ICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXQpOw0KPiA+ICsgICAgICAgICAgICAgICAg ICAgICBnb3RvIGV4aXQ7DQo+ID4gKyAgICAgICAgICAgICB9DQo+ID4gKw0KPiA+ICsgICAgICAg ICAgICAgcmV0ID0gZGV2bV9hZGRfYWN0aW9uKGRldiwgaWZfbWlzY19kZXJlZ2lzdGVyLA0KPiA+ ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZkZXZfY3R4LT5taXNjZGV2KTsN Cj4gPiArICAgICAgICAgICAgIGlmIChyZXQpIHsNCj4gPiArICAgICAgICAgICAgICAgICAgICAg ZGV2X2VycihkZXYsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImZhaWxlZFsl ZF0gdG8gYWRkIGFjdGlvbiB0byB0aGUgbWlzYy1kZXZcbiIsDQo+ID4gKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgcmV0KTsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgZ290byBleGl0 Ow0KPiA+ICsgICAgICAgICAgICAgfQ0KPiA+ICsgICAgIH0NCj4gPiArDQo+ID4gKyAgICAgaW5p dF9jb21wbGV0aW9uKCZwcml2LT5kb25lKTsNCj4gPiArICAgICBzcGluX2xvY2tfaW5pdCgmcHJp di0+bG9jayk7DQo+ID4gKw0KPiA+ICsgICAgIGVsZV9wcml2X2V4cG9ydCA9IHByaXY7DQo+ID4g Kw0KPiA+ICsgICAgIGlmIChpbmZvICYmIGluZm8tPnJlc2VydmVkX2RtYV9yYW5nZXMpIHsNCj4g PiArICAgICAgICAgICAgIHJldCA9IG9mX3Jlc2VydmVkX21lbV9kZXZpY2VfaW5pdChkZXYpOw0K PiANCj4gWW91IGRvbid0IGhhdmUgcmVzZXJ2ZWQgbWVtb3J5LCBhY2NvcmRpbmcgdG8geW91ciBi aW5kaW5ncy4NCltQYW5rYWpdIFRoaXMgd2FzIGFsc28gaGlnaGxpZ2h0ZWQgYXMgcGFydCBEVEIg dGVzdGluZy4gTm93LCBJIGhhdmUgYWRkZWQgaXQgaW4gdGhlIGJpbmRpbmcuDQo+IA0KPiA+ICsg ICAgICAgICAgICAgaWYgKHJldCkgew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICBkZXZfZXJy KGRldiwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZmFpbGVkIHRvIGluaXQg cmVzZXJ2ZWQgbWVtb3J5IHJlZ2lvbiAlZFxuIiwNCj4gPiArICAgICAgICAgICAgICAgICAgICAg ICAgICAgICByZXQpOw0KPiA+ICsgICAgICAgICAgICAgICAgICAgICBwcml2LT5mbGFncyAmPSAo flJFU0VSVkVEX0RNQV9QT09MKTsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgZ290byBleGl0 Ow0KPiA+ICsgICAgICAgICAgICAgfQ0KPiA+ICsgICAgICAgICAgICAgcHJpdi0+ZmxhZ3MgfD0g UkVTRVJWRURfRE1BX1BPT0w7DQo+ID4gKyAgICAgfQ0KPiA+ICsNCj4gPiArICAgICBpZiAoaW5m byAmJiBpbmZvLT5pbml0X2Z3KSB7DQo+ID4gKyAgICAgICAgICAgICAvKiBzdGFydCBpbml0aWFs aXppbmcgZWxlIGZ3ICovDQo+ID4gKyAgICAgICAgICAgICByZXQgPSBlbGVfaW5pdF9mdygpOw0K PiA+ICsgICAgICAgICAgICAgaWYgKHJldCkNCj4gPiArICAgICAgICAgICAgICAgICAgICAgZGV2 X2VycihkZXYsICJGYWlsZWQgdG8gaW5pdGlhbGl6ZSBlbGUgZncuXG4iKTsNCj4gPiArICAgICB9 DQo+ID4gKw0KPiA+ICsgICAgIGlmIChpbmZvICYmIGluZm8tPnNvY2Rldikgew0KPiA+ICsgICAg ICAgICAgICAgcmV0ID0gaW14X3NvY19kZXZpY2VfcmVnaXN0ZXIocGRldiwgaW5mbyk7DQo+IA0K PiBJdCdzIG5vdCBhIHNvYyBkZXZpY2UuDQpbUGFua2FqXSBpdCBpcyBub3QgYSBzb2MgZGV2aWNl LiBCdXQgdGhlIGluZm9ybWF0aW9uIGNhbiBiZSBmZXRjaGVkIGFib3V0IFNvQywgZnJvbSBGVyBw b3N0IHRoaXMgZHJpdmVyIGluaXQuDQoNCj4gDQo+ID4gKyAgICAgICAgICAgICBpZiAocmV0KSB7 DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgIGRldl9lcnIoZGV2LA0KPiA+ICsgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICJmYWlsZWRbJWRdIHRvIHJlZ2lzdGVyIFNvQyBkZXZpY2VcbiIs IHJldCk7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgIGdvdG8gZXhpdDsNCj4gPiArICAgICAg ICAgICAgIH0NCj4gPiArICAgICB9DQo+ID4gKw0KPiA+ICsgICAgIGlmIChpbmZvICYmIGluZm8t PmltZW1fbWdtdCkgew0KPiA+ICsgICAgICAgICAgICAgLyogYWxsb2NhdGUgYnVmZmVyIHdoZXJl IEVMRSBzdG9yZSBlbmNyeXB0ZWQgSU1FTSAqLw0KPiA+ICsgICAgICAgICAgICAgcHJpdi0+aW1l bS5idWYgPSBkbWFtX2FsbG9jX2NvaGVyZW50KGRldiwgRUxFX0lNRU1fU0laRSwNCj4gPiArICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcHJpdi0+aW1l bS5waHlhZGRyLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIEdGUF9LRVJORUwpOw0KPiA+ICsgICAgICAgICAgICAgaWYgKCFwcml2LT5pbWVt LmJ1Zikgew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICBkZXZfZXJyKGRldiwNCj4gPiArICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAiZG1hbS1hbGxvYy1mYWlsZWQ6IFRvIHN0b3JlIGVu Y3ItSU1FTS5cbiIpOw0KPiA+ICsgICAgICAgICAgICAgICAgICAgICByZXQgPSAtRU5PTUVNOw0K PiA+ICsgICAgICAgICAgICAgICAgICAgICBnb3RvIGV4aXQ7DQo+ID4gKyAgICAgICAgICAgICB9 DQo+ID4gKyAgICAgfQ0KPiA+ICsNCj4gPiArICAgICAvKiBzdGFydCBlbGUgcm5nICovDQo+ID4g KyAgICAgcmV0ID0gZWxlX2RvX3N0YXJ0X3JuZygpOw0KPiA+ICsgICAgIGlmIChyZXQpDQo+ID4g KyAgICAgICAgICAgICBkZXZfZXJyKGRldiwgIkZhaWxlZCB0byBzdGFydCBlbGUgcm5nXG4iKTsN Cj4gPiArDQo+ID4gKyAgICAgaWYgKCFyZXQgJiYgaW5mbyAmJiBpbmZvLT5lbmFibGVfZWxlX3Ry bmcpIHsNCj4gPiArICAgICAgICAgICAgIHJldCA9IGVsZV90cm5nX2luaXQoZGV2KTsNCj4gPiAr ICAgICAgICAgICAgIGlmIChyZXQpDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgIGRldl9lcnIo ZGV2LCA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