From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web08.3697.1608153855121705399 for ; Wed, 16 Dec 2020 13:24:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C2CIyHap; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608153853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GuYqGBtmIyDkjKn98vODbO3ghBcVFIipP5iARN77QL4=; b=C2CIyHapeZljG3Q6+8vUUNPznpQv5s3M4lmhMyOXwltU+UENITkQHYn6RmKB5d99zgAcGt r3yv7Fxn9MajBWNGsu5YPoK3iD/d00fin/6iNX/fKFfdHcrmHZopu4cO6p4tByUUAP4VSV F2XiekUtiV0ujdzB+A96PTLljmhDZV4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-286-kePgENsbOpehwtsgKUbhAg-1; Wed, 16 Dec 2020 16:24:09 -0500 X-MC-Unique: kePgENsbOpehwtsgKUbhAg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AA7BB800D62; Wed, 16 Dec 2020 21:24:08 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-152.ams2.redhat.com [10.36.114.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAB9A10021B3; Wed, 16 Dec 2020 21:24:03 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io, virtio-fs@redhat.com, lersek@redhat.com Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2 PATCH 06/48] OvmfPkg/VirtioFsDxe: introduce the basic FUSE request/response headers Date: Wed, 16 Dec 2020 22:10:43 +0100 Message-Id: <20201216211125.19496-7-lersek@redhat.com> In-Reply-To: <20201216211125.19496-1-lersek@redhat.com> References: <20201216211125.19496-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 SW50cm9kdWNlIHRoZSBWSVJUSU9fRlNfRlVTRV9SRVFVRVNUIGFuZCBWSVJUSU9fRlNfRlVTRV9S RVNQT05TRQpzdHJ1Y3R1cmVzLCB3aGljaCBhcmUgdGhlIGNvbW1vbiBoZWFkZXJzIGZvciB0aGUg dmFyaW91cyBGVVNFCnJlcXVlc3QvcmVzcG9uc2Ugc3RydWN0dXJlcy4KCkludHJvZHVjZSB0aGUg VmlydGlvRnNGdXNlTmV3UmVxdWVzdCgpIGhlbHBlciBmdW5jdGlvbiBmb3IgcG9wdWxhdGluZwpW SVJUSU9fRlNfRlVTRV9SRVFVRVNULCBmcm9tIHBhcmFtZXRlcnMgYW5kIGZyb20gYSBWSVJUSU9f RlMtbGV2ZWwgcmVxdWVzdApjb3VudGVyLgoKSW50cm9kdWNlIHRoZSBWaXJ0aW9Gc0Z1c2VDaGVj a1Jlc3BvbnNlKCkgaGVscGVyIGZ1bmN0aW9uIGZvciB2ZXJpZnlpbmcKbW9zdCBGVVNFIHJlc3Bv bnNlIHR5cGVzIHRoYXQgYmVnaW4gd2l0aCB0aGUgVklSVElPX0ZTX0ZVU0VfUk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Ag ICAgICAgICAgICAgICAgICAgICAgICAgIC0tLS0tLS0tLS0tICAgLS0tLS0tLS0tLS0tLS0tLS0t ICAtLS0tLS0tLS0tDQogICBVSU5UNjQgICAgICAgICAgICAgICAgICAgICAgICAgIFNpZ25hdHVy ZTsgLy8gRHJpdmVyQmluZGluZ1N0YXJ0ICAwDQogICBWSVJUSU9fREVWSUNFX1BST1RPQ09MICAg ICAgICAgICpWaXJ0aW87ICAgLy8gRHJpdmVyQmluZGluZ1N0YXJ0ICAwDQogICBWSVJUSU9fRlNf TEFCRUwgICAgICAgICAgICAgICAgIExhYmVsOyAgICAgLy8gVmlydGlvRnNJbml0ICAgICAgICAx DQogICBVSU5UMTYgICAgICAgICAgICAgICAgICAgICAgICAgIFF1ZXVlU2l6ZTsgLy8gVmlydGlv RnNJbml0ICAgICAgICAxDQogICBWUklORyAgICAgICAgICAgICAgICAgICAgICAgICAgIFJpbmc7 ICAgICAgLy8gVmlydGlvUmluZ0luaXQgICAgICAyDQogICBWT0lEICAgICAgICAgICAgICAgICAg ICAgICAgICAgICpSaW5nTWFwOyAgLy8gVmlydGlvUmluZ01hcCAgICAgICAyDQorICBVSU5UNjQg ICAgICAgICAgICAgICAgICAgICAgICAgIFJlcXVlc3RJZDsgLy8gRHJpdmVyQmluZGluZ1N0YXJ0 ICAwDQogICBFRklfRVZFTlQgICAgICAgICAgICAgICAgICAgICAgIEV4aXRCb290OyAgLy8gRHJp dmVyQmluZGluZ1N0YXJ0ICAwDQogICBFRklfU0lNUExFX0ZJTEVfU1lTVEVNX1BST1RPQ09MIFNp bXBsZUZzOyAgLy8gRHJpdmVyQmluZGluZ1N0YXJ0ICAwDQogfSBWSVJUSU9fRlM7DQogDQogI2Rl ZmluZSBWSVJUSU9fRlNfRlJPTV9TSU1QTEVfRlMoU2ltcGxlRnNSZWZlcmVuY2UpIFwNCiAgIENS IChTaW1wbGVGc1JlZmVyZW5jZSwgVklSVElPX0ZTLCBTaW1wbGVGcywgVklSVElPX0ZTX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gICAgICBiZWluZyBwcmVwYXJlZCBmb3IuIFRoZSAiVmlydGlv RnMtPlJlcXVlc3RJZCIgZmllbGQNCisgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbGwgYmUg Y29waWVkIGludG8gIlJlcXVlc3QtPlVuaXF1ZSIuIE9uIG91dHB1dCAob24NCisgICAgICAgICAg ICAgICAgICAgICAgICAgIHN1Y2Nlc3NmdWwgcmV0dXJuKSwgIlZpcnRpb0ZzLT5SZXF1ZXN0SWQi IHdpbGwgYmUNCisgICAgICAgICAgICAgICAgICAgICAgICAgIGluY3JlbWVudGVkLg0KKw0KKyAg QHBhcmFtW291dF0gUmVxdWVzdCAgICAgVGhlIFZJUlRJT19GU19GVVNFX1JFUVVFU1Qgb2JqZWN0 IHdob3NlIGZpZWxkcyBhcmUgdG8NCisgICAgICAgICAgICAgICAgICAgICAgICAgIGJlIHNldC4N CisNCisgIEBwYXJhbVtpbl0gUmVxdWVzdFNpemUgIFRoZSB0b3RhbCBzaXplIG9mIHRoZSByZXF1 ZXN0LCBpbmNsdWRpbmcNCisgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihWSVJUSU9f RlNfRlVTRV9SRVFVRVNUKS4NCisNCisgIEBwYXJhbVtpbl0gT3Bjb2RlICAgICAgIFRoZSBWSVJU SU9fRlNfRlVTRV9PUENPREUgdGhhdCBpZGVudGlmaWVzIHRoZSBjb21tYW5kDQorICAgICAgICAg ICAgICAgICAgICAgICAgICB0byBzZW5kLg0KKw0KKyAgQHBhcmFtW2luXSBOb2RlSWQgICAgICAg VGhlIGlub2RlIG51bWJlciBvZiB0aGUgZmlsZSB0aGF0IHRoZSByZXF1ZXN0IHJlZmVycw0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgdG8uDQorDQorICBAcmV0dmFsIEVGSV9JTlZBTElEX1BB UkFNRVRFUiAgUmVxdWVzdFNpemUgaXMgc21hbGxlciB0aGFuDQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgc2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ZSBleGNoYW5nZSAtLSB0 aGUgYnVmZmVycyB0aGF0DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIFZpcnRp byBGaWxlc3lzdGVtIGRldmljZSBmaWxsZWQgaW4gZHVyaW5nIHRoZQ0KKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHZpcnRpbyB0cmFuc2Zlci4NCisNCisgIEBwYXJhbVtpbl0gUmVxdWVz dElkICAgICAgICBUaGUgcmVxdWVzdCBpZGVudGlmaWVyIHRvIHdoaWNoIHRoZSByZXNwb25zZSBp cw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4cGVjdGVkIHRvIGJlbG9uZy4NCisN CisgIEBwYXJhbVtvdXRdIFRhaWxCdWZmZXJGaWxsICBJZiBOVUxMLCB0aGVuIHRoZSBsYXN0IGJ1 ZmZlciBpbiBSZXNwb25zZVNnTGlzdA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlz IGNvbnNpZGVyZWQgZml4ZWQgc2l6ZS4gT3RoZXJ3aXNlLCB0aGUgbGFzdA0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGJ1ZmZlciBpcyBjb25zaWRlcmVkIHZhcmlhYmxlIHNpemUsIGFu ZCBvbg0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3NmdWwgcmV0dXJuLCBU YWlsQnVmZmVyRmlsbCByZXBvcnRzIHRoZQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG51bWJlciBvZiBieXRlcyBpbiB0aGUgbGFzdCBidWZmZXIuDQorDQorICBAcmV0dmFsIEVGSV9J TlZBTElEX1BBUkFNRVRFUiAgVGFpbEJ1ZmZlckZpbGwgaXMgbm90IE5VTEwgKGkuZS4sIHRoZSBs YXN0DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyIGlzIGNvbnNpZGVy ZWQgdmFyaWFibGUgc2l6ZSksIGFuZA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IFJlc3BvbnNlU2dMaXN0LT5OdW1WZWMgaXMgMS4NCisNCisgIEByZXR2YWwgRUZJX0lOVkFMSURf UEFSQU1FVEVSICBUaGUgYWxsb2NhdGVkIHNpemUgb2YgdGhlIGZpcnN0IGJ1ZmZlciBkb2VzDQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm90IG1hdGNoIHNpemVvZihWSVJUSU9f RlNfRlVTRV9SRVNQT05TRSkuDQorDQorICBAcmV0dmFsIEVGSV9QUk9UT0NPTF9FUlJPUiAgICAg VGhlIFZJUlRJT19GU19GVVNFX1JFU1BPTlNFIHN0cnVjdHVyZSBpbiB0aGUNCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBmaXJzdCBidWZmZXIgaGFzIG5vdCBiZWVuIGZ1bGx5IHBv cHVsYXRlZC4NCisNCisgIEByZXR2YWwgRUZJX1BST1RPQ09MX0VSUk9SICAgICAiVklSVElPX0ZT X0ZVU0VfUkVTUE9OU0UuTGVuIiBpbiB0aGUgZmlyc3QNCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBidWZmZXIgZG9lcyBub3QgZXF1YWwgdGhlIHN1bSBvZiB0aGUNCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRpdmlkdWFsIGJ1ZmZlciBzaXplcyAoYXMgcG9w dWxhdGVkKS4NCisNCisgIEByZXR2YWwgRUZJX1BST1RPQ09MX0VSUk9SICAgICAiVklSVElPX0ZT X0ZVU0VfUkVTUE9OU0UuVW5pcXVlIiBpbiB0aGUgZmlyc3QNCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBidWZmZXIgZG9lcyBub3QgZXF1YWwgUmVxdWVzdElkLg0KKw0KKyAgQHJl dHZhbCBFRklfUFJPVE9DT0xfRVJST1IgICAgICJWSVJUSU9fRlNfRlVTRV9SRVNQT05TRS5FcnJv ciIgaW4gdGhlIGZpcnN0DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVy IGlzIHplcm8sIGJ1dCBhIHN1YnNlcXVlbnQgZml4ZWQgc2l6ZQ0KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGJ1ZmZlciBoYXMgbm90IGJlZW4gZnVsbHkgcG9wdWxhdGVkLg0KKw0K KyAgQHJldHZhbCBFRklfREVWSUNFX0VSUk9SICAgICAgICJWSVJUSU9fRlNfRlVTRV9SRVNQT05T RS5FcnJvciIgaW4gdGhlIGZpcnN0DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg YnVmZmVyIGlzIG5vbnplcm8uIFRoZSBjYWxsZXIgbWF5IGludmVzdGlnYXRlDQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIlZJUlRJT19GU19GVVNFX1JFU1BPTlNFLkVycm9yIi4g Tm90ZSB0aGF0IHRoZQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBsZXRl bmVzcyBvZiB0aGUgc3Vic2VxdWVudCBmaXhlZCBzaXplDQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYnVmZmVycyBpcyBub3QgdmVyaWZpZWQgaW4gdGhpcyBjYXNlLg0KKw0KKyAg QHJldHZhbCBFRklfU1VDQ0VTUyAgICAgICAgICAgIFZlcmlmaWNhdGlvbiBzdWNjZXNzZnVsLg0K KyoqLw0KK0VGSV9TVEFUVVMNCitWaXJ0aW9Gc0Z1c2VDaGVja1Jlc3BvbnNlICgNCisgIElOICBW SVJUSU9fRlNfU0NBVFRFUl9HQVRIRVJfTElTVCAqUmVzcG9uc2VTZ0xpc3QsDQorICBJTiAgVUlO VDY0ICAgICAgICAgICAgICAgICAgICAgICAgUmVxdWVzdElkLA0KKyAgT1VUIFVJTlROICAgICAg ICAgICAgICAgICAgICAgICAgICpUYWlsQnVmZmVyRmlsbA0KKyAgKQ0KK3sNCisgIFVJTlROICAg ICAgICAgICA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