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 6D65AC761AF for ; Wed, 22 Mar 2023 14:43:33 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NAoNieCcxQLxPdleZKntoGUpn5oKw59STwFRCPkAxWc=; b=dSqaYfdvZXJFs5 WQrSWquwGgNP2sJiVcY4X4kRW/54ffOVISQPMoQNal6xPJkuPXDC9/uLwOBWnolXSy7fqLou66D+c psCHvXKU/THBKLj5mCmWH7XtntysMnsJVkH92uAH0SSdX3Zo7MQrJMQx7zbaeafE6eacKLQl+9rgw 70hNC9fAWAHuVzrFoes7afWX4TIt9nqSv4GYHtAb/9DYBosBp5S786y/XawhIzPH5H0m1tYn9s6SG AoP3JzXirjsm0S8Hw6fJRXlnokN6P9P2hcQx2Vz4OSfixdLrklQTrqyhbQuX2T56zCNXTdISI0bjL nIICbSJPjrGYCJeMu2Kw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pezfs-00GLNG-0T; Wed, 22 Mar 2023 14:42:48 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pezfq-00GLKw-0J for linux-arm-kernel@lists.infradead.org; Wed, 22 Mar 2023 14:42:47 +0000 Received: by mail-wm1-x32d.google.com with SMTP id v4-20020a05600c470400b003ee4f06428fso2123173wmo.4 for ; Wed, 22 Mar 2023 07:42:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679496162; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=iclVlj0uRLLGWQO8Ig3rbocnokNbdehKEN39LMvr+XM=; b=JPC+mMlQpMmMFu647oTbAgAK5ChkEldXnrX7wvPXNL+boH7AjnOjmYClon2Ppm+UoC P4p+AhTWyqeuAC4S2nxtZ8q0JP9fCLJB0i/8uJjRjyIm3oiFf+UgWrdEgziEfPQOcgix 6FvjIE4eNMJ/5Vd3SB7kSM1RG+8nqoghdDQIAhEtCdiFPVQQy/0BMz5EzwanEhmmTVFR 3isrwC3inMonusGLefSMnljGDbFk9dchXoK+/WZEqgtelIxWhYANni8oK2vkGdLsTtZ1 HK30Z2zlEAhJa6Q/QYA4RLNpCZSkbGiE/pPdPQl1VWg86HUq964HKSlcARI9xS+WWF2t yFig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679496162; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iclVlj0uRLLGWQO8Ig3rbocnokNbdehKEN39LMvr+XM=; b=BnnnfhfpHUD6i0mQA6SBm+PRwN105eH3D05R+KEWYhsA0ysWrZ5jUgVg/hXKlrWjWJ U9k0SBgELGSGNkbDy2UoGL2qGAmZ5CzuIOQ5l4e0Wf3jo23GFuY9FXHSG5gf/JmRZV5y S+JJGo+6H/jGoYG/VZcTqTlMvM7GkpGMMPAV1CBy0FW8CgPmVZ8vO8vFo/8zTQYYW7DU jpk6vSs6YE8AZ6D6wKdKYVz77tk3E9NCtt5bFNybkEJJFxp1jT208HnTnzPTCUPxMYRB X5anayvK27W48ZEf7fpIB+yDND4AtAzTq/3+4QUz4PECAS7/EwCRSDRw2slJJgMaXTD3 DZNw== X-Gm-Message-State: AO0yUKW54p+zCqfBFcCd3LzzfsWMk2MTMx7EtQ5K9FvQg/B7/Y8J9PyE W2lzbM2vgGRBff/yuv5o4W+lfg== X-Google-Smtp-Source: AK7set+p+EwEu4H95hMdMAkUccdUvP0yEcTcBuLOgej4nfKPvES1tHXFSJqJv7OK63z4+i5uy57gJA== X-Received: by 2002:a7b:cb91:0:b0:3eb:3f2d:f237 with SMTP id m17-20020a7bcb91000000b003eb3f2df237mr5392769wmi.6.1679496162280; Wed, 22 Mar 2023 07:42:42 -0700 (PDT) Received: from myrica (054592b0.skybroadband.com. [5.69.146.176]) by smtp.gmail.com with ESMTPSA id k22-20020a05600c0b5600b003ed2987690dsm16905891wmr.26.2023.03.22.07.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 07:42:41 -0700 (PDT) Date: Wed, 22 Mar 2023 14:42:43 +0000 From: Jean-Philippe Brucker To: Mostafa Saleh Cc: maz@kernel.org, catalin.marinas@arm.com, will@kernel.org, joro@8bytes.org, robin.murphy@arm.com, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, dbrazdil@google.com, ryan.roberts@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, iommu@lists.linux.dev Subject: Re: [RFC PATCH 39/45] iommu/arm-smmu-v3-kvm: Initialize page table configuration Message-ID: <20230322144243.GD594394@myrica> References: <20230201125328.2186498-1-jean-philippe@linaro.org> <20230201125328.2186498-40-jean-philippe@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230322_074246_162130_14445338 X-CRM114-Status: GOOD ( 16.10 ) 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 Hi Mostafa, On Wed, Mar 22, 2023 at 10:23:50AM +0000, Mostafa Saleh wrote: > > + /* > > + * Stage-1 should be easy to support, though we do need to allocate a > > + * context descriptor table. > > + */ > > + cfg = (struct io_pgtable_cfg) { > > + .fmt = ARM_64_LPAE_S2, > > + .pgsize_bitmap = smmu->pgsize_bitmap, > > + .ias = smmu->ias, > > + .oas = smmu->oas, > > + .coherent_walk = smmu->features & ARM_SMMU_FEAT_COHERENCY, > > + }; > > + > > + /* > > + * Choose the page and address size. Compute the PGD size and number of > > + * levels as well, so we know how much memory to pre-allocate. (I also need to fix that comment, we're not getting the number of levels anymore) > > + */ > > + ret = io_pgtable_configure(&cfg, &size); > size variable is overwritten here with pgd size, while used later on > the assumption it still contains the SMMU MMIO size. > This looks like it is not intended? No it's a bug, thanks for spotting it. I'll try to update the pkvm/smmu branch today with the other issues you reported Thanks, Jean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel