Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Does StorPortGetSystemAddress really works on Win7 x64 with 4GB Ra

Reply
Thread Tools Display Modes

Does StorPortGetSystemAddress really works on Win7 x64 with 4GB Ra

 
 
Mini UVC UAC
Guest
Posts: n/a

 
      07-05-2010
Hi, All:
I'm developing a Storport driver and need get the virtual address of
Srb:ataBuffer. I used StorPortGetSystemAddress to get the virtual address.
It
works well under Win7 x64 with 2GB Ram, but failed under Win7 X64 with 4GB
Ram.

I used the dbgview to print the data after I copied it into the virtual
address, and used BusHound to check the data which our drivers returned. From
the dbgview's logfile, driver always return the correct data, but from the
BusHound's log info, the data sometimes match with the dbgview's logfile, and
sometimes don't match.

BTW, if use the scsiport driver, it work ok both 2GB ram and 4GB ram under
Win7X64.

Anyone can give me some help to solve the issue? BTW: I have to use
virtual
address to copy data into Srb:ataBuffer because hardware limited. I have to
use Storport framework.

And I even suspect maybe whether it is the Microsoft stoport class
driver's bug ?

Thanks






 
Reply With Quote
 
 
 
 
Maxim S. Shatskih
Guest
Posts: n/a

 
      07-05-2010
> BTW, if use the scsiport driver, it work ok both 2GB ram and 4GB ram under
> Win7X64.


Probably the storport's port registration info is not correct?

--
Maxim S. Shatskih
Windows DDK MVP

http://www.storagecraft.com

 
Reply With Quote
 
Mini UVC UAC
Guest
Posts: n/a

 
      07-06-2010
Hi, Maxim:
Thanks for your reply.
But would you please give me more details about "storport's port
registration info " ? what is is related with issue?
Thanks again;

"Maxim S. Shatskih" wrote:

> > BTW, if use the scsiport driver, it work ok both 2GB ram and 4GB ram under
> > Win7X64.

>
> Probably the storport's port registration info is not correct?
>
> --
> Maxim S. Shatskih
> Windows DDK MVP
>
> http://www.storagecraft.com
>
> .
>

 
Reply With Quote
 
Mini UVC UAC
Guest
Posts: n/a

 
      07-13-2010
Hi, Maxim & all:
Anyone meet the same issue?
who can give me some suggestion?

many thanks;

BR
Hardys

"Mini UVC UAC" wrote:

> Hi, Maxim:
> Thanks for your reply.
> But would you please give me more details about "storport's port
> registration info " ? what is is related with issue?
> Thanks again;
>
> "Maxim S. Shatskih" wrote:
>
> > > BTW, if use the scsiport driver, it work ok both 2GB ram and 4GB ram under
> > > Win7X64.

> >
> > Probably the storport's port registration info is not correct?
> >
> > --
> > Maxim S. Shatskih
> > Windows DDK MVP
> >
> > http://www.storagecraft.com
> >
> > .
> >

 
Reply With Quote
 
Mini UVC UAC
Guest
Posts: n/a

 
      07-15-2010
HI, Eagersh:

Thanks.
Of course, I have checked the result of StorPortGetSystemAddress, it
return STOR_STATUS_SUCCESS;

Anybody has other suggestions?
 
Reply With Quote
 
Scott Noone
Guest
Posts: n/a

 
      07-15-2010
Is this on a read operation? Could be dummy pages related:

http://msmvps.com/blogs/kernelmustar.../04/45721.aspx

The end result is that when you copy data into the user data buffer the
result may not compare correctly to the original buffer.

-scott

--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com


"Mini UVC UAC" <> wrote in message
news:B04DE4CC-C47B-4475-9CA4-...
> Hi, All:
> I'm developing a Storport driver and need get the virtual address of
> Srb:ataBuffer. I used StorPortGetSystemAddress to get the virtual
> address.
> It
> works well under Win7 x64 with 2GB Ram, but failed under Win7 X64 with 4GB
> Ram.
>
> I used the dbgview to print the data after I copied it into the virtual
> address, and used BusHound to check the data which our drivers returned.
> From
> the dbgview's logfile, driver always return the correct data, but from the
> BusHound's log info, the data sometimes match with the dbgview's logfile,
> and
> sometimes don't match.
>
> BTW, if use the scsiport driver, it work ok both 2GB ram and 4GB ram
> under
> Win7X64.
>
> Anyone can give me some help to solve the issue? BTW: I have to use
> virtual
> address to copy data into Srb:ataBuffer because hardware limited. I have
> to
> use Storport framework.
>
> And I even suspect maybe whether it is the Microsoft stoport class
> driver's bug ?
>
> Thanks
>
>
>
>
>
>

 
Reply With Quote
 
Mini UVC UAC
Guest
Posts: n/a

 
      07-16-2010
Hi, Scott Noone:

Thanks very much, But I can't understand clearly about the dummy page.
and if so, how to do to fix the issue in my storport driver?

"Scott Noone" wrote:

> Is this on a read operation? Could be dummy pages related:
>
> http://msmvps.com/blogs/kernelmustar.../04/45721.aspx
>
> The end result is that when you copy data into the user data buffer the
> result may not compare correctly to the original buffer.
>
> -scott
>
> --
> Scott Noone
> Consulting Associate
> OSR Open Systems Resources, Inc.
> http://www.osronline.com
>
>
> "Mini UVC UAC" <> wrote in message
> news:B04DE4CC-C47B-4475-9CA4-...
> > Hi, All:
> > I'm developing a Storport driver and need get the virtual address of
> > Srb:ataBuffer. I used StorPortGetSystemAddress to get the virtual
> > address.
> > It
> > works well under Win7 x64 with 2GB Ram, but failed under Win7 X64 with 4GB
> > Ram.
> >
> > I used the dbgview to print the data after I copied it into the virtual
> > address, and used BusHound to check the data which our drivers returned.
> > From
> > the dbgview's logfile, driver always return the correct data, but from the
> > BusHound's log info, the data sometimes match with the dbgview's logfile,
> > and
> > sometimes don't match.
> >
> > BTW, if use the scsiport driver, it work ok both 2GB ram and 4GB ram
> > under
> > Win7X64.
> >
> > Anyone can give me some help to solve the issue? BTW: I have to use
> > virtual
> > address to copy data into Srb:ataBuffer because hardware limited. I have
> > to
> > use Storport framework.
> >
> > And I even suspect maybe whether it is the Microsoft stoport class
> > driver's bug ?
> >
> > Thanks
> >
> >
> >
> >
> >
> >

 
Reply With Quote
 
Scott Noone
Guest
Posts: n/a

 
      07-16-2010
"Mini UVC UAC" <> wrote in message
news:4FE83744-6CB1-4134-B20A-
>I can't understand clearly about the dummy page.


For simplicity, imagine that the page size of the architecture is a single
byte and the application has a four page virtually contiguous buffer:

[ ]
[ ]
[ ]
[ ]

When entirely valid, each of these maps to a single page of physical memory:

[ ] --> 20
[ ] --> 22
[ ] --> 40
[ ] --> 41

But, it might be possible that some of these pages are paged out to a file
on disk:

[ ] --> X
[ ] --> 22
[ ] --> 40
[ ] --> X

If the user then references this piece of memory, then the memory manager
needs to page the data back in and fix up the pointers. In this case it
would require two one byte I/Os, because the two pages in the middle are
valid and the memory manager can't overwrite them with whatever happens to
be on the disk.

Starting with Server03 (SP1?) the memory manager attempts to optimize this
case by sending a single I/O that will suck up both regions. The way that it
does this is by building an MDL with new pages for the two paged out regions
(N1 and N2) and then filling in the middle region by pointing both pages to
a single unused page. So, the MDL looks like this:

[N1][D][D][N2]

Say the buffer being read was, "1234" and the starting buffer sent down was,
"0000." As the four bytes were copied one by one into this buffer, it would
transform the following way:

0000
1000
1220
1330
1334

Because the middle two pages are the same page. And, in the end, the source
buffer wouldn't match the destination buffer.

>how to do to fix the issue in my storport driver?


It's not anything that you need to fix, I just wanted to make you aware of
it in case you're not really tracking a bug but an artifact of your
observation of the data.

HTH,

-scott

--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com


"Mini UVC UAC" <> wrote in message
news:4FE83744-6CB1-4134-B20A-...
> Hi, Scott Noone:
>
> Thanks very much, But I can't understand clearly about the dummy
> page.
> and if so, how to do to fix the issue in my storport driver?
>
> "Scott Noone" wrote:
>
>> Is this on a read operation? Could be dummy pages related:
>>
>> http://msmvps.com/blogs/kernelmustar.../04/45721.aspx
>>
>> The end result is that when you copy data into the user data buffer the
>> result may not compare correctly to the original buffer.
>>
>> -scott
>>
>> --
>> Scott Noone
>> Consulting Associate
>> OSR Open Systems Resources, Inc.
>> http://www.osronline.com
>>
>>
>> "Mini UVC UAC" <> wrote in message
>> news:B04DE4CC-C47B-4475-9CA4-...
>> > Hi, All:
>> > I'm developing a Storport driver and need get the virtual address
>> > of
>> > Srb:ataBuffer. I used StorPortGetSystemAddress to get the virtual
>> > address.
>> > It
>> > works well under Win7 x64 with 2GB Ram, but failed under Win7 X64 with
>> > 4GB
>> > Ram.
>> >
>> > I used the dbgview to print the data after I copied it into the
>> > virtual
>> > address, and used BusHound to check the data which our drivers
>> > returned.
>> > From
>> > the dbgview's logfile, driver always return the correct data, but from
>> > the
>> > BusHound's log info, the data sometimes match with the dbgview's
>> > logfile,
>> > and
>> > sometimes don't match.
>> >
>> > BTW, if use the scsiport driver, it work ok both 2GB ram and 4GB ram
>> > under
>> > Win7X64.
>> >
>> > Anyone can give me some help to solve the issue? BTW: I have to use
>> > virtual
>> > address to copy data into Srb:ataBuffer because hardware limited. I
>> > have
>> > to
>> > use Storport framework.
>> >
>> > And I even suspect maybe whether it is the Microsoft stoport class
>> > driver's bug ?
>> >
>> > Thanks
>> >
>> >
>> >
>> >
>> >
>> >

 
Reply With Quote
 
Maxim S. Shatskih
Guest
Posts: n/a

 
      07-16-2010
> Because the middle two pages are the same page. And, in the end, the source
> buffer wouldn't match the destination buffer.


I can rephrase this in other words:

- some filters do the following: instead of generating their own new IRP/MDL for read, they monitor a read flow sent from the top and reuse these reads as their own reads (also provided the upper levels with a read).
- i.e. catch the read coming from the top, register the completion routine, send it down, and, in the C.R., look at the data being read (by the upper level's IRP) as the real data being read, to save the filter from the burden of creating its own read IRP/MDL.
- the "dummy pages" issue, which arise to its full glory in Vista+, prohibits this trick. Reason: the MDL from the top's read IRP can be very special and have aliased physical pages.
- so, you cannot trust the successul read IRPs in the completion routine to contain the read on-disk data. You can trust only in a case your code itself created this IRP/MDL initially.

--
Maxim S. Shatskih
Windows DDK MVP

http://www.storagecraft.com

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Will IE6 run under Win7? PA Bear [MS MVP] Internet Explorer 3 12-27-2009 07:27 AM
How to move Win7 to 1st partition ? Natéag Windows Vista General Discussion 4 12-11-2009 10:45 PM
Win7 Pro x64 dies with BSOD on my toshiba laptop (Win7 Retail/RTM) Warren Postma Windows 64 Bit 6 11-20-2009 10:23 PM
Win7 64-bit upgrade - keeping XP Pro Jerry Windows 64 Bit 6 11-14-2009 11:25 PM
Drive D XpPro 64 not needed with Win7 64bit RoseW Windows 64 Bit 9 11-06-2009 07:05 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59