Received: by 10.213.65.68 with SMTP id h4csp1258086imn; Wed, 14 Mar 2018 14:37:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELtAPoNXfkVMClRc6J1CWcYEQUA6j77h57dq5Yvxuz2yAE4bX6YCNn3HlZkzqF8jc3JnrSkb X-Received: by 10.98.103.136 with SMTP id t8mr5645755pfj.177.1521063467171; Wed, 14 Mar 2018 14:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521063467; cv=none; d=google.com; s=arc-20160816; b=yl1eq9RNtMKciDeOf57FaRuZyUhi9fMaZtmdKHEB1ql5mailv6p0u27qO8k2IeNQkJ cTxPHcHSY/TmlH460KPexOAV+m2wynHckqogNQT+fqoskPYa0bqrt+gG6Jo8KnUbmsNq ABA7aVklfVFFH2sJdVnrXPx76h+w9r+2aXqY186Z6399ZzjVqVC48G33FQ373s2VS3vj XSge0+0olFdbtRbMGl0kgUE0XYWQlocMUJX//GMkQ5ahKT7J16AYQg1m9wboz9i627tI RNfbB5FHnbkWm7y/8Zp1ZHjBCovS0cElNOk8Ky/ysu7fTKJphWcP6yTSCUmLxyMxRL15 7usw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=l1MouDS+poACcdaoN2XBDTXOjToa/NYo5wINPWxve6w=; b=0CfjEZb4pw9GlaNIejveebGiSC2gwanPtOC6m8n8BKYOJEyelhNsMi3AQHQwEUh03y TYnfLbkPH8g8cnORbo9sEhEA84U7XcQ1SV4bGhANzDN/p+9V2TYDQVgz/PMEHj9mX/F2 jbn9WwI8nf9No8/yAHNtIymnSwotHcTtTt02V4CWEFEBil9N5D+AwzPH4yGS/oE+3kgh oH8YMUsvaiUvjAmGGnTJSysKsa5DlIJPMfDS/nJmHe7wfO5gY+/VQN06WaYxupBvtnjv WzJHwb/RJAY7xhqu88C5yQRWRsHrsLHg6h7X7bH8Lq9pqtQppZSVOA7Yf1iPHCNBQmmw xX+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=l5WTNT2M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z13si2370829pgu.804.2018.03.14.14.37.32; Wed, 14 Mar 2018 14:37:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=l5WTNT2M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751806AbeCNVgg (ORCPT + 99 others); Wed, 14 Mar 2018 17:36:36 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:34209 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751279AbeCNVgf (ORCPT ); Wed, 14 Mar 2018 17:36:35 -0400 Received: by mail-pl0-f66.google.com with SMTP id u13-v6so2462848plq.1 for ; Wed, 14 Mar 2018 14:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=l1MouDS+poACcdaoN2XBDTXOjToa/NYo5wINPWxve6w=; b=l5WTNT2MjzJWekT4WcjiPZqKf+UqzLH+/7c9yMMsK1D4mZcQ3WN/EQ4ALs/9CSFtfr 9kD1RmqmD+RQ7FCpPawYaeJtpyHcmSzfgAHohdUUxoLCwaZTMLACUNKCfpF8wieETOSX TxLrLTvuB8rXD55fbvKmTrg/6egDw2tbiMvo2nigdpODXd0flziqfG8c0Bg56RBZETql bQWDE3fVTFw1EEkBpeWycs7mQ9BwZx1A2IZS5yLq688iCV7v/rzJg21lQJ49ecPN4IFc 4N5IT2/3cDPmGUzIB2nzqCgRr9LyU8mpKtcPYtnNnztYsM0JHWbNxH1UOAKIm5vHRgEA 939Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=l1MouDS+poACcdaoN2XBDTXOjToa/NYo5wINPWxve6w=; b=UKgQHb4BhK0ll11HxE46vad2OCxe5PFBVoJ7ZCyL4hC7LcenrazJnc3TTzsDd7nQdr OwGkSB8tPobfUewgtQkeoF+W/SEliej+iA3hHHEDA1h0xsqymd4XMgDJWvdpABM2U2Yl jlPirEfd/qOxRQjEIUSlYj5IImaMbWkUT/jJVq6yMi8ZV6Vb9AuGodrWXmZQ0AmJEkSI aX8q5xB3OEN8G3QJVChfZ1hIWsvp6vm803/SYNN06k9/Z0KSHgQRigdXKR1H5zhg7e76 mY3JFSsaqhZwBKTdKSWkJVUb7fBEWaOAj+1aznNXCIOVBV6BB0OnwLHDZBj1xs9B4s7P qXNg== X-Gm-Message-State: AElRT7Eug8L4fv6iNSXVu83syu144OJvNnEaoe0MJ7ljM+ko0klg+vuS k7TqFnpO1Rt3qEa9vuR5PUjCmg== X-Received: by 2002:a17:902:a2:: with SMTP id a31-v6mr5422814pla.204.1521063394013; Wed, 14 Mar 2018 14:36:34 -0700 (PDT) Received: from sonnyrao2.sfo.corp.google.com ([2620:0:1002:1006:c674:637e:8d02:f758]) by smtp.gmail.com with ESMTPSA id q81sm7529692pfl.188.2018.03.14.14.36.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 14:36:32 -0700 (PDT) From: Sonny Rao To: kvm@vger.kernel.org Cc: Stefan Hajnoczi , "Michael S . Tsirkin" , Jason Wang , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] vhost: add vsock compat ioctl Date: Wed, 14 Mar 2018 14:36:25 -0700 Message-Id: <20180314213625.119211-1-sonnyrao@chromium.org> X-Mailer: git-send-email 2.16.2.804.g6dcf76e118-goog Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This will allow usage of vsock from 32-bit binaries on a 64-bit kernel. Signed-off-by: Sonny Rao --- drivers/vhost/vsock.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 0d14e2ff19f16..ee0c385d9fe54 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -699,12 +699,23 @@ static long vhost_vsock_dev_ioctl(struct file *f, unsigned int ioctl, } } +#ifdef CONFIG_COMPAT +static long vhost_vsock_dev_compat_ioctl(struct file *f, unsigned int ioctl, + unsigned long arg) +{ + return vhost_vsock_dev_ioctl(f, ioctl, (unsigned long)compat_ptr(arg)); +} +#endif + static const struct file_operations vhost_vsock_fops = { .owner = THIS_MODULE, .open = vhost_vsock_dev_open, .release = vhost_vsock_dev_release, .llseek = noop_llseek, .unlocked_ioctl = vhost_vsock_dev_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = vhost_vsock_dev_compat_ioctl, +#endif }; static struct miscdevice vhost_vsock_misc = { -- 2.13.5