public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Zachary Amsden <zach@vmware.com>
Cc: linux-kernel@vger.kernel.org
Subject: [RFC] Use para_fill instead of vmi_get_function for APIC ops
Date: Mon, 26 Feb 2007 18:06:47 -0600	[thread overview]
Message-ID: <45E37617.6050107@codemonkey.ws> (raw)

[-- Attachment #1: Type: text/plain, Size: 693 bytes --]

Hi Zach,

It seems to me that the APIC paravirt_ops should be filled by 
para_fill() instead of vmi_get_function().  vmi_get_function() returns a 
nop when the relocation type is NONE.  para_fill() leaves the native 
code in place.

The native version of the apic write ops is more or less *(APIC_BASE + 
reg) = value.  APIC_BASE is unknown to the ROM so it's impossible to 
simulate this in the ROM.

This means that a ROM has no choice but to do APIC emulation (or jump 
through seriously hairy loops to get the APIC mapped in it's address 
space).  Was this the intention?

N.B. attached patch is just to illustrate the point.  Has not even been 
compile tested.

Regards,

Anthony Liguori

[-- Attachment #2: vmi-apic-ops.diff --]
[-- Type: text/x-patch, Size: 552 bytes --]

--- linux-2.6.21-rc1/arch/i386/kernel/vmi.c~	2007-02-20 22:32:30.000000000 -0600
+++ linux-2.6.21-rc1/arch/i386/kernel/vmi.c	2007-02-26 17:58:18.000000000 -0600
@@ -852,9 +852,9 @@
 #endif
 
 #ifdef CONFIG_X86_LOCAL_APIC
-	paravirt_ops.apic_read = vmi_get_function(VMI_CALL_APICRead);
-	paravirt_ops.apic_write = vmi_get_function(VMI_CALL_APICWrite);
-	paravirt_ops.apic_write_atomic = vmi_get_function(VMI_CALL_APICWrite);
+	para_fill(apic_read, APICRead);
+	para_fill(apic_write, APICWrite);
+	para_fill(apic_write_atomic, APICWrite);
 #endif
 
 	/*

             reply	other threads:[~2007-02-27  0:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-27  0:06 Anthony Liguori [this message]
2007-02-27  0:43 ` [RFC] Use para_fill instead of vmi_get_function for APIC ops Zachary Amsden
2007-02-27  0:49   ` Anthony Liguori
2007-02-27  1:00     ` Zachary Amsden
2007-02-27  1:36   ` Jeremy Fitzhardinge
2007-02-27 16:17   ` Anthony Liguori

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=45E37617.6050107@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zach@vmware.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