From nobody Sat May 18 14:10:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=googlemail.com ARC-Seal: i=1; a=rsa-sha256; t=1628195635; cv=none; d=zohomail.com; s=zohoarc; b=fOH6aVX4Yrnr+PKC8ZQMZxjVxd3nESnbayHs81pP4iROhqsGINBP/l4G9UmaqEH5Yj+TkQn/LVJtoDm9DrmUxSKx1uymFveydcbvm9F5DoylFsM1OnFNvuLkqk21TCC3rEOV4c5h709QVrbMHis7YJ7kGsBiaVit+NlDDmGoE+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628195635; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ZOApfbQ03KsgoK0wZ7x2pZx8wYHu2jq5lfkc8WbXtAs=; b=UYEJsukJsdO8piFqhs7N4pPsYh8oLdmG/APcgrT9abS/DACslh3wSIO/B25KdiF11MnFNA/FPN7+NswDubS8HwD4kCrBmSRKBN+RSxRU4r5AjG1Z9QR4kg/i8QIMohEV5MgIWXRryRVjSNNneoP7fQFFQsFa4BBYrjqiG6OY3n8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1628195635721355.71992007382744; Thu, 5 Aug 2021 13:33:55 -0700 (PDT) Received: from localhost ([::1]:44404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBk3t-00038m-KQ for importer@patchew.org; Thu, 05 Aug 2021 16:33:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBjGp-0000KE-4n; Thu, 05 Aug 2021 15:43:11 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:51786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mBjGn-0007Sk-Ft; Thu, 05 Aug 2021 15:43:10 -0400 Received: by mail-wm1-x32f.google.com with SMTP id u15so4071876wmj.1; Thu, 05 Aug 2021 12:43:08 -0700 (PDT) Received: from endor.speedport.ip (p200300c217088fca515abd37fd86c56e.dip0.t-ipconnect.de. [2003:c2:1708:8fca:515a:bd37:fd86:c56e]) by smtp.gmail.com with ESMTPSA id g16sm8352405wro.63.2021.08.05.12.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Aug 2021 12:43:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZOApfbQ03KsgoK0wZ7x2pZx8wYHu2jq5lfkc8WbXtAs=; b=UOR6wzj2VyF1b9iVY7ghWP35wzSQ96rb04zx7YtN2ImFSM8F2IJlGA32AiSwXGt5Lh Iajqq6YRY7ia/vku4Zzt2s0YXgxCVq0ttIHaRPHJ1LSGhEY+FEp42qRa2qoLR4B3FAVb MnrhPEwg65x7M+0cYq8OpnOlW5KhaTonsEybypwEDkWgtlovcNfeZSBdKd8OSV5cQq5w 9AA65caJjMdnwNM7Vf/lkjP5IVFEDcpkzJwvRe5yAn0+aZJNuJUWKgjaa9Hrqq6yBJp2 hycYVNF+OET12usKvlHuK8V8NqdrF80vLeSayBLXuZh4QxvcP/Xi+BN9TjMTbI6Bb2Ik AnkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZOApfbQ03KsgoK0wZ7x2pZx8wYHu2jq5lfkc8WbXtAs=; b=lNxtsuePHp79A1+PAHtz2sb9zFJWmcpFn2a7Vyb9V6Q2QxnoQ/G+015IlCWeF5KUm3 o8Ut77s1Lb7m2DITcnio8xg7QLDrcR5KMp8MBB4WCz2aamZnjLcLBX55osjApFmkFsao K89ncp59wqyK9TIxuE/RhIFeFVpWcFEuzHgebBY59heOXkAHJ9Kb7V/zJUAjhz/Z8ZDL 2dFoQa5WCrBO531YsGQoiI/CpznE6Pdx31fp8xOgVzg+QWLemTro7jVxfjbfwyeX3HvE J41fCkwrlIBnjf+csvtWyBS4hYyyFouiiTaO9L4aZOIO8DK5Ku+LT/j7B5H8Ilu1XLR6 dlfw== X-Gm-Message-State: AOAM531Z7ufDaUD+oOYD7sIEgcLzoKyl4b9wlvaWjbIMZAOx+6Q55zfK rGsq9f0jLazu3n4aPSRwhaHG4cktSYNTng== X-Google-Smtp-Source: ABdhPJwywWZFiPfLmYwuNexoJMrWrEFakMqvw83azNjgkYk1ccfOqHrVtLnqmNzHolvlMLBgwjLyZg== X-Received: by 2002:a1c:238e:: with SMTP id j136mr6620725wmj.91.1628192587186; Thu, 05 Aug 2021 12:43:07 -0700 (PDT) From: johannst X-Google-Original-From: johannst To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, johannst Subject: [PATCH v0] kvm: unsigned datatype in ioctl wrapper Date: Thu, 5 Aug 2021 21:39:50 +0200 Message-Id: <20210805193950.514357-1-johannes.stoelp@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=johannes.stoelp@googlemail.com; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 05 Aug 2021 16:33:07 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @googlemail.com) X-ZM-MESSAGEID: 1628195637363100001 Content-Type: text/plain; charset="utf-8" Dear all, in my opinion the `type` argument in the kvm ioctl wrappers should be of type unsigned. Please correct me if I am wrong. - Due to the same reason as explained in the comment on the `irq_set_ioctl` field in `struct KVMState` (accel/kvm/kvm-all.c), the kvm ioctl wrapper should take `type` as an unsigned. Signed-off-by: johannst --- accel/kvm/kvm-all.c | 8 ++++---- accel/kvm/trace-events | 8 ++++---- include/sysemu/kvm.h | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 0125c17edb..45cd6edce3 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2967,7 +2967,7 @@ int kvm_cpu_exec(CPUState *cpu) return ret; } =20 -int kvm_ioctl(KVMState *s, int type, ...) +int kvm_ioctl(KVMState *s, unsigned type, ...) { int ret; void *arg; @@ -2985,7 +2985,7 @@ int kvm_ioctl(KVMState *s, int type, ...) return ret; } =20 -int kvm_vm_ioctl(KVMState *s, int type, ...) +int kvm_vm_ioctl(KVMState *s, unsigned type, ...) { int ret; void *arg; @@ -3003,7 +3003,7 @@ int kvm_vm_ioctl(KVMState *s, int type, ...) return ret; } =20 -int kvm_vcpu_ioctl(CPUState *cpu, int type, ...) +int kvm_vcpu_ioctl(CPUState *cpu, unsigned type, ...) { int ret; void *arg; @@ -3021,7 +3021,7 @@ int kvm_vcpu_ioctl(CPUState *cpu, int type, ...) return ret; } =20 -int kvm_device_ioctl(int fd, int type, ...) +int kvm_device_ioctl(int fd, unsigned type, ...) { int ret; void *arg; diff --git a/accel/kvm/trace-events b/accel/kvm/trace-events index 399aaeb0ec..d78c2eff31 100644 --- a/accel/kvm/trace-events +++ b/accel/kvm/trace-events @@ -1,11 +1,11 @@ # See docs/devel/tracing.rst for syntax documentation. =20 # kvm-all.c -kvm_ioctl(int type, void *arg) "type 0x%x, arg %p" -kvm_vm_ioctl(int type, void *arg) "type 0x%x, arg %p" -kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type 0x%= x, arg %p" +kvm_ioctl(unsigned type, void *arg) "type 0x%x, arg %p" +kvm_vm_ioctl(unsigned type, void *arg) "type 0x%x, arg %p" +kvm_vcpu_ioctl(int cpu_index, unsigned type, void *arg) "cpu_index %d, typ= e 0x%x, arg %p" kvm_run_exit(int cpu_index, uint32_t reason) "cpu_index %d, reason %d" -kvm_device_ioctl(int fd, int type, void *arg) "dev fd %d, type 0x%x, arg %= p" +kvm_device_ioctl(int fd, unsigned type, void *arg) "dev fd %d, type 0x%x, = arg %p" kvm_failed_reg_get(uint64_t id, const char *msg) "Warning: Unable to retri= eve ONEREG %" PRIu64 " from KVM: %s" kvm_failed_reg_set(uint64_t id, const char *msg) "Warning: Unable to set O= NEREG %" PRIu64 " to KVM: %s" kvm_init_vcpu(int cpu_index, unsigned long arch_cpu_id) "index: %d id: %lu" diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index a1ab1ee12d..6d6ed4acf9 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -251,11 +251,11 @@ int kvm_on_sigbus(int code, void *addr); =20 /* internal API */ =20 -int kvm_ioctl(KVMState *s, int type, ...); +int kvm_ioctl(KVMState *s, unsigned type, ...); =20 -int kvm_vm_ioctl(KVMState *s, int type, ...); +int kvm_vm_ioctl(KVMState *s, unsigned type, ...); =20 -int kvm_vcpu_ioctl(CPUState *cpu, int type, ...); +int kvm_vcpu_ioctl(CPUState *cpu, unsigned type, ...); =20 /** * kvm_device_ioctl - call an ioctl on a kvm device @@ -264,7 +264,7 @@ int kvm_vcpu_ioctl(CPUState *cpu, int type, ...); * * Returns: -errno on error, nonnegative on success */ -int kvm_device_ioctl(int fd, int type, ...); +int kvm_device_ioctl(int fd, unsigned type, ...); =20 /** * kvm_vm_check_attr - check for existence of a specific vm attribute --=20 2.32.0