direct-io.hg

changeset 8496:ecc20905cde3

Fixes to mtrr interface code in linux guest.

Signed-off-by: Jan Beulich <JBeulich@novell.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Jan 04 18:47:11 2006 +0100 (2006-01-04)
parents c2e93601eae5
children 9efe7eb108e1
files linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c	Wed Jan 04 18:37:24 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c	Wed Jan 04 18:47:11 2006 +0100
     1.3 @@ -67,8 +67,11 @@ int mtrr_add_page(unsigned long base, un
     1.4  	op.u.add_memtype.pfn     = base;
     1.5  	op.u.add_memtype.nr_pfns = size;
     1.6  	op.u.add_memtype.type    = type;
     1.7 -	if ((error = HYPERVISOR_dom0_op(&op)))
     1.8 +	error = HYPERVISOR_dom0_op(&op);
     1.9 +	if (error) {
    1.10 +		BUG_ON(error > 0);
    1.11  		return error;
    1.12 +	}
    1.13  
    1.14  	if (increment)
    1.15  		++usage_table[op.u.add_memtype.reg];
    1.16 @@ -121,8 +124,12 @@ int mtrr_del_page(int reg, unsigned long
    1.17  	if (--usage_table[reg] < 1) {
    1.18  		op.cmd = DOM0_DEL_MEMTYPE;
    1.19  		op.u.del_memtype.handle = 0;
    1.20 -		op.u.add_memtype.reg    = reg;
    1.21 -		(void)HYPERVISOR_dom0_op(&op);
    1.22 +		op.u.del_memtype.reg    = reg;
    1.23 +		error = HYPERVISOR_dom0_op(&op);
    1.24 +		if (error) {
    1.25 +			BUG_ON(error > 0);
    1.26 +			goto out;
    1.27 +		}
    1.28  	}
    1.29  	error = reg;
    1.30   out: