Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755482AbcLUHdq (ORCPT ); Wed, 21 Dec 2016 02:33:46 -0500 Received: from mail-db5eur03hn0200.outbound.protection.outlook.com ([104.47.10.200]:4873 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751252AbcLUHdo (ORCPT ); Wed, 21 Dec 2016 02:33:44 -0500 X-Greylist: delayed 70902 seconds by postgrey-1.27 at vger.kernel.org; Wed, 21 Dec 2016 02:33:43 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Date: Wed, 21 Dec 2016 09:33:05 +0300 From: Roman Kagan To: Stephen Hemminger CC: Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , "K. Y. Srinivasan" , "Vitaly Kuznetsov" , , "Denis V . Lunev" , Haiyang Zhang , , , Ingo Molnar , "H. Peter Anvin" , , Thomas Gleixner Subject: Re: [PATCH 02/15] hyperv: uapi-fy synic event flags definitions Message-ID: <20161221063305.GC15917@rkaganb.sw.ru> Mail-Followup-To: Roman Kagan , Stephen Hemminger , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , "K. Y. Srinivasan" , Vitaly Kuznetsov , kvm@vger.kernel.org, "Denis V . Lunev" , Haiyang Zhang , x86@kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , "H. Peter Anvin" , devel@linuxdriverproject.org, Thomas Gleixner References: <20161220155602.6298-1-rkagan@virtuozzo.com> <20161220155602.6298-3-rkagan@virtuozzo.com> <20161220092453.20d3a640@xeon-e3> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20161220092453.20d3a640@xeon-e3> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [195.214.232.10] X-ClientProxiedBy: HE1PR0802CA0009.eurprd08.prod.outlook.com (10.172.123.147) To AM5PR0802MB2468.eurprd08.prod.outlook.com (10.175.45.9) X-MS-Office365-Filtering-Correlation-Id: 129022cf-c1c9-445c-9b8d-08d4296b3cf4 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:AM5PR0802MB2468; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0802MB2468;3:WIxuPiaZwuiBtvKZlPecGX0LVNUSMU25K+Qdtey34XaCT1pZ25jMa6RlH390k7X6nAETbv4tF76iHlUd46VbL8g4L2ZbTfBMmEka2Kgc6DTJDzAov3iBDo+nheH11r2inSuMxWghyIiZXKJYHMWGAt7NKdrR786k0eSRnMUD7mL1J3BzBPTJ+2L/gEWffri6Rp+lBXeEzUYizp3uf3aPUO+sRmw8jWCREz0TLO8oqdaYf7485b4xIZ+/6TfRp2QqkKQxyXgfmKOWDRT4XBGT1g==;25:YsFriebKqXuM7EpZJgAtRvJVqZ8Gk4ikhTDtuBKeSvAt4W+cJoQktwexbWCZ9NstYuF+PNc2voimobagdWl5KMmHMei+he1Iy6X797nnaybhDUbCZelal5tp40/2Mnop7/VOuP9xNk/qb7f5KexafTZjJ9OEwXf4wi45D30vlVRXbH4xQD04t0Qqu9TEnRebCKHz9UEr7nALFbcbm+GjqcESwA0dWiEH1pItwMcz5cJm06/4ilK2rFdz964vOIXSO9KG4HzirLTywwJ/Iz0PQFRobNRB41Pxaa17FO1GDaeDoYB8LdbEiy2Zm4Ir34meYi+qPJBjxs7m2z8YCpsUEugPcbo1tFwdf/QX6bwX8llwmkplc4ARF2T7EG/PcNeZunxA8IHjiubTnckkF3Mkxa0K7Q2Gs5qCOINo0XPMsXcXOmL6WPU+U7j/FJYdgQCN7TCQH5+CNFRCT2MUy0BdLg== X-Microsoft-Exchange-Diagnostics: 1;AM5PR0802MB2468;31:/hHlldlbYTtep5cnAmjVP/ruxXq4zOmP48+uKbeZV+etF1ijPwAEY0fgR0Gvaa0A4QD2W+Cu24mGV/KCe0IK24+eBgke9FhAyncZ14D5bVsygmiulR6qXzHN+V48biEJgD6n+Mc363WGJJhMfEbxPr5c5KjHwdFcu9zQiA0xCIgFL6HDs7xuj4hzvI2jFvUMB6+ksVTrogunYsHmnCYYCUkECAqRIzSkRDT9JxG0SuJOXmHFXgB3xpDLHPPnQIOK;20:bJ/yR9scAR/kHU9J+Y3WSxZojvlNgj9emrzKQ0mQlz0DjmWeu9tXanuS0Q8kb5UAaZYRx4lps35oDI6r3H043WuOvx7NdezeWRumOzGCy+YS5zm6MfiNLSMqgJeIgCurKdp/MPhpL4mmRSkuWRQpBicALMCZwDqhm8Ny6Emq9BVlFFuu8BJ1/qUv4FdQ0Im8qaSOWDQ+gCci5aCQvnm/7EMS6G596lPOEORq0DsNjrz8H4dWby6CCy9ivLSKlFTH X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(6072148);SRVR:AM5PR0802MB2468;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0802MB2468; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0802MB2468;4:08YyfxUx9WPorbxNbVEzjIgFID7LfvvHrne7MkSgoYvGUirCYg1ldTKuNJ2eb6Tl/bSCb7S2ID0L7Mbn9XihTS9YZAdoVY6ClVfBsSWLahdRJQ00Q8+ws/fzxaalqO04B4cDH442Rr54Kog1xbTYNXOLVdwnpXjFPCXjEvZ5m+S18ClKg3OejPmqUDMpFAc+nWG0oqRzTMIhN7h7kyJG09DM3hS2I5gA9qEUAw1Wu1nrn7gAXwqQGbT2twSmNc+9xuscWsBIrWLzx0I8hGFtSuPWPr0g/EKWyXDftHwth7Ek+oDRcUdqZtkL3CFFtVS+Ca2j9QGA2rn3TWTl0t4YGbvPyf8ZNb+IF50AxYwAxOojuu9eSsYMS+SnDvPG4gjUvADaNHouQoP5yYntKutyl2q6BkXUUxpfr4zlBHBfNixerM6nPxvGiKzzSXQEkz1C1KRyb8BXuKJHgL9TIXilyJZGt1XhSSA5/SGk1C+XhzGAk0ZQre425Zq72acUD//nK7/spq4IR95Pu6Z4aJh+A9Lskn2AawyrrNBW6x852tcGYJPYC9b43u33cmI0alQT7Lh5zmpfP682+KmnjETyoA== X-Forefront-PRVS: 01630974C0 X-Forefront-Antispam-Report: SFV:SPM;SFS:(10019020)(4630300001)(6009001)(7916002)(39450400003)(24454002)(199003)(189002)(97756001)(23726003)(6116002)(106356001)(33656002)(36756003)(105586002)(4001350100001)(42186005)(7416002)(3846002)(6506006)(229853002)(38730400001)(97736004)(25786008)(189998001)(1076002)(7736002)(305945005)(53416004)(110136003)(2906002)(66066001)(69596002)(47776003)(101416001)(81156014)(83506001)(6666003)(50466002)(92566002)(5660300001)(86362001)(575784001)(2950100002)(8676002)(6916009)(54356999)(68736007)(76176999)(50986999)(4326007)(9686002)(8666006)(46406003)(81166006)(30126002);DIR:OUT;SFP:1501;SCL:5;SRVR:AM5PR0802MB2468;H:rkaganb.sw.ru;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM5PR0802MB2468;23:hyLkm9Z9BLaIQsHTmDXAvnXxZZAAH+0fHzhd8I7?= =?us-ascii?Q?ONaPtEqVQ6xtitthX7sJkW6Q3+zWcSeFp292n46sr/anFuNtPKuTMLf0Ysnp?= =?us-ascii?Q?3AiV00XdULm2c3BzQeKB5vma25eZxRRe0dQlnogNj7K5zsxlFKsRPYW0yVoc?= =?us-ascii?Q?eYpVAELSkKWvY24VQfl2uTcB98Z+c3jffCYYKIDQr1wSso6P1R27YoWRHUI/?= =?us-ascii?Q?5jKY8p3Hv2xnDpE65Z13LdMVnA7pJsfVJl4ByRRoUmGXOdI5kgnH+oGiKWS7?= =?us-ascii?Q?PzOPPTYlWNr2y4RqGWO5UbNo2ox1TW0ZCC/S6fjZ8WqZYqEozVbPGD+g+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YOvn9pfoJ6hT5szBA9e+k0baQKjbF4?= =?us-ascii?Q?f6yNV/REnldT24FFLuCv0uuoC35cmtkNNapruguorPgwyH15B/LnQr56lUhW?= =?us-ascii?Q?awvy1k25YbQNNvZ0gc1zNGuaGpvYn1PApXmCEoNk1qF1ZiX+UP3i2S44yqpQ?= =?us-ascii?Q?5A6lh/w=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;AM5PR0802MB2468;6:ZC/Dq2cIPXN2YQup/wsO3TH1rvJjpv/Kipi/RU1uKnLif6fGr5Ec2YmuxXpPo7BAHwqAodEavxG41I+9HD6oGBSEF14X0Kt0zhOz6zUz6PFN3bdw1FzcFw877IhlHbqpdxZcjx1LNvufc70UfHCnnfzbHhohwkcJLKj/ZpB5v5by9BqW6z/KzP3XWOd4SrIkWpdAnR70sf7ykslJgo7Yi+IVOqpWPCI+ObhK/bOQm8aaK9ZGKtBzeghJVQwnx/rnLHzsrCstIfMrfNgqdfNRMn3tL2o+RjVuhZha75Bo1wLFkRwLjmYn6wIIQ+ryCuqjHysQxPl/2RrsOy8U6EuWaEMlnJzPOL/z2nqjFsbrqcj4bWNfwvY2l0ErOBuVSn8Qh0TIhrohCsYaHULALutc3e/m559cBO7E91jn13HP3b0=;5:7wWSGHdq/SzFdX0IwtssDnZmbwduOq9XUdMIkxo1+n/nXeXJdzgESnhcNDUWcseUO8iZPxXzIdi75XE9f1n1npXgNyys/goSSHNrSYuDYP1qdUvO04ect5RTH7q6uXOMr/cAZQcBv41bCu5LhICezw==;24:rvEckqPvVGftYSjrq2fZGUeQCejHAfuDtF08v+3flTr+9EzIg1b9r4kmkz/p/u5aFoq76SdFs5GRtxLVfm4+NQ== SpamDiagnosticOutput: 1:22 X-Microsoft-Exchange-Diagnostics: 1;AM5PR0802MB2468;7:0xd5kVaGfe+QQfn+AaMutpc9CH/Dp4Nl9lD/zJajxHxsTXmnStJ2a4mOtqPDHm3bggwHEJSsVQIwF41b3VyuzKVzpxdeHEEgXgoQCX/nLlj6Htjkmo3hQnqIFvM9QaTmmBviKWWQONZ1t/8TmY7fJlUpAu12/aKgnS2g6KdRxZjKBAUkaVbWUCvdTdY+WQVUJgPeOFX/bFtDD6xwQS8HsU1j3kQ8oOBiP9+dSb4G9BGYWF9eH9zXfqjsy8WF/gePu2eo282URPJkTKqHn0o2SINsKoSriDyUQM6NljVPxZ5tU1iNWHvaD2C7qHX4yNQAYqob9WCORGHRBa9ggZu/KDl2iybpYqJeEnQQ6DEuiffg3EeN/jR5eXBpaa9coVkIA7IBCZgngTKorwkLPNLUXX3vRjrqR9Q9rmXYwBE6D9UdUSR8fcQqw/IXy4otlm/Rcu348pILnQ71ealzRDGp1A==;20:xZf/gQF9twkRCAL0SSrY5kGh501vGl210UZHBz4rKYlgMLIYlpELTlJ/N9or54g7ZG+b3oOEsc1S0PAjBG9w/fh84DqVMijjE5zHSY2yoF2vUgWo4nDCdNWKHenaSvDGtnJdiFC/haFCmCxqrej4/JJdvCtGp//ytpBWO4tNTss= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2016 06:33:10.9470 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2468 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2092 Lines: 53 On Tue, Dec 20, 2016 at 09:24:53AM -0800, Stephen Hemminger wrote: > On Tue, 20 Dec 2016 18:55:49 +0300 > Roman Kagan wrote: > > > Move definitions related to the Hyper-V SynIC event flags to a header > > where they can be consumed by userspace. > > > > While doing so, also clean up their use by switching to standard bitops > > and struct-based dereferencing. The latter is also done for message > > pages. > > > > Signed-off-by: Roman Kagan > > --- > > arch/x86/include/uapi/asm/hyperv.h | 13 +++++++++ > > drivers/hv/hyperv_vmbus.h | 24 ++-------------- > > drivers/hv/channel_mgmt.c | 10 +++---- > > drivers/hv/connection.c | 47 ++++++++++--------------------- > > drivers/hv/vmbus_drv.c | 57 ++++++++++++++------------------------ > > 5 files changed, 54 insertions(+), 97 deletions(-) > > > > diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm/hyperv.h > > index 6098ab5..af542a3 100644 > > --- a/arch/x86/include/uapi/asm/hyperv.h > > +++ b/arch/x86/include/uapi/asm/hyperv.h > > @@ -363,4 +363,17 @@ struct hv_timer_message_payload { > > #define HV_STIMER_AUTOENABLE (1ULL << 3) > > #define HV_STIMER_SINT(config) (__u8)(((config) >> 16) & 0x0F) > > > > +/* Define synthetic interrupt controller flag constants. */ > > +#define HV_EVENT_FLAGS_COUNT (256 * 8) > > + > > +/* Define the synthetic interrupt controller event flags format. */ > > +struct hv_synic_event_flags { > > + __u64 flags[HV_EVENT_FLAGS_COUNT / 64]; > > +}; > > + > > +/* Define the synthetic interrupt flags page layout. */ > > +struct hv_synic_event_flags_page { > > + struct hv_synic_event_flags sintevent_flags[HV_SYNIC_SINT_COUNT]; > > +}; > > + > > #endif > > How are these going to be exposed to user space? > > They should really be unsigned long since there is no guarantee of atomic operation > on 64 bit values on 32 bit architectures. Indeed, absolutely. These are bitmaps and should be unsigned long[], of course. I'll fix it in the next iteration. Thanks, Roman.