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-ia64-devel] [PATCH] This is the second patch to merge vcpu.c

To: "Xu, Anthony" <anthony.xu@xxxxxxxxx>
Subject: RE: [Xen-ia64-devel] [PATCH] This is the second patch to merge vcpu.c
From: "Magenheimer, Dan (HP Labs Fort Collins)" <dan.magenheimer@xxxxxx>
Date: Mon, 19 Sep 2005 06:13:19 -0700
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 19 Sep 2005 13:11:06 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcW9EOnsq8f7PkrtRbOf9CBoPVTbywACNUQg
Thread-topic: [Xen-ia64-devel] [PATCH] This is the second patch to merge vcpu.c
Hi Anthony --

The patch looks good except one possible caution worth
thinking about: the change to the definition of vcpu_regs.
If vcpu_regs is used when the stack is "nested" (e.g.
there is one or more other "stack activation records"
on the stack due to interrupt nesting), the wrong data
may be read/written.

I remember this happened a year ago when I first wrote
this code.  It may not happen anymore, especially in
non-VTI where vcpu_regs is only used in vcpu.c.
But if any of the vcpu_* routines that use vcpu_regs
is ever called when the stack is nested, we may see
some strange data corruption problems when the
system is heavily stressed (e.g. lots of external
interrupts, which my "linux compile stress test"
doesn't do).

Assuming the "old" way of obtaining regs is no
longer necessary, the patch should probably remove
vcpu_set_regs, the call to vcpu_set_regs in
privop.c, the use of arch.regs in process.c,
and the element regs from the arch data structure.
We can remove those in a followup patch.

I will try out your patch and try to check it in
later today.


> -----Original Message-----
> From: Xu, Anthony [mailto:anthony.xu@xxxxxxxxx] 
> Sent: Monday, September 19, 2005 5:55 AM
> To: Magenheimer, Dan (HP Labs Fort Collins)
> Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
> Subject: [Xen-ia64-devel] [PATCH] This is the second patch to 
> merge vcpu.c
> Dan,
> Thanks, Dan, I have noticed that the first patch for merging 
> vcpu.c had been cheked in.
> This patch is based on ver.6866, and has gone through your 
> stress-test.
> Following things are done in this patch.
> 1. Add r4,r5,r6,r7,eml_unat,rfi_pfs six members at the end of 
> pt_regs, 
>    thus VMM for non-VT domain doesn't need to save/restore 
>    just in case VMM may need modify guest r4,r5,r6,r7 value, 
> eml_unat is saved
>    in case VMM may need modify guest unat, rfi_pfs is used to 
> emulate guest rfi
>    instruction for VT domain, and is used as dummy member for 
> alignment of F6,
>    F7 etc. in pt_regs for non-VT domain. And add code to 
> save/restore r4,r5,r6,
>    r7,eml_unat in minstate.h and entry.s for non-VT domain. 
> and remove code to
>    save/restore SWITCH_STACK in ivt.S for non-VT domain.
> 2. Originally guest banked registers of VT domain are saved 
> directly in VPD. Now
>    Guest banked registers of VT domain are saved to pt_regs 
> at the entry of VMM,
>    just for consistence with non-VT domain, vmx_vcpu_bsw0 and 
> vmx_vcpu_bsw1 are 
>    rewriten for accomodating this change.
> 3. After above changes, all guest registers and nat bits are 
> saved at same place
>    both for VTI domain and for non-VTI domain, so vcpu_get/set_gr and 
>    rse_get/set_gr are merged, and all these functions can 
> handle guest nats.
> 4. Merged vcpu_bsw0 and vcpu_bsw1, Now VMM uses 
> vgr[16],vbgr[16],vnat,vbnat in 
>    mapped_regs_t struct (is also vpd) to emuate guest banking 
> switch operation.
> 5. Removed some CONFIG_VTIs and cleaned up some unused 
> structure members and codes.
> Signed-off-by Anthony Xu <Anthony.xu@xxxxxxxxx>
> Thanks,
> Anthony

Xen-ia64-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>