From: Paolo Bonzini <pbonzini@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>, qemu-devel@nongnu.org
Cc: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>,
Aurelien Jarno <aurelien@aurel32.net>,
David Hildenbrand <david@redhat.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>,
Richard Henderson <rth@twiddle.net>,
qemu-s390x@nongnu.org, David Gibson <david@gibson.dropbear.id.au>,
Peter Maydell <peter.maydell@linaro.org>,
Eduardo Habkost <ehabkost@redhat.com>,
kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
Halil Pasic <pasic@linux.ibm.com>,
qemu-arm@nongnu.org, Cornelia Huck <cohuck@redhat.com>,
qemu-ppc@nongnu.org,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Thomas Huth <thuth@redhat.com>
Subject: Re: [RFC PATCH 4/7] accel/kvm: Simplify kvm_set_sigmask_len()
Date: Sun, 5 Jul 2020 09:12:44 +0200 [thread overview]
Message-ID: <cc7b7da2-fcf8-5c5c-5c3c-9e96368ddd22@redhat.com> (raw)
In-Reply-To: <20200623105052.1700-5-philmd@redhat.com>
On 23/06/20 12:50, Philippe Mathieu-Daudé wrote:
> The sigmask_len is a property of the accelerator, not the VM.
> Simplify by directly using the global kvm_state, remove the
> unnecessary KVMState* argument.
This is not entirely true, if there were multiple KVMStates how would
you know which one to read from? So it would have to be a global variable.
Paolo
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> include/sysemu/kvm.h | 2 +-
> accel/kvm/kvm-all.c | 4 ++--
> target/mips/kvm.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
> index 3662641c99..44c1767a7f 100644
> --- a/include/sysemu/kvm.h
> +++ b/include/sysemu/kvm.h
> @@ -469,7 +469,7 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function,
> uint64_t kvm_arch_get_supported_msr_feature(KVMState *s, uint32_t index);
>
>
> -void kvm_set_sigmask_len(KVMState *s, unsigned int sigmask_len);
> +void kvm_set_sigmask_len(unsigned int sigmask_len);
>
> #if !defined(CONFIG_USER_ONLY)
> int kvm_physical_memory_addr_from_host(KVMState *s, void *ram_addr,
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index afd14492a0..7b3f76f23d 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -2240,9 +2240,9 @@ err:
> return ret;
> }
>
> -void kvm_set_sigmask_len(KVMState *s, unsigned int sigmask_len)
> +void kvm_set_sigmask_len(unsigned int sigmask_len)
> {
> - s->sigmask_len = sigmask_len;
> + kvm_state->sigmask_len = sigmask_len;
> }
>
> static void kvm_handle_io(uint16_t port, MemTxAttrs attrs, void *data, int direction,
> diff --git a/target/mips/kvm.c b/target/mips/kvm.c
> index 0adfa70210..cc3e09bdef 100644
> --- a/target/mips/kvm.c
> +++ b/target/mips/kvm.c
> @@ -48,7 +48,7 @@ unsigned long kvm_arch_vcpu_id(CPUState *cs)
> int kvm_arch_init(MachineState *ms, KVMState *s)
> {
> /* MIPS has 128 signals */
> - kvm_set_sigmask_len(s, 16);
> + kvm_set_sigmask_len(16);
>
> kvm_mips_fpu_cap = kvm_check_extension(KVM_CAP_MIPS_FPU);
> kvm_mips_msa_cap = kvm_check_extension(KVM_CAP_MIPS_MSA);
>
next prev parent reply other threads:[~2020-07-05 7:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-23 10:50 [PATCH 0/7] accel/kvm: Simplify few functions that can use global kvm_state Philippe Mathieu-Daudé
2020-06-23 10:50 ` [PATCH 1/7] accel/kvm: Let kvm_check_extension use global KVM state Philippe Mathieu-Daudé
2020-06-23 15:25 ` Cornelia Huck
2020-06-23 10:50 ` [PATCH 2/7] accel/kvm: Simplify kvm_check_extension() Philippe Mathieu-Daudé
2020-06-23 15:43 ` Cornelia Huck
2020-06-23 10:50 ` [PATCH 3/7] accel/kvm: Simplify kvm_check_extension_list() Philippe Mathieu-Daudé
2020-06-23 15:50 ` Cornelia Huck
2020-06-23 10:50 ` [RFC PATCH 4/7] accel/kvm: Simplify kvm_set_sigmask_len() Philippe Mathieu-Daudé
2020-07-05 7:12 ` Paolo Bonzini [this message]
2020-07-05 9:57 ` Philippe Mathieu-Daudé
2020-06-23 10:50 ` [PATCH 5/7] target/i386/kvm: Simplify get_para_features() Philippe Mathieu-Daudé
2020-06-23 15:56 ` Cornelia Huck
2020-06-23 10:50 ` [RFC PATCH 6/7] target/i386/kvm: Simplify kvm_get_mce_cap_supported() Philippe Mathieu-Daudé
2020-06-23 10:50 ` [RFC PATCH 7/7] target/i386/kvm: Simplify kvm_get_supported_[feature]_msrs() Philippe Mathieu-Daudé
2020-07-04 16:50 ` [PATCH 0/7] accel/kvm: Simplify few functions that can use global kvm_state Philippe Mathieu-Daudé
2020-07-05 6:16 ` Paolo Bonzini
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=cc7b7da2-fcf8-5c5c-5c3c-9e96368ddd22@redhat.com \
--to=pbonzini@redhat.com \
--cc=aleksandar.qemu.devel@gmail.com \
--cc=aleksandar.rikalo@syrmia.com \
--cc=aurelien@aurel32.net \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=david@redhat.com \
--cc=ehabkost@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=rth@twiddle.net \
--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).