From: Akio Takebe <takebe_akio@jp.fujitsu.com>
To: "Zhang, Xiantao" <xiantao.zhang@intel.com>,
"Avi Kivity" <avi@qumranet.com>,
"Luck, Tony" <tony.luck@intel.com>,
"Xu, Anthony" <anthony.xu@intel.com>,
"Jes Sorensen" <jes@sgi.com>,
kv
Subject: Re: [14/17][PATCH] kvm/ia64: Add guest interruption injection support.
Date: Fri, 28 Mar 2008 21:36:48 +0900 [thread overview]
Message-ID: <87C890D0641F40takebe_akio@jp.fujitsu.com> (raw)
In-Reply-To: <42DFA526FC41B1429CE7279EF83C6BDCFF7EF2@pdsmsx415.ccr.corp.intel.com>
Hi, Xiantao
It's good, I have some small comments.
>+
>+/* SDM vol2 5.5 - IVA based interruption handling */
>+#define INITIAL_PSR_VALUE_AT_INTERRUPTION 0x0000001808028034
>+
Xen also use this value, you had better use macros of PSR bits.
Or you can add the same comments as Xen.
>+
>+/*
>+ * Handle floating-point assist faults and traps for domain.
>+ */
>+unsigned long vmm_handle_fpu_swa(int fp_fault, REGS *regs, unsigned
>long isr)
>+{
>+ struct kvm_vcpu *v = current_vcpu;
>+ IA64_BUNDLE bundle;
>+ unsigned long fault_ip;
>+ fpswa_ret_t ret;
>+
>+ fault_ip = regs->cr_iip;
>+ /*
>+ * When the FP trap occurs, the trapping instruction is
>completed.
>+ * If ipsr.ri == 0, there is the trapping instruction in
>previous
>+ * bundle.
>+ */
>+ if (!fp_fault && (ia64_psr(regs)->ri == 0))
>+ fault_ip -= 16;
>+
>+ if (fetch_code(v, fault_ip, &bundle))
>+ return -EAGAIN;
>+
>+ if (!bundle.i64[0] && !bundle.i64[1]) {
>+ return -EACCES;
>+ }
>+
>+ ret = vmm_fp_emulate(fp_fault, &bundle, ®s->cr_ipsr,
>®s->ar_fpsr,
>+ &isr, ®s->pr, ®s->cr_ifs, regs);
>+ return ret.status;
>+}
>+
>+void reflect_interruption(u64 ifa, u64 isr, u64 iim,
>+ u64 vec, REGS *regs)
>+{
>+ u64 vector;
>+ int status ;
>+ VCPU *vcpu = current_vcpu;
>+ u64 vpsr = VCPU(vcpu, vpsr);
>+
>+ vector = vec2off[vec];
>+
>+ if (!(vpsr & IA64_PSR_IC) && (vector !=
>IA64_DATA_NESTED_TLB_VECTOR)) {
>+ panic_vm(vcpu);
>+ return;
>+ }
>+
>+ switch (vec) {
>+ case 32:
I want to add a comment of IA64_FP_FAULT_VECTOR.
>+ status = vmm_handle_fpu_swa(1, regs, isr);
>+ if (!status) {
>+ vcpu_increment_iip(vcpu);
>+ return;
>+ } else if (-EAGAIN == status)
>+ return;
>+ break;
>+ case 33:
ditto, I want to add a comments of IA64_FP_TRAP_VECTOR.
>+ status = vmm_handle_fpu_swa(0, regs, isr);
>+ if (!status)
>+ return ;
>+ else if (-EAGAIN == status) {
>+ vcpu_decrement_iip(vcpu);
>+ return ;
>+ }
>+ break;
>+ }
>+
>+ VCPU(vcpu, isr) = isr;
>+ VCPU(vcpu, iipa) = regs->cr_iip;
>+ if (vector == IA64_BREAK_VECTOR || vector ==
>IA64_SPECULATION_VECTOR)
>+ VCPU(vcpu, iim) = iim;
>+ else {
>+ set_ifa_itir_iha(vcpu, ifa, 1, 1, 1);
>+ }
>+ inject_guest_interruption(vcpu, vector);
>+}
>+
>
Best Regards,
Akio Takebe
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
next parent reply other threads:[~2008-03-28 12:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <42DFA526FC41B1429CE7279EF83C6BDCFF7EF2@pdsmsx415.ccr.corp.intel.com>
2008-03-28 12:36 ` Akio Takebe [this message]
2008-03-29 2:16 ` [14/17][PATCH] kvm/ia64: Add guest interruptioninjection support Zhang, Xiantao
2008-03-28 9:58 [14/17][PATCH] kvm/ia64: Add guest interruption injection support Zhang, Xiantao
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=87C890D0641F40takebe_akio@jp.fujitsu.com \
--to=takebe_akio@jp.fujitsu.com \
--cc=anthony.xu@intel.com \
--cc=avi@qumranet.com \
--cc=jes@sgi.com \
--cc=tony.luck@intel.com \
--cc=xiantao.zhang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox