win-pvdrivers

changeset 665:dacb06e01653

Search harder for xen signature
author James Harper <james.harper@bendigoit.com.au>
date Wed Sep 23 17:02:30 2009 +1000 (2009-09-23)
parents 4969d3abdffc
children 0ce79d5ace51
files xenpci/memory.c
line diff
     1.1 --- a/xenpci/memory.c	Sat Sep 19 14:46:54 2009 +1000
     1.2 +++ b/xenpci/memory.c	Wed Sep 23 17:02:30 2009 +1000
     1.3 @@ -4,6 +4,9 @@
     1.4  
     1.5  #if !defined(__ia64__)
     1.6  
     1.7 +#define XEN_SIGNATURE_LOWER 0x40000000
     1.8 +#define XEN_SIGNATURE_UPPER 0x4000FFFF
     1.9 +
    1.10  NTSTATUS
    1.11  hvm_get_stubs(PXENPCI_DEVICE_DATA xpdd)
    1.12  {
    1.13 @@ -14,7 +17,7 @@ hvm_get_stubs(PXENPCI_DEVICE_DATA xpdd)
    1.14    ULONG pages;
    1.15    ULONG msr;
    1.16  
    1.17 -  for (base = 0x40000000; base < 0x40001000; base += 0x100)
    1.18 +  for (base = XEN_SIGNATURE_LOWER; base < XEN_SIGNATURE_UPPER; base += 0x100)
    1.19    {
    1.20      __cpuid(cpuid_output, base);
    1.21      *(ULONG*)(xensig + 0) = cpuid_output[1];
    1.22 @@ -25,7 +28,7 @@ hvm_get_stubs(PXENPCI_DEVICE_DATA xpdd)
    1.23      if (!strncmp("XenVMMXenVMM", xensig, 12) && ((cpuid_output[0] - base) >= 2))
    1.24        break;
    1.25    }
    1.26 -  if (base >= 0x40001000)
    1.27 +  if (base > XEN_SIGNATURE_UPPER)
    1.28    {
    1.29      KdPrint((__DRIVER_NAME "     Cannot find Xen signature\n"));
    1.30      return STATUS_UNSUCCESSFUL;
    1.31 @@ -47,7 +50,7 @@ hvm_get_stubs(PXENPCI_DEVICE_DATA xpdd)
    1.32    for (i = 0; i < pages; i++) {
    1.33      ULONGLONG pfn;
    1.34      pfn = (MmGetPhysicalAddress(xpdd->hypercall_stubs + i * PAGE_SIZE).QuadPart >> PAGE_SHIFT);
    1.35 -    KdPrint((__DRIVER_NAME "     pfn = %16lX\n", pfn));
    1.36 +    //KdPrint((__DRIVER_NAME "     pfn = %16lX\n", pfn));
    1.37      __writemsr(msr, (pfn << PAGE_SHIFT) + i);
    1.38    }
    1.39    return STATUS_SUCCESS;