All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Smarduch <m.smarduch@samsung.com>
To: "kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	Marc Zyngier <Marc.Zyngier@arm.com>,
	"christoffer.dall@linaro.org" <christoffer.dall@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>
Subject: Question on corruption of host/guest vfp switch  hyp function
Date: Thu, 18 Jun 2015 18:16:04 -0700	[thread overview]
Message-ID: <55836D54.7070009@samsung.com> (raw)


  I created a HYP function and call it from kvm_arch_vcpu_put().
It dies in restore_vfp_state right at the 'ldm' call.

Is the calling convention bad? Or anything else?
vcpu structure is corrupted right after that instruction.

I expanded the restore_vfp_state macro below, without
the ldm the guest boots (of course vfp restore is
not complete).

I'm running this on FastModels 9.x

Thanks,
  Mario


+ENTRY(__kvm_restore_host_vfp_state)
+       push {r3, r7}
+
+       mov     r1, #0
+       str     r1, [r0, #VCPU_VFP_SAVED]
+
+       VFPFMRX r1, FPEXC
+       push {r1}
+       orr     r6, r2, #FPEXC_EN
+       VFPFMXR FPEXC, r6
+
+       add     r7, r0, #VCPU_VFP_GUEST
+       store_vfp_state r7
+
+       add      r7, r0, #VCPU_VFP_HOST
+       ldr      r7, [r7]
+       restore_vfp_state r7
+
+       pop {r1}
+       VFPFMXR FPEXC, r1
+       pop {r3, r7}
+       bx      lr
+ENDPROC(__kvm_restore_host_vfp_state)


+       LDC     p11, cr0, [r7],#32*4
+       MRC     p10, 7, r6, cr7, cr0, 0
+       and     r6, r6, #(0xf << 0)
+       cmp     r6, #2
+       @ldceql  p11, cr0, [r7],#32*4
+       @addne   r7, r7, #32*4
+       @dsb
+       @sb
>>>>>>>>> Corruption here and dies <<<<<<<
+       ldm     r7, {r2-r5}

                 reply	other threads:[~2015-06-19  1:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55836D54.7070009@samsung.com \
    --to=m.smarduch@samsung.com \
    --cc=Marc.Zyngier@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.