From: "George Dunlap " Subject: [PATCH] Make xentrace hypercall a bit more sane Date: Thu, 1 Jun 2006 16:17:03 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_7709_21447264.1149193023042" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org ------=_Part_7709_21447264.1149193023042 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline xentrace, setsize and the hypervisor don't seem to be on the same page. If tracing is not enabled, the hypercall will only allow TBUF_SET_SIZE and TBUF_ENABLE. However, set_size calls TBUF_GET_INFO, and xentrace wants to call TBUF_SET_EVT_MASK and TBUF_SET_CPU_MASK before calling TBUF_ENABLE. I don't see any reason not to call SET_*_MASK and GET_INFO if tracing is not enabled. If the buffer hasn't been allocated yet, GET_INFO should just return something invalid in the mfn field. Anyone calling should check this value. Comments? -George ------=_Part_7709_21447264.1149193023042 Content-Type: text/x-patch; name=xentrace.patch; charset=ISO-8859-1 Content-Transfer-Encoding: base64 X-Attachment-Id: f_enxjtihn Content-Disposition: attachment; filename="xentrace.patch" ZGlmZiAtciBhY2JkZWMzM2Y2NjYgeGVuL2NvbW1vbi90cmFjZS5jCi0tLSBhL3hlbi9jb21tb24v dHJhY2UuYwlUaHUgSnVuIDAxIDE2OjA4OjM2IDIwMDYgLTA0MDAKKysrIGIveGVuL2NvbW1vbi90 cmFjZS5jCVRodSBKdW4gMDEgMTY6MTM6MTEgMjAwNiAtMDQwMApAQCAtMTc4LDIxICsxNzgsMTgg QEAgaW50IHRiX2NvbnRyb2woZG9tMF90YnVmY29udHJvbF90ICp0YmMpCiAKICAgICBzcGluX2xv Y2soJmxvY2spOwogCi0gICAgaWYgKCAhdGJfaW5pdF9kb25lICYmCi0gICAgICAgICAodGJjLT5v cCAhPSBET00wX1RCVUZfU0VUX1NJWkUpICYmCi0gICAgICAgICAodGJjLT5vcCAhPSBET00wX1RC VUZfRU5BQkxFKSApCi0gICAgewotICAgICAgICBzcGluX3VubG9jaygmbG9jayk7Ci0gICAgICAg IHJldHVybiAtRUlOVkFMOwotICAgIH0KLQogICAgIHN3aXRjaCAoIHRiYy0+b3AgKQogICAgIHsK ICAgICBjYXNlIERPTTBfVEJVRl9HRVRfSU5GTzoKICAgICAgICAgdGJjLT5jcHVfbWFzayAgID0g dGJfY3B1X21hc2s7CiAgICAgICAgIHRiYy0+ZXZ0X21hc2sgICA9IHRiX2V2ZW50X21hc2s7Ci0g ICAgICAgIHRiYy0+YnVmZmVyX21mbiA9IF9fcGEodF9idWZzWzBdKSA+PiBQQUdFX1NISUZUOwot ICAgICAgICB0YmMtPnNpemUgICAgICAgPSBvcHRfdGJ1Zl9zaXplICogUEFHRV9TSVpFOworICAg ICAgICBpZiggb3B0X3RidWZfc2l6ZSApIHsKKyAgICAgICAgICAgIHRiYy0+YnVmZmVyX21mbiA9 IF9fcGEodF9idWZzWzBdKSA+PiBQQUdFX1NISUZUOworICAgICAgICAgICAgdGJjLT5zaXplICAg ICAgID0gb3B0X3RidWZfc2l6ZSAqIFBBR0VfU0laRTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAg ICAgICAgIHRiYy0+YnVmZmVyX21mbiA9ICh1bnNpZ25lZCBsb25nKS0xOworICAgICAgICAgICAg dGJjLT5zaXplICAgICAgID0gMDsKKyAgICAgICAgfQogICAgICAgICBicmVhazsKICAgICBjYXNl IERPTTBfVEJVRl9TRVRfQ1BVX01BU0s6CiAgICAgICAgIHRiX2NwdV9tYXNrID0gdGJjLT5jcHVf bWFzazsK ------=_Part_7709_21447264.1149193023042 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ------=_Part_7709_21447264.1149193023042--