This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] [PATCH] reenabling ptrace for paravirtualized guests

To: Simon Kagstrom <simon.kagstrom@xxxxxx>
Subject: Re: [Xen-devel] [PATCH] reenabling ptrace for paravirtualized guests
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Fri, 12 May 2006 08:19:36 +0100
Cc: xen-devel list <xen-devel@xxxxxxxxxxxxxxxxxxx>, Hollis Blanchard <hollisb@xxxxxxxxxx>, Ryan Harper <ryanh@xxxxxxxxxx>
Delivery-date: Fri, 12 May 2006 00:24:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <87y7x74t6i.wl%simon.kagstrom@xxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <87zmho4na4.wl%simon.kagstrom@xxxxxx> <1147382998.10714.38.camel@xxxxxxxxxxxxxxxxxxxxx> <87y7x74t6i.wl%simon.kagstrom@xxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

On 12 May 2006, at 08:07, Simon Kagstrom wrote:

        ctxt.gs_base_kernel = (unsigned long)(cpu_pda(vcpu));
+   /* set sane cr0 bits, protected and paging enabled  */
+   ctxt.ctrlreg[0] = 0x80000001;

        BUG_ON(HYPERVISOR_vcpu_op(VCPUOP_initialise, vcpu, &ctxt));

I'll add this to the patch.

This can be done entirely in Xen without guest modification and avoiding magic numbers.

Add the following to arch_set_info_guest, immediately after the memcpy to guest_context:
  /* Only CR0.TS is modifiable by guest or admin. */
  v->arch.guest_context.ctrl_reg[0] &= X86_CR0_TS;
  v->arch.guest_context.ctrl_reg[0] |= read_cr0() & ~X86_CR0_TS;

Whether we should fill in from real CR0 or simply set a static selection of flags is open to debate. I don't really think it matters either way.

 -- Keir

Xen-devel mailing list