From patchwork Fri Feb 3 09:42:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 4929 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp744731wrn; Fri, 3 Feb 2023 02:00:00 -0800 (PST) X-Google-Smtp-Source: AK7set+GR4oqwo+dOfqmPdPpZyeeMIhnFFa3BgUeuniayVdL+KskqYP0QgZL63HkglEDd8JoGrZa X-Received: by 2002:a17:906:c213:b0:878:81d9:63ea with SMTP id d19-20020a170906c21300b0087881d963eamr9279602ejz.52.1675418400169; Fri, 03 Feb 2023 02:00:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675418400; cv=none; d=google.com; s=arc-20160816; b=bjo4z2nj4OL1DB6ABAZ6GMfk54Hv/d6LBRZzopXpc1R+vhQgJ57yqwuXwuxvCeReka U0McebvCmUMdpxEy5jZ1N+Oks+ByN/xmforLxjnyzM+zkgZD7FyYHQ6WNOVzJAwY6ETC +HUODd4EGpaCckbkg79BVqs/VaCmkPJeyCccJA3803pHZI3eIwHLd3NAayLjIBI2dMbm Ua6KLRwdFVgUl63Ovc8GdCK6bdzjKGzhUAOTkm8LI5tZAomIbIqQljmbXloxOsmgqOds T5srV7jIZzhOvNAio0CsNrcR3xIxDYuyKgd1POpfJQB1aPbrIlX/EqnETIWKHfEmtMAf mHmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=gq4Yn/0owA9XdbDg6QuVgQFBldHRzwq+OimRCX/v9mI=; b=LExQ9edCK6/FuBh1M95LkSpwHvWVtVxdwnVHbncqF0LS/Ue7JIS5stReCYbPihA7fO 20u0T110eEFon4mssN7r2CS1qtJ2TX/7RubJWb38bgljsRwvAIvOBjil9GhLBOiRp4zT yPCuGHK5u2NTvepgzv7uPL+sx2rEQ6AKRFC90QGJ8TaaKDVrxUkKEbVlbfdPRaJ6Jpl7 0KfXunQ86XAc2WhzxMBuSV4SVuMY+95ihQlxI3NF8Dpj0KmZKl9xqOgNTaVeO6///MNr 11ChgLNKVhjEbQTwJbzeqnbahUmpjVInHp3UXHRRAyAr6eCGk0ZaM//Tc9xCobivWPCv tBHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QrkGc5Pj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eq7-20020a170907290700b0084d34979417si203919ejc.323.2023.02.03.01.59.36; Fri, 03 Feb 2023 02:00:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QrkGc5Pj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232861AbjBCJni (ORCPT + 99 others); Fri, 3 Feb 2023 04:43:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231672AbjBCJnf (ORCPT ); Fri, 3 Feb 2023 04:43:35 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F8E22CC55 for ; Fri, 3 Feb 2023 01:42:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675417366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=gq4Yn/0owA9XdbDg6QuVgQFBldHRzwq+OimRCX/v9mI=; b=QrkGc5PjQ2/w2jaND3gBr29zI/jmJyPQIsYDz5jobVTgP57o1g4Vv0TfyNQuKsPDKrGPg/ dzy16RGaHlpEK14Kq/QfEPc0gQhDletlbQO3lf9S8PlZWkWKpopjbY+sYyDlbPpETf5vZd fDvYq3ul3JEKUoJPlfm7K0sQFSpsgTQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-591-Z2JZTNm2PaWxScDI7rs6hw-1; Fri, 03 Feb 2023 04:42:41 -0500 X-MC-Unique: Z2JZTNm2PaWxScDI7rs6hw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 70D9329AB3FA; Fri, 3 Feb 2023 09:42:40 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.204]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70E31404CD80; Fri, 3 Feb 2023 09:42:37 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson Cc: kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm-riscv@lists.infradead.org, Marc Zyngier , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , linuxppc-dev@lists.ozlabs.org Subject: [PATCH 0/7] KVM: Standardize on "int" return types instead of "long" Date: Fri, 3 Feb 2023 10:42:23 +0100 Message-Id: <20230203094230.266952-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756803524231940869?= X-GMAIL-MSGID: =?utf-8?q?1756803524231940869?= This patch series is a follow-up from one of my patches in 2022 and Sean's reply here: https://lore.kernel.org/kvm/YpZu6%2Fk+8EydfBKf@google.com/ KVM functions use "long" return values for functions that are wired up to "struct file_operations", but otherwise use "int" return values for functions that can return 0/-errno in order to avoid unintentional divergences between 32-bit and 64-bit kernels. Some related functions that are not part of a "struct file_operations" still use "long", though, which can cause confusion or even subtle problems (see second patch). Thus let's standardize on using "int" for return values in these functions to avoid such problems in the future. Thomas Huth (7): KVM: Standardize on "int" return types instead of "long" in kvm_main.c KVM: x86: Improve return type handling in kvm_vm_ioctl_get_nr_mmu_pages() KVM: Move KVM_GET_NR_MMU_PAGES into the deprecation section KVM: PPC: Standardize on "int" return types in the powerpc KVM code KVM: s390: Use "int" as return type for kvm_s390_get/set_skeys() KVM: arm64: Change return type of kvm_vm_ioctl_mte_copy_tags() to "int" KVM: Change return type of kvm_arch_vm_ioctl() to "int" arch/arm64/include/asm/kvm_host.h | 4 ++-- arch/arm64/kvm/arm.c | 3 +-- arch/arm64/kvm/guest.c | 4 ++-- arch/mips/kvm/mips.c | 4 ++-- arch/powerpc/include/asm/kvm_ppc.h | 14 +++++++------- arch/powerpc/kvm/book3s_64_mmu_hv.c | 14 +++++++------- arch/powerpc/kvm/book3s_64_vio.c | 4 ++-- arch/powerpc/kvm/book3s_hv.c | 6 +++--- arch/powerpc/kvm/book3s_pr.c | 4 ++-- arch/powerpc/kvm/powerpc.c | 5 ++--- arch/riscv/kvm/vm.c | 3 +-- arch/s390/kvm/kvm-s390.c | 7 +++---- arch/x86/kvm/x86.c | 8 +++++--- include/linux/kvm_host.h | 3 +-- include/uapi/linux/kvm.h | 3 ++- virt/kvm/kvm_main.c | 4 ++-- 16 files changed, 44 insertions(+), 46 deletions(-)