From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 253733AB5AC for ; Tue, 12 May 2026 12:36:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778589403; cv=none; b=WZyuR9s+rkmVrzFtX9/yMJQmpGNqCNScvnrpZ1+8+nQoa9nRvbcfSvQ8cp8T92cMubNNpC5goKzCbRed8o6MPv/u8a55nQ9yUUJWJkL65Egxf20ruZqqdUN2fJYtpKOGt0HUvfuisPnWn+T0DwXNd6Dm5gyTvkU5byLXyhxkCFM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778589403; c=relaxed/simple; bh=QuXcvbNKcdRmJ0PUN7xsL0HY9nWmc8jMrwxpJx0KWZY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=J20REJPwILaIDFglj6wnBaC6EDHs6CgJAXbTohhdStVMvAmaKl6S/LQmwOf6ivmOyGxaMH9/GUylvhjJV1pg1w/hrIHb5UQBPHfED5N5g5terWk1YnWmmr7hO9PoXgqANjPKzGxFL+iPaOnwpbQNhBePMEoanncnonwCn1rxDyg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=fnk6otfv; arc=none smtp.client-ip=209.85.160.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="fnk6otfv" Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-50d75bfb259so36562881cf.1 for ; Tue, 12 May 2026 05:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1778589393; x=1779194193; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=MOp4VzQJzpVrzaLWG2n8IsNxEYbCwRvMjRwLio3IkjI=; b=fnk6otfvXX38Ykv9efzSh6Ez31WpXEl0HrepvRAx47WaVYU0Ag6IwdkCg5PQUOxOoZ /hWYj0pKOVyLGUsiw8+HisMq5n8OdGaLtqbm60b65LxpgCkKK68M7/m4WsxkrKeKGEM6 9S7oxe3Iv/rdvch7JqxSAhc26aObnYjzuvNcPTfg9CqZ5IBsAMEQtdnMelrNT7joha6A g2hguPCWOO56XsOBbSbU9vPpc0J7RY8cuMQjb40eT30lJKnq6XdivQm/TOdoYkZX9XIl TnaRPvZxawB7kuVfEzhXhIjRggbcfuYxukee3+BujFIaFu5MtFXorX76lXpqHhvT8Nw0 1+jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778589393; x=1779194193; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MOp4VzQJzpVrzaLWG2n8IsNxEYbCwRvMjRwLio3IkjI=; b=ECSrtGERn0G7NRTUmbNUELzqKYghJDq0MvrRnWu6UAPuJP/lcLwYdJqrjaflZ1P4FD GW0LzIZeHQxrf0mtSqU4CVBVVPBPUkx20V2gnbRlcRvOFL7H0zl6TAlhRgGanbexVEX9 5+fLunwJAj0VRkT5iCbyiLyYYImNlet2TiJAJdSfau4ZMdY4rYiE5aMoK467+gXMQhSi rL7SU94bRHUKlzTqX1+8tb2Xk/E55g3Jgg0O1xvq8qnWT1nGIb0YEX0QA1V9w41akJLk Ge5AgQeB4HOjWmkErU9HTC6jvnuuF2wwdWP/wVxovr2Uka1163f9TBkdblxdrPd5d+vy IcIw== X-Forwarded-Encrypted: i=1; AFNElJ/7Cwl2OX4gVeHLilhh6MSf7h85wAkMJQU6fmYq7VrmyuQKtj97WI8JyztUy01IL3QlZlZxMKIb9WtX/Fo=@vger.kernel.org X-Gm-Message-State: AOJu0YxawnGZt7+qGp6GV/uWQxOM9U8wiFmLvxt2FFHDoyJ1ylrRJE+r nkkGmB6g9cpsuGKwgqYl4/RUniH0mIO9Uc5Jc3aOzSIN/U3fgIMzVj+OiCUydaRbj7c= X-Gm-Gg: Acq92OESMEXrrl8sBOHF2/mhrzmwrWX9RG8DpacWLwhcZ6SJch3ohZgdn37RgfHiU3s FkbR89rztM9uEt8milde8J+DRpu0T+yGRnMtNhSBpXkwcw+BYr7lODXhUO5j8lAn7x0xiWCS7KQ 0l9VUmJyPIBxdULbowBP5GtbnVvVOtAJXzkAbPmVJuIhEujT9Q/srMXhN/hlbM0NnTNAbQdwR93 WuU1/gFzTAFNc17AjRCthSRxRL8CVesSYY44t4kn4nGT5Fax2sC6JdDzaYwHB4H7B4Qa13XwOGD eKcb3U+BllkZJLUD4mafi+P5NyljCaGhzRSVkm/a6TDRr/eaNfQSC4BzrM4/USwsEdH65Y6fHBa kGq0HKyjosTKuydEP7NwYc5+RRC+x++rZNJq42/c3wdtsVZoe/Q8ZLTnq7koCbJ0cubtUBXL1St JiP8RyDXdFrUPMJiwfv6ftmdonbiqJky2x0DX4DI01OCEuEOJ2xtCXy9IOTvebLirL2i/1d2Wt1 roE3Q== X-Received: by 2002:a05:622a:4ccc:b0:50d:97e8:939b with SMTP id d75a77b69052e-51461f9e47fmr406246311cf.36.1778589393437; Tue, 12 May 2026 05:36:33 -0700 (PDT) Received: from ziepe.ca (crbknf0213w-47-54-130-67.pppoe-dynamic.high-speed.nl.bellaliant.net. [47.54.130.67]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8b53cd827c5sm391412326d6.40.2026.05.12.05.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2026 05:36:32 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wMmLg-00000005AiQ-0kgs; Tue, 12 May 2026 09:36:32 -0300 Date: Tue, 12 May 2026 09:36:32 -0300 From: Jason Gunthorpe To: Mostafa Saleh Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, iommu@lists.linux.dev, catalin.marinas@arm.com, will@kernel.org, maz@kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, joro@8bytes.org, jean-philippe@linaro.org, mark.rutland@arm.com, qperret@google.com, tabba@google.com, vdonnefort@google.com, sebastianene@google.com, keirf@google.com Subject: Re: [PATCH v6 08/25] KVM: arm64: iommu: Shadow host stage-2 page table Message-ID: <20260512123632.GT9285@ziepe.ca> References: <20260501111928.259252-1-smostafa@google.com> <20260501111928.259252-9-smostafa@google.com> <20260501130006.GF6912@ziepe.ca> <20260509232714.GI9285@ziepe.ca> <20260511142232.GP9285@ziepe.ca> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, May 12, 2026 at 10:42:30AM +0000, Mostafa Saleh wrote: > > Also io-pgtable arm cannot trigger BBM behaviors, so how do you > > implement it? > > At the moment, we workaround this by mapping all the memory with PTE > level, while MMIO remains at block level as they never change ownership > at the moment. > > This is one of the missing features I plan to add after this series, > if you look in the cover letter, these are listed under “Future work” Hrm, I would not be happy to see io-pgtable modified to have bbm features :\ They are very complex this is what iommupt is for.. > > So that's the real explanation, KVM cannot manage the S2 in the right > > way so you can't share it. RMM/etc are managing the S2 without > > pointless page faults so they can share it. > > Well, there is not really a right way, even with a fully populated > stage-2 page table, you can’t guarantee not getting TLB conflict aborts > without FEAT_BBML3 (which is quite recent), unless you map everything > with a leaf level, which then impacts performance. I mean, there is a right way - you need to rely on the BBM features in all HW and fully populate the S2 for no faults. So if that isn't present then you are doing things that will harm performance to work around the issue. It's fine, but just explain in the commit message. Jason