From patchwork Fri Feb 24 19:28:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13151729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77E50C6FA8E for ; Fri, 24 Feb 2023 19:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229461AbjBXT2i (ORCPT ); Fri, 24 Feb 2023 14:28:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229513AbjBXT2g (ORCPT ); Fri, 24 Feb 2023 14:28:36 -0500 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A4E529E09 for ; Fri, 24 Feb 2023 11:28:35 -0800 (PST) Received: by mail-pl1-x64a.google.com with SMTP id iw4-20020a170903044400b0019ccafc1fbeso208577plb.3 for ; Fri, 24 Feb 2023 11:28:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:reply-to:from:to:cc:subject:date:message-id :reply-to; bh=t9//kZJYNl4izvytHF7z7Dnucu90xh6NKNXZlIG10fQ=; b=N4uMwwIz4FqjJ9FM8/Jp2dnnYhdKN41elaX5w3ce3TcrdJG/W8EzXo3Yi6XXAApxat 80fUNj04Wt0Mse771QGq815Duvq4PiqIinQw/9T4b5o/7Ab8ktWzMNfcd0O2NPP4q1EJ h5GkgGVtdvXGynoBCOACvKv3NzUhoCRL3v01WsRueoyIDKdEzrr+AYcnm7F0S7TWrn5d nqMdz+krg34hQNLWGqMUn5qdkBNA96qSIj4DHhKD8xVs+B70heBy/Tc4xGa6Vs694+ne sX+45w5v0A2FobeG0JGG06WeLYgYsoaAbeGOHTuZMyhtpbEJ68nOgL84y1o4B5I/UTLO 86Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:reply-to:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=t9//kZJYNl4izvytHF7z7Dnucu90xh6NKNXZlIG10fQ=; b=CfcmGKVjrEoE2eyAHDMydd/oPeC8kVjUKwGeddZKuw1W+81TkL5NBFfjOu3n7gS+ED wjSPo6RLNrk3bqO2iyS2ygQYNqD0a4l2GhrahCDFFolkRU5ifat6wOCCAhFhNqXjDzZM 6L0NNApRAb97c/IFS3ci5cQarDq4Vyu6izErmf5BuxSPJZ3DRDMID0Y/O6DpBipfUIyc q/jzsytduS3oXP1Lq9Bijt8iJCMKsjwFR/XMMF3dYx4qJ6EPh5940o2LDURXzYTfaiuF l5oFpsnlSby9Xx6zJcMASjQxAv/2AURYVDifBBhuevuYMVbNvBrei0CCyzl79zcgGuFd 1b7g== X-Gm-Message-State: AO0yUKViK7ylFczCJll9T3Dxp+a3AbUyaYSXEV9WIR/bCDnM0Coiy70a c7dJVTJVhSfHvci2H0ya0XzGIDYWb+A= X-Google-Smtp-Source: AK7set8gQnDgd8AG5QXkVWmuSwCeOQmUnx+cCbmPxxPkcEWiuy9vkA0Ac3gAhRdY8KBGrIYdYWvh2l2spTc= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a02:241:b0:502:f8a4:86db with SMTP id bi1-20020a056a02024100b00502f8a486dbmr333807pgb.1.1677266914636; Fri, 24 Feb 2023 11:28:34 -0800 (PST) Reply-To: Sean Christopherson Date: Fri, 24 Feb 2023 11:28:32 -0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.39.2.722.g9855ee24e9-goog Message-ID: <20230224192832.1286267-1-seanjc@google.com> Subject: [PATCH] KVM: MIPS: Make kvm_mips_callbacks const From: Sean Christopherson To: Huacai Chen , Aleksandar Markovic Cc: linux-mips@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, " =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= " , Sean Christopherson Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Make kvm_mips_callbacks fully const as it's now hardcoded to point at kvm_vz_callbacks, the only remaining the set of callbacks. Link: https://lore.kernel.org/all/beb697c2-dfad-780e-4638-76b229f28731@linaro.org Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Sean Christopherson Reviewed-by: Philippe Mathieu-Daudé --- arch/mips/include/asm/kvm_host.h | 2 +- arch/mips/kvm/vz.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) base-commit: 3ad108511e1c19ff3a3fcb9a39b3eaebf4dd4054 diff --git a/arch/mips/include/asm/kvm_host.h b/arch/mips/include/asm/kvm_host.h index 2803c9c21ef9..957121a495f0 100644 --- a/arch/mips/include/asm/kvm_host.h +++ b/arch/mips/include/asm/kvm_host.h @@ -757,7 +757,7 @@ struct kvm_mips_callbacks { int (*vcpu_run)(struct kvm_vcpu *vcpu); void (*vcpu_reenter)(struct kvm_vcpu *vcpu); }; -extern struct kvm_mips_callbacks *kvm_mips_callbacks; +extern const struct kvm_mips_callbacks * const kvm_mips_callbacks; int kvm_mips_emulation_init(void); /* Debug: dump vcpu state */ diff --git a/arch/mips/kvm/vz.c b/arch/mips/kvm/vz.c index dafab003ea0d..3d21cbfa7443 100644 --- a/arch/mips/kvm/vz.c +++ b/arch/mips/kvm/vz.c @@ -3305,7 +3305,7 @@ static struct kvm_mips_callbacks kvm_vz_callbacks = { }; /* FIXME: Get rid of the callbacks now that trap-and-emulate is gone. */ -struct kvm_mips_callbacks *kvm_mips_callbacks = &kvm_vz_callbacks; +const struct kvm_mips_callbacks * const kvm_mips_callbacks = &kvm_vz_callbacks; int kvm_mips_emulation_init(void) {