lkml.org 
[lkml]   [2019]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH v2 08/19] RISC-V: KVM: Implement VCPU world-switch
From
Date
On 02/08/19 09:47, Anup Patel wrote:
> + /* Save Host SSTATUS, HSTATUS, SCRATCH and STVEC */
> + csrr t0, CSR_SSTATUS
> + REG_S t0, (KVM_ARCH_HOST_SSTATUS)(a0)
> + csrr t1, CSR_HSTATUS
> + REG_S t1, (KVM_ARCH_HOST_HSTATUS)(a0)
> + csrr t2, CSR_SSCRATCH
> + REG_S t2, (KVM_ARCH_HOST_SSCRATCH)(a0)
> + csrr t3, CSR_STVEC
> + REG_S t3, (KVM_ARCH_HOST_STVEC)(a0)
> +

A possible optimization: if these cannot change while Linux runs (I am
thinking especially of STVEC and HSTATUS, but perhaps SSCRATCH can be
saved on kvm_arch_vcpu_load too) you can avoid the csrr and store.

Paolo

\
 
 \ /
  Last update: 2019-08-02 10:30    [W:0.174 / U:0.904 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site