All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Price <steven.price@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Marc Zyngier <maz@kernel.org>, Will Deacon <will@kernel.org>
Cc: Steven Price <steven.price@arm.com>,
	James Morse <james.morse@arm.com>,
	Julien Thierry <julien.thierry.kdev@gmail.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Dave Martin <Dave.Martin@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	qemu-devel@nongnu.org, Juan Quintela <quintela@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Peter Maydell <peter.maydell@linaro.org>,
	Haibo Xu <Haibo.Xu@arm.com>, Andrew Jones <drjones@redhat.com>
Subject: [PATCH v5 0/2] MTE support for KVM guest
Date: Thu, 19 Nov 2020 15:38:59 +0000	[thread overview]
Message-ID: <20201119153901.53705-1-steven.price@arm.com> (raw)

This series adds support for Arm's Memory Tagging Extension (MTE) to
KVM, allowing KVM guests to make use of it. This builds on the existing
user space support already in v5.10-rc1, see [1] for an overview.

[1] https://lwn.net/Articles/834289/

Changes since v4[2]:

 * Rebased on v5.10-rc4.

 * Require the VMM to map all guest memory PROT_MTE if MTE is enabled
   for the guest.

 * Add a kvm_has_mte() accessor.

[2] http://lkml.kernel.org/r/20201026155727.36685-1-steven.price%40arm.com

The change to require the VMM to map all guest memory PROT_MTE is
significant as it means that the VMM has to deal with the MTE tags even
if it doesn't care about them (e.g. for virtual devices or if the VMM
doesn't support migration). Also unfortunately because the VMM can
change the memory layout at any time the check for PROT_MTE/VM_MTE has
to be done very late (at the point of faulting pages into stage 2).

The alternative would be to modify the set_pte_at() handler to always
check if there is MTE data relating to a swap page even if the PTE
doesn't have the MTE bit set. I haven't initially done this because of
ordering issues during early boot, but could investigate further if the
above VMM requirement is too strict.

Steven Price (2):
  arm64: kvm: Save/restore MTE registers
  arm64: kvm: Introduce MTE VCPU feature

 arch/arm64/include/asm/kvm_emulate.h       |  3 +++
 arch/arm64/include/asm/kvm_host.h          |  8 ++++++++
 arch/arm64/include/asm/sysreg.h            |  3 ++-
 arch/arm64/kvm/arm.c                       |  9 +++++++++
 arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 14 ++++++++++++++
 arch/arm64/kvm/mmu.c                       |  6 ++++++
 arch/arm64/kvm/sys_regs.c                  | 20 +++++++++++++++-----
 include/uapi/linux/kvm.h                   |  1 +
 8 files changed, 58 insertions(+), 6 deletions(-)

-- 
2.20.1


WARNING: multiple messages have this Message-ID (diff)
From: Steven Price <steven.price@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Marc Zyngier <maz@kernel.org>, Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Andrew Jones <drjones@redhat.com>, Haibo Xu <Haibo.Xu@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	qemu-devel@nongnu.org, Dave Martin <Dave.Martin@arm.com>,
	Juan Quintela <quintela@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	linux-kernel@vger.kernel.org, Steven Price <steven.price@arm.com>,
	James Morse <james.morse@arm.com>,
	Julien Thierry <julien.thierry.kdev@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 0/2] MTE support for KVM guest
Date: Thu, 19 Nov 2020 15:38:59 +0000	[thread overview]
Message-ID: <20201119153901.53705-1-steven.price@arm.com> (raw)

This series adds support for Arm's Memory Tagging Extension (MTE) to
KVM, allowing KVM guests to make use of it. This builds on the existing
user space support already in v5.10-rc1, see [1] for an overview.

[1] https://lwn.net/Articles/834289/

Changes since v4[2]:

 * Rebased on v5.10-rc4.

 * Require the VMM to map all guest memory PROT_MTE if MTE is enabled
   for the guest.

 * Add a kvm_has_mte() accessor.

[2] http://lkml.kernel.org/r/20201026155727.36685-1-steven.price%40arm.com

The change to require the VMM to map all guest memory PROT_MTE is
significant as it means that the VMM has to deal with the MTE tags even
if it doesn't care about them (e.g. for virtual devices or if the VMM
doesn't support migration). Also unfortunately because the VMM can
change the memory layout at any time the check for PROT_MTE/VM_MTE has
to be done very late (at the point of faulting pages into stage 2).

The alternative would be to modify the set_pte_at() handler to always
check if there is MTE data relating to a swap page even if the PTE
doesn't have the MTE bit set. I haven't initially done this because of
ordering issues during early boot, but could investigate further if the
above VMM requirement is too strict.

Steven Price (2):
  arm64: kvm: Save/restore MTE registers
  arm64: kvm: Introduce MTE VCPU feature

 arch/arm64/include/asm/kvm_emulate.h       |  3 +++
 arch/arm64/include/asm/kvm_host.h          |  8 ++++++++
 arch/arm64/include/asm/sysreg.h            |  3 ++-
 arch/arm64/kvm/arm.c                       |  9 +++++++++
 arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 14 ++++++++++++++
 arch/arm64/kvm/mmu.c                       |  6 ++++++
 arch/arm64/kvm/sys_regs.c                  | 20 +++++++++++++++-----
 include/uapi/linux/kvm.h                   |  1 +
 8 files changed, 58 insertions(+), 6 deletions(-)

-- 
2.20.1



WARNING: multiple messages have this Message-ID (diff)
From: Steven Price <steven.price@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Marc Zyngier <maz@kernel.org>, Will Deacon <will@kernel.org>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	qemu-devel@nongnu.org, Dave Martin <Dave.Martin@arm.com>,
	Juan Quintela <quintela@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	linux-kernel@vger.kernel.org, Steven Price <steven.price@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 0/2] MTE support for KVM guest
Date: Thu, 19 Nov 2020 15:38:59 +0000	[thread overview]
Message-ID: <20201119153901.53705-1-steven.price@arm.com> (raw)

This series adds support for Arm's Memory Tagging Extension (MTE) to
KVM, allowing KVM guests to make use of it. This builds on the existing
user space support already in v5.10-rc1, see [1] for an overview.

[1] https://lwn.net/Articles/834289/

Changes since v4[2]:

 * Rebased on v5.10-rc4.

 * Require the VMM to map all guest memory PROT_MTE if MTE is enabled
   for the guest.

 * Add a kvm_has_mte() accessor.

[2] http://lkml.kernel.org/r/20201026155727.36685-1-steven.price%40arm.com

The change to require the VMM to map all guest memory PROT_MTE is
significant as it means that the VMM has to deal with the MTE tags even
if it doesn't care about them (e.g. for virtual devices or if the VMM
doesn't support migration). Also unfortunately because the VMM can
change the memory layout at any time the check for PROT_MTE/VM_MTE has
to be done very late (at the point of faulting pages into stage 2).

The alternative would be to modify the set_pte_at() handler to always
check if there is MTE data relating to a swap page even if the PTE
doesn't have the MTE bit set. I haven't initially done this because of
ordering issues during early boot, but could investigate further if the
above VMM requirement is too strict.

Steven Price (2):
  arm64: kvm: Save/restore MTE registers
  arm64: kvm: Introduce MTE VCPU feature

 arch/arm64/include/asm/kvm_emulate.h       |  3 +++
 arch/arm64/include/asm/kvm_host.h          |  8 ++++++++
 arch/arm64/include/asm/sysreg.h            |  3 ++-
 arch/arm64/kvm/arm.c                       |  9 +++++++++
 arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 14 ++++++++++++++
 arch/arm64/kvm/mmu.c                       |  6 ++++++
 arch/arm64/kvm/sys_regs.c                  | 20 +++++++++++++++-----
 include/uapi/linux/kvm.h                   |  1 +
 8 files changed, 58 insertions(+), 6 deletions(-)

-- 
2.20.1

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Steven Price <steven.price@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Marc Zyngier <maz@kernel.org>, Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Andrew Jones <drjones@redhat.com>, Haibo Xu <Haibo.Xu@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	qemu-devel@nongnu.org, Dave Martin <Dave.Martin@arm.com>,
	Juan Quintela <quintela@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	linux-kernel@vger.kernel.org, Steven Price <steven.price@arm.com>,
	James Morse <james.morse@arm.com>,
	Julien Thierry <julien.thierry.kdev@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 0/2] MTE support for KVM guest
Date: Thu, 19 Nov 2020 15:38:59 +0000	[thread overview]
Message-ID: <20201119153901.53705-1-steven.price@arm.com> (raw)

This series adds support for Arm's Memory Tagging Extension (MTE) to
KVM, allowing KVM guests to make use of it. This builds on the existing
user space support already in v5.10-rc1, see [1] for an overview.

[1] https://lwn.net/Articles/834289/

Changes since v4[2]:

 * Rebased on v5.10-rc4.

 * Require the VMM to map all guest memory PROT_MTE if MTE is enabled
   for the guest.

 * Add a kvm_has_mte() accessor.

[2] http://lkml.kernel.org/r/20201026155727.36685-1-steven.price%40arm.com

The change to require the VMM to map all guest memory PROT_MTE is
significant as it means that the VMM has to deal with the MTE tags even
if it doesn't care about them (e.g. for virtual devices or if the VMM
doesn't support migration). Also unfortunately because the VMM can
change the memory layout at any time the check for PROT_MTE/VM_MTE has
to be done very late (at the point of faulting pages into stage 2).

The alternative would be to modify the set_pte_at() handler to always
check if there is MTE data relating to a swap page even if the PTE
doesn't have the MTE bit set. I haven't initially done this because of
ordering issues during early boot, but could investigate further if the
above VMM requirement is too strict.

Steven Price (2):
  arm64: kvm: Save/restore MTE registers
  arm64: kvm: Introduce MTE VCPU feature

 arch/arm64/include/asm/kvm_emulate.h       |  3 +++
 arch/arm64/include/asm/kvm_host.h          |  8 ++++++++
 arch/arm64/include/asm/sysreg.h            |  3 ++-
 arch/arm64/kvm/arm.c                       |  9 +++++++++
 arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 14 ++++++++++++++
 arch/arm64/kvm/mmu.c                       |  6 ++++++
 arch/arm64/kvm/sys_regs.c                  | 20 +++++++++++++++-----
 include/uapi/linux/kvm.h                   |  1 +
 8 files changed, 58 insertions(+), 6 deletions(-)

-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2020-11-19 15:39 UTC|newest]

Thread overview: 152+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19 15:38 Steven Price [this message]
2020-11-19 15:38 ` [PATCH v5 0/2] MTE support for KVM guest Steven Price
2020-11-19 15:38 ` Steven Price
2020-11-19 15:38 ` Steven Price
2020-11-19 15:39 ` [PATCH v5 1/2] arm64: kvm: Save/restore MTE registers Steven Price
2020-11-19 15:39   ` Steven Price
2020-11-19 15:39   ` Steven Price
2020-11-19 15:39   ` Steven Price
2020-11-19 15:39 ` [PATCH v5 2/2] arm64: kvm: Introduce MTE VCPU feature Steven Price
2020-11-19 15:39   ` Steven Price
2020-11-19 15:39   ` Steven Price
2020-11-19 15:39   ` Steven Price
2020-11-19 15:45 ` [PATCH v5 0/2] MTE support for KVM guest Peter Maydell
2020-11-19 15:45   ` Peter Maydell
2020-11-19 15:45   ` Peter Maydell
2020-11-19 15:45   ` Peter Maydell
2020-11-19 15:57   ` Steven Price
2020-11-19 15:57     ` Steven Price
2020-11-19 15:57     ` Steven Price
2020-11-19 15:57     ` Steven Price
2020-11-19 16:39     ` Peter Maydell
2020-11-19 16:39       ` Peter Maydell
2020-11-19 16:39       ` Peter Maydell
2020-11-19 16:39       ` Peter Maydell
2020-11-19 18:42   ` Andrew Jones
2020-11-19 18:42     ` Andrew Jones
2020-11-19 18:42     ` Andrew Jones
2020-11-19 18:42     ` Andrew Jones
2020-11-19 19:11     ` Marc Zyngier
2020-11-19 19:11       ` Marc Zyngier
2020-11-19 19:11       ` Marc Zyngier
2020-11-19 19:11       ` Marc Zyngier
2020-11-20  9:50       ` Steven Price
2020-11-20  9:50         ` Steven Price
2020-11-20  9:50         ` Steven Price
2020-11-20  9:50         ` Steven Price
2020-11-20  9:56         ` Marc Zyngier
2020-11-20  9:56           ` Marc Zyngier
2020-11-20  9:56           ` Marc Zyngier
2020-11-20  9:56           ` Marc Zyngier
2020-11-20  9:58           ` Steven Price
2020-11-20  9:58             ` Steven Price
2020-11-20  9:58             ` Steven Price
2020-11-20  9:58             ` Steven Price
2020-12-04  8:25         ` Haibo Xu
2020-12-04  8:25           ` Haibo Xu
2020-12-04  8:25           ` Haibo Xu
2020-12-04  8:25           ` Haibo Xu
2020-12-07 14:48           ` Steven Price
2020-12-07 14:48             ` Steven Price
2020-12-07 14:48             ` Steven Price
2020-12-07 14:48             ` Steven Price
2020-12-07 15:27             ` Peter Maydell
2020-12-07 15:27               ` Peter Maydell
2020-12-07 15:27               ` Peter Maydell
2020-12-07 15:27               ` Peter Maydell
2020-12-07 15:45               ` Steven Price
2020-12-07 15:45                 ` Steven Price
2020-12-07 15:45                 ` Steven Price
2020-12-07 15:45                 ` Steven Price
2020-12-07 16:05                 ` Marc Zyngier
2020-12-07 16:05                   ` Marc Zyngier
2020-12-07 16:05                   ` Marc Zyngier
2020-12-07 16:05                   ` Marc Zyngier
2020-12-07 16:34                   ` Catalin Marinas
2020-12-07 16:34                     ` Catalin Marinas
2020-12-07 16:34                     ` Catalin Marinas
2020-12-07 16:34                     ` Catalin Marinas
2020-12-07 19:03                     ` Marc Zyngier
2020-12-07 19:03                       ` Marc Zyngier
2020-12-07 19:03                       ` Marc Zyngier
2020-12-07 19:03                       ` Marc Zyngier
2020-12-08 17:21                       ` Catalin Marinas
2020-12-08 17:21                         ` Catalin Marinas
2020-12-08 17:21                         ` Catalin Marinas
2020-12-08 17:21                         ` Catalin Marinas
2020-12-08 18:21                         ` Marc Zyngier
2020-12-08 18:21                           ` Marc Zyngier
2020-12-08 18:21                           ` Marc Zyngier
2020-12-08 18:21                           ` Marc Zyngier
2020-12-09 12:44                           ` Catalin Marinas
2020-12-09 12:44                             ` Catalin Marinas
2020-12-09 12:44                             ` Catalin Marinas
2020-12-09 12:44                             ` Catalin Marinas
2020-12-09 13:25                             ` Marc Zyngier
2020-12-09 13:25                               ` Marc Zyngier
2020-12-09 13:25                               ` Marc Zyngier
2020-12-09 13:25                               ` Marc Zyngier
2020-12-09 15:27                               ` Catalin Marinas
2020-12-09 15:27                                 ` Catalin Marinas
2020-12-09 15:27                                 ` Catalin Marinas
2020-12-09 15:27                                 ` Catalin Marinas
2020-12-09 18:27                                 ` Richard Henderson
2020-12-09 18:27                                   ` Richard Henderson
2020-12-09 18:27                                   ` Richard Henderson
2020-12-09 18:27                                   ` Richard Henderson
2020-12-09 18:39                                   ` Catalin Marinas
2020-12-09 18:39                                     ` Catalin Marinas
2020-12-09 18:39                                     ` Catalin Marinas
2020-12-09 18:39                                     ` Catalin Marinas
2020-12-09 20:13                                     ` Richard Henderson
2020-12-09 20:13                                       ` Richard Henderson
2020-12-09 20:13                                       ` Richard Henderson
2020-12-09 20:13                                       ` Richard Henderson
2020-12-09 20:20                                       ` Peter Maydell
2020-12-09 20:20                                         ` Peter Maydell
2020-12-09 20:20                                         ` Peter Maydell
2020-12-09 20:20                                         ` Peter Maydell
2020-12-07 16:44                 ` Dr. David Alan Gilbert
2020-12-07 16:44                   ` Dr. David Alan Gilbert
2020-12-07 16:44                   ` Dr. David Alan Gilbert
2020-12-07 16:44                   ` Dr. David Alan Gilbert
2020-12-07 17:10                   ` Peter Maydell
2020-12-07 17:10                     ` Peter Maydell
2020-12-07 17:10                     ` Peter Maydell
2020-12-07 17:10                     ` Peter Maydell
2020-12-07 17:44                     ` Dr. David Alan Gilbert
2020-12-07 17:44                       ` Dr. David Alan Gilbert
2020-12-07 17:44                       ` Dr. David Alan Gilbert
2020-12-07 17:44                       ` Dr. David Alan Gilbert
2020-12-08 10:05                   ` Haibo Xu
2020-12-08 10:05                     ` Haibo Xu
2020-12-08 10:05                     ` Haibo Xu
2020-12-08 10:05                     ` Haibo Xu
2020-12-08  9:51             ` Haibo Xu
2020-12-08  9:51               ` Haibo Xu
2020-12-08  9:51               ` Haibo Xu
2020-12-08  9:51               ` Haibo Xu
2020-12-08 10:01               ` Marc Zyngier
2020-12-08 10:01                 ` Marc Zyngier
2020-12-08 10:01                 ` Marc Zyngier
2020-12-08 10:01                 ` Marc Zyngier
2020-12-08 10:10                 ` Haibo Xu
2020-12-08 10:10                   ` Haibo Xu
2020-12-08 10:10                   ` Haibo Xu
2020-12-08 10:10                   ` Haibo Xu
2020-12-16  7:31             ` Haibo Xu
2020-12-16  7:31               ` Haibo Xu
2020-12-16  7:31               ` Haibo Xu
2020-12-16  7:31               ` Haibo Xu
2020-12-16 10:22               ` Steven Price
2020-12-16 10:22                 ` Steven Price
2020-12-16 10:22                 ` Steven Price
2020-12-16 10:22                 ` Steven Price
2020-12-17  1:47                 ` Haibo Xu
2020-12-17  1:47                   ` Haibo Xu
2020-12-17  1:47                   ` Haibo Xu
2020-12-17  1:47                   ` Haibo Xu
2020-11-23 12:16   ` Dr. David Alan Gilbert
2020-11-23 12:16     ` Dr. David Alan Gilbert
2020-11-23 12:16     ` Dr. David Alan Gilbert
2020-11-23 12:16     ` Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201119153901.53705-1-steven.price@arm.com \
    --to=steven.price@arm.com \
    --cc=Dave.Martin@arm.com \
    --cc=Haibo.Xu@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=dgilbert@redhat.com \
    --cc=drjones@redhat.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=richard.henderson@linaro.org \
    --cc=suzuki.poulose@arm.com \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.