Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934444AbdDGTsS (ORCPT ); Fri, 7 Apr 2017 15:48:18 -0400 Received: from mail-cys01nam02on0128.outbound.protection.outlook.com ([104.47.37.128]:23920 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933636AbdDGTsK (ORCPT ); Fri, 7 Apr 2017 15:48:10 -0400 From: Jork Loeser To: Vitaly Kuznetsov , "devel@linuxdriverproject.org" , "x86@kernel.org" CC: "linux-kernel@vger.kernel.org" , "KY Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Steven Rostedt Subject: RE: [PATCH 4/7] x86/hyperv: implement rep hypercalls Thread-Topic: [PATCH 4/7] x86/hyperv: implement rep hypercalls Thread-Index: AQHSr5HsOc4QL7rXUEyYmt4E5b4qgKG6UCqA Date: Fri, 7 Apr 2017 19:48:06 +0000 Message-ID: References: <20170407112701.17157-1-vkuznets@redhat.com> <20170407112701.17157-5-vkuznets@redhat.com> In-Reply-To: <20170407112701.17157-5-vkuznets@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [2001:4898:80e8:4::1f] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR21MB0640;7:bVcu8hZzVGmNvmfvaLeEsTa0VH4kuDn9I7IzLEVMKV5zIg54lMOfPp6VaOZxY/Wig1SwdGKABSmEwQUbTi5ybyrNznb6FeQt/yUr4hDH7EBFBQrrlQy2MH7qk7ckD5yucSWpfe9k6PkAeINonZS3XFHOjQqT2GO26ynsm393XcN6PfTo5W63BRmnRkfyqd6HP76MvZJrn3nAeEanWljbkuiy6GBwnfQhWWNtFa1VxBPwt104pvfnXfWzNkHj/URSdiVsvfo/LAoRBvbpqIniWiMSzO+BDD3zYgAOJCT4wWNmdjxuXMC3b6ZMNJUDUAm+kUZiBjhKVje0eXnuZ2RHJ6xULZEkxl1jNGojj3mr6nc= x-ms-office365-filtering-correlation-id: bb95ad01-72ad-4d18-4c9a-08d47def02e3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:MWHPR21MB0640; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041248)(20161123562025)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(20161123564025)(6072148);SRVR:MWHPR21MB0640;BCL:0;PCL:0;RULEID:;SRVR:MWHPR21MB0640; x-forefront-prvs: 0270ED2845 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(39450400003)(39840400002)(39400400002)(39410400002)(39850400002)(13464003)(54906002)(9686003)(2501003)(55016002)(33656002)(99286003)(8676002)(53936002)(10090500001)(50986999)(76176999)(54356999)(3660700001)(74316002)(189998001)(305945005)(7736002)(2950100002)(3280700002)(5660300001)(6436002)(6506006)(2906002)(81166006)(7696004)(25786009)(53546009)(10290500002)(122556002)(5005710100001)(77096006)(86362001)(38730400002)(4326008)(102836003)(6116002)(86612001)(2201001)(8936002)(6246003);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR21MB0640;H:MWHPR21MB0639.namprd21.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2017 19:48:06.3657 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0640 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v37JmT5E016448 Content-Length: 1389 Lines: 35 > -----Original Message----- > From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com] > Sent: Friday, April 7, 2017 04:27 > To: devel@linuxdriverproject.org; x86@kernel.org > Cc: linux-kernel@vger.kernel.org; KY Srinivasan ; > Haiyang Zhang ; Stephen Hemminger > ; Thomas Gleixner ; Ingo > Molnar ; H. Peter Anvin ; Steven > Rostedt ; Jork Loeser > Subject: [PATCH 4/7] x86/hyperv: implement rep hypercalls > diff --git a/arch/x86/include/asm/mshyperv.h > b/arch/x86/include/asm/mshyperv.h index 9a5f58b..a2c996b 100644 > --- a/arch/x86/include/asm/mshyperv.h > +++ b/arch/x86/include/asm/mshyperv.h > @@ -4,6 +4,7 @@ > #include > #include > #include > +#include > #include > > /* > @@ -253,6 +254,26 @@ static inline u64 hv_do_fast_hypercall8(u16 code, > u64 input1) #endif } > > +static inline u64 hv_do_rep_hypercall(u16 code, u16 rep_count, void > *input, > + void *output) > +{ > + union hv_hypercall_input hc_input = { .code = code, > + .rep_count = rep_count}; Is there a way to statically verify the re-count not to exceed 12 bits? Could a dynamic check be justified? Perhaps a function comment?