kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	Janosch Frank <frankja@linux.vnet.ibm.com>,
	David Hildenbrand <david@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH] KVM: s390: generate kvm hypercall functions
Date: Wed, 14 Jul 2021 11:38:43 +0200	[thread overview]
Message-ID: <20210714113843.6daa7e09@p-imbrenda> (raw)
In-Reply-To: <20210713145713.2815167-1-hca@linux.ibm.com>

On Tue, 13 Jul 2021 16:57:13 +0200
Heiko Carstens <hca@linux.ibm.com> wrote:

[snip]

> +#define HYPERCALL_ARGS_0
> +#define HYPERCALL_ARGS_1 , arg1
> +#define HYPERCALL_ARGS_2 HYPERCALL_ARGS_1, arg2
> +#define HYPERCALL_ARGS_3 HYPERCALL_ARGS_2, arg3
> +#define HYPERCALL_ARGS_4 HYPERCALL_ARGS_3, arg4
> +#define HYPERCALL_ARGS_5 HYPERCALL_ARGS_4, arg5
> +#define HYPERCALL_ARGS_6 HYPERCALL_ARGS_5, arg6
> +
> +#define GENERATE_KVM_HYPERCALL_FUNC(args)
> 	\ +static inline
> 			\ +long __kvm_hypercall##args(unsigned long
> nr HYPERCALL_PARM_##args)	\ +{
> 					\
> +	register unsigned long __nr asm("1") = nr;
> 	\
> +	register long __rc asm("2");
> 	\

didn't we want to get rid of asm register allocations?

this would have been a nice time to do such a cleanup

> +	HYPERCALL_REGS_##args;
> 		\
> +
> 	\
> +	asm volatile (
> 		\
> +		"	diag	2,4,0x500\n"
> 		\
> +		: "=d" (__rc)
> 	\
> +		: "d" (__nr) HYPERCALL_FMT_##args
> 	\
> +		: "memory", "cc");
> 	\
> +	return __rc;
> 	\ +}
> 		\
> +
> 	\ +static inline
> 			\ +long kvm_hypercall##args(unsigned long nr
> HYPERCALL_PARM_##args)	\ +{
> 					\
> +	diag_stat_inc(DIAG_STAT_X500);
> 		\
> +	return __kvm_hypercall##args(nr
> HYPERCALL_ARGS_##args);		\ +}
> +
> +GENERATE_KVM_HYPERCALL_FUNC(0)
> +GENERATE_KVM_HYPERCALL_FUNC(1)
> +GENERATE_KVM_HYPERCALL_FUNC(2)
> +GENERATE_KVM_HYPERCALL_FUNC(3)
> +GENERATE_KVM_HYPERCALL_FUNC(4)
> +GENERATE_KVM_HYPERCALL_FUNC(5)
> +GENERATE_KVM_HYPERCALL_FUNC(6)
>  
>  /* kvm on s390 is always paravirtualization enabled */
>  static inline int kvm_para_available(void)


  parent reply	other threads:[~2021-07-14  9:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 14:57 [PATCH] KVM: s390: generate kvm hypercall functions Heiko Carstens
2021-07-13 15:41 ` Christian Borntraeger
2021-07-13 15:52   ` Heiko Carstens
2021-07-13 15:59     ` Christian Borntraeger
2021-07-13 16:15       ` Heiko Carstens
2021-07-13 18:06 ` Christian Borntraeger
2021-07-14  9:38 ` Claudio Imbrenda [this message]
2021-07-14  9:50   ` Heiko Carstens
2021-07-14 10:03     ` Christian Borntraeger
2021-07-14 11:21       ` Heiko Carstens

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=20210714113843.6daa7e09@p-imbrenda \
    --to=imbrenda@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.vnet.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).