Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
vGT: add posted read for head pointer after restore
Browse files Browse the repository at this point in the history
	/*
	 * FIXME: One weird issue observed when switching between dom0
	 * and win8 VM. The video ring #1 is not used by both dom0 and
	 * win8 (head=tail=0), however sometimes after switching back
	 * to win8 the video ring may enter a weird state that VCS cmd
	 * parser continues to parse the whole ring (fulled with ZERO).
	 * Sometimes it ends for one whole loop when head reaches back
	 * to 0. Sometimes it may parse indefinitely so that there's
	 * no way to wait for the ring empty.
	 *
	 * Add a posted read works around the issue. In the future we
	 * can further optimize by not switching unused ring.
	 */

the ringbuffer looks like:
[ 1015.518426] vGT(wait-empty): wait 20 seconds for ring(1)
[ 1015.523865] vGT-cur(1): head(0), tail(0), start(7eee000)
[ 1015.529339] vGT-dom0(0): head(0), tail(0), start(8023000)
[ 1015.534899] debug registers(ring-1, reg maked with <*> may not apply to every ring):
[ 1015.542864] ....EIR: 0
[ 1015.545337] ....ESR: 0
[ 1015.547808] ....blit EIR: 0
[ 1015.550724] ....blit ESR: 0
[ 1015.553635] ....IPEHR(last executed inst): 0
[ 1015.558049] ....INSTPS* (parser state): 0 :
[ 1015.562375] ....ACTHD(active header): 18800468
[ 1015.566966] ....DMA_FADD_P(current fetch DMA): 7eee400
[ 1015.572264] ....CSCMDOP* (instruction DWORD): 0
[ 1015.576942] ....CSCMDVLD* (command buffer valid): 0
[ 1015.581975] (informative)
[ 1015.584712] ....INSTDONE_1(FYI)*: ff8fffff
[ 1015.588949] ....INSTDONE_2*: 0
[ 1015.592130] ring buffer(1): head (82c003c4) tail(10000), start(7eee000)
[ 1015.598924] p_contents(ffffc900189ee3c4)
[ 1015.602986]
[ 1015.603025] [00000384]:        0        0        0        0        0        0        0        0
[ 1015.613228] [000003a4]:        0        0        0        0        0        0        0        0
[ 1015.622144] [000003c4]:        0(*)        0        0        0        0        0        0        0
[ 1015.631326] [000003e4]:        0        0        0        0        0        0        0        0

by ktian1
  • Loading branch information
ktian1 authored and zhiyuanlv committed Jan 9, 2015
1 parent bff2f9c commit f43de1d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion drivers/xen/vgt_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,9 @@ void ring_shadow_2_phys(struct pgt_device *pdev, int ring_id, vgt_ringbuffer_t *
VGT_MMIO_READ(pdev, RB_CTL(ring_id)));

if (!(srb->ctl & _RING_CTL_ENABLE)) {
printk("vGT: ring (%d) not enabled. exit restore\n", ring_id);
printk("vGT/switch-%d: ring (%d) not enabled. exit restore\n",
vgt_ctx_switch(pdev), ring_id);
VGT_MMIO_WRITE(pdev, RB_CTL(ring_id), 0);
return;
}
disable_ring(pdev, ring_id);
Expand All @@ -1552,6 +1554,20 @@ void ring_shadow_2_phys(struct pgt_device *pdev, int ring_id, vgt_ringbuffer_t *

enable_ring(pdev, ring_id, srb->ctl);

/*
* FIXME: One weird issue observed when switching between dom0
* and win8 VM. The video ring #1 is not used by both dom0 and
* win8 (head=tail=0), however sometimes after switching back
* to win8 the video ring may enter a weird state that VCS cmd
* parser continues to parse the whole ring (fulled with ZERO).
* Sometimes it ends for one whole loop when head reaches back
* to 0. Sometimes it may parse indefinitely so that there's
* no way to wait for the ring empty.
*
* Add a posted read works around the issue. In the future we
* can further optimize by not switching unused ring.
*/
VGT_POST_READ(pdev, RB_HEAD(ring_id));
dprintk("shadow 2 phys: [%x, %x]\n", VGT_MMIO_READ(pdev, RB_HEAD(ring_id)),
VGT_MMIO_READ(pdev, RB_TAIL(ring_id)));
}
Expand Down

0 comments on commit f43de1d

Please sign in to comment.