From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JLoes-0002pr-42 for qemu-devel@nongnu.org; Sun, 03 Feb 2008 18:53:58 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JLoeq-0002lr-C5 for qemu-devel@nongnu.org; Sun, 03 Feb 2008 18:53:57 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JLoep-0002lD-Pa for qemu-devel@nongnu.org; Sun, 03 Feb 2008 18:53:55 -0500 Received: from ug-out-1314.google.com ([66.249.92.174]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JLoep-0004h6-8q for qemu-devel@nongnu.org; Sun, 03 Feb 2008 18:53:55 -0500 Received: by ug-out-1314.google.com with SMTP id m2so960492uge.4 for ; Sun, 03 Feb 2008 15:53:54 -0800 (PST) Message-ID: Date: Mon, 4 Feb 2008 00:53:54 +0100 From: "andrzej zaborowski" In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2450_7827772.1202082834200" References: Subject: [Qemu-devel] Re: [kqemu] gpf in memory access Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Qemu mailing list ------=_Part_2450_7827772.1202082834200 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Ok, here's a patch that also makes -kernel-kqemu behave (with the previous patch it would abort with a "triple fault"). Due to the way kqemu sets up the mmu there should never be a GP fault in the mem access operations, so it would normally indicate some breakage and kqemu correctly aborts. However I looked it up in the amd64 specs and there can be a GP fault in a memory access when the sign extend bits ([63:52]) of the address are not in "canonical form" (for instance 0xff00000000000000 is not in canonical form). This patch will make such a GPF be reported to qemu. The patch only affects the x86-64 on x86-64 case. ------=_Part_2450_7827772.1202082834200 Content-Type: text/x-patch; name=kqemu-mem-gpf-amd64.patch Content-Transfer-Encoding: base64 X-Attachment-Id: f_fc8b3c1b Content-Disposition: attachment; filename=kqemu-mem-gpf-amd64.patch ZGlmZiAtLWdpdCBhL2NvbW1vbi9jb21tb24uYyBiL2NvbW1vbi9jb21tb24uYwppbmRleCAyODVi MDcyLi4yOTQ0M2NlIDEwMDY0NAotLS0gYS9jb21tb24vY29tbW9uLmMKKysrIGIvY29tbW9uL2Nv bW1vbi5jCkBAIC0yNDIsNyArMjQyLDcgQEAgc3RhdGljIGlubGluZSB1aW50NjRfdCAqbW9uX2dl dF9wdGVwX2wzKHN0cnVjdCBrcWVtdV9zdGF0ZSAqcywKICAgICBpZiAoIShwbWw0ZSAmIFBHX1BS RVNFTlRfTUFTSykpICB7CiAgICAgICAgIGlmICghYWxsb2MpCiAgICAgICAgICAgICByZXR1cm4g TlVMTDsKLSAgICAgICAgLyogYWxsb2NhZ2UgYSBuZXcgcGFnZSAqLworICAgICAgICAvKiBhbGxv Y2F0ZSBhIG5ldyBwYWdlICovCiAgICAgICAgIHB0ciA9IG1vbl9hbGxvY19wYWdlKHMsICZwZHBf cGFnZV9pbmRleCk7CiAgICAgICAgIGlmICghcHRyKQogICAgICAgICAgICAgcmV0dXJuIE5VTEw7 CmRpZmYgLS1naXQgYS9jb21tb24va3FlbXVfaW50LmggYi9jb21tb24va3FlbXVfaW50LmgKaW5k ZXggZDg4MWQ4NS4uYjJmMGI2ZSAxMDA2NDQKLS0tIGEvY29tbW9uL2txZW11X2ludC5oCisrKyBi L2NvbW1vbi9rcWVtdV9pbnQuaApAQCAtMTA2NSw2ICsxMDY1LDkgQEAgc3RhdGljIGlubGluZSB2 b2lkIHN0cV9mYXN0KHN0cnVjdCBrcWVtdV9zdGF0ZSAqcywgdW5zaWduZWQgbG9uZyBhZGRyLAog I2RlZmluZSBNTVVfRVhDRVBUSU9OKGxhYmVsKSBcCiAgICAgIi5zZWN0aW9uIFwibW11X2V4X3Rh YmxlXCIsIFwiYVwiXG4iXAogICAgICIucXVhZCAiICNsYWJlbCAiXG4iXAorICAgICIucHJldmlv dXNcbiJcCisgICAgIi5zZWN0aW9uIFwic2VnX2V4X3RhYmxlXCIsIFwiYVwiXG4iXAorICAgICIu cXVhZCAiICNsYWJlbCAiXG4iXAogICAgICIucHJldmlvdXNcbiIKICNlbHNlCiAjZGVmaW5lIE1N VV9FWENFUFRJT04obGFiZWwpIFwKZGlmZiAtLWdpdCBhL2NvbW1vbi9tb25pdG9yLmMgYi9jb21t b24vbW9uaXRvci5jCmluZGV4IGVkNDY4NDUuLmIzYjcyZGMgMTAwNjQ0Ci0tLSBhL2NvbW1vbi9t b25pdG9yLmMKKysrIGIvY29tbW9uL21vbml0b3IuYwpAQCAtMTUxNSw2ICsxNTE1LDEwIEBAIHN0 YXRpYyB2b2lkIGhhbmRsZV9tb25fZXhjZXB0aW9uKHN0cnVjdCBrcWVtdV9zdGF0ZSAqcywKICAg ICAgICAgLyogZGl2aXNpb24gZXhjZXB0aW9uIGZyb20gaW50ZXJwICovCiAgICAgICAgIC8qIFhY WDogdmVyaWZ5IGZvciBmeHNhdmUvZnhyc3RvciAqLwogICAgICAgICBzLT5yZWdzID0gJnMtPnJl Z3MxOworI2lmZGVmIF9feDg2XzY0X18KKyAgICB9IGVsc2UgaWYgKGludG5vID09IDB4MGQgJiYg ZXhwZWN0ZWRfbW9uaXRvcl9leGNlcHRpb24ocGMpKSB7CisgICAgICAgIHJhaXNlX2V4Y2VwdGlv bihzLCBLUUVNVV9SRVRfU09GVE1NVSk7CisjZW5kaWYKICAgICB9IGVsc2UgewogICAgICAgICAv KiBOb3RlOiB0aGUgZXhjZXB0aW9uIHN0YXRlIGlzIHJlbGlhYmxlIG9ubHkgZm9yIGdvdG9fdXNl cgogICAgICAgICAgICBoYW5kbGluZyAqLwo= ------=_Part_2450_7827772.1202082834200--