[viostor] Fix SRB Extension struct member alignment#1472
[viostor] Fix SRB Extension struct member alignment#1472benyamin-codez wants to merge 1 commit intovirtio-win:masterfrom
Conversation
Summary of ChangesHello @benyamin-codez, 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 and resolves a struct member misalignment issue within the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
|
|
[Jenkins CI]: Can one of the admins verify this patch? |
There was a problem hiding this comment.
Code Review
This pull request correctly addresses a structure member misalignment issue in _SRB_EXTENSION by reordering its members. The change to introduce an _SRB_EXTENSION_FLAGS struct for the fua flag is a good approach. However, the implementation of _SRB_EXTENSION_FLAGS seems to deviate from the stated intent in the pull request description, resulting in a larger-than-necessary struct and an inefficient memory layout. I've provided a suggestion to align the implementation with the description, which will result in a more efficient memory layout.
d1d37fa to
08e4190
Compare
Refactors to fix a struct member misalignment: 1. Creates a new _SRB_EXTENSION_FLAGS struct of 32 bits length 2. The first bit is fua (Forced Unit Access) 3. The other bits are unused padding 4. Replaces the _SRB_EXTENSION member fua with new flags member 5. Updates references to srbExt->fua to use srbExt->flags.fua 6. Enforces 1-byte alignment of structs _SRB_EXTENSION and _SRB_EXTENSION_FLAGS Signed-off-by: benyamin-codez <115509179+benyamin-codez@users.noreply.github.com>
08e4190 to
338a508
Compare
|
ok to test |
|
I'm not sure this one will work. I ended up with BSODs in my stress tests for both 32 and 16 bit members. I'll try to test some more in coming hours, but in any case, I think this one is likely to get another push... Methinks it might be better to just wrap the extension in a |
|
@benyamin-codez so you also can reproduce bsod with qcow2 image and viostor. Am I correct? |
@kostyanf14, with the changes in this PR in my WIP, yes, I get BSODs on qcow2 images. I haven't checked it as is because without the other changes, it will likely get BSODs anyway. I don't get the BSODs with PR #1467, even on qcow2 images. It is the combination of |
|
By way of update: I've gone with a different and more simple approach here that is just as effective. I note this only helps to resolve the BSODs and 4KiB block write performance, and not the QCOW2 issue. |
|
@benyamin-codez - Please rebase. |
As mentioned above, I went a different (wholistic - imho better) path with this. I just need to do some recalculations and tests following the I think a new PR is probably best. |
Refactors to fix a struct member misalignment in
_SRB_EXTENSION:_SRB_EXTENSION_FLAGSstruct of 32 bits lengthfua(Forced Unit Access)_SRB_EXTENSIONmemberfuawith newflagsmembersrbExt->fuato usesrbExt->flags.fua_SRB_EXTENSIONand_SRB_EXTENSION_FLAGS