x86 pseudo inst broken in KVM

Description

I believe there's a problem with using the new ABI API with X86+KVM.

I'm seeing the following when I execute `m5 readfile`

It looks like the parameter fetching isn't quite right. I think that it should be something like `0x7ffffffbeca0, 0x40000, 0x0`. This is the address of the buffer, the size of the buffer, and the offset.

I tried using GDB with gem5, but the output is inscrutable due to the recursive template :/. , if you could give me some pointers, I'd appreciate it!

I can see that my register state in the guest is correct (using GDB in the guest). The args in in rdi, rsi, and rdx, respectively:

I think the problem is that the position isn't being updated in the Argument template. , does the following change look right?

 

See https://gem5-review.googlesource.com/c/public/gem5/+/25543

Environment

None

Activity

Show:
Jason Lowe-Power
February 18, 2020, 1:46 AM

, Is this the problem you’ve been running into?

Gabe Black
February 18, 2020, 3:46 AM

Yes, I think you’re right. getArgument (the pre-existing argument getting mechanism) will increment position an extra time if it uses two argument slots (two registers, for instance), but you need to increment it once normally to be sure to move on to the next argument. That's a bit awkward and unintuitive, which is another reason I’m glad we’re replacing it.

I had remembered that it would increment position sometimes, but had misremembered and thought it would handle all the position adjusting necessary and not just the extra incrementing for large arguments.

Jason Lowe-Power
February 18, 2020, 7:15 PM

Got it. That fixes the problem! Patch coming soon. Thanks for the help!

Done

Assignee

Unassigned

Reporter

Jason Lowe-Power

Priority

Medium

Affects versions

None

Fix versions

None

Epic Link

None

Components

Labels

None
Configure