Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp69761pxb; Tue, 14 Sep 2021 18:58:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwE9kapEFsqkjDeLETvDebZAtvWuZ14eFiW68UmJ1iAWNja5lhNnX6b5toIkfhmDIxbsGF X-Received: by 2002:ac2:58ef:: with SMTP id v15mr15681478lfo.34.1631671087317; Tue, 14 Sep 2021 18:58:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631671087; cv=none; d=google.com; s=arc-20160816; b=wC/q25TnL7MW7X2+zBBG9JHpFwrCunbCsiQcJSzeBnFg1wa0EG1Rm+LGMMj63maEMj 9Qa0b1Ms+Cc+pWP+2Uj7Cv1MxCsSUdooj8zqBIsormaV6mtpn8p6FzIqiZy/N+Teq3xc u5Ckb6hUgklpFDD5aUj+xWhS8kkZMRSvlyb224AEf50DoRj3A23a2fOJcXrXb/k9jk0E 7tiRiLlO1qDjsySAbjq+5V8YvAANDYrEpJ+z4kVQAMUpYgeHRh1H4adwbp8G51N7cZ74 ehBNW0NWuacxoOVaiYnv7IsDM3QCsekaVurLnn5F7lXMK8VCVe1tkE7ZNER7r0PxyrPc PGTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=EtVY6q4Xua+DuEPJrklH4CTcvHb7G+e9vECj93jzUKE=; b=RSFyS/Pfb/xcD8vidXZEA11Qx8jkNQCjahCjj+0WXiliwEbfDd7UqAE6UWB+RflneV 2QBJnSoPdVmrv2YGdP3RHGBYIqTqgwd9J95HYLKgWDrqy+aEo8IXum4jAxexSgiUBj0Q JIQRKK0FB3i93BJu9f1Nbb14uQvmNp26srad6BY1mzwDIaqi+Fh/ejpYoPpcG02AlrIs 9bsPrJK3tfPdewjNRyKPAP/VEDVw7Zy9JT98a9xPCkrtEiSLt2DZI61c5qrkIiB7oS8q j4sGnu3dewx4/SuaxUx8BKz4VxbJ/AP6O8GYJryrTpL1z14z+vymhMZmz/ytTaj6RnpH dDbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fdw1xpnM; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e15si18229368ljg.448.2021.09.14.18.57.40; Tue, 14 Sep 2021 18:58:07 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=fdw1xpnM; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229489AbhIOBzp (ORCPT + 99 others); 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