-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Virtio Qemu 8.1.2 issues fix #11201
Merged
Merged
Virtio Qemu 8.1.2 issues fix #11201
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
openamp/0002-libmetal-nuttx-io.c-align-access-when-read-write-siz.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
From af3de6cd042c89ae2e8d07d503e0a07129e1296c Mon Sep 17 00:00:00 2001 | ||
From: Bowen Wang <wangbowen6@xiaomi.com> | ||
Date: Thu, 16 Nov 2023 14:52:48 +0800 | ||
Subject: [PATCH] libmetal/nuttx/io.c: align access when read/write size = 1, | ||
2, 4, 8 | ||
|
||
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com> | ||
--- | ||
lib/system/nuttx/io.c | 25 +++++++++++++++++++++++-- | ||
1 file changed, 23 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/lib/system/nuttx/io.c libmetal/lib/system/nuttx/io.c | ||
index 4fa4727..3ce9cbe 100644 | ||
--- a/lib/system/nuttx/io.c | ||
+++ libmetal/lib/system/nuttx/io.c | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's upstream to open-amp community |
||
@@ -37,7 +37,17 @@ static int metal_io_block_read_(struct metal_io_region *io, | ||
void *va = metal_io_virt(io, offset); | ||
|
||
metal_cache_invalidate(va, len); | ||
- memcpy(dst, va, len); | ||
+ if (len == 1) | ||
+ *(uint8_t *)dst = *(uint8_t *)va; | ||
+ else if (len == 2) | ||
+ *(uint16_t *)dst = *(uint16_t *)va; | ||
+ else if (len == 4) | ||
+ *(uint32_t *)dst = *(uint32_t *)va; | ||
+ else if (len == 8) { | ||
+ *(uint32_t *)dst = *(uint32_t *)va; | ||
+ *(uint32_t *)(dst + 4) = *(uint32_t *)(va + 4); | ||
+ } else | ||
+ memcpy(dst, va, len); | ||
|
||
return len; | ||
} | ||
@@ -50,7 +60,18 @@ static int metal_io_block_write_(struct metal_io_region *io, | ||
{ | ||
void *va = metal_io_virt(io, offset); | ||
|
||
- memcpy(va, src, len); | ||
+ if (len == 1) | ||
+ *(uint8_t *)va = *(uint8_t *)src; | ||
+ else if (len == 2) | ||
+ *(uint16_t *)va = *(uint16_t *)src; | ||
+ else if (len == 4) | ||
+ *(uint32_t *)va = *(uint32_t *)src; | ||
+ else if (len == 8) { | ||
+ *(uint32_t *)va = *(uint32_t *)src; | ||
+ *(uint32_t *)(va + 4) = *(uint32_t *)(src + 4); | ||
+ } else | ||
+ memcpy(va, src, len); | ||
+ | ||
metal_cache_flush(va, len); | ||
|
||
return len; | ||
-- | ||
2.34.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
why not change metal io operation to non-atomic directly?