[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 4/7] accel/kvm: Simplify kvm_set_sigmask_len()
From: |
Paolo Bonzini |
Subject: |
Re: [RFC PATCH 4/7] accel/kvm: Simplify kvm_set_sigmask_len() |
Date: |
Sun, 5 Jul 2020 09:12:44 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
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);
>
- Re: [RFC PATCH 4/7] accel/kvm: Simplify kvm_set_sigmask_len(),
Paolo Bonzini <=