Skip to content
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

plat/drivers/virtio: Fix virtio_9p tag read #1059

Closed
wants to merge 1 commit into from

Conversation

zhxj9823
Copy link
Contributor

@zhxj9823 zhxj9823 commented Aug 17, 2023

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

Base target

  • Architecture(s): N/A
  • Platform(s): kvm
  • Application(s): app-sqlite

Description of changes

Swap the last two arguments of virtio_9p_feature_negotiate's first call to virtio_config_get. As per the function definition, the last argument needs to actually be the length of the type.

@zhxj9823 zhxj9823 requested a review from a team as a code owner August 17, 2023 09:03
@unikraft-bot
Copy link
Member

Checkpatch passed

Beep boop! I ran Unikraft's checkpatch.pl support script on your pull request and it all looks good!

SHA commit checkpatch
95a56c8 plat/drivers/virtio: Fix virtio_9p tag read

@unikraft-bot unikraft-bot added area/plat Unikraft Patform lang/c Issues or PRs to do with C/C++ plat/driver plat/driver/virtio labels Aug 17, 2023
@razvand razvand removed request for a team and dragosargint August 17, 2023 09:38
@razvand razvand assigned razvand and unassigned nderjung Aug 17, 2023
@razvand razvand added this to the v0.14.0 (Prometheus) milestone Aug 17, 2023
@mogasergiu
Copy link
Member

I have tested this with nginx and redis.
I am not sure this is correct. How do you know tag_len is ignored?
vpci_legacy_pci_config_get seems to be using it, or am I missing something?
Although nothing seems to break, I think the commit message is misleading.

Copy link
Member

@StefanJum StefanJum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, thanks.
Reviewed-by: Stefan Jumarea stefanjumarea02@gmail.com

@StefanJum
Copy link
Member

I have tested this with nginx and redis. I am not sure this is correct. How do you know tag_len is ignored? vpci_legacy_pci_config_get seems to be using it, or am I missing something? Although nothing seems to break, I think the commit message is misleading.

Agree with that actually, nothing should break since in the end the vpci_legacy_pci_config_get uses len * type_len, which stays the same (I tested it with everything and it works fine), but the commit message is misleading.
Maybe just say that the virtio_mmio vm_get function ignores the last argument, instead of The underlying function of virtio_config_get.

@mogasergiu
Copy link
Member

mogasergiu commented Aug 17, 2023

Maybe just say that the virtio_mmio vm_get function ignores the last argument, instead of The underlying function of virtio_config_get.

virtio_mmio vm_get is not related to 9pfs, right? 9pfs is PCI based. Better to not mention about vm_get.
What about just:

Swap the last two arguments of `virtio_9p_feature_negotiate`'s first call to `virtio_config_get`. As per the function definition, the last argument needs to actually be the length of the type.

@StefanJum
Copy link
Member

virtio_mmio vm_get is not related to 9pfs, right? It's PCI based. Better to not mention about vm_get. What about just:

Swap the order of `virtio_9p_feature_negotiate` first call to `virtio_config_get`. As per the function definition, the last argument needs to actually be the length of the type.

Yeah much better 😄

Copy link
Member

@mogasergiu mogasergiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

virtio_mmio vm_get is not related to 9pfs, right? It's PCI based. Better to not mention about vm_get. What about just:

Swap the last two arguments of `virtio_9p_feature_negotiate`'s first call to `virtio_config_get`. As per the function definition, the last argument needs to actually be the length of the type.

Yeah much better 😄

@zhxj9823 If you agree, please change the commit message accordingly and I will approve.

Swap the last two arguments of virtio_9p_feature_negotiate's first
call to virtio_config_get. As per the function definition, the last
argument needs to actually be the length of the type.

Signed-off-by: Xingjian Zhang <zhxj9823@qq.com>
@razvand
Copy link
Contributor

razvand commented Aug 17, 2023

@mogasergiu , @StefanJum , is it OK now, after @zhxj9823 's update?

I re-request a review from both of you.

@razvand razvand requested a review from StefanJum August 17, 2023 13:47
Copy link
Member

@mogasergiu mogasergiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the bug fix!

Reviewed-by: Sergiu Moga sergiu@unikraft.io

Copy link
Member

@StefanJum StefanJum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-by: Stefan Jumarea stefanjumarea02@gmail.com

Copy link
Contributor

@razvand razvand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved-by: Razvan Deaconescu razvand@unikraft.io

@unikraft-bot unikraft-bot added the ci/merged Merged by CI label Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plat Unikraft Patform ci/merged Merged by CI lang/c Issues or PRs to do with C/C++ plat/driver/virtio plat/driver
Projects
Status: Done!
Development

Successfully merging this pull request may close these issues.

None yet

6 participants