From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>,
Lucas Meneghel Rodrigues <lmr@redhat.com>
Cc: kvm@vger.kernel.org
Subject: [PATCH kvm-unit-tests 3/3] x86/smp: use desc.c for setting up IPI handler
Date: Tue, 6 Sep 2011 17:11:36 +0300 [thread overview]
Message-ID: <1315318296-22815-4-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1315318296-22815-1-git-send-email-avi@redhat.com>
This allows other callers to use desc.c without conflict. Fixes
apic.flat failure with -smp 2.
Signed-off-by: Avi Kivity <avi@redhat.com>
---
lib/x86/smp.c | 23 ++---------------------
1 files changed, 2 insertions(+), 21 deletions(-)
diff --git a/lib/x86/smp.c b/lib/x86/smp.c
index 0d8bae8..d4c8106 100644
--- a/lib/x86/smp.c
+++ b/lib/x86/smp.c
@@ -42,26 +42,6 @@ asm (
#endif
);
-
-static void set_ipi_descriptor(void (*ipi_entry)(void))
-{
- unsigned short *desc = (void *)(IPI_VECTOR * sizeof(long) * 2);
- unsigned short cs;
- unsigned long ipi = (unsigned long)ipi_entry;
-
- asm ("mov %%cs, %0" : "=r"(cs));
- desc[0] = ipi;
- desc[1] = cs;
- desc[2] = 0x8e00;
- desc[3] = ipi >> 16;
-#ifdef __x86_64__
- desc[4] = ipi >> 32;
- desc[5] = ipi >> 48;
- desc[6] = 0;
- desc[7] = 0;
-#endif
-}
-
void spin_lock(struct spinlock *lock)
{
int v = 1;
@@ -134,7 +114,8 @@ void smp_init(void)
_cpu_count = fwcfg_get_nb_cpus();
- set_ipi_descriptor(ipi_entry);
+ setup_idt();
+ set_idt_entry(IPI_VECTOR, ipi_entry, 0);
setup_smp_id(0);
for (i = 1; i < cpu_count(); ++i)
--
1.7.6.1
prev parent reply other threads:[~2011-09-06 14:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-06 14:11 [PATCH kvm-unit-tests 0/3] Fix apic.flat Avi Kivity
2011-09-06 14:11 ` [PATCH kvm-unit-tests 1/3] x86/desc: switch to using boot_idt Avi Kivity
2011-09-06 14:11 ` [PATCH kvm-unit-tests 2/3] x86/desc: allow multiple initializations Avi Kivity
2011-09-06 14:11 ` Avi Kivity [this message]
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=1315318296-22815-4-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lmr@redhat.com \
--cc=mtosatti@redhat.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