-
Notifications
You must be signed in to change notification settings - Fork 0
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
Pointer Masking ACT #15
Comments
This work is not yet staffed. |
@mustafa7755, @Muhammad-Saadi-Abbasi, it sounds like you guys will be working on this. I've assigned it to both of you not knowing if you're sharing or working on separate pieces. Feel free to unassign yourselves as-appropriate based on assignments. |
If possible, I'd like an update in the April 25th meeting on when you think you'll have the following dates:
Comments in the issue with these dates would be great. |
BTW, I should note for this issue that it's marked "At Risk" due to the fact that we had no one assigned. Given that we have assignees, I'd like their comfort with the SOW and have a basic plan before we move back to "As Planned" status. My hope is that we'll be able to do this in the April 25th meeting at the latest. |
@Muhammad-Saadi-Abbasi, @mustafa7755, please review the SOW and note that there have been updates to the content based on the feedback from Architecture Review. This is a good reminder that the contents of the specification may be in flux until we get final AR approval. So, please be advised. |
Update: Apr 25th, 2023 => The planning phase of this project has been completed, this is the test plan for the viewers to review: Test plan Pointer Masking Ext |
@martinmaas, @Adam-pi3 Sir, Please find some time to review the test plan. You are the domain experts, so your comments would be valuable. |
Apologies for the delayed response (I was on vacation and it took me a while to catch up on everything after coming back). Thank you so much for working on this! My main feedback is that the latest version of the pointer masking spec has removed instruction pointer masking, which obviates the need for tests related to instructions and to the *ipmen fields. https://github.com/riscv/riscv-j-extension/blob/master/zjpm-spec.pdf Some additional feedback:
Please don't hesitate to let @Adam-pi3 and me know if there are any additional questions. |
Update May 7th, 2023 ⇾ Not much update on this task. Possibly it will get deferred to Q3, 2023 because of upcoming new work (debug native triggers) |
@martinmaas, thanks for the update. Would you kindly ensure that your additional comments about ACT get into the referenced SOW document (link)? |
Thanks for the update, @UmerShahidengr. I recognize we're in a holding pattern here. I'm going to leave on the Agenda for discussion purpsoses at this time. @martinmaas, @Adam-pi3, you folks should be aware that given the challenges we've had with Code Size Reduction, I've got 1 resource to spend on either Pointer Masking and/or Debug. So, barring some explicit priority guidance, they will be started first-come, first serve. I'll be in touch with what and how we decide. |
Correction, the challenges with Pointer Masking ACT have been in Zfinx, Zfh, Zdinx, and Zhinx. |
The discussion this week in the Pointer Masking TG was that @martinmaas would request the Architecture Review Committee to prioritize closure of the items preventing SAIL and ACT work in hopes of keeping this work moving forward. @martinmaas, please provide an update when available. |
Update May 23rd, 2023 => Not much update on this task yet. |
@martinmaas, any update from AR? Marking as Blocked until we get AR resolution of issues. |
Update August 6th, 2024 |
Thanks, @UmerShahidengr. That's exciting. @martinmaas, @Adam-pi3, can you please take a look at the tests to ensure they map to the proposed coverage from Adam? Please post your confirmation of completeness of the tests and/or raise any issues here. Once we get the coverage PR, we'll need to 2 more things to proceed to Ratification:
|
I schimmed through the tests and I've been in sync with @UmerShahidengr regarding the functional problem which @UmerShahidengr already fixed. Nevertheless, per my understanding as of now the test covers: there is missing for 1.ii/iii/iv, 2.ii/iii/iv and 4. Did I miss them?
|
@UmerShahidengr, can you respond to @Adam-pi3 review comments? I'm particularly interested in whether the mentioned gaps exist in the current ACT tests? Are they included in the cover reports? |
@Adam-pi3 There is the inline reply to each coverpoint required: Standard LOAD / STORE Execution and Validation of Expected Results
Execute LOAD / STORE and Validate Expected Results
Initialization Values
Non-FNL SW Test Plan - Context Switch
|
Thanks @UmerShahidengr! I'll let @Adam-pi3 chime in as well, but it makes sense to me that some of the features cannot be supported in the Sail model. However, I had the same question as Adam:
The part that was unclear to me is where it checks that the address that is being accessed after the masking operation is the correct one. For example, how do we check whether the implementation masked 7 bits or 16 bits? Or is the idea that we will trap on every access and log the address, thus making the masked address part of the signature?
I probably overlooked something really simple, but wasn't able to find where this check is happening. Can you please point me to the logic? |
Look OK (especially if something is not supported). However, some questions which @martinmaas also pointed out are still open. |
@UmerShahidengr, I believe you have answers for some of @martinmaas questions. Can you kindly post them for all to see? |
Email from Umer:
|
Thanks, @UmerShahidengr for the update. Please post the PR for all at your earlierst convenience so that @Adam-pi3 and @martinmaas can review. I'll prepare the vote. |
Fantastic – thank you so much for the detailed update! One quick comment on item (3): Pointer masking is now supported in Spike, so it should be possible to compare the two. |
The tests and covergroups are complete and are available at riscv-non-isa/riscv-arch-test#484 |
@martinmaas, @Adam-pi3, your review of the PR for completeness is what I need for now. Please post comments here. |
Thank you for all the work on this, and for sending the PR! The question I would like to confirm is how the following part works:
I am not familiar with the coverpoint definition format, but was unable to spot where this was defined. Assuming that these definitions are present, how are the effective and translated addresses validated? From my understanding, they would need to either be checked explicitly as part of the coverpoint definition, or compared against a run of a different simulator (likely Spike), to confirm they are the same. Further, have the ACTs been validated against Spike as well, in addition to the Sail model? Subject to those two points (checking of the effective/translated addresses, and comparison against Spike), the PR looks good to me. |
@UmerShahidengr, @MuhammadHammad001, can we please keep the questions being asked here moving? We need Adam and Martin to approve your work in the next couple days. |
Hi, @jjscheel , @martinmaas , @Adam-pi3 The spike is not working as intended for the M Mode Tests in which the virtualization is enabled but those tests are running fine on the Sail. I have created an issue for this available at riscv-software-src/riscv-isa-sim#1817 |
@Adam-pi3, @martinmaas, with respect to the freeze waiver for Pointer Masking, are you satisfied that we've created the tests for expected coverage? We may still have debug work and stylistic things to clean up, but we're "feature complete" for testing. |
Thank you for the update! This addresses my concern about comparison against Spike (I am not too concerned if there is a minor bug somewhere, as long as we understand what the bug is and that it does not point towards a problem with the spec; which does not seem to be the case here). My remaining question is about how the masked addresses are being checked so that they are the same between Sail and Spike – there is a good chance this is somewhere in the logs, but I was not able to see it reading through them. There is probably an argument to be made that the tests could be considered feature complete even without these comparisons (since the tests themselves already check whether or not masking is applied, just not that the exact right bits are being masked) – but independently of whether this is required for the "feature complete" milestone, it would be good to have this eventually, as it will make coverage significantly stronger. I'd be interested in @Adam-pi3's view on this as well. |
The masked address in getting checked within the Sail and Spike log, and the cover points are written in such a way that in some of the tests, test is showing different behaviors when pmm is disabled vs pmm is enabled. For example, in one of the tests, we used virtual address as 0xABAB500000000000, this test will cause a trap (due to illegal virtual address) when pmm is disabled, and when pmm will be enabled, then its 0xABAB bits will be masked with zeros and it will not cause trap. Similarly for virtual addresses like 0x0000900000000000, it will cause trap when pmm is disabled, but when pmm is enabled then last bits will be sign extended and masked address will become 0xFFFF900000000000 and will not trap. All these scenerios are tested in the tests. |
Thanks for the clarification! This is how I read the tests as well, and I agree this tests the most important aspects of pointer masking behavior (i.e., "is it enabled exactly when it should be?"). What the trap-based testing doesn't catch are cases where the implementation masks the wrong bits (e.g., 0x0000900000000000 turns into 0x0010900000000000 despite pointer masking being disabled) – in both cases we'd see a trap, but we don't see that the address was still incorrect. In other words, we get one bit of signal per check, when there are many more incorrect behaviors that cannot be discerned based on that one bit. Having said this, those failure modes don't seem to be like the most likely ones. I believe there is a good case to be made that the current version should be sufficient in terms of feature-completeness. But if there is a way to test the sequence of actual addresses, I think that would represent a significant increase in coverage. If everyone else is fine with this, I think it doesn't have to block feature completeness sign-off, though. |
Sorry for delay in replying but I was trying to carefully analyze the tests. Per my understanding most of the cover points are covered (the one which are possible to implement taking into account some limitation which @UmerShahidengr was and @MuhammadHammad001 were describing). However, I don't really understand how exactly comparison of the expected addresses in case of fault happens. Tests expects to generate a fault (e.g., when PM is disabled or enabled - depends on the test). However, I don't see the function set-up in MTVEC which would handle this fault and do the expected logic. Is the expectation that tests don't require it and some default fault handler writes something to the log which are parsed? That's the only missing point I have. I agree we shouldn't block feature completeness sign-off because of that. Nevertheless, my question remains and it is also connected to the @martinmaas comments too. |
Thanks, @Adam-pi3, @martinmaas. I will mark the Freeze Waiver complete based on your approvals. Now, the final question becomes have we completed ACT Testing? This is a Ratification Requirement. |
@UmerShahidengr, can you kindly drive closure on the state of ACT Testing ASAP? |
@Adam-pi3 for the trap handler, we have made no changes in the default trap handler, the default trap handler of riscv-arch-tests (available here) is generic, and dealing with the traps caused by load/store access due to pmm/vm. Thus, there are no need to change the MTVEC register. The default trap handler deposits 4 signature items in the signature file per trap, 2 of them are mepc and mtval value, in case of pmm enabled/disabled, mtval csr will be updated with the effective address, and the same value will be shown in the trap signatures. This value is getting compared in Spike and Sail log |
@martinmaas as explained in the above comment, since mtval is getting the effective address on every trap and also getting updated into trap signature area, thus such cases have already been checked if correct bits are getting masked or not. We have made sure to check the effective address on every memory access through the log file, and also made sure to compare mtval value through signature on every trap. |
@martinmaas and @Adam-pi3, does this answer your question? @UmerShahidengr, so you believe all tests are passing and the coverage is being met? Correct? |
Thank you for the clarification, Umer! To confirm my understanding: When there is a trap, the effective address will be written into the signature file, and thus compared against a reference implementation. When there is no trap, we know the address is correct, because the correct value is loaded. Assuming the above, all sounds good to me and I think the tests meet the required coverage. One final question (but not required for coverage): Was the checking of the effective address in the log file done manually, or can this be done automatically as part of running the test? |
@martinmaas in the developement phase, the effective address was checked from the log file manually, now it is the part of signature file, so one can automatically check the effective address from signature file (in case of a trap). |
@Adam-pi3 , @martinmaas is this PR good to go? Should we merge this one? |
Technical Group
Pointer Masking TG
ratification-pkg
Pointer Masking
Technical Liaison
Martin Maas, Adam Zabrocki
Task Category
Arch Tests
Task Sub Category
Ratification Target
3Q2023
Statement of Work (SOW)
SOW: link
SOW Signoffs: (delete those not needed)
Waiver
Pull Request Details
The text was updated successfully, but these errors were encountered: