-
Notifications
You must be signed in to change notification settings - Fork 427
viostor: Remove DmaWidth initialization in HwStorFindAdapter #1455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
[Jenkins CI]: Can one of the admins verify this patch? |
Summary of ChangesHello @zjmletang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a compliance issue within the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly removes the explicit initialization of the DmaWidth field within the HwStorFindAdapter function. As noted in the description, Microsoft's Storport documentation states that miniport drivers must not modify this field. The change aligns the driver with the documented API contract, improving compliance and ensuring better compatibility across different Windows versions. The modification is well-justified and correct.
|
@zjmletang Thank you for the patch. I have one doubt about the patch - unfortunately we still have to support 32bit version of Windows 10, and I will be more happy to keep the old behavior for 32 bit versions or even for win10 and below in general. @vrozenfe what do you think? |
@YanVugenfirer What was removed:
What was kept:
The change only removes the manual setting of I initially had the same concern about 32-bit system compatibility, but after reviewing the Microsoft documentation more carefully, I realized that:
This change follows Microsoft's documented requirements and shouldn't affect functionality on any system architecture. if I misunderstood something, please let me know and I'm happy to discuss further or adjust the approach. |
|
@YanVugenfirer Additionally, I should note that according to the MSDN documentation,
If you prefer strict compliance with the documentation, we could also remove the |
|
@zjmletang I understand compliance with documentation, but I also reminder the history of those flags. And they were specifically designed for HW that might have issues with 64 bit addressing. As verifying the effect of something that worked for ages on 32bit systems is hard to estimate, and more over 32bit systems are lower priority and are going to be deprecated anyway, that's why I suggest to make the change only on 64bit systems. Where it is definitely a bug and a remnant on old historical decision. But in order not to make unknown side effects on 32bit systems, I suggest to use compile time decisions that will be removed later on anyway as we depreciate 32 bit systems. I also discussed this with @ybendito and @vrozenfe - so this is a unified position from our side. |
According to Microsoft documentation, DmaWidth and Dma32BitAddresses should be initialized by Storport, not by miniport drivers. However, to avoid unknown side effects on 32-bit systems, keep the old behavior for 32-bit builds using compile-time conditionals. This will be removed when 32-bit systems are deprecated. On 64-bit systems, let Storport initialize these fields automatically to comply with MSDN requirements. Signed-off-by: Zhang JianMing <[email protected]>
69a666e to
46c4c7a
Compare
|
@YanVugenfirer Understood—thanks, I learned a lot! I've updated it with a new version. |
|
ok to test |
|
@kostyanf14 In Win11_24H2 disk stress test failed, is this something new? |
|
@YanVugenfirer triggered tests |
|
@zjmletang This patch cause BSOD on Win10 22H2 on Disk Stress test https://www.dropbox.com/scl/fo/hry3ofa5x328usfhcya4m/AKWuM6rEFF4Ab5aaq4bK1mU?rlkey=h64olhjkr37btpa3jnxlo6y9o&dl=0&lst= |
Summary
Remove the
DmaWidthinitialization inHwStorFindAdapterto comply with Microsoft Storport driver requirements.Problem
According to the Microsoft documentation, the
DmaWidthfield inPORT_CONFIGURATION_INFORMATIONis initialized by Storport and miniport drivers must not modify it. However, the current code explicitly setsConfigInfo->DmaWidth = Width32Bits;in theHwStorFindAdapterroutine, which violates this requirement.Changes
ConfigInfo->DmaWidth = Width32Bits;fromvirtio_stor.cTesting
I tested the current behavior (with
DmaWidthassignment) on Windows Server 2022 and found that:DmaWidthassignment does not appear to affect 64-bit DMA functionality in practiceDmaWidthis set toWidth32BitsHowever, since:
We should remove this assignment to comply with the official documentation.
Reference