Date: Wed, 20 May 2020 11:04:13 +0000 From: "whu (Wei Hu)" <phabric-noreply@FreeBSD.org> To: freebsd-net@freebsd.org Subject: [Differential] D24061: Hyper-V socket implementation for FreeBSD guest Message-ID: <31600b32a6cfba2ec75555d0be6000a9@localhost.localdomain> In-Reply-To: <differential-rev-PHID-DREV-jw7sxemgfjxsdvkov4cn-req@reviews.freebsd.org> References: <differential-rev-PHID-DREV-jw7sxemgfjxsdvkov4cn-req@reviews.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--b1_31600b32a6cfba2ec75555d0be6000a9 Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: base64 VGhpcyByZXZpc2lvbiB3YXMgbm90IGFjY2VwdGVkIHdoZW4gaXQgbGFuZGVkOyBpdCBsYW5kZWQg aW4gc3RhdGUgIk5lZWRzIFJldmlldyIuClRoaXMgcmV2aXNpb24gd2FzIGF1dG9tYXRpY2FsbHkg dXBkYXRlZCB0byByZWZsZWN0IHRoZSBjb21taXR0ZWQgY2hhbmdlcy4KQ2xvc2VkIGJ5IGNvbW1p dCByUzM2MTI3NTogSHlwZXJWIHNvY2tldCBpbXBsZW1lbnRhdGlvbiBmb3IgRnJlZUJTRCAoYXV0 aG9yZWQgYnkgd2h1KS4KCkNIQU5HRUQgUFJJT1IgVE8gQ09NTUlUCiAgaHR0cHM6Ly9yZXZpZXdz LmZyZWVic2Qub3JnL0QyNDA2MT92cz03MDU5NSZpZD03MjAyMSN0b2MKClJFUE9TSVRPUlkKICBy UyBGcmVlQlNEIHNyYyByZXBvc2l0b3J5CgpDSEFOR0VTIFNJTkNFIExBU1QgVVBEQVRFCiAgaHR0 cHM6Ly9yZXZpZXdzLmZyZWVic2Qub3JnL0QyNDA2MT92cz03MDU5NSZpZD03MjAyMQoKQ0hBTkdF UyBTSU5DRSBMQVNUIEFDVElPTgogIGh0dHBzOi8vcmV2aWV3cy5mcmVlYnNkLm9yZy9EMjQwNjEv bmV3LwoKUkVWSVNJT04gREVUQUlMCiAgaHR0cHM6Ly9yZXZpZXdzLmZyZWVic2Qub3JnL0QyNDA2 MQoKQUZGRUNURUQgRklMRVMKICBoZWFkL3N5cy9jb25mL2ZpbGVzLng4NgogIGhlYWQvc3lzL2Rl di9oeXBlcnYvaHZzb2NrL2h2X3NvY2suYwogIGhlYWQvc3lzL2Rldi9oeXBlcnYvaHZzb2NrL2h2 X3NvY2suaAogIGhlYWQvc3lzL2Rldi9oeXBlcnYvaW5jbHVkZS92bWJ1cy5oCiAgaGVhZC9zeXMv ZGV2L2h5cGVydi92bWJ1cy92bWJ1cy5jCiAgaGVhZC9zeXMvZGV2L2h5cGVydi92bWJ1cy92bWJ1 c19ici5jCiAgaGVhZC9zeXMvZGV2L2h5cGVydi92bWJ1cy92bWJ1c19icnZhci5oCiAgaGVhZC9z eXMvZGV2L2h5cGVydi92bWJ1cy92bWJ1c19jaGFuLmMKICBoZWFkL3N5cy9kZXYvaHlwZXJ2L3Zt YnVzL3ZtYnVzX2NoYW52YXIuaAogIGhlYWQvc3lzL2Rldi9oeXBlcnYvdm1idXMvdm1idXNfcmVn LmgKICBoZWFkL3N5cy9tb2R1bGVzL2h5cGVydi9NYWtlZmlsZQogIGhlYWQvc3lzL21vZHVsZXMv aHlwZXJ2L2h2c29jay9NYWtlZmlsZQogIGhlYWQvc3lzL3N5cy9zb2NrZXQuaAoKRU1BSUwgUFJF RkVSRU5DRVMKICBodHRwczovL3Jldmlld3MuZnJlZWJzZC5vcmcvc2V0dGluZ3MvcGFuZWwvZW1h aWxwcmVmZXJlbmNlcy8KClRvOiB3aHUsIGRlY3VpX21pY3Jvc29mdC5jb20sIGZyZWVic2QtbmV0 LWxpc3QKQ2M6IGdiZXJnbGluZ19nbWFpbC5jb20sIGFlLCBncmVnX3VucmVsZW50aW5nLnRlY2hu b2xvZ3ksIGltcAo= --b1_31600b32a6cfba2ec75555d0be6000a9 Content-Type: text/x-patch; charset=utf-8; name="D24061.72021.patch" Content-Transfer-Encoding: base64 Content-Dispos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IHByb3ZpZGVkIGNhbGxiYWNrIHJvdXRpbmUuCisgKiBDYWxsZXIg c2hvdWxkIGhvbGQgbG9jayB0byBzZXJpYWxpemUgcmluZyBidWZmZXIgYWNjZXNzZXMuCisgKi8K K2ludAordm1idXNfcnhicl9wZWVrX2NhbGwoc3RydWN0IHZtYnVzX3J4YnIgKnJiciwgaW50IGRs ZW4sIHVpbnQzMl90IHNraXAsCisgICAgdm1idXNfYnJfY29weV9jYWxsYmFja190IGNiLCB2b2lk ICpjYmFyZykKK3sKKwl1aW50MzJfdCByaW5kZXgsIGJyX2RzaXplMCA9IHJici0+cnhicl9kc2l6 ZTsKKwlpbnQgcmV0OworCisJbXR4X2xvY2tfc3BpbigmcmJyLT5yeGJyX2xvY2spOworCS8qCisJ ICogVGhlIHJlcXVlc3RlZCBkYXRhICsgc2tpcCBhbmQgdGhlIDY0Yml0cyBjaGFubmVsIHBhY2tl dAorCSAqIG9mZnNldCBzaG91bGQgYmUgdGhlcmUgYXQgbGVhc3QuCisJICovCisJaWYgKHZtYnVz X3J4YnJfYXZhaWwocmJyKSA8IHNraXAgKyBkbGVuICsgc2l6ZW9mKHVpbnQ2NF90KSkgeworCQlt dHhfdW5sb2NrX3NwaW4oJnJici0+cnhicl9sb2NrKTsKKwkJcmV0dXJuIChFQUdBSU4pOworCX0K KworCXJpbmRleCA9IFZNQlVTX0JSX0lEWElOQyhyYnItPnJ4YnJfcmluZGV4LCBza2lwLCBicl9k c2l6ZTApOworCW10eF91bmxvY2tfc3BpbigmcmJyLT5yeGJyX2xvY2spOworCisJcmV0ID0gdm1i dXNfcnhicl9jb3B5ZnJvbV9jYWxsKHJiciwgcmluZGV4LCBkbGVuLCBjYiwgY2JhcmcpOworCisJ cmV0dXJuIChyZXQpOworfQorCisvKgorICogTk9URToKKyAqIFdlIGFzc3VtZSBpZHhfYWR2ID09 IHNpemVvZihjaGFubmVsIHBhY2tldCkuCisgKi8KK2ludAordm1idXNfcnhicl9pZHhhZHZfcGVl ayhz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JbXR4X3VubG9jaygmaHZzX3RyYW5zX3NvY2tzX210 eCk7CisKKwlyZXR1cm4gczsKK30KKworc3RhdGljIGlubGluZSB2b2lkCitodnNfYWRkcl9zZXQo c3RydWN0IHNvY2thZGRyX2h2cyAqYWRkciwgdW5zaWduZWQgaW50IHBvcnQpCit7CisJbWVtc2V0 KGFkZHIsIDAsIHNpemVvZigqYWRkcikpOworCWFkZHItPnNhX2ZhbWlseSA9IEFGX0hZUEVSVjsK KwlhZGRyLT5odnNfcG9ydCA9IHBvcnQ7Cit9CisKK3ZvaWQKK2h2c19hZGRyX2luaXQoc3RydWN0 IHNvY2thZGRyX2h2cyAqYWRkciwgY29uc3Qgc3RydWN0IGh5cGVydl9ndWlkICpzdnJfaWQpCit7 CisJaHZzX2FkZHJfc2V0KGFkZHIsIGdldF9wb3J0X2J5X3Nydl9pZChzdnJfaWQpKTsKK30KKwor aW50CitodnNfdHJhbnNfbG9jayh2b2lkKQoreworCXN4X3hsb2NrKCZodnNfdHJhbnNfc29ja3Nf c3gpOworCXJldHVybiAoMCk7Cit9CisKK3ZvaWQKK2h2c190cmFuc191bmxvY2sodm9pZCkKK3sK KwlzeF94dW5sb2NrKCZodnNfdHJhbnNfc29ja3Nfc3gpOworfQorCit2b2lkCitodnNfdHJhbnNf aW5pdCh2b2lkKQoreworCS8qIFNraXAgaW5pdGlhbGl6YXRpb24gb2YgZ2xvYmFscyBmb3Igbm9u LWRlZmF1bHQgaW5zdGFuY2VzLiAqLworCWlmICghSVNfREVGQVVMVF9WTkVUKGN1cnZuZXQpKQor CQlyZXR1cm47CisKKwlpZiAodm1fZ3Vlc3QgIT0gVk1fR1VFU1RfSFYpCisJCXJldHVybjsKKwor CUhWU09DS19EQkcoSFZTT0NLX0RCR19WRVJCT1NFLAorCSAgICAiJXM6IEh5cGVyViBTb2NrZXQg aHZzX3RyYW5zX2luaXQgY2FsbGVkXG4iLCBfX2Z1bmNfXyk7CisKKwkvKiBJbml0aWFsaXplIEds b2JhbHM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iksIE1fSFZTT0NLLCBNX05P V0FJVCB8IE1fWkVSTyk7CisJaWYgKHBjYiA9PSBOVUxMKQorCQlyZXR1cm4gKEVOT01FTSk7CisK KwlwY2ItPnNvID0gc287CisJc28tPnNvX3BjYiA9ICh2b2lkICopcGNiOworCisJcmV0dXJuICgw KTsKK30KKwordm9pZAoraHZzX3RyYW5zX2RldGFjaChzdHJ1Y3Qgc29ja2V0ICpzbykKK3sKKwlz dHJ1Y3QgaHZzX3BjYiAqcGNiOworCisJSFZTT0NLX0RCRyhIVlNPQ0tfREJHX1ZFUkJPU0UsCisJ ICAgICIlczogSHlwZXJWIFNvY2tldCBodnNfdHJhbnNfZGV0YWNoIGNhbGxlZFxuIiwgX19mdW5j X18pOworCisJKHZvaWQpIGh2c190cmFuc19sb2NrKCk7CisJcGNiID0gc28yaHZzcGNiKHNvKTsK KwlpZiAocGNiID09IE5VTEwpIHsKKwkJaHZzX3RyYW5zX3VubG9jaygpOworCQlyZXR1cm47CisJ fQorCisJaWYgKFNPTElTVEVOSU5HKHNvKSkgeworCQliemVybyhwY2IsIHNpemVvZigqcGNiKSk7 CisJCWZyZWUocGNiLCBNX0hWU09DSyk7CisJfQorCisJc28tPnNvX3BjYiA9IE5VTEw7CisKKwlo dnNfdHJhbnNfdW5sb2NrKCk7Cit9CisKK2ludAoraHZzX3RyYW5zX2JpbmQoc3RydWN0IHNvY2tl dCAqc28sIHN0cnVjdCBzb2NrYWRkciAqYWRkciwgc3RydWN0IHRocmVhZCAqdGQpCit7CisJc3Ry dWN0IGh2c19wY2IgKnBjYiA9IHNvMmh2c3BjYihzbyk7CisJc3RydWN0IHNvY2thZGRyX2h2cyAq c2EgPSAoc3RydWN0IHNvY2thZGRyX2h2cyAqKSBhZGRyOworCWludCBlcnJvciA9IDA7CisKKwlI VlNPQ0tfREJHKEhWU09DS19EQkdfVkVSQk9TRSwKKwkgICAgIiVzOiBIeXBlclYgU29ja2V0IGh2 c190cmFuc19iaW5kIGNhbGxlZFxuIi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hbiBjcmVhdGUKKyAqIGEg bWFwcGluZyBiZXR3ZWVuIEZyZWVCU0QgQUZfSFlQRVJWIHBvcnQgYW5kIFNPQ0tBRERSX0hWIFNl cnZpY2UgR1VJRC4KKyAqIFRoZSBydWxlIG9mIHdyaXRpbmcgSHlwZXItViBTb2NrZXRzIGFwcHMg b24gdGhlIGhvc3QgYW5kIGluIEZyZWVCU0QgVk0gaXM6CisgKgorICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioKKyAqIFRoZSBvbmx5IHZhbGlkIFNlcnZpY2UgR1VJRHMsIGZyb20gdGhlIHBlcnNwZWN0aXZl cyBvZiBib3RoIHRoZSBob3N0IGFuZCAqCisgKiBGcmVlQlNEIFZNLCB0aGF0IGNhbiBiZSBjb25u ZWN0ZWQgYnkgdGhlIG90aGVyIGVuZCwgbXVzdCBjb25mb3JtIHRvIHRoaXMgKgorICogZm9ybWF0 OiA8cG9ydD4tZmFjYi0xMWU2LWJkNTgtNjQwMDZhNzk4NmQzLiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogV2hlbiB3ZSB3cml0ZSBh cHBzIG9uIHRoZSBob3N0IHRvIGNvbm5lY3QoKSwgdGhlIEdVSUQgU2VydmljZUlEIGlzIHVzZWQu CisgKiBXaGVuIHdlIHdyaXRlIGFwcHMgaW4gRnJlZUJTRCBWTSB0byBjb25uZWN0KCksIHdlIG9u bHkgbmVlZCB0byBzcGVjaWZ5IHRoZQorICogcG9ydCBhbmQgdGhlIGRyaXZlciB3aWxsIGZvcm0g dGhlIEdVSUQgYW5kIHVzZSB0aGF0IHRvIHJlcXVlc3QgdGhlIGhvc3QuCisgKgorICogRnJvbSB0 aGUgcGVyc3BlY3RpdmUgb2YgRnJlZU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19zYykKK307CisKK3N0 YXRpYyBkZXZjbGFzc190IGh2c29ja19kZXZjbGFzczsKKworRFJJVkVSX01PRFVMRShodnNvY2ss IHZtYnVzLCBodnNvY2tfZHJpdmVyLCBodnNvY2tfZGV2Y2xhc3MsIE5VTEwsIE5VTEwpOworTU9E VUxFX1ZFUlNJT04oaHZzb2NrLCAxKTsKK01PRFVMRV9ERVBFTkQoaHZzb2NrLCB2bWJ1cywgMSwg MSwgMSk7CmRpZmYgLS1naXQgYS9oZWFkL3N5cy9jb25mL2ZpbGVzLng4NiBiL2hlYWQvc3lzL2Nv bmYvZmlsZXMueDg2Ci0tLSBhL2hlYWQvc3lzL2NvbmYvZmlsZXMueDg2CisrKyBiL2hlYWQvc3lz L2NvbmYvZmlsZXMueDg2CkBAIC0xMzMsNiArMTMzLDcgQEAKIGRldi9od3BtYy9od3BtY191bmNv cmUuYwlvcHRpb25hbAlod3BtYwogZGV2L2h3cG1jL2h3cG1jX3RzYy5jCQlvcHRpb25hbAlod3Bt YwogZGV2L2h3cG1jL2h3cG1jX3g4Ni5jCQlvcHRpb25hbAlod3BtYworZGV2L2h5cGVydi9odnNv Y2svaHZfc29jay5jCQkJCW9wdGlvbmFsCWh5cGVydgogZGV2L2h5cGVydi9pbnB1dC9odl9rYmQu YwkJCQlvcHRpb25hbAloeXBlcnYKIGRldi9oeXBlcnYvaW5wdXQvaHZfa2JkYy5jCQkJCW9wdGlv bmFsCWh5cGVydgogZGV2L2h5cGVydi9wY2liL3ZtYnVzX3BjaWIuYwkJCQlvcHRpb25hbAloeXBl cnYgcGNpCgo= --b1_31600b32a6cfba2ec75555d0be6000a9--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31600b32a6cfba2ec75555d0be6000a9>