From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3DB8AEE49A4 for ; Sun, 20 Aug 2023 05:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xRH8oE3st51jX70AXOTvZXQla0LuIIcybXc2QAeG8uA=; b=rPtpST4SEbbsT9 Z1olUMxbWyYl545/yJfSdLzqX5xa4uLbBebmm1r9gCM7ciJm8kiNvMPygQswmOsJ4cJTnQwF5Dqwn RdurjicEl9wNBpbgeigzI39tT0BobYMu+lZ3ASXXqlmNdjLGRbHTq3YkVA1cej7CFGPz/NtcON46v 8THCbnFCDqadd5vNiaUViFGVUCpZ7KbD+HJc4BgDW/dp8SITAud6mQ8XmKin1SqOzhk1WzoGvIX79 KpHIh6KKAXvztsOGiJkGSoTwxrwPxMJx1+DJybCUtwTy9WnTrbzltuxG8iD20SfWEf+a1cCUjnId7 DvT4+KHTh13JOA0/aXqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qXarE-00BQ5Q-0v; Sun, 20 Aug 2023 05:20:12 +0000 Received: from mail-eastasiaazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c400::1] helo=HK2P15301CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qXarB-00BQ4j-0P for linux-arm-kernel@lists.infradead.org; Sun, 20 Aug 2023 05:20:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hVnCP6S2ucfQ7CD6Sq4qdj51N9es1bFAfHFQgKt7jM7TmwwqSoQ6rAE6McU5VXQWXbRo/pMPErZQblvttxbc+TQ1J04gQbKhurX0JCO+zE2ZdUnrRcWMAtojvNkzvszEh3CxfaGGqXcjnK5p0btCaiMnoeIPBv7inx975XIQ0uCWyv4oRbcrI1cFXWtELyf7Vlzlqe1YTVFCkM6Sk5ZyWpUyG/lzLCTZ/0EKBJLoWUGA3+pscQWjJjCjrFfbnY72xbWiotcCvnZ1qODO586fUBrQEQuNzklwBl0eDFSFfUpb0K9fx6hOR9UK+uFM+TudnQRAWC7vax4afNJDPhylhQ== 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H5sucshz072AsP4dO4gV0m6DBYQ5Ig6nZbsaUSCCz6Q=; b=VsiLBCc5/Ph8LPcgVwEkIPNJpq6kmKexenhMf1W72PwbHdy/hFIGs7tq3muHT7ly0aUkrjVhlNI6TmQ5Rs181/KdBcUFlHshgI0L4WDYrCUTsDjOQv8uziaX8azcpQOAFQAZchFhPLMwttZ920MgFpXg70rqybHExSJ3ZWLLEpRuCt8h5RRol8xxYTvMV3RgHr4ofOJC5tADM7FU5S12OqvaBAxXR+zw1LM0qfTVLmb0uM1XHGTG0L6rxuictjZMtYzlzVPbhA/ZXUIiLL5NJZa/IXs9yPZhnLGUtMssQpaSPL1tj8xRjAaU3UqEukJTEmsy8Db106EdtthPtvELZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H5sucshz072AsP4dO4gV0m6DBYQ5Ig6nZbsaUSCCz6Q=; b=W14N5NnpNVJxHInuXaDGMDHkSEJCUUuC7O2ucFifAFDoQMERr/jpPMad5BR9L9BrFGU7XJGIih1FCcRZ2m2lpgroVUgBfPuBabm0wfCFzCTMJAIDKKKuZOUMZnETVS8r1HMQTI1QSHDhzcsyZetf4NhTgyGBqcZxKvRI82M1/aI= Received: from PUZP153MB0635.APCP153.PROD.OUTLOOK.COM (2603:1096:301:e2::8) by TYZP153MB0494.APCP153.PROD.OUTLOOK.COM (2603:1096:400:58::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6723.11; Sun, 20 Aug 2023 05:19:52 +0000 Received: from PUZP153MB0635.APCP153.PROD.OUTLOOK.COM ([fe80::4153:b8b:7077:5188]) by PUZP153MB0635.APCP153.PROD.OUTLOOK.COM ([fe80::4153:b8b:7077:5188%6]) with mapi id 15.20.6745.000; Sun, 20 Aug 2023 05:19:51 +0000 From: Saurabh Singh Sengar To: Nuno Das Neves , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-arch@vger.kernel.org" CC: "patches@lists.linux.dev" , "Michael Kelley (LINUX)" , KY Srinivasan , "wei.liu@kernel.org" , Haiyang Zhang , Dexuan Cui , "apais@linux.microsoft.com" , Tianyu Lan , "ssengar@linux.microsoft.com" , MUKESH RATHOR , "stanislav.kinsburskiy@gmail.com" , "jinankjain@linux.microsoft.com" , vkuznets , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "hpa@zytor.com" , "will@kernel.org" , "catalin.marinas@arm.com" Subject: RE: [PATCH v2 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V Thread-Topic: [PATCH v2 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V Thread-Index: AQHZ0VZ96EEPB9Xi80mUoj983vpcr6/v7KBwgAB88wCAAjguIA== Date: Sun, 20 Aug 2023 05:19:49 +0000 Message-ID: References: <1692309711-5573-1-git-send-email-nunodasneves@linux.microsoft.com> <1692309711-5573-16-git-send-email-nunodasneves@linux.microsoft.com> <664aec4c-7ea9-447f-afab-9e31e9e106c1@linux.microsoft.com> In-Reply-To: <664aec4c-7ea9-447f-afab-9e31e9e106c1@linux.microsoft.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=2d523610-1953-42eb-9926-c0dba99793cc;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-08-20T04:53:09Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PUZP153MB0635:EE_|TYZP153MB0494:EE_ x-ms-office365-filtering-correlation-id: 7a73b770-e25b-45a2-6a50-08dba13d1399 x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VyAfttaG2JjuXqSmnV2m1MsxUYXTsW5wKzgfq46aPVLzKBC86Mrn1dAyQZF7oixcs3nHNiI3QIYPJWRW9Pzf61Od1/7ILxnx2bvLVm5x/WDQnL271cxeCj1Ye2W7DNAPjTc6813tlsdY0icxCo8+u0zm1Ew/h7e3UYFHBuNX8Ci6AL8cxhcN78JoaW3JtkGjS3u7kAFFlT5Nm8ef/81vwG7XKjcAaCkMvELNWwFVP7KWnvni4k9CO87HOBzTjm8motzYHBIompsP83IjQroWAWPd40Vh0G2CYp6LgJCTKA+S7InN2r4Dp6R+/fw3VLj9eJVN+TNw06nkXskz8zHGTJr7T9/Et2WeCVJkzGySxTD2odSGzAlDTV0XGRjL87mgbyLx9gBPTKxsseP6VPuS/o4HR395LnhT234E7uA5eKG3rTWx3Fd/qQkg8rWo8fInDbZ/3npV7auWhhhYwO0DfEgtVgK5a4DRzzBEZzonHvD5nPg5nmyHCXNPPtCJM05uZVcYPXgOcQeiGNDiPRpA2H1FZlQ/3f2xj4R8eIX4NWJWZFC9owELdnXF4MJcE68Mgt4UrlWkUHZBSkb/PIjB9w7HcdPROSkz/zSanb4k20FQhutJgctx3N6hmpqHE8KjNLzcX08+50kqEM4sFqrY/L7eAqPwMXGA79Hyw/jcEUc3Dq+nTznEV6VadTyKdJYZ x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZP153MB0635.APCP153.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(396003)(136003)(366004)(346002)(376002)(451199024)(1800799009)(186009)(71200400001)(7696005)(53546011)(9686003)(6506007)(83380400001)(8990500004)(5660300002)(4326008)(8676002)(8936002)(52536014)(2906002)(7416002)(478600001)(10290500003)(41300700001)(966005)(76116006)(110136005)(54906003)(64756008)(66446008)(66476007)(66556008)(316002)(66946007)(38070700005)(82950400001)(38100700002)(122000001)(55016003)(82960400001)(33656002)(86362001)(12101799020);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?eGlWQkk0TTRqTmc2ZDQ3QWtnd1BqL24xUExQNWx6UFVYaWwvUldVem9IdjBv?= =?utf-8?B?VXNIeS9CRjVVMldrMjNzUi9GQ1c2V09rK3B1VFZ5bGdGcUppN1JvcC8zT0kw?= =?utf-8?B?R2MyQW5vb2dJdDJ2YThDZ2U4c1pQZTJRSi84STdwVzQvdGZsbktZcXVJa05n?= =?utf-8?B?Z0dUOFc5dCtkWjRTTm95ZklGaDFMSCtuT2hkVHRUZmJQQTBOcmdzOXBGekhx?= =?utf-8?B?OUI3RXd3Rm55cStJQUtMeUl6Vkd1dFZDKytjN3AwMmhKTWI2NldjVTlxcVJC?= =?utf-8?B?ZEQwRzdYWEh6TEtFaDJzeUFUYWJ0Z2d2MzloQ0F4cXNWRCsxMGtTOUpaRGRj?= =?utf-8?B?aVgxQWNMMmdKZHUwRVJGZDhJRXZJSnZkcGloNW9IU1NxZ1c3RUZMUWNvK1p0?= =?utf-8?B?Rmx1WTNaVjNST2ZObmREcW52ZGZYejU3TmdTMTAyd1dMaGQ3bkVLQ2hkMGc4?= =?utf-8?B?eUhiRGlJVTQzb25VV3BiSFhRR3cyZXNmTENWTXJyZmVueng3elJxTTBpTVRk?= =?utf-8?B?VzA1L1FVMUc5YlVZeWw1bTkyRGVFcHdiaHdGLzQyU2lDNTRtcTQ2VEpwUUtZ?= =?utf-8?B?Ykl2R1U2Q3FkRkcwaEM3L3VCejVvajhmRlBEVXcwMHRDdXg0Z2pPRmFSbGxH?= =?utf-8?B?NHVONi9QdU1DN2dXZ2VSVGNMaWl1b1BSSkdPbjdET1JIMFhkVEpvN2EycjIr?= =?utf-8?B?Qy9DUzE4TTErVi9sSWJ5K2JqczF6bzMvclBGZzF6ZUpScXc4S2RhNTR0SUVV?= =?utf-8?B?ZU1KTms5dlVwbVJ1QnJ1MjQ4YWh3WERtM2xlVzVReXJsZ3dmSVpsRDdYeGdH?= =?utf-8?B?QmpHTjhSUVZLUFl4ZkFFVmlpVVpjTDErOXRCZzBYY3ZScmFYZGd1OCtFSEtZ?= =?utf-8?B?UVdUaU9GUVBhM2h1bE9rSjNKY1BpSTMyME0rUGZzZnNmWExPeXY2aEMvVng3?= =?utf-8?B?djBNVEFWYjh1Wkt5N09pY1RNazFlVlNQZ0lUUlNEaGlEYktURlJmbDV1aWdE?= =?utf-8?B?M2R2QWp6d09vR1lkRHBVdzZpb1Rib1ZiUWRQdGVLZ2FKYzlseHdBT29TWEZQ?= =?utf-8?B?V3BiVlB1ZVp5K2NiRVVLT1BDdG44OG1VM0FDd0pFQ1RlSmZCQXlsZUFGMDdH?= =?utf-8?B?Q1diTlltVW9aWERDS3pvVkNrdENmU2lvVEtLUkkycnBJbHh3dzNnZUE2bFRm?= =?utf-8?B?NTBQTStHcGs2bjA3UXJLNytJVUFMem9tbjdEaXR5ZTJzSmlJR09ZMVhJcmFr?= =?utf-8?B?cWIycXowRkZMSTJYaTZJRHdQL3cxZHlueVk1SWNsNXpvWExYWDA2Qi9HSUVl?= =?utf-8?B?K2JDdXNsUkpTOFVLT2tPd2dJbVV4QktLRUprVUw5c1gzUUVheG5CSllyck1k?= =?utf-8?B?U3pTMnhZZzhEbVB2NmcyZ3FCZ3ZJOVlkWHFIZTdSeU5kbUdRT3REZnhqQ0hn?= =?utf-8?B?b0dRc1JjZU9OSFpueUpodW9zRHJlQURrVDVYRDRoWlBHOXZBak9jOGpiYVVh?= =?utf-8?B?NDd0K2s4NWhEaW5nSWpscEh3Z1YvOGhDMGUxUmY2RGx1WFhjMkNsWkMyMTM3?= =?utf-8?B?MllHSEhUNFkweUphREZUdVRYcW1RTUNRUjVuRk1XTDJlRW85SG1qTlVic3FZ?= =?utf-8?B?L0tFdlUvcThRYk50OE5FUkZBZFhjcitVTGk4SWRNY3JiRWVhd3ZwcllUNm9W?= =?utf-8?B?V0VWZEJGdVB3cTJRaDhCWXd5RmR0MG4vazg0VHVtMlIwckkyV2pRYnVMWDZP?= =?utf-8?B?dkhMSHhtNEpPMmtxanhiNkdTNTdGOG9odTNnVHBNVUtoSXRsMDdHa1VISXVw?= =?utf-8?B?clQ5NTUwL242MlRDZXJDWjNJYUMxaUc2R2FxdytSVmIxZGpGa21IZEVoQmdW?= =?utf-8?B?SWJ5ZWh2dEE2NVJ3SjkvdkJ5WjJ5SWZxd2hTa0ZzZ0Z0TGpsOHF4WTdNMFJn?= =?utf-8?B?U2hpaG5MSE1nVHNjRmJ0d0hVL0hkR0x1SVVtWTh1NElTV1RuN3U2ei9RQ1ZR?= =?utf-8?B?MHhIS3JFNlJGQ3QyS1NRZ0tSQlUzS2g0ZEFWSnF0SWc2ZUE2YUtaVDRUbFlh?= =?utf-8?B?aXJOOU45SkRsc2ZucXlvNlVOY3J3T3FvYW1DQVFhMDJleEs2d3YwbGZGT2Y1?= =?utf-8?Q?bd8VXR4b76zbdvsMkoz0CqMDL?= MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PUZP153MB0635.APCP153.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 7a73b770-e25b-45a2-6a50-08dba13d1399 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Aug 2023 05:19:49.6673 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: b9GVcieuld6xGX2cnq2wkVV4utKhs3EFgqGrLlpNovm+OpqXhlT5EpC35yEwH4cT7QRQ7AcFCrKQpeeq29vKAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZP153MB0494 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230819_222009_338081_8D3548DD X-CRM114-Status: GOOD ( 23.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > -----Original Message----- > From: Nuno Das Neves > Sent: Saturday, August 19, 2023 12:30 AM > To: Saurabh Singh Sengar ; linux- > hyperv@vger.kernel.org; linux-kernel@vger.kernel.org; x86@kernel.org; linux- > arm-kernel@lists.infradead.org; linux-arch@vger.kernel.org > Cc: patches@lists.linux.dev; Michael Kelley (LINUX) > ; KY Srinivasan ; > wei.liu@kernel.org; Haiyang Zhang ; Dexuan Cui > ; apais@linux.microsoft.com; Tianyu Lan > ; ssengar@linux.microsoft.com; MUKESH > RATHOR ; stanislav.kinsburskiy@gmail.com; > jinankjain@linux.microsoft.com; vkuznets ; > tglx@linutronix.de; mingo@redhat.com; bp@alien8.de; > dave.hansen@linux.intel.com; hpa@zytor.com; will@kernel.org; > catalin.marinas@arm.com > Subject: Re: [PATCH v2 15/15] Drivers: hv: Add modules to expose /dev/mshv > to VMMs running on Hyper-V > > On 8/18/2023 6:08 AM, Saurabh Singh Sengar wrote: > >> + > >> +config MSHV_VTL > >> + tristate "Microsoft Hyper-V VTL driver" > >> + depends on MSHV > >> + select HYPERV_VTL_MODE > >> + select TRANSPARENT_HUGEPAGE > > > > TRANSPARENT_HUGEPAGE can be avoided for now. > > > > I will remove it in the next version. Thanks. > >> + > >> +#define HV_GET_REGISTER_BATCH_SIZE \ > >> + (HV_HYP_PAGE_SIZE / sizeof(union hv_register_value)) > >> +#define HV_SET_REGISTER_BATCH_SIZE \ > >> + ((HV_HYP_PAGE_SIZE - sizeof(struct hv_input_set_vp_registers)) \ > >> + / sizeof(struct hv_register_assoc)) > >> + > >> +int hv_call_get_vp_registers( > >> + u32 vp_index, > >> + u64 partition_id, > >> + u16 count, > >> + union hv_input_vtl input_vtl, > >> + struct hv_register_assoc *registers) { > >> + struct hv_input_get_vp_registers *input_page; > >> + union hv_register_value *output_page; > >> + u16 completed = 0; > >> + unsigned long remaining = count; > >> + int rep_count, i; > >> + u64 status; > >> + unsigned long flags; > >> + > >> + local_irq_save(flags); > >> + > >> + input_page = *this_cpu_ptr(hyperv_pcpu_input_arg); > >> + output_page = *this_cpu_ptr(hyperv_pcpu_output_arg); > >> + > >> + input_page->partition_id = partition_id; > >> + input_page->vp_index = vp_index; > >> + input_page->input_vtl.as_uint8 = input_vtl.as_uint8; > >> + input_page->rsvd_z8 = 0; > >> + input_page->rsvd_z16 = 0; > >> + > >> + while (remaining) { > >> + rep_count = min(remaining, HV_GET_REGISTER_BATCH_SIZE); > >> + for (i = 0; i < rep_count; ++i) > >> + input_page->names[i] = registers[i].name; > >> + > >> + status = hv_do_rep_hypercall(HVCALL_GET_VP_REGISTERS, > >> rep_count, > >> + 0, input_page, output_page); > > > > Is there any possibility that count value is passed 0 by mistake ? In > > that case status will remain uninitialized. > > > > These lines ensure rep_count is never 0 here: > > while (remaining) { > rep_count = min(remaining, HV_GET_REGISTER_BATCH_SIZE); > > Remaining can't be 0 or the loop would exit, and > HV_GET_REGISTER_BATCH_SIZE is not 0, or we would never get any registers. There is a parameter in this function "count". I was checking if there is any possibility that is passed as 0 by mistake ? this will lead to "remaining" value as 0 and loop will never execute. Which results using "status" uninitialized later in the function. > > >> diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c index > >> 13f972e72375..ccd76f30a638 100644 > >> --- a/drivers/hv/hv_common.c > >> +++ b/drivers/hv/hv_common.c > >> @@ -62,7 +62,11 @@ EXPORT_SYMBOL_GPL(hyperv_pcpu_output_arg); > >> */ > >> static inline bool hv_output_arg_exists(void) { > >> +#ifdef CONFIG_MSHV_VTL > > > > Although today both the option works together. But thinking > > which is more accurate CONFIG_HYPERV_VTL_MODE or > > CONFIG_MSHV_VTL here for scalability of VTL modules. > > > > Good point. Though I'm not sure it matters too much right now, > since as you mention they will always be enabled together. > > Does CONFIG_HYPERV_VTL_MODE use the output arg? Currently its not, I think MSHV_VTL is good for now. Thanks. > > >> diff --git a/drivers/hv/mshv.h b/drivers/hv/mshv.h > >> new file mode 100644 > >> index 000000000000..166480a73f3f > >> --- /dev/null > >> +++ b/drivers/hv/mshv.h > >> @@ -0,0 +1,156 @@ > >> +/* SPDX-License-Identifier: GPL-2.0-only */ > >> +/* > >> + * Copyright (c) 2023, Microsoft Corporation. > >> + */ > >> + > >> +#ifndef _MSHV_H_ > >> +#define _MSHV_H_ > >> + > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> + > >> +/* > >> + * Hyper-V hypercalls > >> + */ > >> + > >> +int hv_call_withdraw_memory(u64 count, int node, u64 partition_id); > >> +int hv_call_create_partition( > >> + u64 flags, > >> + struct hv_partition_creation_properties creation_properties, > >> + union hv_partition_isolation_properties isolation_properties, > >> + u64 *partition_id); > >> +int hv_call_initialize_partition(u64 partition_id); > >> +int hv_call_finalize_partition(u64 partition_id); > >> +int hv_call_delete_partition(u64 partition_id); > >> +int hv_call_map_gpa_pages( > >> + u64 partition_id, > >> + u64 gpa_target, > >> + u64 page_count, u32 flags, > >> + struct page **pages); > >> +int hv_call_unmap_gpa_pages( > >> + u64 partition_id, > >> + u64 gpa_target, > >> + u64 page_count, u32 flags); > >> +int hv_call_get_vp_registers( > >> + u32 vp_index, > >> + u64 partition_id, > >> + u16 count, > >> + union hv_input_vtl input_vtl, > >> + struct hv_register_assoc *registers); > >> +int hv_call_get_gpa_access_states( > >> + u64 partition_id, > >> + u32 count, > >> + u64 gpa_base_pfn, > >> + u64 state_flags, > >> + int *written_total, > >> + union hv_gpa_page_access_state *states); > >> + > >> +int hv_call_set_vp_registers( > >> + u32 vp_index, > >> + u64 partition_id, > >> + u16 count, > >> + union hv_input_vtl input_vtl, > >> + struct hv_register_assoc *registers); > > > > Nit: Opportunity to fix many of the checkpatch.pl related to line break here > > and many other places. > > > > checkpatch.pl doesn't complain about anything in this file. If we use --strict switch with checkpatch.pl we observe additional CHECK(s). I observe 159 CHECK(s) with this patch overall. (total: 1 errors, 7 warnings, 159 checks, 7460 lines checked) Few examples: CHECK: Lines should not end with a '(' #240: FILE: drivers/hv/hv_call.c:73: +int hv_call_set_vp_registers( CHECK: Alignment should match open parenthesis #266: FILE: drivers/hv/hv_call.c:99: + memcpy(input_page->elements, registers, + sizeof(struct hv_register_assoc) * rep_count); I also see an error with flexible array, possibly we can fix that as well. ERROR: Use C99 flexible arrays - see https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays #7468: FILE: include/uapi/linux/mshv.h:134: + struct mshv_msi_routing_entry entries[0]; +}; - Saurabh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel