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=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 1B6E1C07E9B for ; Tue, 20 Jul 2021 09:09:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04B486120E for ; Tue, 20 Jul 2021 09:09:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232287AbhGTI2X (ORCPT ); Tue, 20 Jul 2021 04:28:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:42884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235466AbhGTIXq (ORCPT ); Tue, 20 Jul 2021 04:23:46 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8EFC8611F2; Tue, 20 Jul 2021 08:46:53 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m5lOt-00ETCj-Lq; Tue, 20 Jul 2021 09:46:51 +0100 Date: Tue, 20 Jul 2021 09:46:51 +0100 Message-ID: <874kcp9xtw.wl-maz@kernel.org> From: Marc Zyngier To: Quentin Perret Cc: james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, ardb@kernel.org, qwandor@google.com, tabba@google.com, dbrazdil@google.com, kernel-team@android.com Subject: Re: [PATCH 05/14] KVM: arm64: Don't overwrite ignored bits with owner id In-Reply-To: References: <20210719104735.3681732-1-qperret@google.com> <20210719104735.3681732-6-qperret@google.com> <87im16jwe6.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: qperret@google.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, ardb@kernel.org, qwandor@google.com, tabba@google.com, dbrazdil@google.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Jul 2021 14:39:05 +0100, Quentin Perret wrote: > > On Monday 19 Jul 2021 at 13:55:29 (+0100), Marc Zyngier wrote: > > On Mon, 19 Jul 2021 11:47:26 +0100, > > Quentin Perret wrote: > > > > > > The nVHE protected mode uses invalid mappings in the host stage-2 > > > page-table to track the owner of each page in the system. In order to > > > allow the usage of ignored bits (a.k.a. software bits) in these > > > mappings, move the owner encoding away from the top bits. > > > > But that's exactly what the current situation is allowing: the use of > > the SW bits. I am guessing that what you really mean is that you want > > to *preserve* the SW bits from an existing mapping and use other bits > > when the mapping is invalid? > > Yes, this is really just forward looking, but I think it might be useful > to allow annotating invalid mappings with both an owner id _and_ > additional flags for e.g. shared pages and such. And using bits [58-55] > to store those flags just like we do for valid mappings should make > things easier, but no big deal. Right, so maybe worth calling that out. > I see how this is going to conflict with kvm_pgtable_stage2_annotate() > from your series though, so maybe I should just drop this patch and > leave the encoding 'issue' to the caller -- the rest of the series > doesn't depend on this anyway, this was just small cleanup. I'm not too worried about that for now. We can always rewrite one in terms of the other, but I wanted to understand exactly this change was about. Thanks, M. -- Without deviation from the norm, progress is not possible. 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=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 92A45C07E9B for ; Tue, 20 Jul 2021 08:46:58 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 13B5161205 for ; Tue, 20 Jul 2021 08:46:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13B5161205 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 9DCC14A95C; Tue, 20 Jul 2021 04:46:57 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H787Akw9wrcS; Tue, 20 Jul 2021 04:46:56 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 92FAA4B082; Tue, 20 Jul 2021 04:46:56 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 895664A95C for ; Tue, 20 Jul 2021 04:46:55 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tlDwTlgVzCha for ; Tue, 20 Jul 2021 04:46:54 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 8868F4A500 for ; Tue, 20 Jul 2021 04:46:54 -0400 (EDT) Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8EFC8611F2; Tue, 20 Jul 2021 08:46:53 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m5lOt-00ETCj-Lq; Tue, 20 Jul 2021 09:46:51 +0100 Date: Tue, 20 Jul 2021 09:46:51 +0100 Message-ID: <874kcp9xtw.wl-maz@kernel.org> From: Marc Zyngier To: Quentin Perret Subject: Re: [PATCH 05/14] KVM: arm64: Don't overwrite ignored bits with owner id In-Reply-To: References: <20210719104735.3681732-1-qperret@google.com> <20210719104735.3681732-6-qperret@google.com> <87im16jwe6.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: qperret@google.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, ardb@kernel.org, qwandor@google.com, tabba@google.com, dbrazdil@google.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: kernel-team@android.com, qwandor@google.com, will@kernel.org, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Mon, 19 Jul 2021 14:39:05 +0100, Quentin Perret wrote: > > On Monday 19 Jul 2021 at 13:55:29 (+0100), Marc Zyngier wrote: > > On Mon, 19 Jul 2021 11:47:26 +0100, > > Quentin Perret wrote: > > > > > > The nVHE protected mode uses invalid mappings in the host stage-2 > > > page-table to track the owner of each page in the system. In order to > > > allow the usage of ignored bits (a.k.a. software bits) in these > > > mappings, move the owner encoding away from the top bits. > > > > But that's exactly what the current situation is allowing: the use of > > the SW bits. I am guessing that what you really mean is that you want > > to *preserve* the SW bits from an existing mapping and use other bits > > when the mapping is invalid? > > Yes, this is really just forward looking, but I think it might be useful > to allow annotating invalid mappings with both an owner id _and_ > additional flags for e.g. shared pages and such. And using bits [58-55] > to store those flags just like we do for valid mappings should make > things easier, but no big deal. Right, so maybe worth calling that out. > I see how this is going to conflict with kvm_pgtable_stage2_annotate() > from your series though, so maybe I should just drop this patch and > leave the encoding 'issue' to the caller -- the rest of the series > doesn't depend on this anyway, this was just small cleanup. I'm not too worried about that for now. We can always rewrite one in terms of the other, but I wanted to understand exactly this change was about. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 267F3C07E95 for ; Tue, 20 Jul 2021 08:48:31 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DF6AC6120A for ; Tue, 20 Jul 2021 08:48:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF6AC6120A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Cid4cocpw5/DXPYEsB3MDT0nEOBpzKi1qFpz6WKbCFo=; b=PLgPa6Iv1D5Il8 h/EqwY9r3ItDLblDQIh6AEUPRyYKehHxkPPZj4Fg9XZ9eK3fO1/TqCpSyjXEKFQNByDWXNs5U5cLd mqSGvl5fzE3g4EeFtGXWICmqcyyaW6u8aL0fVbvEDtBhWxQeIk+9Pc3JjSkL6htZAoZO7tZwJJOvT aQk1iflD1bPIuZ1o52yWJycctqMNBWwd8ehcVQnAraEmzXWyGtXMevX0dFu1Jnt9S4Wu3anRhanQe w9UrbSnmRY2azwuj0CB9Hm7ExgcacyLwnWEt8GgP4ZNBu0UDQdtS3YJz6EKqMMJyiAi/21w2Iwdq5 N1a9ZpsBEMzRxlfpllPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5lP5-00CGaZ-I5; Tue, 20 Jul 2021 08:47:04 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5lOv-00CGZ9-Vx for linux-arm-kernel@lists.infradead.org; Tue, 20 Jul 2021 08:46:55 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8EFC8611F2; Tue, 20 Jul 2021 08:46:53 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m5lOt-00ETCj-Lq; Tue, 20 Jul 2021 09:46:51 +0100 Date: Tue, 20 Jul 2021 09:46:51 +0100 Message-ID: <874kcp9xtw.wl-maz@kernel.org> From: Marc Zyngier To: Quentin Perret Cc: james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, ardb@kernel.org, qwandor@google.com, tabba@google.com, dbrazdil@google.com, kernel-team@android.com Subject: Re: [PATCH 05/14] KVM: arm64: Don't overwrite ignored bits with owner id In-Reply-To: References: <20210719104735.3681732-1-qperret@google.com> <20210719104735.3681732-6-qperret@google.com> <87im16jwe6.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: qperret@google.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, ardb@kernel.org, qwandor@google.com, tabba@google.com, dbrazdil@google.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210720_014654_089388_7647569D X-CRM114-Status: GOOD ( 26.22 ) 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 On Mon, 19 Jul 2021 14:39:05 +0100, Quentin Perret wrote: > > On Monday 19 Jul 2021 at 13:55:29 (+0100), Marc Zyngier wrote: > > On Mon, 19 Jul 2021 11:47:26 +0100, > > Quentin Perret wrote: > > > > > > The nVHE protected mode uses invalid mappings in the host stage-2 > > > page-table to track the owner of each page in the system. In order to > > > allow the usage of ignored bits (a.k.a. software bits) in these > > > mappings, move the owner encoding away from the top bits. > > > > But that's exactly what the current situation is allowing: the use of > > the SW bits. I am guessing that what you really mean is that you want > > to *preserve* the SW bits from an existing mapping and use other bits > > when the mapping is invalid? > > Yes, this is really just forward looking, but I think it might be useful > to allow annotating invalid mappings with both an owner id _and_ > additional flags for e.g. shared pages and such. And using bits [58-55] > to store those flags just like we do for valid mappings should make > things easier, but no big deal. Right, so maybe worth calling that out. > I see how this is going to conflict with kvm_pgtable_stage2_annotate() > from your series though, so maybe I should just drop this patch and > leave the encoding 'issue' to the caller -- the rest of the series > doesn't depend on this anyway, this was just small cleanup. I'm not too worried about that for now. We can always rewrite one in terms of the other, but I wanted to understand exactly this change was about. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel