qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: David Hildenbrand <david@redhat.com>,
	Thomas Huth <thuth@redhat.com>, Halil Pasic <pasic@linux.ibm.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Eric Farman <farman@linux.ibm.com>,
	Ilya Leoshkevich <iii@linux.ibm.com>,
	qemu-s390x@nongnu.org,
	Richard Henderson <richard.henderson@linaro.org>,
	Peter Xu <peterx@redhat.com>,
	Matthew Rosato <mjrosato@linux.ibm.com>
Subject: Re: [PATCH 2/5] hw/s390x/pv: Un-inline s390_pv_init()
Date: Sat, 17 Dec 2022 00:27:49 +0100	[thread overview]
Message-ID: <cd5048e0-846b-49c5-08ac-24b7ca55f103@linaro.org> (raw)
In-Reply-To: <20221216220411.6779-3-philmd@linaro.org>

On 16/12/22 23:04, Philippe Mathieu-Daudé wrote:
> There is no point in having s390_pv_init() inlined.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/s390x/pv.c         | 13 +++++++++++++
>   include/hw/s390x/pv.h | 14 +-------------
>   2 files changed, 14 insertions(+), 13 deletions(-)


> diff --git a/include/hw/s390x/pv.h b/include/hw/s390x/pv.h
> index 9360aa1091..5bca5bcaf1 100644
> --- a/include/hw/s390x/pv.h
> +++ b/include/hw/s390x/pv.h
> @@ -12,7 +12,6 @@
>   #ifndef HW_S390_PV_H
>   #define HW_S390_PV_H
>   
> -#include "qapi/error.h"
>   #include "sysemu/kvm.h"
>   
>   #ifdef CONFIG_KVM
> @@ -78,17 +77,6 @@ static inline int kvm_s390_dump_completion_data(void *buff) { return 0; }
>   #endif /* CONFIG_KVM */
>   
>   int s390_pv_kvm_init(ConfidentialGuestSupport *cgs, Error **errp);
> -static inline int s390_pv_init(ConfidentialGuestSupport *cgs, Error **errp)
> -{
> -    if (!cgs) {
> -        return 0;
> -    }
> -    if (kvm_enabled()) {
> -        return s390_pv_kvm_init(cgs, errp);
> -    }
> -
> -    error_setg(errp, "Protected Virtualization requires KVM");
> -    return -1;
> -}
> +int s390_pv_init(ConfidentialGuestSupport *cgs, Error **errp);

OK I understood why this function is inlined. It is called from:

$ git grep s390_pv_init
hw/s390x/pv.c:29:int s390_pv_init(ConfidentialGuestSupport *cgs, Error 
**errp)
hw/s390x/s390-virtio-ccw.c:259:    s390_pv_init(machine->cgs, &error_fatal);
include/hw/s390x/pv.h:86:int s390_pv_init(ConfidentialGuestSupport *cgs, 
Error **errp);

Now note in meson.build:

s390x_ss.add(when: 'CONFIG_KVM', if_true: files(
   'tod-kvm.c',
   's390-skeys-kvm.c',
   's390-stattrib-kvm.c',
   'pv.c',
   's390-pci-kvm.c',
))

So when CONFIG_KVM=false s390-virtio-ccw.c doesn't have to link with
the kvm-specific pv.o.

I'll rework this patch.


  reply	other threads:[~2022-12-16 23:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 22:04 [PATCH 0/5] target/s390x: Header cleanups around "cpu.h" Philippe Mathieu-Daudé
2022-12-16 22:04 ` [PATCH 1/5] exec/memory: Expose memory_region_access_valid() Philippe Mathieu-Daudé
2022-12-17  0:42   ` Richard Henderson
2022-12-16 22:04 ` [PATCH 2/5] hw/s390x/pv: Un-inline s390_pv_init() Philippe Mathieu-Daudé
2022-12-16 23:27   ` Philippe Mathieu-Daudé [this message]
2022-12-16 22:04 ` [PATCH 3/5] hw/s390x/pv: Simplify s390_is_pv() for user emulation Philippe Mathieu-Daudé
2022-12-17 11:42   ` Philippe Mathieu-Daudé
2022-12-16 22:04 ` [PATCH 4/5] target/s390x/tcg/misc_helper: Remove unused "memory.h" include Philippe Mathieu-Daudé
2022-12-17  0:43   ` Richard Henderson
2022-12-16 22:04 ` [PATCH 5/5] target/s390x/tcg/excp_helper: Restrict system headers to sysemu Philippe Mathieu-Daudé
2022-12-17  0:45   ` Richard Henderson
2022-12-17 11:51     ` Philippe Mathieu-Daudé

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=cd5048e0-846b-49c5-08ac-24b7ca55f103@linaro.org \
    --to=philmd@linaro.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@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;
as well as URLs for NNTP newsgroup(s).