From patchwork Wed Dec 27 01:22:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 183387 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1186655dyb; Tue, 26 Dec 2023 17:23:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkyQItpbqcmQEtUvQO6i4+/S3dnx3BjL76zWpRZcy8VZEcn/0L51UrndMFACkNsysWO6fe X-Received: by 2002:ac8:7d44:0:b0:427:92f8:336f with SMTP id h4-20020ac87d44000000b0042792f8336fmr10899528qtb.90.1703640188673; Tue, 26 Dec 2023 17:23:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703640188; cv=none; d=google.com; s=arc-20160816; b=dwI+/Yvo+mRUJb8gMj4Lddx932f2ocN5sUPKgehtKDQITZAC4115MZqVg7bbRff0qa PGpIE9fWdNUBr4ssnRpBEMU+R1e8x700MqRPD1rjkG2MFZ4uZIehmrxts/eR+njBLhvg 5Un8LtmTukjmQnzy8CPaEwrnhG6XrJchiWdR9DvW1jaadZAeyfknLneQwbcL+/qMJjgH RPTNfIqJZarlsrloWbQnWiSqxwD/xawhnoYaO2Yf4DMuUf9RNwlhxsaYq3gSNT4x9v65 Pq3oRwuL3no+o95ERcuxcYupQmnQsfFye8JFY4Ph9CIGliWBxMCbeT+tceqaTX989qYe DX3A== ARC-Message-Signature: i=1; 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:message-id:date:subject:cc:to :from:dkim-signature; bh=SuZFcoL6i0kMdM6kD/totFTlC3QefOClRnBM4XrBqqI=; fh=k5dKy3kKJJxYe2Fq2ITT/JNrw7WxHjbM6Cpr+vb7zqs=; b=XOHNVjD+clsmjsgdDR3hS45KduREDzU9OfuoaJVrMUlHHYVehBcGTgjCTw/3oKkh/S MjTel75EB4uIcSHUdR+06NYgE3xrVPGnMWaKzHg5H6iNFsJmTfZhW+K1157jiEzYTVi/ 31FiG2ONTeKMrLTcYcGC71dVu6Z3sZtlwrsyYHLAeh5ICpCSZFd8tPzrnn6SK3kyE9wI m3fR2PmQf29reowhbK7PLPiMDf9DICNE9RHch+Sd3ugZ4WmbL7QYB4ip779iSUymYdov BhCDeIDu8mVIpHYgTwi8iPAQ9DmNiy7OyADTU/SIaKZbGKs3JfZAH3B/Gpd3ZAk92TCf 52rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=xNkGEoU8; spf=pass (google.com: domain of linux-kernel+bounces-11758-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11758-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d18-20020a05622a05d200b00427e8433c63si1256392qtb.473.2023.12.26.17.23.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 17:23:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11758-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=xNkGEoU8; spf=pass (google.com: domain of linux-kernel+bounces-11758-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11758-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 774D81C2215A for ; Wed, 27 Dec 2023 01:23:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D016123D2; Wed, 27 Dec 2023 01:22:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="xNkGEoU8" X-Original-To: linux-kernel@vger.kernel.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E77D61C3E; Wed, 27 Dec 2023 01:22:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=SuZFcoL6i0kMdM6kD/totFTlC3QefOClRnBM4XrBqqI=; b=xNkGEoU8W2YOPy99YSbSwfTb2X 9TVDUtwsIvSZFHkSIErhjTrIyzaO8yvHnT/vmaQsfQO6ZP70iWmZ+UHO0HJ8LARfQ/2ewkB8g4x4A eDH2pNJTDmpSftzLOXuqeuxMCEFRd82lU/AzSCNF9kJjJjVItMZVyP05pMw9YIDnARTjDsULCgsJP 4N8sJ7+RFRlakKrvUObPc4MAsa1SkZxQvsc/MQ/i04RlF0UW0cFlyJeefmT/YHMXpdf1H+wi65s1Z cSNRbWFVWH/mJTWchgOe6cz5pyAAevJwxWscvdR33zEM7591nLfBOrqcMryHgbf6tTR1bVVwOfUOA NKyX1H4g==; Received: from [50.53.46.231] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rIId9-00DlNz-19; Wed, 27 Dec 2023 01:22:43 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Bibo Mao , Tianrui Zhao , Huacai Chen , WANG Xuerui , kvm@vger.kernel.org, loongarch@lists.linux.dev, Stephen Rothwell Subject: [PATCH v2] LoongArch: KVM: add returns to SIMD stubs Date: Tue, 26 Dec 2023 17:22:40 -0800 Message-ID: <20231227012240.6545-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786396214706233338 X-GMAIL-MSGID: 1786396214706233338 The stubs for kvm_own/lsx()/kvm_own_lasx() when CONFIG_CPU_HAS_LSX or CONFIG_CPU_HAS_LASX is not defined should have a return value since they return an int, so add "return -EINVAL;" to the stubs. Fixes the build error: In file included from ../arch/loongarch/include/asm/kvm_csr.h:12, from ../arch/loongarch/kvm/interrupt.c:8: ../arch/loongarch/include/asm/kvm_vcpu.h: In function 'kvm_own_lasx': ../arch/loongarch/include/asm/kvm_vcpu.h:73:39: error: no return statement in function returning non-void [-Werror=return-type] 73 | static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { } Fixes: 118e10cd893d ("LoongArch: KVM: Add LASX (256bit SIMD) support") Fixes: db1ecca22edf ("LoongArch: KVM: Add LSX (128bit SIMD) support") Signed-off-by: Randy Dunlap Cc: Bibo Mao Cc: Tianrui Zhao Cc: Huacai Chen Cc: WANG Xuerui Cc: kvm@vger.kernel.org Cc: loongarch@lists.linux.dev Cc: Stephen Rothwell --- v2: also update kvm_own_lsx() as requested by Huacai arch/loongarch/include/asm/kvm_vcpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -- a/arch/loongarch/include/asm/kvm_vcpu.h b/arch/loongarch/include/asm/kvm_vcpu.h --- a/arch/loongarch/include/asm/kvm_vcpu.h +++ b/arch/loongarch/include/asm/kvm_vcpu.h @@ -60,7 +60,7 @@ int kvm_own_lsx(struct kvm_vcpu *vcpu); void kvm_save_lsx(struct loongarch_fpu *fpu); void kvm_restore_lsx(struct loongarch_fpu *fpu); #else -static inline int kvm_own_lsx(struct kvm_vcpu *vcpu) { } +static inline int kvm_own_lsx(struct kvm_vcpu *vcpu) { return -EINVAL; } static inline void kvm_save_lsx(struct loongarch_fpu *fpu) { } static inline void kvm_restore_lsx(struct loongarch_fpu *fpu) { } #endif @@ -70,7 +70,7 @@ int kvm_own_lasx(struct kvm_vcpu *vcpu); void kvm_save_lasx(struct loongarch_fpu *fpu); void kvm_restore_lasx(struct loongarch_fpu *fpu); #else -static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { } +static inline int kvm_own_lasx(struct kvm_vcpu *vcpu) { return -EINVAL; } static inline void kvm_save_lasx(struct loongarch_fpu *fpu) { } static inline void kvm_restore_lasx(struct loongarch_fpu *fpu) { } #endif