[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6fda5d7d-4214-460c-a727-9bb3382aa78f@redhat.com>
Date: Tue, 8 Oct 2024 12:56:36 +1000
From: Gavin Shan <gshan@...hat.com>
To: Steven Price <steven.price@....com>, kvm@...r.kernel.org,
kvmarm@...ts.linux.dev
Cc: Suzuki K Poulose <suzuki.poulose@....com>,
Catalin Marinas <catalin.marinas@....com>, Marc Zyngier <maz@...nel.org>,
Will Deacon <will@...nel.org>, James Morse <james.morse@....com>,
Oliver Upton <oliver.upton@...ux.dev>, Zenghui Yu <yuzenghui@...wei.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Joey Gouly <joey.gouly@....com>, Alexandru Elisei
<alexandru.elisei@....com>, Christoffer Dall <christoffer.dall@....com>,
Fuad Tabba <tabba@...gle.com>, linux-coco@...ts.linux.dev,
Ganapatrao Kulkarni <gankulkarni@...amperecomputing.com>,
Shanker Donthineni <sdonthineni@...dia.com>, Alper Gun
<alpergun@...gle.com>, "Aneesh Kumar K . V" <aneesh.kumar@...nel.org>
Subject: Re: [PATCH v6 09/11] arm64: Enable memory encrypt for Realms
On 10/5/24 12:43 AM, Steven Price wrote:
> From: Suzuki K Poulose <suzuki.poulose@....com>
>
> Use the memory encryption APIs to trigger a RSI call to request a
> transition between protected memory and shared memory (or vice versa)
> and updating the kernel's linear map of modified pages to flip the top
> bit of the IPA. This requires that block mappings are not used in the
> direct map for realm guests.
>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
> Co-developed-by: Steven Price <steven.price@....com>
> Signed-off-by: Steven Price <steven.price@....com>
> Reviewed-by: Catalin Marinas <catalin.marinas@....com>
> ---
> Changes since v5:
> * Added comments and a WARN() in realm_set_memory_{en,de}crypted() to
> explain that memory is leaked if the transition fails. This means the
> callers no longer need to provide their own WARN.
> Changed since v4:
> * Reworked to use the new dispatcher for the mem_encrypt API
> Changes since v3:
> * Provide pgprot_{de,en}crypted() macros
> * Rename __set_memory_encrypted() to __set_memory_enc_dec() since it
> both encrypts and decrypts.
> Changes since v2:
> * Fix location of set_memory_{en,de}crypted() and export them.
> * Break-before-make when changing the top bit of the IPA for
> transitioning to/from shared.
> ---
> arch/arm64/Kconfig | 3 +
> arch/arm64/include/asm/mem_encrypt.h | 9 +++
> arch/arm64/include/asm/pgtable.h | 5 ++
> arch/arm64/include/asm/set_memory.h | 3 +
> arch/arm64/kernel/rsi.c | 16 +++++
> arch/arm64/mm/pageattr.c | 90 +++++++++++++++++++++++++++-
> 6 files changed, 123 insertions(+), 3 deletions(-)
>
Reviewed-by: Gavin Shan <gshan@...hat.com>
Powered by blists - more mailing lists