Skip to content

Commit 3ddb6d4

Browse files
atishp04avpatel
authored andcommitted
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: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Atish Patra <atishp@rivosinc.com> Link: https://lore.kernel.org/r/20240420151741.962500-7-atishp@rivosinc.com Signed-off-by: Anup Patel <anup@brainfault.org>
1 parent 8f486ce commit 3ddb6d4

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

arch/riscv/include/asm/sbi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ struct sbi_sta_struct {
277277
u8 pad[47];
278278
} __packed;
279279

280-
#define SBI_STA_SHMEM_DISABLE -1
280+
#define SBI_SHMEM_DISABLE -1
281281

282282
/* SBI spec version fields */
283283
#define SBI_SPEC_VERSION_DEFAULT 0x1

arch/riscv/kernel/paravirt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static int sbi_sta_steal_time_set_shmem(unsigned long lo, unsigned long hi,
6262
ret = sbi_ecall(SBI_EXT_STA, SBI_EXT_STA_STEAL_TIME_SET_SHMEM,
6363
lo, hi, flags, 0, 0, 0);
6464
if (ret.error) {
65-
if (lo == SBI_STA_SHMEM_DISABLE && hi == SBI_STA_SHMEM_DISABLE)
65+
if (lo == SBI_SHMEM_DISABLE && hi == SBI_SHMEM_DISABLE)
6666
pr_warn("Failed to disable steal-time shmem");
6767
else
6868
pr_warn("Failed to set steal-time shmem");
@@ -84,8 +84,8 @@ static int pv_time_cpu_online(unsigned int cpu)
8484

8585
static int pv_time_cpu_down_prepare(unsigned int cpu)
8686
{
87-
return sbi_sta_steal_time_set_shmem(SBI_STA_SHMEM_DISABLE,
88-
SBI_STA_SHMEM_DISABLE, 0);
87+
return sbi_sta_steal_time_set_shmem(SBI_SHMEM_DISABLE,
88+
SBI_SHMEM_DISABLE, 0);
8989
}
9090

9191
static u64 pv_time_steal_clock(int cpu)

arch/riscv/kvm/vcpu_sbi_sta.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ static int kvm_sbi_sta_steal_time_set_shmem(struct kvm_vcpu *vcpu)
9393
if (flags != 0)
9494
return SBI_ERR_INVALID_PARAM;
9595

96-
if (shmem_phys_lo == SBI_STA_SHMEM_DISABLE &&
97-
shmem_phys_hi == SBI_STA_SHMEM_DISABLE) {
96+
if (shmem_phys_lo == SBI_SHMEM_DISABLE &&
97+
shmem_phys_hi == SBI_SHMEM_DISABLE) {
9898
vcpu->arch.sta.shmem = INVALID_GPA;
9999
return 0;
100100
}

0 commit comments

Comments
 (0)