Commit 3ddb6d4d authored by Atish Patra's avatar Atish Patra Committed by Anup Patel

RISC-V: KVM: Rename the SBI_STA_SHMEM_DISABLE to a generic name

SBI_STA_SHMEM_DISABLE is a macro to invoke disable shared memory
commands. As this can be invoked from other SBI extension context
as well, rename it to more generic name as SBI_SHMEM_DISABLE.
Reviewed-by: default avatarAndrew Jones <ajones@ventanamicro.com>
Signed-off-by: default avatarAtish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20240420151741.962500-7-atishp@rivosinc.comSigned-off-by: default avatarAnup Patel <anup@brainfault.org>
parent 8f486ced
...@@ -277,7 +277,7 @@ struct sbi_sta_struct { ...@@ -277,7 +277,7 @@ struct sbi_sta_struct {
u8 pad[47]; u8 pad[47];
} __packed; } __packed;
#define SBI_STA_SHMEM_DISABLE -1 #define SBI_SHMEM_DISABLE -1
/* SBI spec version fields */ /* SBI spec version fields */
#define SBI_SPEC_VERSION_DEFAULT 0x1 #define SBI_SPEC_VERSION_DEFAULT 0x1
......
...@@ -62,7 +62,7 @@ static int sbi_sta_steal_time_set_shmem(unsigned long lo, unsigned long hi, ...@@ -62,7 +62,7 @@ static int sbi_sta_steal_time_set_shmem(unsigned long lo, unsigned long hi,
ret = sbi_ecall(SBI_EXT_STA, SBI_EXT_STA_STEAL_TIME_SET_SHMEM, ret = sbi_ecall(SBI_EXT_STA, SBI_EXT_STA_STEAL_TIME_SET_SHMEM,
lo, hi, flags, 0, 0, 0); lo, hi, flags, 0, 0, 0);
if (ret.error) { if (ret.error) {
if (lo == SBI_STA_SHMEM_DISABLE && hi == SBI_STA_SHMEM_DISABLE) if (lo == SBI_SHMEM_DISABLE && hi == SBI_SHMEM_DISABLE)
pr_warn("Failed to disable steal-time shmem"); pr_warn("Failed to disable steal-time shmem");
else else
pr_warn("Failed to set steal-time shmem"); pr_warn("Failed to set steal-time shmem");
...@@ -84,8 +84,8 @@ static int pv_time_cpu_online(unsigned int cpu) ...@@ -84,8 +84,8 @@ static int pv_time_cpu_online(unsigned int cpu)
static int pv_time_cpu_down_prepare(unsigned int cpu) static int pv_time_cpu_down_prepare(unsigned int cpu)
{ {
return sbi_sta_steal_time_set_shmem(SBI_STA_SHMEM_DISABLE, return sbi_sta_steal_time_set_shmem(SBI_SHMEM_DISABLE,
SBI_STA_SHMEM_DISABLE, 0); SBI_SHMEM_DISABLE, 0);
} }
static u64 pv_time_steal_clock(int cpu) static u64 pv_time_steal_clock(int cpu)
......
...@@ -93,8 +93,8 @@ static int kvm_sbi_sta_steal_time_set_shmem(struct kvm_vcpu *vcpu) ...@@ -93,8 +93,8 @@ static int kvm_sbi_sta_steal_time_set_shmem(struct kvm_vcpu *vcpu)
if (flags != 0) if (flags != 0)
return SBI_ERR_INVALID_PARAM; return SBI_ERR_INVALID_PARAM;
if (shmem_phys_lo == SBI_STA_SHMEM_DISABLE && if (shmem_phys_lo == SBI_SHMEM_DISABLE &&
shmem_phys_hi == SBI_STA_SHMEM_DISABLE) { shmem_phys_hi == SBI_SHMEM_DISABLE) {
vcpu->arch.sta.shmem = INVALID_GPA; vcpu->arch.sta.shmem = INVALID_GPA;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment