Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5128209pxb; Tue, 28 Sep 2021 11:06:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfZZ+F/xsygx/PVBaQICzb2NN39pHfAv/7/fbhTwARD2deem+LT1WPIG6EAs8RM/84x7EO X-Received: by 2002:a17:906:2b1b:: with SMTP id a27mr8246696ejg.280.1632852372963; Tue, 28 Sep 2021 11:06:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1632852372; cv=pass; d=google.com; s=arc-20160816; b=A4sh5OFEHuyX4kotwsDvKhdcHKT9Jk0zVzAMd4qAGBZng+TiSDIhUMfl3XVjjduCuX jCMndHQg+Bm/zWrjKxQ3Huf9fjXO4tYhfN3IHYQM14dEewqa7cC3zZs/8qU/APLUhf54 H7+W7dvFmAMjjzzz1dXipGUMnJOt4mksU83RFh9BjBRvtwzNanp5oBcuozNgZq40oVQv ORNcdQPmVbVkU/qpKCELT3zpMjNAaaK9VY8x/9CXmb1BLRtaEw4ys/lTl4IuMvJT2dYe LXEkek3UZrMdWAoJkV9k+yYK430jyQg1Z1IMftiOiidcTT6NYNVl2rIg5LZzSZWcVFee Ci6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-language :content-transfer-encoding:in-reply-to:user-agent:date:message-id :from:references:cc:to:subject:dkim-signature; bh=OxyreQCmF9MmJp4bDMvFrettzEULf8WyRST8zIDDFw0=; b=zfI4OpHHHxW4DAmh1rgiPz+AguuZ9wW/2a50Ud23QmqMsztdYfbeA7/6UXOZAwyuYz BkBorOiXZlnSvYwB31rQ47gSTw/hcK9tx5cXkmhrZFZq+a1JXa5PATCju1POJnI00GHX 8uEQAAiukNAGWERmCtdyIxEc7Ki5bInzHHFn7kFepZvUJ1y+s8k9tRSiuT1G+7GoNIQV HPZltZ5ct+GPQHxnZZMVLfovznrOvyrD9qS/vRPIMXObPo+snu3J9DmWxaYfQqT0w+gd q5dbsJcCu6Y+CoiMhopNaHaGu57thdw1lOxylW8PSx1gW1nryoXZc02uezVXugAYadFB z/4w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=lHT8aEP8; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q2si21778742ejf.24.2021.09.28.11.05.47; Tue, 28 Sep 2021 11:06:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=lHT8aEP8; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242132AbhI1SDn (ORCPT + 99 others); Tue, 28 Sep 2021 14:03:43 -0400 Received: from mga01.intel.com ([192.55.52.88]:24146 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241839AbhI1SDm (ORCPT ); Tue, 28 Sep 2021 14:03:42 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10121"; a="247287498" X-IronPort-AV: E=Sophos;i="5.85,330,1624345200"; d="scan'208";a="247287498" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2021 11:02:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,330,1624345200"; d="scan'208";a="520543083" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga001.jf.intel.com with ESMTP; 28 Sep 2021 11:02:01 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 28 Sep 2021 11:02:01 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 28 Sep 2021 11:02:00 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 28 Sep 2021 11:02:00 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.43) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 28 Sep 2021 11:02:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ntlHsaujprZ//uCnK2C6fX8HEiSDNkVu5Ic29VQAcLQDuRlyntkop18pyDfCS7rGmDAWWZ1kfILh4sNQkSBl5dLSFD9dWHyFnXxmBKpfl33BUgtmmHMGV64kyk5jsIRztmmePDJCSbEEykZWamQUdRn94/BXp+rAwjVDVWwTYY+4LeWmX6S+5z6yqZgP0NVoKcAj/g+7zoV29LpIQ34TtoDCCuwH+hTl6vFoCukIlo8AIsch8lOisdcLb1VXhXrydlO0jxFBlDwS+MVQedejHvV5MpM223R4vCzoq7zxL16rdChZDMRdLC8qU4NXxAdBtP4MQnbYjsoG7YLBSRzvPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=OxyreQCmF9MmJp4bDMvFrettzEULf8WyRST8zIDDFw0=; b=YV7kIg2Dg9bU35FsYujE+bCNr2l7l43H6I9Zd7ZEHW1xQ/+YkWsnNDvXncH5q5V2FwU/uHosPKtTWDhadTb1FxsJ5e1FJGTExRDtaoKpty1rbgAYOAko3RKbyhGyb/0o5Ygn2g2IXSykClQu+Qyr3fQ9z9TXgu2rVdkY7BHlLMV9Cx5ZPKNrzIXOn7756kLRWoCBERNzFMlwQeYoSdK4NegqDg/46IVwn+zMKrc3r0ES2GVh1f5IC8QxUSn0VKFXkXumWuuzJiPn7Aml8xVsj3AFYSfp36wZ2t1bkcDPX+adz1RQSZFo1dJXj7IVo93NczMM6ebjfF0qUnwO+jvC2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OxyreQCmF9MmJp4bDMvFrettzEULf8WyRST8zIDDFw0=; b=lHT8aEP8i7yjlTJ8tcH/9uaFn228lwJLT7aTQ0XBkyh0LZWI0F7DDDHWx3JCYWTc34Rd9afq+cgocTK09diJyeGsMr2jN6sYZ4h9AWQO/4s+o3hGsiV5pdVc1dEcevHc2c0DA+nJkN6rYR+DPJuWK9Cr4DyAqzsaPTAtg9KD34Y= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=intel.com; Received: from BYAPR11MB3320.namprd11.prod.outlook.com (2603:10b6:a03:18::25) by BY5PR11MB4038.namprd11.prod.outlook.com (2603:10b6:a03:18c::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Tue, 28 Sep 2021 18:01:56 +0000 Received: from BYAPR11MB3320.namprd11.prod.outlook.com ([fe80::4167:f9ef:19b2:eaff]) by BYAPR11MB3320.namprd11.prod.outlook.com ([fe80::4167:f9ef:19b2:eaff%3]) with mapi id 15.20.4544.021; Tue, 28 Sep 2021 18:01:56 +0000 Subject: Re: [RFC PATCH 10/13] x86/uintr: Introduce user IPI sender syscalls To: Greg KH CC: , Tony Luck , Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Andy Lutomirski , Jens Axboe , Christian Brauner , Peter Zijlstra , Shuah Khan , Arnd Bergmann , Jonathan Corbet , Ashok Raj , Jacob Pan , "Gayatri Kammela" , Zeng Guang , "Dan Williams" , Randy E Witt , Ravi V Shankar , Ramesh Thomas , , , , References: <20210913200132.3396598-1-sohil.mehta@intel.com> <20210913200132.3396598-11-sohil.mehta@intel.com> From: Sohil Mehta Message-ID: <4704e81d-a3d2-aedf-1c79-e45cc86826a5@intel.com> Date: Tue, 28 Sep 2021 11:01:54 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-ClientProxiedBy: BYAPR05CA0096.namprd05.prod.outlook.com (2603:10b6:a03:e0::37) To BYAPR11MB3320.namprd11.prod.outlook.com (2603:10b6:a03:18::25) MIME-Version: 1.0 Received: from [192.168.86.37] (73.222.31.188) by BYAPR05CA0096.namprd05.prod.outlook.com (2603:10b6:a03:e0::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.7 via Frontend Transport; Tue, 28 Sep 2021 18:01:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e928a98-e1e7-4535-072d-08d982aa0f4c X-MS-TrafficTypeDiagnostic: BY5PR11MB4038: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr,ExtFwd X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LqtatOuuKevzbqSNrzaIkJO21Xe3SrpQrfw/oni5ZaJm+eNYM62oBohWV7hK+YHhqvq8Q19Jv2kKDGHuB4vUquMBrDW83RcZqkVckIpUZQgyQ7RLVyBqwP/xvbbkmiIunpErZkUhWwf8X8zY/Zz1MPbC8fBLIJ3nMsh6eFxSyvgwPOdr/ITsDeVlq46cTlRtPyePzwE9sU07r20G4MJfMyYNeXkLPj13w4cstuRxpMzxhFNb3caDez7t4nuLBWQ+Q1WqnAsly13aPvSSiKWtPZWdRnqRPMNrS1hRieg3k5S5f234Fy3WG/snz/TFVDH0dLiQ5qP1Ma7dnWPZvtWCj7t+JkO6o2lnqCfml3a5ZPVoLevoNobUGU4ZtgwwCZKoRL7IgiA9nZgpzWxgJGd9viZltrnQDDNtuvXVZ5IEuavYsjH+o8yr/zNwYY79mz+4v+UczRHWDRYokb0/hRQwJQHvgQiWCRILJkejK40UOafYFKRk24PuM+UYHXBCeNkJiMhQJYXv3CkZ84xorWRkdgDqYGu1AA19nk9I0rqV7knd0KCiZaTjy9EY9ezpsiy4AGk2wI01rQoz0MoETwxcQdv/TquwICR014RPtagH/uyLsZYyTx7Yb46QbI3+TeQV7dXUQov+hXPWI/gs3fVYaxTr5iVBER9dimy4ZTim77bnsM15Zh7/82/E5XFDbrdt9Xpp/tFPihATFDVYu5MyeHs0BFrWlErzbK46jFSL25g= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3320.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(316002)(31686004)(66476007)(66556008)(956004)(16576012)(8676002)(83380400001)(4326008)(186003)(36756003)(38100700002)(54906003)(508600001)(26005)(66946007)(2616005)(6916009)(5660300002)(7416002)(6486002)(44832011)(53546011)(31696002)(86362001)(8936002)(2906002)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NTlvckI3elltNVBxYTR5cUZsOVcyNUdiVXN6MkhOYWFGTXNrUjUwdk5sdGE3?= =?utf-8?B?Vi9GdVRHcEpzSG52S3MwQitRRUE1Vm5nckZKNHFybjBrQjh5NHRkdFVoUk5z?= =?utf-8?B?dFhGQkllQ25nOWFMd0NtR0w3QStJUmFJUW1ZWTJIbk9oUkRUdWh2QUYrODhU?= =?utf-8?B?NmZlMG1ZRDh1UC9EU3E4UjZ2RzFsWDA3K0JkeThZYXkreTEvQlA4Y09xK0ZF?= =?utf-8?B?Mjd4SWJrelhtK21rVUQvOTNBWm0xWXgzYlcveDNvcUVneXl5OGNaeHR5eUto?= =?utf-8?B?eGp3K1laWlJuMEUxUzFkdk1uaEg5bExQeDhMa3hLMkwwTURzdXZ1dDFQZGlC?= =?utf-8?B?cXo0eFh6bXBuM3ZoUUU2ZFZLR1BXNUpGQ21IazZGVWF5dEwzbVIxMVNINWZu?= =?utf-8?B?RnlaSVJ0RDkvSkx2Z05DeE50S1FaNEVxL081Qm8zSmJVVHBjK2NmMzFvdy9x?=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VhrYkJZZWxnSHVSNHpwWmlyYU9k?= =?utf-8?B?WW0vQnBydmUyOEo3YWtxb0MrbzZHY0JHL1dJVTVGRHJiS0V3RUVDMUg5aUNn?= =?utf-8?B?RGFWZzBnOVl5MmE0WDFYSmkvL3VhUCtDYk4xNE1BUldIZGthVG1FVnQvMzRH?= =?utf-8?B?Z1V4UnRqcFcrbUh1U3gwZFJYdC9XQmQ4algyS2MyM3djV0lPZ3JOQnpManNT?= =?utf-8?B?R0ZpYjFYQzQ4V2IyUWZRQ3p1SURaQXlZNU8wYUY4ZXZ3TVdxWnhDenpPY20v?= =?utf-8?B?cTFSRlZGMk5IbVI2d1JyTUlWcUpyRFpXcjJyTU5hOWQxRU5ha0JXUlduankx?= =?utf-8?B?YVFjQ2V6YVl4ckxjbzMzVCtHTlRCT0VzZmJTU2hiTUF4dTVpR0JIUHhnc1hI?= =?utf-8?Q?PYkzypE7Jq6mog5OV3XWANrCzP/uyedFL0p8p7C?= X-MS-Exchange-CrossTenant-Network-Message-Id: 2e928a98-e1e7-4535-072d-08d982aa0f4c X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3320.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2021 18:01:56.5955 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: G8zj74uYHwS+sk+6j7AAcGxq1CMXqfU+p26gW6usI33sM7CEspTT4tSjPi7LssH4oB8uikY6Luvj9rMHa4ohgw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4038 X-OriginatorOrg: intel.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/23/2021 5:28 AM, Greg KH wrote: > On Mon, Sep 13, 2021 at 01:01:29PM -0700, Sohil Mehta wrote: >> +/* User Interrupt Target Table Entry (UITTE) */ >> +struct uintr_uitt_entry { >> + u8 valid; /* bit 0: valid, bit 1-7: reserved */ > Do you check that the other bits are set to 0? I don't have a check but kzalloc() in alloc_uitt() should set it to 0. >> + u8 user_vec; >> + u8 reserved[6]; > What is this reserved for? This is hardware defined structure as well. I should probably mention this it in the comment above. >> + u64 target_upid_addr; > If this is a pointer, why not say it is a pointer? I used a u64 to get the size and alignment of this structure as required by the hardware. I wasn't sure if using a struct upid * would complicate that. Also this field is never used as a pointer by the kernel. It is only used to program an entry that is read by the hardware. Is this reasonable or would you still prefer a pointer? >> +} __packed __aligned(16); >> + >> +struct uintr_uitt_ctx { >> + struct uintr_uitt_entry *uitt; >> + /* Protect UITT */ >> + spinlock_t uitt_lock; >> + refcount_t refs; > Again, a kref please. Will do. Thanks, Sohil