Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5951AC433F5 for ; Wed, 15 Sep 2021 08:05:08 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F3A88610D1 for ; Wed, 15 Sep 2021 08:05:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F3A88610D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.187274.336072 (Exim 4.92) (envelope-from ) id 1mQPuY-0002nk-JM; Wed, 15 Sep 2021 08:04:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 187274.336072; Wed, 15 Sep 2021 08:04:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQPuY-0002nd-FA; Wed, 15 Sep 2021 08:04:54 +0000 Received: by outflank-mailman (input) for mailman id 187274; Wed, 15 Sep 2021 08:04:52 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQPuW-0002nX-Sv for xen-devel@lists.xenproject.org; Wed, 15 Sep 2021 08:04:52 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.111.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id df169c4b-1fa0-4bd3-a69a-f7f12dd4c625; Wed, 15 Sep 2021 08:04:51 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2110.outbound.protection.outlook.com [104.47.18.110]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-14-X9jyxgW-PO2ucaABi9Wqwg-1; Wed, 15 Sep 2021 10:04:49 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR0402MB3392.eurprd04.prod.outlook.com (2603:10a6:803:7::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Wed, 15 Sep 2021 08:04:47 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 08:04:47 +0000 Received: from [10.156.60.236] (37.24.206.209) by PR2PR09CA0003.eurprd09.prod.outlook.com (2603:10a6:101:16::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Wed, 15 Sep 2021 08:04:47 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: df169c4b-1fa0-4bd3-a69a-f7f12dd4c625 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1631693090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r132eiCb14LF3oKvpumOcwCR1jNghL/zwsEyh0UIrSY=; b=iM7zKMbi3pHhB8x1etviWeebo+m/0R5KzFgIwi+fNau7X0x0XU6EqW2XiM9GRCuJ5vdJag Wgg00vwypfuP0z+UZ4k2ZclnKjpY982pXATqmY6tXwr8fRYPvByGk/qA5lPy4wUSh4hWWZ ZKWYcpjHRNTpNXGrQNRJoyOLaDE2+lg= X-MC-Unique: X9jyxgW-PO2ucaABi9Wqwg-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YMjeqgtxZOzecfOl9XVohA844BHun1geGRBwe4PoCp11H1PpoYWP0swF8TS52ACHsyTEJDoS2VLIZUrEmUfDtwZ45RCWJU/ERwW9uVmvbCqqw3iQj3jKYJifJM3zfzhJ42Lsg1wVjQOmHQZDLx3CQjpH58pxM+/XoGynIWwKhnOwBJbo+D280E2mzR82FGnBnlVeyW9wHM79d2VazMHvI/TAcuA3V7Z9wjGY0aOG31rBam4WXHvKcEwtup2jwMz1MFzS+HUxnl3u6LYaFPyDMVE6agmLC4nCZe2FIHYyUAH+M+VovnBTnk8rMG4VnmSry/yTunuxYWZ5i2CIFfo7Fw== 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=r132eiCb14LF3oKvpumOcwCR1jNghL/zwsEyh0UIrSY=; b=Vx5EZs817tlPtQPk6h1iejvDcSvCzI0UPrdKoOUXXPwrhrbVbs+lJcqcYSNJy5sa/rAH3LjHRo/VOCgONvoVub8Yf3ClWRnZVnC0PaHJUhjSteZVemvMIZ5T4UXDO+fQrfoA/rIDZi1P8kPkclxPRqARhycE6BGXLn3uJhUQ7YXneyRnGcj+nr9xuu6lLqsV9bnGRpgJ4ZF+A8yk2Z/AFvu3iYSMB7HPgCTcGf5lLoWBHlvOhUBbP0raMoeTBg/mt7Y2r2mlijOldKzu5pzYRPptNlv5q0xGSPZQAHzLFrSNItfy9o/uiHo2HmkJ2rUf2en9GBGIrstWxn8l2S8mZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=suse.com; Subject: Re: [PATCH v7 5/7] xen: re-define assign_pages and introduce a new function assign_page To: Stefano Stabellini Cc: Penny Zheng , Bertrand.Marquis@arm.com, Wei.Chen@arm.com, xen-devel@lists.xenproject.org, julien@xen.org References: <20210910025215.1671073-1-penny.zheng@arm.com> <20210910025215.1671073-6-penny.zheng@arm.com> From: Jan Beulich Message-ID: Date: Wed, 15 Sep 2021 10:04:45 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PR2PR09CA0003.eurprd09.prod.outlook.com (2603:10a6:101:16::15) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1cb274df-df84-40e3-84de-08d9781f7c57 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3392: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6Upn39ntDiY6yaAuSbcZsITtJXckDJm0su9ezkgPSIEmjAOdADPhZDQWxndmMzBN6/exAK43AuyToxWUcPGKJhYlWa2JCH3+pHRwb4DxXcz3c+N7TrMFi87mnnLRkF8RSW2RmM1VjMsZaCpPFpkPnawS4Bp5tpdcCFvyDCcznCCOc1iCJzkGm3TA6w34rMOCL0/pSW3DuJN2qrvEpQXptM9Q0i/A4yvkv+gmRlyfIFzdTabVuc4qxaZapPCE2bn3C6KxPcOqyPjn/MZfCQ5dEtShFD2Tl0RSLNfFPvyOTDBNv/Vad7rhTKQKLr8GkJY21AFexY+kRLkRPnVOm5JFh1K/qPJqhZuelqZbe/Y2OMp44TPs0EDcngW5bXcF2N5yOHB+E30vfwccaVEcrRbiTpbfCLWKYxhSZ1CCUFnKL7YllZj2VTDhRu0UrAc2IQ/9v7TQOOKzQ9o26OYl3EvUL17Ix1yKMR7Pln7rjrwohvvSNwLIuH1rtJTsLtFGPbU9UDLdFL7QRMh5m/4paNgebu6aJkVoJIMys5cL+oFkUcTB46zYxNzwoScu3tbtCUOkZZSFzwtjv8InW9nW+fHZuoacxmEa7HsIzvpBx4qOSAIWoosNdeJBApbbw4oNvBnKmf0YPcr4rMc9FJKU9AwHWDI4tEFGiwb6ztyU8aPT1EQWy6b+H6JA+L/6u2IF/EnO/zC4tvrfSW3yT/SukluH1uc+U3liwVB6AsDevbcHr7Q= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(2616005)(2906002)(66556008)(86362001)(186003)(6916009)(31686004)(508600001)(6486002)(83380400001)(31696002)(53546011)(4326008)(316002)(26005)(16576012)(66476007)(8676002)(956004)(36756003)(8936002)(38100700002)(5660300002)(66946007)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?K0FXOUx6aTZyRFlzakFHMDM5NVgrL0JVUEllRFNVNWdZUzVkR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BpT2F5YjlCNXRKOTBBOVE0THFmZWhH?= =?utf-8?B?Y3FvQ0owWVlrUjcvZjVwc2xyR0FRbVhQS3lQT05OSmhySmtJUWxkZS9vcldR?= =?utf-8?B?V20xUm5yREw4R0hyampFQ21rOFBUZFh4UXE4cWRPRU8rdWkzWnltYnkxWEk3?= =?utf-8?B?MjRuU3lEVXdjVTNqbjREd3pSUDNvVUxwVGE0OTdTaUpMaFpFN0pGWTA3dUVF?= =?utf-8?B?OExVQkx0VzFWRC90L1ZPOTF0bG1xVXQ1NDRHZURlRVlzbk1BLzVjcEdYM3JM?= =?utf-8?B?NTk2Z2tyeGhBdzJDYlBjczc0TU5VZVkydUFsLytESFlNR25ReUsvcmRCQk1J?= =?utf-8?B?cVlodWpIV3ViUXNRREtNaVRqb1V3K09STGV1Vjg2a0VWRWl0R1l3cWNwdmph?= =?utf-8?B?eGlMaXpSa0xSdUhXSDRUVUhZM25OUE9zc0kxT1N2YklkOHFpb1ZodVJ6WG5W?= =?utf-8?B?VUtVdllZVzVadmdNcTZMYzNTNGJUUklTNUwyc3VhTlJTVEI0Tzl1NGZGYjFK?= =?utf-8?B?Nk9IbUUzc2tMeS9nMzlBWTVVcitTOUFwZVNFZldRTisrM2pZczB2OUhnQ1k5?= =?utf-8?B?V0o0cWFzNmdaWWNGaUtuMER3WXg2TzUwcDZaODgzMG1sMkIyNjVpaXdkSWta?= =?utf-8?B?M1piR1lSR3NtMGxwZWRiclNzOWNCUG05dUpkamhnOENQNUhDYWxEMDMwcFFP?= =?utf-8?B?MWxabEZZbkhMWFFlNWdVUzdnQzJ3UVJOTUhySi9LOGUxN281V2ljOG5DWkhB?= =?utf-8?B?anZIaXNrZFowY2oxNWJGSWZoZTN4ci9RNEN0Q1V2UmlNcXNxOWU3cmRkVmR5?= =?utf-8?Q?OY/HnKusTAHOFNo/Il0zR4zV8fcrjK9312vPNqG?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1cb274df-df84-40e3-84de-08d9781f7c57 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 08:04:47.6724 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f3tQHYXsaOWkoBK7/N9we58RcGZ/YH1YCyHXsd4zh+eOFBF0wAxSNS8VVDb63RvLxV8oo98xkuoMRqrZI1tAhg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3392 On 10.09.2021 18:23, Stefano Stabellini wrote: > On Fri, 10 Sep 2021, Jan Beulich wrote: >> On 10.09.2021 04:52, Penny Zheng wrote: >>> In order to deal with the trouble of count-to-order conversion when page number >>> is not in a power-of-two, this commit re-define assign_pages for nr pages and >>> assign_page for original page with a single order. >>> >>> Backporting confusion could be helped by altering the order of assign_pages >>> parameters, such that the compiler would point out that adjustments at call >>> sites are needed. >> >> Thanks, this now takes care of my primary concern. However, I (now?) have >> another (I thought I would have mentioned this before): >> >>> --- a/xen/common/page_alloc.c >>> +++ b/xen/common/page_alloc.c >>> @@ -2259,9 +2259,9 @@ void init_domheap_pages(paddr_t ps, paddr_t pe) >>> >>> >>> int assign_pages( >>> - struct domain *d, >>> struct page_info *pg, >>> - unsigned int order, >>> + unsigned long nr, >> >> If this really is to be "unsigned long" (and not "unsigned int"), then... > > Thanks for spotting this. I think it makes sense to use "unsigned int > nr" here. I see you've made the change while committing, but the subsequent patch then would have needed adjustment as well: It's now silently truncating an "unsigned long" value to "unsigned int". It was the splitting that's now needed there _anyway_ that made me wonder whether the patch here really is worthwhile to have. But of course acquire_domstatic_pages() could for now also simply reject too large values ... Jan