Skip to content

acpi_protect: Fix unaligned memory access#20

Merged
PG-MANA merged 1 commit intomainfrom
fix/19
Sep 8, 2025
Merged

acpi_protect: Fix unaligned memory access#20
PG-MANA merged 1 commit intomainfrom
fix/19

Conversation

@PG-MANA
Copy link
Copy Markdown
Collaborator

@PG-MANA PG-MANA commented Sep 7, 2025

This PR fixes unaligned access while protecting ACPI tables.
This fixes #19 .

Co-authored-by: hhc0null <hhc.0.null@gmail.com>
@PG-MANA PG-MANA requested a review from fukai-t September 7, 2025 04:15
@PG-MANA PG-MANA self-assigned this Sep 7, 2025
@PG-MANA PG-MANA added the bug Something isn't working label Sep 7, 2025
Copy link
Copy Markdown
Contributor

@fukai-t fukai-t left a comment

Choose a reason for hiding this comment

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

LGTM

@PG-MANA PG-MANA merged commit 51f6837 into main Sep 8, 2025
3 checks passed
@PG-MANA PG-MANA deleted the fix/19 branch September 8, 2025 00:48
@fukai-t
Copy link
Copy Markdown
Contributor

fukai-t commented Sep 8, 2025

@PG-MANA
I approved this PR. Please merge this PR.
By the way, do you have any idea to find this kind of bugs efficiently?

@PG-MANA
Copy link
Copy Markdown
Collaborator Author

PG-MANA commented Sep 8, 2025

By the way, do you have any idea to find this kind of bugs efficiently?

It may be efficient to replace memory accesses like unsafe{*&(address as *const ...)} to read_unaligned or write_unaligned , but it may cause some overheads.

@fukai-t
Copy link
Copy Markdown
Contributor

fukai-t commented Sep 8, 2025

In my understanding, replacing all unsafe memory access with *_unaligned may cause performance overhead, but there is no trivial method to find memory access that may not be alingned.

If so, I think following is interesting items for MilvusVisor (just idea, not todo).

  • Revealing the performance overhead of *_unaligned by some experiments
  • Considering some method to automatically finding unaligned memory access if the *_unaligned cause non-negligible performance overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug report: Boot failed due to misaligned pointer dereference on some ACPI strucutres

2 participants