Re: Not emulated registers on BOOKE_HV (GS-mode)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/16/2012 11:02 AM, Sethi Varun-B16395 wrote:

-----Original Message-----
From: kvm-ppc-owner@xxxxxxxxxxxxxxx [mailto:kvm-ppc-
owner@xxxxxxxxxxxxxxx] On Behalf Of Bhushan Bharat-R65777
Sent: Wednesday, May 16, 2012 12:58 PM
To: Alexander Graf
Cc: Wood Scott-B07421; Yoder Stuart-B08248; kvm-ppc@xxxxxxxxxxxxxxx
Subject: Not emulated registers on BOOKE_HV (GS-mode)

Hi Alex,

There is below comment in arch/powerpc/kvm/booke_emulate.c

/*
  * NOTE: some of these registers are not emulated on BOOKE_HV (GS-mode).
  * Their backing store is in real registers, and these functions
  * will return the wrong result if called for them in another context
  * (such as debugging).
  */

"some of these registers are not emulated on BOOKE_HV (GS-mode)"
  1) Is not that mtspr()/mfspr() for "not emulated" registers should
follow EMULATE_FAIL path? So should be ifdef out for BOOKE_HV? Otherwise
the emulation code execute.
  2) Or These are not emulated because the GS mode have direct access to
these registers, Right? So no trap?

For BOOKE_HV mtspr/mfspr would get mapped to hardware maintained guest shadow copies.
For example guest access to dear would get mapped to gdear and wouldn't trap

"and these functions will return the wrong result if called for them in
another context (such as debugging)."
  1) So do you mean that guest is not supposed to access these registers
in normal scenario but the debugger (some command on gdb in guest) can
access these register? then does it make sense to treat mtspr() as nop
and mfspr returns 0/undefined?

Actually, in a normal scenario (For BOOKE_HV) guest (MSR[GS] = 1) would be able to directly access these registers
without hypervisor intervention. However I am not sure under what condition would the guest access generate a trap, all
guest accesses would be with MSR[GS]=1.

Yup. E500mc would just never reach that code - and even if it did, it simply wouldn't do anything useful.

What did you guys need this change for? I'm sure there's some incentive behind it, right? The only one I can see right now would be reduced code size.


Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux