Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp962916lqt; Fri, 19 Apr 2024 16:49:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXTPkmCkeVecG6mmmLkA4P6Nnw04BEDJHjrIN/Y6GvOk3CCHs1ZAvr/fvdgOMSM29ZKMRtMll4C+Z+qMIrumZLrR5ZAEaGE4PaKWoqpUQ== X-Google-Smtp-Source: AGHT+IEj8Nu1sYC/j8gbZti6BRXzLx6wHn4GwZsm3nddzh4EUXn/LER7BI5i3NQ9cBWRjFLAEH3a X-Received: by 2002:aca:1214:0:b0:3c5:eb7b:ed1a with SMTP id 20-20020aca1214000000b003c5eb7bed1amr3699541ois.13.1713570592263; Fri, 19 Apr 2024 16:49:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713570592; cv=pass; d=google.com; s=arc-20160816; b=cy0wchTuhkKYJW9ZvW/TD50+F7krKFpHcGJmTPdTRAOI4le7M202oe5JH8iy8i8CVd SudyLAwiy58G4LK453BOW7SAwf9RsHiRLqUaF7pEM9RkJLSyIoJPMxocByRHmHYdrez9 dmwOD0KIjimx6JmtduUu3veiO3cugHF9qQgJFd9ThLsiQz5q3r6N2LHB6z2F8Vj5/kNh PAZ+RxEKYI3SAi8yDtywRrnxFEiErRBmcmw9if/HjBay75O+VKc0ARf46xOhbQk9g+OX qxr+cMJpwBPfzKGkb/Nz9E8ZouncylzPKxxNRMpMnnSlWzHXHolC9irddDLB0R7V9+mv So7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=CkMvEzo278xPIa/MSXztYs2ivQ6wYMeKBg/aNDTTbzU=; fh=z7fJWkZ4T7GjqwnZHLiFaBRNsKIE6v81MvuCrwEofW0=; b=u/oZXeqvoHB1vNrlNT51gCIHT4QlSbGTaNAACQY03RHSTLwLy92IjYH4VFyqnIn4g3 WqaRbdRM7lJObrjmzLmdLu1pnVR9R4vQT1NuxDSZwVSl+vO/IAXx9ncHXsjYKVC0a2tT sKJZWwNkGlckm2quTEzB1aVHc+iEO6CfcgynHrMi9vr1Xxgir+P/hPmRfhoQj+0s3B5u ffIyOjd8BM5OO36Sjsw23bQJVHS9ldmXmBsxD+p3lbx0PX3n6ZQAStSkU1YI7MAFEUsf Efehha+c9lSYSPRPbpfDmwBaF6oEMTEtxUo5/T21Q/0r3z+33ES+c7o/nVYhQtgRBG0J VpIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=AkH8Lkzl; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-152029-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152029-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id o25-20020a635a19000000b005d8bed5ec84si4013321pgb.258.2024.04.19.16.49.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 16:49:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152029-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=AkH8Lkzl; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-152029-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152029-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D638B281F17 for ; Fri, 19 Apr 2024 23:49:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 40B6B14291D; Fri, 19 Apr 2024 23:47:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="AkH8Lkzl" Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E275143866 for ; Fri, 19 Apr 2024 23:47:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713570478; cv=none; b=iP7qiEzAvF3+IdBWrz+cIKDjA8YVqZdSQsCy7Gs7ua3Aq35BbNrqK1Tg4tiNSCY3Uq+lqR6gCkzkSne+c9BQyhqnBkZYAMOopEvMAS5MRJ+qltZ4LGgoz4uesBnLfonxgkUI8XZOBaAkOFaME2NQ0GzXN3hqvdC1cUv8DIwB2DI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713570478; c=relaxed/simple; bh=akgdKSazpCJozBL9deA+0ximAc5a6b6WW9ag1TZQiU0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=r2vLGZ5+ZCxN51NEYq5phcmkBMJPmF2QBxG8NmgODH3/RrVf+ZgPCPePhMCPZKkGEXFsfz51c9SSFzxdgHvpOTWlCayIUu3FRo5RKTpzBZdR6rjgB0pygxycJ1DzSnuDmbuTJRXoXhKo67JlLsx0kKkFpMa7IOjAfTzKc69Ie84= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=AkH8Lkzl; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1e3ca546d40so22550905ad.3 for ; Fri, 19 Apr 2024 16:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1713570475; x=1714175275; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CkMvEzo278xPIa/MSXztYs2ivQ6wYMeKBg/aNDTTbzU=; b=AkH8LkzllL2SPyTSZVDUd+z1wShTFKU7snd7zN9KAA6CvkyRMOjAuKf6Xw+edei1BN KPrSZqGaF7BrSdWwratzPoC727sxsA+fSX3iNvtmMeFellzNURj4yq+41MhKND8URRsy 3NB7ZL/HMX7+G3U7RU0F7+FjhyyaYM5MbXyap2dhE+O0lYHL26XOIZR/vqOUb88YWUXf oguGyx9P+Aaf1ERfexopts1xyjdWKMh4gBtq+D8dJCNW+MTrQWozv6h2Ni9LSephUy/l LB8zhp7LZCpE8/10dcdYtZKloP8SAiB5EKKjm2WXQzPvgYAbm3roZqlcEDwwuKAUdhZr EjHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713570475; x=1714175275; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CkMvEzo278xPIa/MSXztYs2ivQ6wYMeKBg/aNDTTbzU=; b=Cabm9fw+SiBkaPewbDojRRmG9QKTZfufPstkOBz0TNzrR8WYqNF4tCPDaGwDtyEczN 7YSISSenGS6xBTI7sq0eWqaIm5TQtOyu07GEWzoRt5THBMJMmCcUeTXgtwv3GJh5/twR 3Ck/AYPnx9HQkHQZds7Us8Y63fBQRQn2MGHfwN4Rf1mkRciX+osqRs2rOtM5Tm5ef2KB 8EzcZL36Iay+GSdMR2etHb7ZryOgoXQD6FPCBBLNOgyx6A8LZFCzkLMElHcBGmfd+YPs aA7jF8PS7siuu3GtoMqgsqtQR/AVuLldqkHo6QfwERzc13ELhO7IcTM3SkvVTSfGjXhh fyGQ== X-Gm-Message-State: AOJu0YxIqXtPdIEZQNsg9aExBbfSV4iZLVyR1Iwg6FerLNGEJ+IZql5q MzbcFlvFtMHai9ZoNlB2fuxHJ5NtDFVX3/LEPrmbcyoMvrFQVljgrz9BBvM7rQVt6qqsJUDwQNS Z X-Received: by 2002:a17:903:4294:b0:1e6:1a9b:6d24 with SMTP id ju20-20020a170903429400b001e61a9b6d24mr3578224plb.30.1713570475638; Fri, 19 Apr 2024 16:47:55 -0700 (PDT) Received: from atishp.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id w17-20020a170902d11100b001e42f215f33sm3924017plw.85.2024.04.19.16.47.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 16:47:55 -0700 (PDT) From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Andrew Jones , Ajay Kaher , Albert Ou , Alexandre Ghiti , Anup Patel , samuel.holland@sifive.com, Conor Dooley , Juergen Gross , kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, Mark Rutland , Palmer Dabbelt , Paolo Bonzini , Paul Walmsley , Shuah Khan , virtualization@lists.linux.dev, Will Deacon , x86@kernel.org Subject: [PATCH v8 06/24] RISC-V: KVM: Rename the SBI_STA_SHMEM_DISABLE to a generic name Date: Sat, 20 Apr 2024 08:17:22 -0700 Message-Id: <20240420151741.962500-7-atishp@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240420151741.962500-1-atishp@rivosinc.com> References: <20240420151741.962500-1-atishp@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Atish Patra --- arch/riscv/include/asm/sbi.h | 2 +- arch/riscv/kernel/paravirt.c | 6 +++--- arch/riscv/kvm/vcpu_sbi_sta.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 9aada4b9f7b5..f31650b10899 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -277,7 +277,7 @@ struct sbi_sta_struct { u8 pad[47]; } __packed; -#define SBI_STA_SHMEM_DISABLE -1 +#define SBI_SHMEM_DISABLE -1 /* SBI spec version fields */ #define SBI_SPEC_VERSION_DEFAULT 0x1 diff --git a/arch/riscv/kernel/paravirt.c b/arch/riscv/kernel/paravirt.c index 0d6225fd3194..fa6b0339a65d 100644 --- a/arch/riscv/kernel/paravirt.c +++ b/arch/riscv/kernel/paravirt.c @@ -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, lo, hi, flags, 0, 0, 0); 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"); else pr_warn("Failed to set steal-time shmem"); @@ -84,8 +84,8 @@ static int pv_time_cpu_online(unsigned int cpu) static int pv_time_cpu_down_prepare(unsigned int cpu) { - return sbi_sta_steal_time_set_shmem(SBI_STA_SHMEM_DISABLE, - SBI_STA_SHMEM_DISABLE, 0); + return sbi_sta_steal_time_set_shmem(SBI_SHMEM_DISABLE, + SBI_SHMEM_DISABLE, 0); } static u64 pv_time_steal_clock(int cpu) diff --git a/arch/riscv/kvm/vcpu_sbi_sta.c b/arch/riscv/kvm/vcpu_sbi_sta.c index d8cf9ca28c61..5f35427114c1 100644 --- a/arch/riscv/kvm/vcpu_sbi_sta.c +++ b/arch/riscv/kvm/vcpu_sbi_sta.c @@ -93,8 +93,8 @@ static int kvm_sbi_sta_steal_time_set_shmem(struct kvm_vcpu *vcpu) if (flags != 0) return SBI_ERR_INVALID_PARAM; - if (shmem_phys_lo == SBI_STA_SHMEM_DISABLE && - shmem_phys_hi == SBI_STA_SHMEM_DISABLE) { + if (shmem_phys_lo == SBI_SHMEM_DISABLE && + shmem_phys_hi == SBI_SHMEM_DISABLE) { vcpu->arch.sta.shmem = INVALID_GPA; return 0; } -- 2.34.1