From patchwork Wed Jan 24 00:40:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elizabeth Figura X-Patchwork-Id: 191273 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp699053dyi; Tue, 23 Jan 2024 17:00:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUk5xLYjXhLayURKJqjDbVhvCpWwJ6KsCWWwzicMkcYapredlfi5KhvTUkmRdRyqFWv1TA X-Received: by 2002:a05:6a00:3d47:b0:6dd:8709:d133 with SMTP id lp7-20020a056a003d4700b006dd8709d133mr565160pfb.19.1706058026677; Tue, 23 Jan 2024 17:00:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706058026; cv=pass; d=google.com; s=arc-20160816; b=Ce2VzF27zJtxbKTPwv7TVAd6BXyi0vu+FdB1Qmo1ZxhGm2EZQGn6rVA8sw+iYDJNf5 DKZdFqeap+MUMrHvPatmYhtkXex2oND+AmoR21RQ8rcEZt5EyShUv6jj4dF1DZvfg67u EK78mHPE7k9m5Z2qKrPRaHObMyle8aHNziYMKP6+HrEBx3qJISN/8mjipmNra7B5sDjU qpq2jYH3n/rpujBArI6guPCHCmeysBhrC9Z2zgQsxFILc4nOvqSxNVcWkokuaGgaV9T5 +3qhqNzUCtj6r9s44fAmwaOFyC5T2WMP2/SxeTpgtLfIa6pKacZFByX0dYZZ7DdiXb9j MJtA== 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=pCs+y0jFrd9vwNY8aF2JjaxuTN4JFwXk3TK7B1Y6y98=; fh=zOh/gHR1JdjLnPSwcFKri+IPCR5+T1wa2H0dRJVHA2I=; b=ghLoEQbMjkv+eK6to6SV5rP2kMFIrXcj6fVY9a7vyweUVq1OpuGK96ARV38r9cPvoz oyppX9eRucJOVQET6A7wXMzHZxAKuMArEGTqN7Z7/Dv3P4ZvBo28NVLGvWAtSWB407oG P6fx0cXfY2qxFkm75fQ4hRmY9pMIm2FN5UzmPZWuJzzvA5flc3k+eMZiErwX9ssEVxnl opB/pI8g1J7jssUtoyfgz22StrokG6TFn1YQBuTigvSMXVHhnhhJYTTYvyOkeOQbfHrF 9EFsHI21LFJ+00fNfRCW9xMANKnOuo9MNIsigX8uiRf1WuqhNlmBSPqsNHvNt58ydS3h URlQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@codeweavers.com header.s=s1 header.b=KSTIVbxI; arc=pass (i=1 spf=pass spfdomain=codeweavers.com dkim=pass dkdomain=codeweavers.com dmarc=pass fromdomain=codeweavers.com); spf=pass (google.com: domain of linux-kernel+bounces-36243-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36243-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codeweavers.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u3-20020a63f643000000b005cdec41cb70si10514149pgj.35.2024.01.23.17.00.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 17:00:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36243-ouuuleilei=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=@codeweavers.com header.s=s1 header.b=KSTIVbxI; arc=pass (i=1 spf=pass spfdomain=codeweavers.com dkim=pass dkdomain=codeweavers.com dmarc=pass fromdomain=codeweavers.com); spf=pass (google.com: domain of linux-kernel+bounces-36243-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36243-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codeweavers.com 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 7C87628DD7F for ; Wed, 24 Jan 2024 01:00:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD9DDBA25; Wed, 24 Jan 2024 00:58:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=codeweavers.com header.i=@codeweavers.com header.b="KSTIVbxI" Received: from mail.codeweavers.com (mail.codeweavers.com [4.36.192.163]) (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 B7FB25689; Wed, 24 Jan 2024 00:58:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=4.36.192.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706057926; cv=none; b=pFvwEyrzaiqkD0iuya0dNXbJ/o2viS4Kkw3nqOUkiLPrtdirsA+/lPMa67BunSv9kv8CvznlWxjXpI9tsH8PcVR9o7FzmiUF8qaRY2cA9+0tIIr3HfzUG+6al8kbC8re3QzyZYfNfXoxIYwgYxR9UCDGMLB5mNdEpxoy1/qIs6k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706057926; c=relaxed/simple; bh=bnDZ18PzZiaqrfIIydrSzNCN+uIZ5h48OVhffyfN5fk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DaLN30PNtvP3o8vmDRW4fGc2ZTQB7gli20Y0ne4eghnkBI2CUPXufHqXtQXzoJoI9pPL/WW5wofsBf/YCpkYX5H1GHmtWZDNM4W2APbyHf0r+fizAUzh5de28ECT7jbdyE5ZGZ0+zOXgcDmmQbWuU9CrdusLMbbxvAuhuId652U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=codeweavers.com; spf=pass smtp.mailfrom=codeweavers.com; dkim=pass (2048-bit key) header.d=codeweavers.com header.i=@codeweavers.com header.b=KSTIVbxI; arc=none smtp.client-ip=4.36.192.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=codeweavers.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=codeweavers.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codeweavers.com; s=s1; h=Message-ID:Date:Subject:Cc:To:From:Sender; bh=pCs+y0jFrd9vwNY8aF2JjaxuTN4JFwXk3TK7B1Y6y98=; b=KSTIVbxIiyc9Muc3XdvntahxwW zX4bLc6KLjak4Xc9XVYkeg8MCg6n0zXFgY4+AISWp9Dsa70hVb04dwZczqbF2EzaNXnr+x/XCgbS1 qK0gMvMHCXJ8i1J39IoajxkdN0NQkEi2NocMO5azudtu7EsER5PWX++ME0ovhQ5rR9hfJyF0UO1vX fm0Sx0p6wkk1Gp4FdXXlZX9SupKbhsUe2/dkmuKsORCPNolawLN2l7gn29yiccbZO3IBn1GZugVcA lfAca31W8mzpAmVEIYAQF9KKNR5rFkx7LyuwZK85Vw82b/b3fk1xIm5WcC1xmTewzzq08vaZ5pPTy 0N7fHRMA==; Received: from cw137ip160.mn.codeweavers.com ([10.69.137.160] helo=camazotz.mn.codeweavers.com) by mail.codeweavers.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rSRLB-00DVeW-1G; Tue, 23 Jan 2024 18:42:05 -0600 From: Elizabeth Figura To: Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: wine-devel@winehq.org, =?utf-8?q?Andr=C3=A9_Almeida?= , Wolfram Sang , Arkadiusz Hiler , Peter Zijlstra , Elizabeth Figura Subject: [RFC PATCH 2/9] ntsync: Reserve a minor device number and ioctl range. Date: Tue, 23 Jan 2024 18:40:21 -0600 Message-ID: <20240124004028.16826-3-zfigura@codeweavers.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124004028.16826-1-zfigura@codeweavers.com> References: <20240124004028.16826-1-zfigura@codeweavers.com> 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: 1788931116345427384 X-GMAIL-MSGID: 1788931501559547852 Signed-off-by: Elizabeth Figura --- Documentation/admin-guide/devices.txt | 3 ++- Documentation/userspace-api/ioctl/ioctl-number.rst | 2 ++ drivers/misc/ntsync.c | 3 ++- include/linux/miscdevice.h | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/devices.txt b/Documentation/admin-guide/devices.txt index 94c98be1329a..041404397ee5 100644 --- a/Documentation/admin-guide/devices.txt +++ b/Documentation/admin-guide/devices.txt @@ -376,8 +376,9 @@ 240 = /dev/userio Serio driver testing device 241 = /dev/vhost-vsock Host kernel driver for virtio vsock 242 = /dev/rfkill Turning off radio transmissions (rfkill) + 243 = /dev/ntsync NT synchronization primitive device - 243-254 Reserved for local use + 244-254 Reserved for local use 255 Reserved for MISC_DYNAMIC_MINOR 11 char Raw keyboard device (Linux/SPARC only) diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspace-api/ioctl/ioctl-number.rst index 457e16f06e04..a1326a5bc2e0 100644 --- a/Documentation/userspace-api/ioctl/ioctl-number.rst +++ b/Documentation/userspace-api/ioctl/ioctl-number.rst @@ -378,6 +378,8 @@ Code Seq# Include File Comments 0xF6 all LTTng Linux Trace Toolkit Next Generation +0xF7 00-1F uapi/linux/ntsync.h NT synchronization primitives + 0xF8 all arch/x86/include/uapi/asm/amd_hsmp.h AMD HSMP EPYC system management interface driver 0xFD all linux/dm-ioctl.h diff --git a/drivers/misc/ntsync.c b/drivers/misc/ntsync.c index 9424c6210e51..84b498e2b2d5 100644 --- a/drivers/misc/ntsync.c +++ b/drivers/misc/ntsync.c @@ -40,7 +40,7 @@ static const struct file_operations ntsync_fops = { }; static struct miscdevice ntsync_misc = { - .minor = MISC_DYNAMIC_MINOR, + .minor = NTSYNC_MINOR, .name = NTSYNC_NAME, .fops = &ntsync_fops, }; @@ -51,3 +51,4 @@ MODULE_AUTHOR("Elizabeth Figura"); MODULE_DESCRIPTION("Kernel driver for NT synchronization primitives"); MODULE_LICENSE("GPL"); MODULE_ALIAS("devname:" NTSYNC_NAME); +MODULE_ALIAS_MISCDEV(NTSYNC_MINOR); diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index c0fea6ca5076..fe5d9366fdf7 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -71,6 +71,7 @@ #define USERIO_MINOR 240 #define VHOST_VSOCK_MINOR 241 #define RFKILL_MINOR 242 +#define NTSYNC_MINOR 243 #define MISC_DYNAMIC_MINOR 255 struct device;