forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/arch/powerpc/kvm/book3s_rtas.c
....@@ -1,9 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright 2012 Michael Ellerman, IBM Corporation.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License, version 2, as
6
- * published by the Free Software Foundation.
74 */
85
96 #include <linux/kernel.h>
....@@ -33,7 +30,7 @@
3330 server = be32_to_cpu(args->args[1]);
3431 priority = be32_to_cpu(args->args[2]);
3532
36
- if (xive_enabled())
33
+ if (xics_on_xive())
3734 rc = kvmppc_xive_set_xive(vcpu->kvm, irq, server, priority);
3835 else
3936 rc = kvmppc_xics_set_xive(vcpu->kvm, irq, server, priority);
....@@ -56,7 +53,7 @@
5653 irq = be32_to_cpu(args->args[0]);
5754
5855 server = priority = 0;
59
- if (xive_enabled())
56
+ if (xics_on_xive())
6057 rc = kvmppc_xive_get_xive(vcpu->kvm, irq, &server, &priority);
6158 else
6259 rc = kvmppc_xics_get_xive(vcpu->kvm, irq, &server, &priority);
....@@ -83,7 +80,7 @@
8380
8481 irq = be32_to_cpu(args->args[0]);
8582
86
- if (xive_enabled())
83
+ if (xics_on_xive())
8784 rc = kvmppc_xive_int_off(vcpu->kvm, irq);
8885 else
8986 rc = kvmppc_xics_int_off(vcpu->kvm, irq);
....@@ -105,7 +102,7 @@
105102
106103 irq = be32_to_cpu(args->args[0]);
107104
108
- if (xive_enabled())
105
+ if (xics_on_xive())
109106 rc = kvmppc_xive_int_on(vcpu->kvm, irq);
110107 else
111108 rc = kvmppc_xics_int_on(vcpu->kvm, irq);
....@@ -232,7 +229,9 @@
232229 */
233230 args_phys = kvmppc_get_gpr(vcpu, 4) & KVM_PAM;
234231
232
+ vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
235233 rc = kvm_read_guest(vcpu->kvm, args_phys, &args, sizeof(args));
234
+ srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);
236235 if (rc)
237236 goto fail;
238237