public inbox for kvmarm@lists.cs.columbia.edu
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	dave.martin@arm.com, linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu
Subject: Re: [PATCH 1/2] ARM: hyp-stub: improve ABI
Date: Mon, 9 Jan 2017 14:10:59 +0000	[thread overview]
Message-ID: <20170109141059.GB14217@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20170109140500.GA14217@n2100.armlinux.org.uk>

On Mon, Jan 09, 2017 at 02:05:00PM +0000, Russell King - ARM Linux wrote:
> So, although Marc produced a patch which updates the KVM hypervisor for
> the GET_VECTORS change, through reading the code today, it's become clear
> that much more is needed, so I'm yet again banging on about documentation.
> It's only become clear to me today that the KVM stub calling convention
> for the host kernel is:
> 
> entry:
> 	r0 = function pointer
> 	r1 = 32-bit function argument 0
> 	r2 = 32-bit function argument 1
> 	r3 = 32-bit function argument 2
> 	no further arguments are supported
> 	--- or ---
> 	r0 = -1 (or 0 post Marc's patch) for get_vectors
> exit:
> 	r0 = vectors (if get_vectors call was made)
> 	otherwise, who knows...
> 
> I specify "32-bit" there because they're shifted by one register, which,
> if a 64-bit argument is passed with EABI, the arguments will no longer be
> appropriately aligned... so it's an important detail to be aware of with
> the current KVM hypervisor interface.
> 
> What I want to do here is to fix this kexec issue completely, not in a
> piecemeal fashion - I'm not interested in fixing one small problem, then
> coming back to it in a few months time to fix another problem.  That's a
> waste of time (well, unless you're into job creation.)  I've always been
> for "if you're going to do the job, damn well do the job properly".  So
> I'm not going to accept anything short of fixing _both_ kexec and kdump
> together.
> 
> So, given that the hyp-stub has this ABI after my patches:
> 
> entry:
> 	r0 = argument (0 = get vectors, 1 = set vectors, 2 = call function)
> 	r1 = vectors for r0 = 1
> 	r3 = function pointer (with bit 0 already set for thumb functions)
> 	     for r0 = 2
> exit:
> 	r0 = -1 for invalid calls
> 	r0 = current vectors address (for r0 = 0 on entry)
> 	is not expected to return for r0 = 2 on entry
> 	otherwise registers preserved preserved
> 
> which is clearly incompatible with the current KVM stub, can we come up
> with a common ABI that is satisfactory to both.
> 
> The above are probably the very first time anyone has written out the
> ABI of these things, and as can be seen, it's still something of a mess.

For completeness, this is the existing hyp-stub ABI:

entry:
	r0 = -1 => get_vectors
	r0 != -1 => set_vectors (to the value in r0)
exit:
	r0 = current vector address

And that's it.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2017-01-09 14:09 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1cFRAn-0003ob-HH@rmk-PC.armlinux.org.uk>
2016-12-13 10:54 ` [PATCH] ARM: soft-reboot into same mode that we entered the kernel Mark Rutland
2016-12-13 11:11   ` Russell King - ARM Linux
2016-12-13 11:30     ` Mark Rutland
2016-12-14 10:46       ` [PATCH 1/2] ARM: hyp-stub: improve ABI Russell King
2016-12-14 11:49         ` Mark Rutland
2016-12-15 11:18         ` Marc Zyngier
2016-12-15 11:35           ` Russell King - ARM Linux
2016-12-15 11:46             ` Marc Zyngier
2016-12-15 15:15               ` Russell King - ARM Linux
2016-12-15 15:37                 ` Marc Zyngier
2016-12-15 18:57                   ` Russell King - ARM Linux
2016-12-17 12:07                     ` Catalin Marinas
2017-01-02 12:12                       ` Russell King - ARM Linux
2017-01-03  9:51                     ` Christoffer Dall
2017-01-09 12:26                       ` Russell King - ARM Linux
2017-01-09 13:26                         ` Christoffer Dall
2017-01-09 14:05                           ` Russell King - ARM Linux
2017-01-09 14:10                             ` Russell King - ARM Linux [this message]
2017-01-09 14:42                             ` Russell King - ARM Linux
2017-01-09 14:57                               ` Christoffer Dall
2017-01-09 15:01                             ` Christoffer Dall
2017-01-09 15:43                               ` Russell King - ARM Linux
2017-01-09 12:54           ` Russell King - ARM Linux
2017-01-09 13:14             ` Marc Zyngier
2017-01-09 13:20               ` Russell King - ARM Linux
2017-01-09 13:31                 ` Marc Zyngier
2017-01-09 14:28             ` Catalin Marinas
2016-12-14 10:46       ` [PATCH 2/2] ARM: soft-reboot into same mode that we entered the kernel Russell King
2016-12-14 11:56         ` Mark Rutland
2016-12-14 12:05           ` Russell King - ARM Linux
2016-12-14 12:17             ` Mark Rutland
2016-12-14 12:29               ` Russell King - ARM Linux
2016-12-14 12:40                 ` Mark Rutland
2016-12-14 12:46                   ` Russell King - ARM Linux
2016-12-14 13:42             ` Marc Zyngier

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=20170109141059.GB14217@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=christoffer.dall@linaro.org \
    --cc=dave.martin@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marc.zyngier@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox