All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Zachary Amsden <zach@vmware.com>
Cc: Andrew Morton <akpm@osdl.org>, Petr Vandrovec <petr@vmware.com>,
	Chaz Masden <zamsden@gmail.com>,
	Virtualization Mailing List <virtualization@lists.osdl.org>,
	Chris Wright <chrisw@sous-sol.org>, Andi Kleen <ak@muc.de>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [RFC, PATCH 1/5] Paravirt_ops full patching.patch
Date: Thu, 19 Apr 2007 18:58:30 -0700	[thread overview]
Message-ID: <46281E46.7040007@goop.org> (raw)
In-Reply-To: <20070420015224.56315BFC@zach-dev2.vmware.com>

Zachary Amsden wrote:
> Add 5-argument handling for paravirt ops patching of PAE functions.
>
> Signed-off-by: Zachary Amsden <zach@vmware.com>
>
> diff -r dbe11208916f include/asm-i386/paravirt.h
> --- a/include/asm-i386/paravirt.h	Thu Apr 19 11:40:55 2007 -0700
> +++ b/include/asm-i386/paravirt.h	Thu Apr 19 12:04:16 2007 -0700
> @@ -308,10 +308,9 @@ unsigned paravirt_patch_insns(void *site
>   * return value handling from within these macros.  This is fairly
>   * cumbersome.
>   *
> - * There are 5 sets of PVOP_* macros for dealing with 0-4 arguments.
> - * It could be extended to more arguments, but there would be little
> - * to be gained from that.  For each number of arguments, there are
> - * the two VCALL and CALL variants for void and non-void functions.
> + * There are 5 sets of PVOP_* macros for dealing with 0-5 arguments.
> + * For each number of arguments, there are the two VCALL and CALL
> + * variants for void and non-void functions.
>   *
>   * When there is a return value, the invoker of the macro must specify
>   * the return type.  The macro then uses sizeof() on that type to
> @@ -405,6 +404,21 @@ unsigned paravirt_patch_insns(void *site
>  		    "0" ((u32)(arg1)), "1" ((u32)(arg2)),		\
>  		    "2" ((u32)(arg3)), [_arg4] "mr" ((u32)(arg4)))
>  
> +#define PVOP_CALL5(rettype, op, arg1, arg2, arg3, arg4, arg5)		\
> +	__PVOP_CALL(rettype, op,					\
> +		    "push %[_arg5]; push %[_arg4];",			\
> +		    "lea 8(%%esp),%%esp;",				\
> +		    "0" ((u32)(arg1)), "1" ((u32)(arg2)),		\
> +		    "2" ((u32)(arg3)), [_arg4] "mr" ((u32)(arg4)),	\
> +		    [_arg5] "mr" ((u32)(arg5)))
>   

Won't work if arg4 is a stack-relative addressing mode.  That was the
main reason I avoided 5-arg patching.  I guess using "r" as the arg4
constraint would work, but register pressure is getting pretty tight.

    J

  reply	other threads:[~2007-04-20  1:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-20  1:52 [RFC, PATCH 1/5] Paravirt_ops full patching.patch Zachary Amsden
2007-04-20  1:58 ` Jeremy Fitzhardinge [this message]
2007-04-20  2:29 ` Rusty Russell
2007-04-20  4:43 ` Jeremy Fitzhardinge

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=46281E46.7040007@goop.org \
    --to=jeremy@goop.org \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=chrisw@sous-sol.org \
    --cc=mingo@elte.hu \
    --cc=petr@vmware.com \
    --cc=virtualization@lists.osdl.org \
    --cc=zach@vmware.com \
    --cc=zamsden@gmail.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.