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

KeInvalidateAllCaches() alternative for ARM64 #60

Open
tester962 opened this issue Jul 30, 2018 · 6 comments
Open

KeInvalidateAllCaches() alternative for ARM64 #60

tester962 opened this issue Jul 30, 2018 · 6 comments

Comments

@tester962
Copy link

tester962 commented Jul 30, 2018

The driver can't be compiled on ARM64 because of the missing KeInvalidateAllCaches().
Can someone provide an alternative using KeInvalidateRangeAllCaches() ?

File: RosKmdRapAdapter.cpp, line 445

@BelleNottelling
Copy link

According to this: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ntddk/nf-ntddk-keinvalidateallcaches, KeInvalidateAllCaches() is availbe universally on all platforms

@thchi12
Copy link

thchi12 commented Aug 21, 2018

But VS refuses to build that when set to ARM64 and complains about KeInvalidateAllCaches.

@BelleNottelling
Copy link

BelleNottelling commented Aug 21, 2018

Yeah, I know. I'm not sure why it does that. It happens even if you include ntddk.h

@thchi12
Copy link

thchi12 commented Aug 22, 2018

It seems this thing cannot be used in WoA ARM64. I opened ntoskrnl.exe using IDA and searched for it but found nothing. While the x64 one does have this.

@pmsjt
Copy link
Member

pmsjt commented Jul 20, 2022

Arm arch itself does not provide a way to clean and/or invalidate the entire d-cache. This means that d-cache clean operations always need a start address and length. That is the reason a parameter-less KeInvalidateAllCaches cannot be implemented reliably.

_IRQL_requires_min_(PASSIVE_LEVEL)
_IRQL_requires_max_(DISPATCH_LEVEL)
NTKERNELAPI
VOID
FASTCALL
KeInvalidateRangeAllCaches (
    _In_ PVOID BaseAddress,
    _In_ ULONG Length
    );

Is the replacement and it is available on all architectures. For some reason, I can't find it in the documentation. Will try to investigate why.

@pmsjt
Copy link
Member

pmsjt commented Jul 28, 2022

Doc is live :)

https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-keinvalidaterangeallcaches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants