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 X-Spam-Level: X-Spam-Status: No, score=-12.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 D28A7C433EF for ; Wed, 15 Sep 2021 01:54:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE87861211 for ; Wed, 15 Sep 2021 01:54:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234414AbhIOBzp (ORCPT ); Tue, 14 Sep 2021 21:55:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:42268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234389AbhIOBzf (ORCPT ); Tue, 14 Sep 2021 21:55:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 268A3600AA; Wed, 15 Sep 2021 01:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631670857; bh=MqDbmijwQbGSZNaO6bnRJxyOp/mjLub5Df6jQIZhwdo=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=fdw1xpnMmAZA7cwc4JwkDdxOK1Ood93KCC1NKZQMNArWCxBySC/614vrjkBhJ8tgP Q9O9Ws4O8XX8tfEd/WOeTy75REHHK3vsBsO2HUf7aVGOo0iSeSotEZx7svfOdXVl9j z95jluv5tsVxH0Lm8wezkptaCUavlWBE258hUHmDnldgy3EC+6wzollKQ0C7uwEdlW qWEBluOz+xjG8yZWtXkLM1SDRkUT2dbTs9+M+6vNejCz3shyumHTdpEEQECyDz/EMb CBCt9Q5Nms7OaO5uhbfocfIgWAfCssLrv6PQy1FJtY1KifnwJHYMX0S8eGWmSYaQg5 d57v3bdIK516w== Date: Tue, 14 Sep 2021 18:54:16 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Stefano Stabellini cc: Jan Beulich , Juergen Gross , Boris Ostrovsky , lkml , "xen-devel@lists.xenproject.org" Subject: Re: [PATCH 04/12] swiotlb-xen: ensure to issue well-formed XENMEM_exchange requests In-Reply-To: Message-ID: References: <588b3e6d-2682-160c-468e-44ca4867a570@suse.com> <397bf325-f81e-e104-6142-e8c9c4955475@suse.com> <9819a6e9-93d5-e62a-7b4a-ffc2ecd996dc@suse.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Sep 2021, Stefano Stabellini wrote: > On Tue, 14 Sep 2021, Jan Beulich wrote: > > On 13.09.2021 22:31, Stefano Stabellini wrote: > > > On Mon, 13 Sep 2021, Jan Beulich wrote: > > >> On 11.09.2021 01:14, Stefano Stabellini wrote: > > >>> On Tue, 7 Sep 2021, Jan Beulich wrote: > > >>>> While the hypervisor hasn't been enforcing this, we would still better > > >>>> avoid issuing requests with GFNs not aligned to the requested order. > > >>>> > > >>>> Signed-off-by: Jan Beulich > > >>>> --- > > >>>> I wonder how useful it is to include the alignment in the panic() > > >>>> message. > > >>> > > >>> Not very useful given that it is static. I don't mind either way but you > > >>> can go ahead and remove it if you prefer (and it would make the line > > >>> shorter.) > > >>> > > >>> > > >>>> I further wonder how useful it is to wrap "bytes" in > > >>>> PAGE_ALIGN(), when it is a multiple of a segment's size anyway (or at > > >>>> least was supposed to be, prior to "swiotlb-xen: maintain slab count > > >>>> properly"). > > >>> > > >>> This one I would keep, to make sure to print out the same amount passed > > >>> to memblock_alloc. > > >> > > >> Oh - if I was to drop it from the printk(), I would have been meaning to > > >> also drop it there. If it's useless, then it's useless everywhere. > > > > > > That's fine too > > > > Thanks, I'll see about dropping that then. > > > > Another Arm-related question has occurred to me: Do you actually > > mind the higher-than-necessary alignment there? If so, a per-arch > > definition of the needed alignment would need introducing. Maybe > > that could default to PAGE_SIZE, allowing Arm and alike to get away > > without explicitly specifying a value ... > > Certainly a patch like that could be good. Given that it is only one > allocation I was assuming that the higher-than-necessary alignment > wouldn't be a problem worth addressing (and I cannot completely rule out > that one day we might have to use XENMEM_exchange on ARM too). Also this code is currently #ifdef CONFIG_X86 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 X-Spam-Level: X-Spam-Status: No, score=-12.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 62267C433F5 for ; Wed, 15 Sep 2021 01:54:29 +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 279CD61214 for ; Wed, 15 Sep 2021 01:54:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 279CD61214 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.187172.335945 (Exim 4.92) (envelope-from ) id 1mQK7w-0001ag-1P; Wed, 15 Sep 2021 01:54:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 187172.335945; Wed, 15 Sep 2021 01:54:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQK7v-0001aZ-Uk; Wed, 15 Sep 2021 01:54:19 +0000 Received: by outflank-mailman (input) for mailman id 187172; Wed, 15 Sep 2021 01:54:18 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQK7u-0001aT-P5 for xen-devel@lists.xenproject.org; Wed, 15 Sep 2021 01:54:18 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d61b2c30-15c7-11ec-b48b-12813bfff9fa; Wed, 15 Sep 2021 01:54:18 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 268A3600AA; Wed, 15 Sep 2021 01:54:17 +0000 (UTC) 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: d61b2c30-15c7-11ec-b48b-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631670857; bh=MqDbmijwQbGSZNaO6bnRJxyOp/mjLub5Df6jQIZhwdo=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=fdw1xpnMmAZA7cwc4JwkDdxOK1Ood93KCC1NKZQMNArWCxBySC/614vrjkBhJ8tgP Q9O9Ws4O8XX8tfEd/WOeTy75REHHK3vsBsO2HUf7aVGOo0iSeSotEZx7svfOdXVl9j z95jluv5tsVxH0Lm8wezkptaCUavlWBE258hUHmDnldgy3EC+6wzollKQ0C7uwEdlW qWEBluOz+xjG8yZWtXkLM1SDRkUT2dbTs9+M+6vNejCz3shyumHTdpEEQECyDz/EMb CBCt9Q5Nms7OaO5uhbfocfIgWAfCssLrv6PQy1FJtY1KifnwJHYMX0S8eGWmSYaQg5 d57v3bdIK516w== Date: Tue, 14 Sep 2021 18:54:16 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Stefano Stabellini cc: Jan Beulich , Juergen Gross , Boris Ostrovsky , lkml , "xen-devel@lists.xenproject.org" Subject: Re: [PATCH 04/12] swiotlb-xen: ensure to issue well-formed XENMEM_exchange requests In-Reply-To: Message-ID: References: <588b3e6d-2682-160c-468e-44ca4867a570@suse.com> <397bf325-f81e-e104-6142-e8c9c4955475@suse.com> <9819a6e9-93d5-e62a-7b4a-ffc2ecd996dc@suse.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Tue, 14 Sep 2021, Stefano Stabellini wrote: > On Tue, 14 Sep 2021, Jan Beulich wrote: > > On 13.09.2021 22:31, Stefano Stabellini wrote: > > > On Mon, 13 Sep 2021, Jan Beulich wrote: > > >> On 11.09.2021 01:14, Stefano Stabellini wrote: > > >>> On Tue, 7 Sep 2021, Jan Beulich wrote: > > >>>> While the hypervisor hasn't been enforcing this, we would still better > > >>>> avoid issuing requests with GFNs not aligned to the requested order. > > >>>> > > >>>> Signed-off-by: Jan Beulich > > >>>> --- > > >>>> I wonder how useful it is to include the alignment in the panic() > > >>>> message. > > >>> > > >>> Not very useful given that it is static. I don't mind either way but you > > >>> can go ahead and remove it if you prefer (and it would make the line > > >>> shorter.) > > >>> > > >>> > > >>>> I further wonder how useful it is to wrap "bytes" in > > >>>> PAGE_ALIGN(), when it is a multiple of a segment's size anyway (or at > > >>>> least was supposed to be, prior to "swiotlb-xen: maintain slab count > > >>>> properly"). > > >>> > > >>> This one I would keep, to make sure to print out the same amount passed > > >>> to memblock_alloc. > > >> > > >> Oh - if I was to drop it from the printk(), I would have been meaning to > > >> also drop it there. If it's useless, then it's useless everywhere. > > > > > > That's fine too > > > > Thanks, I'll see about dropping that then. > > > > Another Arm-related question has occurred to me: Do you actually > > mind the higher-than-necessary alignment there? If so, a per-arch > > definition of the needed alignment would need introducing. Maybe > > that could default to PAGE_SIZE, allowing Arm and alike to get away > > without explicitly specifying a value ... > > Certainly a patch like that could be good. Given that it is only one > allocation I was assuming that the higher-than-necessary alignment > wouldn't be a problem worth addressing (and I cannot completely rule out > that one day we might have to use XENMEM_exchange on ARM too). Also this code is currently #ifdef CONFIG_X86