Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp14008pxb; Fri, 5 Mar 2021 13:00:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdGz3QZrtbMmVKirhsZew7M/bdibzqIbP9nUrq69Uo8IeQXQYGeDhKjHUoEwrI5Ynv/yYC X-Received: by 2002:a17:906:c005:: with SMTP id e5mr4115453ejz.270.1614978042624; Fri, 05 Mar 2021 13:00:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1614978042; cv=pass; d=google.com; s=arc-20160816; b=ltNJR/2mD9H2UOHoF3ylGck/EhBd8apbL8q6KyFyxPWc895kwmhOfUvv4IhKmh4vLs rrdPGqSyXT2xAO8dogH3KqldR+3sqwdp+wP+6Bg+WSNNnsd+tWxe5PAzYshr3MQAU2gY 8rFiBeBnBjrAFA9xx968ilGcRqw3Tv3hM5Nmbh/Jscaw8eFR+KyNEGfIa5H2wnwljgFd gPmbNu+x89ZpvnT8lksGhP9XtfQxgiokMlL0KuGfor9kP6ksDjxR4MJ8XjK6LEu7/MBm +Z30tw4AW1TNvJYfqQQXlJVo4eYgAoj/AyinB2ZXDk/wbxKplwUcuQ5g0sVTxtpn22be g8Zw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=XRh9lEvZpacGLBgF7XB1XifH9YKJTPJBwtTz4TES0Y0=; b=tz9fv5dZFr0/fZBPg2GfXGL72NcSqTbtJlg4FQ6KOgXTPi+So9/5+t6E3XlO5dktLz ReTl6Aw3cZ7m/lsFP9nROEy+V91De6eDRNv/orM/4ZSYMJ3v3C5Ln1vsiJ/2EqWGZYaH nD9M1NQ+rn6TFyE5nGZ1ene+arH6cn4gPvohQufXnEFXImPZmKraroPSlCkrxv8YTNKj LUHdj54T+s2mKdlGJzhg1Xcag2se2+HtT8TRa8USYQ5FAhf4OoAsUsu35m4oGyNyDPUy usIaq/2lvwtwGT/O8L2xbmFSmjNj6Nr1JEZYMcWFf8iVryuh6sm4cWtvn9E3bkZh2gHM CxBw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=O9pWAMEy; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.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=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l1si1985554ejb.137.2021.03.05.13.00.08; Fri, 05 Mar 2021 13:00:42 -0800 (PST) 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=@microsoft.com header.s=selector2 header.b=O9pWAMEy; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.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=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229719AbhCEU6p (ORCPT + 99 others); Fri, 5 Mar 2021 15:58:45 -0500 Received: from mail-bn7nam10on2133.outbound.protection.outlook.com ([40.107.92.133]:3905 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229794AbhCEU6k (ORCPT ); Fri, 5 Mar 2021 15:58:40 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TCFRqy/D4rUjuI3n9qp0G6oMtMvo48NRCdf9gS+X/EgNc6GQigR1EFunxjfCcCJ/j0wXehOoLQ7DLEtA1K274EcxQD2z2b2EH7XUve1kCnB/UCAXvRgDYb0JjA//9odjkOf3nOLkMk/UdGbQgMldx+AG8MvkgH4gHNzMuaJSTqXgFKTqwqcul2ektuvSns17f/UWRHEACcIxx9D33x/YvPPuRyZ/VnJUJxDqHS3ZP6L6yUzpruZjjPG9JyTr6F49HZFGDFA4TTFcLf3OgPun5j/LEakZdB9lR3Vetyx94dkdjaOktnv6bPorwKBjXVJkDXuI6s7hStNAcx5FKuiFhQ== 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-SenderADCheck; bh=XRh9lEvZpacGLBgF7XB1XifH9YKJTPJBwtTz4TES0Y0=; b=UjyJPjMorwxO+GQfOgh/soPMA8DX+VVwRExSgus1Ip7KVeMXlsVeTcJfo0q++508OdI/Wk2LLMnyXQ/hkDIuBJhTiTn9jpfvxmSFQDSjpl8lWceZuwOPrJXG/pg3PIMUxkLHTzAcnIyTb/sInmVMjIySFe1FYajsiVj9ma4bUUpgjIrElvwKgejeXUAOUz7n2Wy/q35Dpncli441PrywNfMZNrGLCrj7/W95YqLm6ck86Vdh6fXDTD0PV6U22EXdJcBJniQnrKUZRqzpK19eWcy9+6d2xdd9EQhwRyC/j/nDlW5zTx2SFZtHdQFIXirdfISihZGy7KU2SRFRsePwRw== 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=XRh9lEvZpacGLBgF7XB1XifH9YKJTPJBwtTz4TES0Y0=; b=O9pWAMEySqo/kR5oPCcEp+QvuMh5f35XppvOp0U3chIpLT5Y7LQeW305DGFbmwKHRuQs9jNyZUghQZjbpL4FB/mJ6A2fZjaL6BG8ZG5X1UAQSSomRavTABcCu8y5le17BUGxwZItUZf9+tEVf3ST8x3gINY4K5MdMyvcfXWUJWc= Received: from MWHPR21MB1593.namprd21.prod.outlook.com (2603:10b6:301:7c::11) by MW4PR21MB1953.namprd21.prod.outlook.com (2603:10b6:303:74::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.17; Fri, 5 Mar 2021 20:58:37 +0000 Received: from MWHPR21MB1593.namprd21.prod.outlook.com ([fe80::9c8:94c9:faf1:17c2]) by MWHPR21MB1593.namprd21.prod.outlook.com ([fe80::9c8:94c9:faf1:17c2%9]) with mapi id 15.20.3912.025; Fri, 5 Mar 2021 20:58:37 +0000 From: Michael Kelley To: Sunil Muthuswamy CC: "will@kernel.org" , "catalin.marinas@arm.com" , Mark Rutland , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "linux-efi@vger.kernel.org" , "arnd@arndb.de" , "wei.liu@kernel.org" , "ardb@kernel.org" , "daniel.lezcano@linaro.org" , KY Srinivasan Subject: RE: [PATCH v8 1/6] arm64: hyperv: Add Hyper-V hypercall and register access utilities Thread-Topic: [PATCH v8 1/6] arm64: hyperv: Add Hyper-V hypercall and register access utilities Thread-Index: AQHXDwVm7IanFUbz6UeLdWLFekPIfapxZzMggAEuN+CAA1B6YA== Date: Fri, 5 Mar 2021 20:58:37 +0000 Message-ID: References: <1614649360-5087-1-git-send-email-mikelley@microsoft.com> <1614649360-5087-2-git-send-email-mikelley@microsoft.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2021-03-05T20:58:35Z; 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_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=1b3f19ee-cc8c-4582-9abf-4b5ccb34c3a7; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0 authentication-results: microsoft.com; dkim=none (message not signed) header.d=none;microsoft.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [24.22.167.197] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: efc1d4bc-09be-4214-252d-08d8e01972bd x-ms-traffictypediagnostic: MW4PR21MB1953: x-ms-exchange-transport-forked: True x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DeqBIKgptZFtOo8sWF+vTzGmKTfi2x8Woy9AUt3yhBv5LLn1tpndo2LyDuHIZAU15eTI2Wn5l8LdTWJOSweYWfe3IciI0Y/auiHmcl+xXRfVVKSsLGooBTgfOhpFhQbd+KUnh70orgEFFhtl4T70695z09e2n6ZeuZaZfh3tJmc+Rkc2Pvd0NZVH1ZJ88uhI18E+cntmXgh+/RwopNAcP/ZJ+yyhlyLdrKN0Rjh558ssN1iKp/D4n9/EMlJdyw9Ckv6qUNwWDEQPiubj8C+kOrJd7F2yBW8WyKG2dsn5dOhp2jcm/ZCo/BAKVL4s0DcKLP9tC+vd8RIv80CmhOPIUd/hZP0L7Z4UeoUBKbJd3uazMRvozmHbt4aoSf9fJvFzkOelFEBc5DkaVE4tciz4oGRk3fZFZ81XsdszRKcvov2mIGK/mQVDE0WYXqKjdWGYiK3ZG96+tnMkrK9zupq6V0jJw39Hk4YFoyu3DsMH9TmYlHgrYSLU4+TOl3f1ceeLdIULG7Toi/md6KZ9VPcBt+fWBpzlQlK8zfFh6xg42rJEFXmcHP15kDMjrwd5YVMf x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR21MB1593.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(346002)(376002)(39860400002)(366004)(136003)(86362001)(186003)(478600001)(26005)(82960400001)(82950400001)(316002)(71200400001)(54906003)(5660300002)(55016002)(64756008)(76116006)(52536014)(66476007)(4326008)(6862004)(8676002)(66946007)(10290500003)(6506007)(8936002)(66446008)(8990500004)(7416002)(66556008)(7696005)(2906002)(33656002)(6636002)(107886003)(9686003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?9OIKQmY7ypE3a8qnUFwErSGw/ozepOK5MTkBnjWmnmV3j0CkAA05WnSzzcKz?= =?us-ascii?Q?iyIWdej3TPn4OBLwkENgVJBheKGdIC8xtn2HUPqpX+85+o6fk/3G2jhMQHwK?= =?us-ascii?Q?vIeEuCAwys5A15habjIyOhA84bESkSuVMqFanOQa6nA6u82bziuM9ulcXpMP?= =?us-ascii?Q?szhnCXKIM4VDMjwjr+NJ6NMYC1VOWqpi4opfG8a3c9Hcql99H3i+gA6B9GT8?= =?us-ascii?Q?RKFiJsxmsAn1OaYE3o7ByWA6Cjj6i1uWsLPk/0eyRZKM9652OzLbSp8VYODh?= =?us-ascii?Q?pirNpvZSbaaLpoBnOT+W5OkJ0KOuUyve4hH1rEIvS1AiZypOoDOwAQRnQRkQ?= =?us-ascii?Q?rEbfzsYtsSfvCCXMQtHPsxgpLGh3pys8x7eekF9NP1fkM2AxErFWItOvg/4S?= =?us-ascii?Q?NAV7vt0A1Bk0GeJso63Sn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JsrRvDzKYj/Zjf2AMnI?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR21MB1593.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: efc1d4bc-09be-4214-252d-08d8e01972bd X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Mar 2021 20:58:37.5518 (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: Yylqnayrw46W8jy92Rs2ulk44zmaFbMftjzFmzScZdA16u2lmfY/YENFgeaQGCJ0ZNQlcceHiQ+1ZkJz2HMv9ZCcPYz1hMtOPUcKW//REH0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR21MB1953 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sunil Muthuswamy Sent: Wednesday, March 3, 2= 021 10:28 AM >=20 > > > + > > > + /* > > > + * Allocate a power of 2 size so alignment to that size is > > > + * guaranteed, since the hypercall input and output areas > > > + * must not cross a page boundary. > > > + */ > > > + input =3D kzalloc(roundup_pow_of_two(sizeof(input->header) + > > > + sizeof(input->element[0])), GFP_ATOMIC); > > > + output =3D kmalloc(roundup_pow_of_two(sizeof(*output)), GFP_ATOMIC)= ; > > > + > > Check for null from these malloc routines? Here and in other places. >=20 > Between, is there a plan to setup a percpu input/output page for hypercal= l > input/output on ARM (like we do for x64)? I didn't check the specific siz= e requirement > for this particular call, but, that generally will remove the need for th= ese > allocations. I'm not planning to add percpu input/output pages in this patch set. As no= ted in another reply, we can eliminate these memory allocations entirely by usi= ng "fast" hypercalls. At that point, there would be no usage of percpu input/= output pages in this patch set. If the need arises in the context of future work,= we can add them at that time. Michael