Re: [Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after resuming from stop

2019-03-13 Thread Steven Price
On 13/03/2019 01:57, Heyi Guo wrote: > Dear all, > > Really appreciate your comments and information. For "Live Physical > Time", is there any document to tell the whole story? And may I know the > timeline to make it happen? The documentation is available here: https://developer.arm.com/docs/den

Re: [Qemu-devel] [RFC] arm/cpu: fix soft lockup panic after resuming from stop

2019-03-13 Thread Steven Price
On 12/03/2019 14:12, Marc Zyngier wrote: > Hi Peter, > > On 12/03/2019 10:08, Peter Maydell wrote: >> On Tue, 12 Mar 2019 at 06:10, Heyi Guo wrote: >>> >>> When we stop a VM for more than 30 seconds and then resume it, by qemu >>> monitor command "stop" and "cont", Linux on VM will complain of "s

Re: [RFC v2 PATCH 06/13] KVM: Register/unregister memfd backed memslot

2021-11-25 Thread Steven Price
On 19/11/2021 13:47, Chao Peng wrote: > Signed-off-by: Yu Zhang > Signed-off-by: Chao Peng > --- > virt/kvm/kvm_main.c | 23 +++ > 1 file changed, 19 insertions(+), 4 deletions(-) > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 271cef8d1cd0..b8673490d301 1

Re: [PATCH v4 01/12] mm/shmem: Introduce F_SEAL_INACCESSIBLE

2022-02-23 Thread Steven Price
On 23/02/2022 11:49, Chao Peng wrote: > On Thu, Feb 17, 2022 at 11:09:35AM -0800, Andy Lutomirski wrote: >> On Thu, Feb 17, 2022, at 5:06 AM, Chao Peng wrote: >>> On Fri, Feb 11, 2022 at 03:33:35PM -0800, Andy Lutomirski wrote: On 1/18/22 05:21, Chao Peng wrote: > From: "Kirill A. Shutemov

Re: [PATCH v4 00/12] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-01-28 Thread Steven Price
On 18/01/2022 13:21, Chao Peng wrote: > This is the v4 of this series which try to implement the fd-based KVM > guest private memory. The patches are based on latest kvm/queue branch > commit: > > fea31d169094 KVM: x86/pmu: Fix available_event_types check for >REF_CPU_CYCLES even

Re: [PATCH v4 00/12] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-02-02 Thread Steven Price
Hi Jun, On 02/02/2022 02:28, Nakajima, Jun wrote: > >> On Jan 28, 2022, at 8:47 AM, Steven Price wrote: >> >> On 18/01/2022 13:21, Chao Peng wrote: >>> This is the v4 of this series which try to implement the fd-based KVM >>> guest private memory. Th

Re: [PATCH v4 02/12] mm/memfd: Introduce MFD_INACCESSIBLE flag

2022-01-21 Thread Steven Price
On 18/01/2022 13:21, Chao Peng wrote: > Introduce a new memfd_create() flag indicating the content of the > created memfd is inaccessible from userspace. It does this by force > setting F_SEAL_INACCESSIBLE seal when the file is created. It also set > F_SEAL_SEAL to prevent future sealing, which mea

Re: [PATCH v5 00/13] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-03-30 Thread Steven Price
On 29/03/2022 18:01, Quentin Perret wrote: > On Monday 28 Mar 2022 at 18:58:35 (+), Sean Christopherson wrote: >> On Mon, Mar 28, 2022, Quentin Perret wrote: >>> Hi Sean, >>> >>> Thanks for the reply, this helps a lot. >>> >>> On Monday 28 Mar 2022 at 17:13:10 (+), Sean Christopherson wrote

Re: [PATCH v11 2/6] arm64: kvm: Introduce MTE VM feature

2021-05-06 Thread Steven Price
On 04/05/2021 18:40, Catalin Marinas wrote: On Thu, Apr 29, 2021 at 05:06:41PM +0100, Steven Price wrote: On 28/04/2021 18:07, Catalin Marinas wrote: I probably asked already but is the only way to map a standard RAM page (not device) in stage 2 via the fault handler? One case I had in mind

Re: [PATCH v11 5/6] KVM: arm64: ioctl to fetch/store tags in a guest

2021-05-07 Thread Steven Price
On 04/05/2021 18:44, Catalin Marinas wrote: On Thu, Apr 29, 2021 at 05:06:07PM +0100, Steven Price wrote: On 27/04/2021 18:58, Catalin Marinas wrote: On Fri, Apr 16, 2021 at 04:43:08PM +0100, Steven Price wrote: diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm

Re: [PATCH v11 2/6] arm64: kvm: Introduce MTE VM feature

2021-05-12 Thread Steven Price
On 10/05/2021 19:35, Catalin Marinas wrote: On Fri, May 07, 2021 at 07:25:39PM +0100, Catalin Marinas wrote: On Thu, May 06, 2021 at 05:15:25PM +0100, Steven Price wrote: On 04/05/2021 18:40, Catalin Marinas wrote: On Thu, Apr 29, 2021 at 05:06:41PM +0100, Steven Price wrote: Given the

Re: [PATCH v10 1/6] arm64: mte: Sync tags for pages where PTE is untagged

2021-03-29 Thread Steven Price
On 26/03/2021 18:56, Catalin Marinas wrote: Hi Steven, On Fri, Mar 12, 2021 at 03:18:57PM +, Steven Price wrote: A KVM guest could store tags in a page even if the VMM hasn't mapped the page with PROT_MTE. So when restoring pages from swap we will need to check to see if there ar

Re: [PATCH v10 2/6] arm64: kvm: Introduce MTE VM feature

2021-03-29 Thread Steven Price
On 28/03/2021 13:21, Catalin Marinas wrote: On Sat, Mar 27, 2021 at 03:23:24PM +, Catalin Marinas wrote: On Fri, Mar 12, 2021 at 03:18:58PM +, Steven Price wrote: diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c index 77cb2d28f2a4..b31b7a821f90 100644 --- a/arch/arm64/kvm/mmu.c

Re: [PATCH v10 1/6] arm64: mte: Sync tags for pages where PTE is untagged

2021-03-31 Thread Steven Price
On 30/03/2021 11:13, Catalin Marinas wrote: On Mon, Mar 29, 2021 at 04:55:29PM +0100, Steven Price wrote: On 26/03/2021 18:56, Catalin Marinas wrote: On Fri, Mar 12, 2021 at 03:18:57PM +, Steven Price wrote: A KVM guest could store tags in a page even if the VMM hasn't mapped the

Re: [PATCH v10 2/6] arm64: kvm: Introduce MTE VM feature

2021-03-31 Thread Steven Price
On 31/03/2021 10:32, David Hildenbrand wrote: On 31.03.21 11:21, Catalin Marinas wrote: On Wed, Mar 31, 2021 at 09:34:44AM +0200, David Hildenbrand wrote: On 30.03.21 12:30, Catalin Marinas wrote: On Mon, Mar 29, 2021 at 05:06:51PM +0100, Steven Price wrote: On 28/03/2021 13:21, Catalin

Re: [PATCH v10 2/6] arm64: kvm: Introduce MTE VM feature

2021-04-07 Thread Steven Price
On 31/03/2021 19:43, Catalin Marinas wrote: On Wed, Mar 31, 2021 at 11:41:20AM +0100, Steven Price wrote: On 31/03/2021 10:32, David Hildenbrand wrote: On 31.03.21 11:21, Catalin Marinas wrote: On Wed, Mar 31, 2021 at 09:34:44AM +0200, David Hildenbrand wrote: On 30.03.21 12:30, Catalin

Re: [PATCH v10 2/6] arm64: kvm: Introduce MTE VM feature

2021-04-07 Thread Steven Price
On 07/04/2021 16:14, Catalin Marinas wrote: On Wed, Apr 07, 2021 at 11:20:18AM +0100, Steven Price wrote: On 31/03/2021 19:43, Catalin Marinas wrote: When a slot is added by the VMM, if it asked for MTE in guest (I guess that's an opt-in by the VMM, haven't checked the other patche

Re: [PATCH v9 6/6] KVM: arm64: Document MTE capability and ioctl

2021-03-11 Thread Steven Price
On 09/03/2021 11:01, Peter Maydell wrote: On Mon, 1 Mar 2021 at 14:23, Steven Price wrote: A new capability (KVM_CAP_ARM_MTE) identifies that the kernel supports granting a guest access to the tags, and provides a mechanism for the VMM to enable it. A new ioctl (KVM_ARM_MTE_COPY_TAGS

[PATCH v10 1/6] arm64: mte: Sync tags for pages where PTE is untagged

2021-03-12 Thread Steven Price
en swapped out. Signed-off-by: Steven Price --- arch/arm64/include/asm/pgtable.h | 2 +- arch/arm64/kernel/mte.c | 16 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index e1

[PATCH v10 5/6] KVM: arm64: ioctl to fetch/store tags in a guest

2021-03-12 Thread Steven Price
the VMM to easily read/write the tags from guest memory, allowing the VMM's mapping to be non-PROT_MTE while the VMM can still read/write the tags for the purpose of migration. Signed-off-by: Steven Price --- arch/arm64/include/uapi/asm/kvm.h | 14 +++ arch/arm64/kvm/arm.c

[PATCH v10 2/6] arm64: kvm: Introduce MTE VM feature

2021-03-12 Thread Steven Price
e tags are correctly saved/restored across swap. Actually exposing the new capability to user space happens in a later patch. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_emulate.h | 3 +++ arch/arm64/include/asm/kvm_host.h| 3 +++ arch/arm64/kvm/hyp/exception.c | 3 ++- arch

[PATCH v10 6/6] KVM: arm64: Document MTE capability and ioctl

2021-03-12 Thread Steven Price
mapping in userspace. The above capability gates access to the ioctl. Signed-off-by: Steven Price --- Documentation/virt/kvm/api.rst | 53 ++ 1 file changed, 53 insertions(+) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index

[PATCH v10 4/6] arm64: kvm: Expose KVM_ARM_CAP_MTE

2021-03-12 Thread Steven Price
It's now safe for the VMM to enable MTE in a guest, so expose the capability to user space. Signed-off-by: Steven Price --- arch/arm64/kvm/arm.c | 9 + arch/arm64/kvm/sys_regs.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/

[PATCH v10 0/6] MTE support for KVM guest

2021-03-12 Thread Steven Price
r now). * Correctly hold slots_lock during the ioctl (rather than embarrassingly not do any locking as before...). * Add the structure definition to the documentation and some improvements suggested by Peter. [1] https://lore.kernel.org/r/20210301142315.30920-1-steven.price%40arm.com Steven Pri

[PATCH v10 3/6] arm64: kvm: Save/restore MTE registers

2021-03-12 Thread Steven Price
Define the new system registers that MTE introduces and context switch them. The MTE feature is still hidden from the ID register as it isn't supported in a VM yet. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_host.h | 6 ++ arch/arm64/include/asm/kvm_

Re: [PATCH v12 4/8] arm64: kvm: Introduce MTE VM feature

2021-05-20 Thread Steven Price
On 20/05/2021 09:51, Marc Zyngier wrote: > On Wed, 19 May 2021 11:48:21 +0100, > Steven Price wrote: >> >> On 17/05/2021 17:45, Marc Zyngier wrote: >>> On Mon, 17 May 2021 13:32:35 +0100, >>> Steven Price wrote: [...] >>>>

Re: [PATCH v12 4/8] arm64: kvm: Introduce MTE VM feature

2021-05-20 Thread Steven Price
On 20/05/2021 12:54, Catalin Marinas wrote: > On Mon, May 17, 2021 at 01:32:35PM +0100, Steven Price wrote: >> diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c >> index c5d1f3c87dbd..8660f6a03f51 100644 >> --- a/arch/arm64/kvm/mmu.c >> +++ b/arch/arm64/kvm

Re: [PATCH v12 5/8] arm64: kvm: Save/restore MTE registers

2021-05-20 Thread Steven Price
On 20/05/2021 10:46, Marc Zyngier wrote: > On Wed, 19 May 2021 14:04:20 +0100, > Steven Price wrote: >> >> On 17/05/2021 18:17, Marc Zyngier wrote: >>> On Mon, 17 May 2021 13:32:36 +0100, >>> Steven Price wrote: >>>> >>>> Define the

Re: [PATCH v12 7/8] KVM: arm64: ioctl to fetch/store tags in a guest

2021-05-20 Thread Steven Price
On 20/05/2021 13:05, Catalin Marinas wrote: > On Mon, May 17, 2021 at 01:32:38PM +0100, Steven Price wrote: >> diff --git a/arch/arm64/include/uapi/asm/kvm.h >> b/arch/arm64/include/uapi/asm/kvm.h >> index 24223adae150..b3edde68bc3e 100644 >> --- a/arch/arm64/include/u

Re: [PATCH v12 4/8] arm64: kvm: Introduce MTE VM feature

2021-05-21 Thread Steven Price
On 20/05/2021 18:50, Catalin Marinas wrote: > On Thu, May 20, 2021 at 04:05:46PM +0100, Steven Price wrote: >> On 20/05/2021 12:54, Catalin Marinas wrote: >>> On Mon, May 17, 2021 at 01:32:35PM +0100, Steven Price wrote: >>>> diff --git a/arch/arm64/kvm/mmu.c b/a

Re: [PATCH v12 7/8] KVM: arm64: ioctl to fetch/store tags in a guest

2021-05-21 Thread Steven Price
On 20/05/2021 18:27, Catalin Marinas wrote: > On Thu, May 20, 2021 at 04:58:01PM +0100, Steven Price wrote: >> On 20/05/2021 13:05, Catalin Marinas wrote: >>> On Mon, May 17, 2021 at 01:32:38PM +0100, Steven Price wrote: >>>> diff --git a/arch/arm64/kvm/arm.c b/a

[PATCH v13 0/8] MTE support for KVM guest

2021-05-24 Thread Steven Price
PAGE_SIZE / MTE_GRANULE_SIZE. * Correct the definition of struct kvm_arm_copy_mte_tags in the docs. Also avoid mentioning MTE_GRANULE_SIZE as it isn't exported to userspace. [1] https://lore.kernel.org/r/20210517123239.8025-1-steven.pr...@arm.com/ Catalin Marinas (1): arm64: Handl

[PATCH v13 1/8] arm64: mte: Handle race when synchronising tags

2021-05-24 Thread Steven Price
g the process. Instead implement a new (global) spinlock to protect the mte_sync_page_tags() function. Fixes: 34bfeea4a9e9 ("arm64: mte: Clear the tags when a page is mapped in user-space with PROT_MTE") Reviewed-by: Catalin Marinas Signed-off-by: Steven Price --- --- arch/arm64/ke

[PATCH v13 8/8] KVM: arm64: Document MTE capability and ioctl

2021-05-24 Thread Steven Price
mapping in userspace. The above capability gates access to the ioctl. Signed-off-by: Steven Price --- Documentation/virt/kvm/api.rst | 52 ++ 1 file changed, 52 insertions(+) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index

[PATCH v13 2/8] arm64: Handle MTE tags zeroing in __alloc_zeroed_user_highpage()

2021-05-24 Thread Steven Price
the page tags on allocation in __alloc_zeroed_user_highpage() if the vma flags have VM_MTE set. Signed-off-by: Catalin Marinas Signed-off-by: Steven Price --- arch/arm64/include/asm/page.h | 6 -- arch/arm64/mm/fault.c | 21 + 2 files changed, 25 insertions(+)

[PATCH v13 3/8] arm64: mte: Sync tags for pages where PTE is untagged

2021-05-24 Thread Steven Price
e will not have been swapped out. Signed-off-by: Steven Price --- arch/arm64/include/asm/mte.h | 4 ++-- arch/arm64/include/asm/pgtable.h | 22 +++--- arch/arm64/kernel/mte.c | 16 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/

[PATCH v13 4/8] KVM: arm64: Introduce MTE VM feature

2021-05-24 Thread Steven Price
e tags are correctly saved/restored across swap. Actually exposing the new capability to user space happens in a later patch. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_emulate.h | 3 ++ arch/arm64/include/asm/kvm_host.h| 3 ++ arch/arm64/kvm/hyp/exception.c | 3 +- arch

[PATCH v13 6/8] KVM: arm64: Expose KVM_ARM_CAP_MTE

2021-05-24 Thread Steven Price
It's now safe for the VMM to enable MTE in a guest, so expose the capability to user space. Signed-off-by: Steven Price --- arch/arm64/kvm/arm.c | 9 + arch/arm64/kvm/reset.c| 3 ++- arch/arm64/kvm/sys_regs.c | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff

[PATCH v13 5/8] KVM: arm64: Save/restore MTE registers

2021-05-24 Thread Steven Price
Define the new system registers that MTE introduces and context switch them. The MTE feature is still hidden from the ID register as it isn't supported in a VM yet. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_host.h | 6 ++ arch/arm64/include/asm/kvm_

[PATCH v13 7/8] KVM: arm64: ioctl to fetch/store tags in a guest

2021-05-24 Thread Steven Price
the VMM to easily read/write the tags from guest memory, allowing the VMM's mapping to be non-PROT_MTE while the VMM can still read/write the tags for the purpose of migration. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_host.h | 3 ++ arch/arm64/include/asm/mte-def.h |

Re: [PATCH v12 7/8] KVM: arm64: ioctl to fetch/store tags in a guest

2021-05-27 Thread Steven Price
On 24/05/2021 19:11, Catalin Marinas wrote: > On Fri, May 21, 2021 at 10:42:09AM +0100, Steven Price wrote: >> On 20/05/2021 18:27, Catalin Marinas wrote: >>> On Thu, May 20, 2021 at 04:58:01PM +0100, Steven Price wrote: >>>> On 20/05/2021 13:05, Catalin Marinas wro

Re: [PATCH v9 2/6] arm64: kvm: Introduce MTE VM feature

2021-03-10 Thread Steven Price
On 09/03/2021 17:06, Marc Zyngier wrote: On Mon, 01 Mar 2021 14:23:11 +, Steven Price wrote: Add a new VM feature 'KVM_ARM_CAP_MTE' which enables memory tagging for a VM. This will expose the feature to the guest and automatically tag memory pages touched by the VM as PG_mte_t

Re: [PATCH v9 3/6] arm64: kvm: Save/restore MTE registers

2021-03-10 Thread Steven Price
On 09/03/2021 17:27, Marc Zyngier wrote: On Mon, 01 Mar 2021 14:23:12 +, Steven Price wrote: Define the new system registers that MTE introduces and context switch them. The MTE feature is still hidden from the ID register as it isn't supported in a VM yet. Signed-off-by: Steven

Re: [PATCH v9 5/6] KVM: arm64: ioctl to fetch/store tags in a guest

2021-03-10 Thread Steven Price
On 09/03/2021 17:57, Marc Zyngier wrote: On Mon, 01 Mar 2021 14:23:14 +, Steven Price wrote: The VMM may not wish to have it's own mapping of guest memory mapped with PROT_MTE because this causes problems if the VMM has tag checking enabled (the guest controls the tags in physical RA

Re: [PATCH v11 2/6] arm64: kvm: Introduce MTE VM feature

2021-05-13 Thread Steven Price
On 12/05/2021 18:45, Catalin Marinas wrote: > On Wed, May 12, 2021 at 04:46:48PM +0100, Steven Price wrote: >> On 10/05/2021 19:35, Catalin Marinas wrote: >>> On Fri, May 07, 2021 at 07:25:39PM +0100, Catalin Marinas wrote: >>>> On Thu, May 06, 2021 at 05:15:

[PATCH v12 0/8] MTE support for KVM guest

2021-05-17 Thread Steven Price
andle MTE tags zeroing in __alloc_zeroed_user_highpage() Steven Price (7): arm64: mte: Handle race when synchronising tags arm64: mte: Sync tags for pages where PTE is untagged arm64: kvm: Introduce MTE VM feature arm64: kvm: Save/restore MTE registers arm64: kvm: Expose KVM_ARM_CAP_MTE KVM: arm64: ioctl

[PATCH v12 4/8] arm64: kvm: Introduce MTE VM feature

2021-05-17 Thread Steven Price
e tags are correctly saved/restored across swap. Actually exposing the new capability to user space happens in a later patch. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_emulate.h | 3 +++ arch/arm64/include/asm/kvm_host.h| 3 +++ arch/arm64/kvm/hyp/exception.c | 3 ++- arch

[PATCH v12 1/8] arm64: mte: Handle race when synchronising tags

2021-05-17 Thread Steven Price
g the process. Instead implement a new (global) spinlock to protect the mte_sync_page_tags() function. Fixes: 34bfeea4a9e9 ("arm64: mte: Clear the tags when a page is mapped in user-space with PROT_MTE") Signed-off-by: Steven Price --- --- arch/arm64/kernel/mte.c | 21 ++

[PATCH v12 2/8] arm64: Handle MTE tags zeroing in __alloc_zeroed_user_highpage()

2021-05-17 Thread Steven Price
the page tags on allocation in __alloc_zeroed_user_highpage() if the vma flags have VM_MTE set. Signed-off-by: Catalin Marinas Signed-off-by: Steven Price --- arch/arm64/include/asm/page.h | 6 -- arch/arm64/mm/fault.c | 21 + 2 files changed, 25 insertions(+)

[PATCH v12 5/8] arm64: kvm: Save/restore MTE registers

2021-05-17 Thread Steven Price
Define the new system registers that MTE introduces and context switch them. The MTE feature is still hidden from the ID register as it isn't supported in a VM yet. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_host.h | 6 ++ arch/arm64/include/asm/kvm_

[PATCH v12 3/8] arm64: mte: Sync tags for pages where PTE is untagged

2021-05-17 Thread Steven Price
e will not have been swapped out. Signed-off-by: Steven Price --- arch/arm64/include/asm/pgtable.h | 9 +++-- arch/arm64/kernel/mte.c | 16 ++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm

[PATCH v12 8/8] KVM: arm64: Document MTE capability and ioctl

2021-05-17 Thread Steven Price
mapping in userspace. The above capability gates access to the ioctl. Signed-off-by: Steven Price --- Documentation/virt/kvm/api.rst | 53 ++ 1 file changed, 53 insertions(+) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index

[PATCH v12 6/8] arm64: kvm: Expose KVM_ARM_CAP_MTE

2021-05-17 Thread Steven Price
It's now safe for the VMM to enable MTE in a guest, so expose the capability to user space. Signed-off-by: Steven Price --- arch/arm64/kvm/arm.c | 9 + arch/arm64/kvm/sys_regs.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/

[PATCH v12 7/8] KVM: arm64: ioctl to fetch/store tags in a guest

2021-05-17 Thread Steven Price
the VMM to easily read/write the tags from guest memory, allowing the VMM's mapping to be non-PROT_MTE while the VMM can still read/write the tags for the purpose of migration. Signed-off-by: Steven Price --- arch/arm64/include/uapi/asm/kvm.h | 11 + arch/arm64/kvm/arm.c

Re: [PATCH v12 1/8] arm64: mte: Handle race when synchronising tags

2021-05-17 Thread Steven Price
On 17/05/2021 15:03, Marc Zyngier wrote: > Hi Steven, Hi Marc, > On Mon, 17 May 2021 13:32:32 +0100, > Steven Price wrote: >> >> mte_sync_tags() used test_and_set_bit() to set the PG_mte_tagged flag >> before restoring/zeroing the MTE tags. However if another thread

Re: [PATCH v12 3/8] arm64: mte: Sync tags for pages where PTE is untagged

2021-05-19 Thread Steven Price
On 17/05/2021 17:14, Marc Zyngier wrote: > On Mon, 17 May 2021 13:32:34 +0100, > Steven Price wrote: >> >> A KVM guest could store tags in a page even if the VMM hasn't mapped >> the page with PROT_MTE. So when restoring pages from swap we will >> need to check

Re: [PATCH v12 4/8] arm64: kvm: Introduce MTE VM feature

2021-05-19 Thread Steven Price
On 17/05/2021 17:45, Marc Zyngier wrote: > On Mon, 17 May 2021 13:32:35 +0100, > Steven Price wrote: >> >> Add a new VM feature 'KVM_ARM_CAP_MTE' which enables memory tagging >> for a VM. This will expose the feature to the guest and automatically >&g

Re: [PATCH v12 5/8] arm64: kvm: Save/restore MTE registers

2021-05-19 Thread Steven Price
On 17/05/2021 18:17, Marc Zyngier wrote: > On Mon, 17 May 2021 13:32:36 +0100, > Steven Price wrote: >> >> Define the new system registers that MTE introduces and context switch >> them. The MTE feature is still hidden from the ID register as it isn't >> support

Re: [PATCH v12 6/8] arm64: kvm: Expose KVM_ARM_CAP_MTE

2021-05-19 Thread Steven Price
On 17/05/2021 18:40, Marc Zyngier wrote: > On Mon, 17 May 2021 13:32:37 +0100, > Steven Price wrote: >> >> It's now safe for the VMM to enable MTE in a guest, so expose the >> capability to user space. >> >> Signed-off-by: Steven Price >> --- >&

Re: [PATCH v12 7/8] KVM: arm64: ioctl to fetch/store tags in a guest

2021-05-19 Thread Steven Price
On 17/05/2021 19:04, Marc Zyngier wrote: > On Mon, 17 May 2021 13:32:38 +0100, > Steven Price wrote: >> >> The VMM may not wish to have it's own mapping of guest memory mapped >> with PROT_MTE because this causes problems if the VMM has tag checking >> enab

Re: [PATCH v12 8/8] KVM: arm64: Document MTE capability and ioctl

2021-05-19 Thread Steven Price
On 17/05/2021 19:09, Marc Zyngier wrote: > On Mon, 17 May 2021 13:32:39 +0100, > Steven Price wrote: >> >> A new capability (KVM_CAP_ARM_MTE) identifies that the kernel supports >> granting a guest access to the tags, and provides a mechanism for the >> VMM t

Re: [PATCH v12 6/8] arm64: kvm: Expose KVM_ARM_CAP_MTE

2021-05-20 Thread Steven Price
On 20/05/2021 11:09, Marc Zyngier wrote: > On Wed, 19 May 2021 14:26:31 +0100, > Steven Price wrote: >> >> On 17/05/2021 18:40, Marc Zyngier wrote: >>> On Mon, 17 May 2021 13:32:37 +0100, >>> Steven Price wrote: >>>> >>>> It&#x

Re: [PATCH v12 8/8] KVM: arm64: Document MTE capability and ioctl

2021-05-20 Thread Steven Price
On 20/05/2021 11:24, Marc Zyngier wrote: > On Wed, 19 May 2021 15:09:23 +0100, > Steven Price wrote: >> >> On 17/05/2021 19:09, Marc Zyngier wrote: >>> On Mon, 17 May 2021 13:32:39 +0100, >>> Steven Price wrote: [...]>>>> +bytes (i.e. 1/16th

Re: [PATCH v12 3/8] arm64: mte: Sync tags for pages where PTE is untagged

2021-05-20 Thread Steven Price
On 19/05/2021 19:06, Catalin Marinas wrote: > On Mon, May 17, 2021 at 01:32:34PM +0100, Steven Price wrote: >> A KVM guest could store tags in a page even if the VMM hasn't mapped >> the page with PROT_MTE. So when restoring pages from swap we will >> need to check to

Re: [PATCH v12 3/8] arm64: mte: Sync tags for pages where PTE is untagged

2021-05-20 Thread Steven Price
On 20/05/2021 13:25, Catalin Marinas wrote: > On Thu, May 20, 2021 at 12:55:21PM +0100, Steven Price wrote: >> On 19/05/2021 19:06, Catalin Marinas wrote: >>> On Mon, May 17, 2021 at 01:32:34PM +0100, Steven Price wrote: >>>> A KVM guest could store tags in a page

[PATCH v11 0/6] MTE support for KVM guest

2021-04-16 Thread Steven Price
g/r/20210312151902.17853-1-steven.price%40arm.com Steven Price (6): arm64: mte: Sync tags for pages where PTE is untagged arm64: kvm: Introduce MTE VM feature arm64: kvm: Save/restore MTE registers arm64: kvm: Expose KVM_ARM_CAP_MTE KVM: arm64: ioctl to fetch/store tags in a guest KVM: a

[PATCH v11 4/6] arm64: kvm: Expose KVM_ARM_CAP_MTE

2021-04-16 Thread Steven Price
It's now safe for the VMM to enable MTE in a guest, so expose the capability to user space. Signed-off-by: Steven Price --- arch/arm64/kvm/arm.c | 9 + arch/arm64/kvm/sys_regs.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/

[PATCH v11 5/6] KVM: arm64: ioctl to fetch/store tags in a guest

2021-04-16 Thread Steven Price
the VMM to easily read/write the tags from guest memory, allowing the VMM's mapping to be non-PROT_MTE while the VMM can still read/write the tags for the purpose of migration. Signed-off-by: Steven Price --- arch/arm64/include/uapi/asm/kvm.h | 14 +++ arch/arm64/kvm/arm.c

[PATCH v11 1/6] arm64: mte: Sync tags for pages where PTE is untagged

2021-04-16 Thread Steven Price
en swapped out. Signed-off-by: Steven Price --- arch/arm64/include/asm/pgtable.h | 2 +- arch/arm64/kernel/mte.c | 16 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index e1

[PATCH v11 6/6] KVM: arm64: Document MTE capability and ioctl

2021-04-16 Thread Steven Price
mapping in userspace. The above capability gates access to the ioctl. Signed-off-by: Steven Price --- Documentation/virt/kvm/api.rst | 53 ++ 1 file changed, 53 insertions(+) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index

[PATCH v11 2/6] arm64: kvm: Introduce MTE VM feature

2021-04-16 Thread Steven Price
e tags are correctly saved/restored across swap. Actually exposing the new capability to user space happens in a later patch. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_emulate.h | 3 +++ arch/arm64/include/asm/kvm_host.h| 3 +++ arch/arm64/kvm/hyp/exception.c | 3 ++- arch

[PATCH v11 3/6] arm64: kvm: Save/restore MTE registers

2021-04-16 Thread Steven Price
Define the new system registers that MTE introduces and context switch them. The MTE feature is still hidden from the ID register as it isn't supported in a VM yet. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_host.h | 6 ++ arch/arm64/include/asm/kvm_

Re: [PATCH v11 1/6] arm64: mte: Sync tags for pages where PTE is untagged

2021-04-29 Thread Steven Price
On 27/04/2021 18:43, Catalin Marinas wrote: On Fri, Apr 16, 2021 at 04:43:04PM +0100, Steven Price wrote: A KVM guest could store tags in a page even if the VMM hasn't mapped the page with PROT_MTE. So when restoring pages from swap we will need to check to see if there are any saved tags

Re: [PATCH v11 5/6] KVM: arm64: ioctl to fetch/store tags in a guest

2021-04-29 Thread Steven Price
On 27/04/2021 18:58, Catalin Marinas wrote: On Fri, Apr 16, 2021 at 04:43:08PM +0100, Steven Price wrote: diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h index 24223adae150..2b85a047c37d 100644 --- a/arch/arm64/include/uapi/asm/kvm.h +++ b/arch/arm64/include

Re: [PATCH v11 2/6] arm64: kvm: Introduce MTE VM feature

2021-04-29 Thread Steven Price
On 28/04/2021 18:07, Catalin Marinas wrote: On Fri, Apr 16, 2021 at 04:43:05PM +0100, Steven Price wrote: diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c index 77cb2d28f2a4..5f8e165ea053 100644 --- a/arch/arm64/kvm/mmu.c +++ b/arch/arm64/kvm/mmu.c @@ -879,6 +879,26 @@ static int

[PATCH v9 0/6] MTE support for KVM guest

2021-03-01 Thread Steven Price
documentation patch [1] https://lore.kernel.org/r/20210205135803.48321-1-steven.pr...@arm.com/ Steven Price (6): arm64: mte: Sync tags for pages where PTE is untagged arm64: kvm: Introduce MTE VM feature arm64: kvm: Save/restore MTE registers arm64: kvm: Expose KVM_ARM_CAP_MTE KVM: arm64: ioctl to

[PATCH v9 1/6] arm64: mte: Sync tags for pages where PTE is untagged

2021-03-01 Thread Steven Price
en swapped out. Signed-off-by: Steven Price --- arch/arm64/include/asm/pgtable.h | 2 +- arch/arm64/kernel/mte.c | 16 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index e1

[PATCH v9 3/6] arm64: kvm: Save/restore MTE registers

2021-03-01 Thread Steven Price
Define the new system registers that MTE introduces and context switch them. The MTE feature is still hidden from the ID register as it isn't supported in a VM yet. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_host.h | 6 ++ arch/arm64/include/asm/kvm_

[PATCH v9 5/6] KVM: arm64: ioctl to fetch/store tags in a guest

2021-03-01 Thread Steven Price
the VMM to easily read/write the tags from guest memory, allowing the VMM's mapping to be non-PROT_MTE while the VMM can still read/write the tags for the purpose of migration. Signed-off-by: Steven Price --- arch/arm64/include/uapi/asm/kvm.h | 13 +++ arch/arm64/kvm/arm.c

[PATCH v9 2/6] arm64: kvm: Introduce MTE VM feature

2021-03-01 Thread Steven Price
e tags are correctly saved/restored across swap. Actually exposing the new capability to user space happens in a later patch. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_emulate.h | 3 +++ arch/arm64/include/asm/kvm_host.h| 3 +++ arch/arm64/kvm/hyp/exception.c | 3 ++- arch

[PATCH v9 4/6] arm64: kvm: Expose KVM_ARM_CAP_MTE

2021-03-01 Thread Steven Price
It's now safe for the VMM to enable MTE in a guest, so expose the capability to user space. Signed-off-by: Steven Price --- arch/arm64/kvm/arm.c | 9 + arch/arm64/kvm/sys_regs.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/

[PATCH v9 6/6] KVM: arm64: Document MTE capability and ioctl

2021-03-01 Thread Steven Price
mapping in userspace. The above capability gates access to the ioctl. Signed-off-by: Steven Price --- Documentation/virt/kvm/api.rst | 37 ++ 1 file changed, 37 insertions(+) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index

Re: [PATCH v7 1/3] arm64: kvm: Save/restore MTE registers

2021-02-04 Thread Steven Price
On 02/02/2021 15:36, Marc Zyngier wrote: On 2021-01-15 15:28, Steven Price wrote: Define the new system registers that MTE introduces and context switch them. The MTE feature is still hidden from the ID register as it isn't supported in a VM yet. Signed-off-by: Steven Price ---  arch/

Re: [PATCH v7 2/3] arm64: kvm: Introduce MTE VCPU feature

2021-02-04 Thread Steven Price
On 02/02/2021 17:12, Marc Zyngier wrote: On 2021-01-15 15:28, Steven Price wrote: Add a new VM feature 'KVM_ARM_CAP_MTE' which enables memory tagging for a VM. This exposes the feature to the guest and automatically tags memory pages touched by the VM as PG_mte_tagged (and clear

[PATCH v8 1/5] arm64: mte: Sync tags for pages where PTE is untagged

2021-02-05 Thread Steven Price
en swapped out. Signed-off-by: Steven Price --- arch/arm64/include/asm/pgtable.h | 2 +- arch/arm64/kernel/mte.c | 16 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 50

[PATCH v8 0/5] MTE support for KVM guest

2021-02-05 Thread Steven Price
[1] https://lore.kernel.org/r/20210115152811.8398-1-steven.price%40arm.com Steven Price (5): arm64: mte: Sync tags for pages where PTE is untagged arm64: kvm: Introduce MTE VM feature arm64: kvm: Save/restore MTE registers arm64: kvm: Expose KVM_ARM_CAP_MTE KVM: arm64: ioctl to fetch/store

[PATCH v8 3/5] arm64: kvm: Save/restore MTE registers

2021-02-05 Thread Steven Price
Define the new system registers that MTE introduces and context switch them. The MTE feature is still hidden from the ID register as it isn't supported in a VM yet. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_host.h | 6 ++ arch/arm64/include/asm/kvm_

[PATCH v8 4/5] arm64: kvm: Expose KVM_ARM_CAP_MTE

2021-02-05 Thread Steven Price
It's now safe for the VMM to enable MTE in a guest, so expose the capability to user space. Signed-off-by: Steven Price --- arch/arm64/kvm/arm.c | 9 + arch/arm64/kvm/sys_regs.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/

[PATCH v8 2/5] arm64: kvm: Introduce MTE VM feature

2021-02-05 Thread Steven Price
e tags are correctly saved/restored across swap. Actually exposing the new capability to user space happens in a later patch. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_emulate.h | 3 +++ arch/arm64/include/asm/kvm_host.h| 3 +++ arch/arm64/kvm/hyp/exception.c | 3 ++- arch

[RFC PATCH v8 5/5] KVM: arm64: ioctl to fetch/store tags in a guest

2021-02-05 Thread Steven Price
the VMM to easily read/write the tags from guest memory, allowing the VMM's mapping to be non-PROT_MTE while the VMM can still read/write the tags for the purpose of migration. Signed-off-by: Steven Price --- arch/arm64/include/uapi/asm/kvm.h | 13 +++ arch/arm64/kvm/arm.c

[PATCH v4 1/2] arm64: kvm: Save/restore MTE registers

2020-10-26 Thread Steven Price
Define the new system registers that MTE introduces and context switch them. The MTE feature is still hidden from the ID register as it isn't supported in a VM yet. Signed-off-by: Steven Price Reviewed-by: Andrew Jones --- arch/arm64/include/asm/kvm_host.h | 4 arch/

[PATCH v4 0/2] MTE support for KVM guest

2020-10-26 Thread Steven Price
er we want to expose the KVM_CAP before everything is ready. 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 | 7 +++ arch/arm64/include/as

[PATCH v4 2/2] arm64: kvm: Introduce MTE VCPU feature

2020-10-26 Thread Steven Price
e tags are correctly saved/restored across swap. Signed-off-by: Steven Price Reviewed-by: Andrew Jones --- arch/arm64/include/asm/kvm_emulate.h | 3 +++ arch/arm64/include/asm/kvm_host.h| 3 +++ arch/arm64/kvm/arm.c | 9 + arch/arm64/kvm/mmu.c

Re: [PATCH v6 0/2] MTE support for KVM guest

2020-12-03 Thread Steven Price
On 03/12/2020 16:09, Mark Rutland wrote: On Fri, Nov 27, 2020 at 03:21:11PM +, Steven Price wrote: It's been a week, and I think the comments on v5 made it clear that enforcing PROT_MTE requirements on the VMM was probably the wrong approach. So since I've got swap working correct

Re: [PATCH v5 0/2] MTE support for KVM guest

2020-12-07 Thread Steven Price
On 04/12/2020 08:25, Haibo Xu wrote: On Fri, 20 Nov 2020 at 17:51, Steven Price wrote: On 19/11/2020 19:11, Marc Zyngier wrote: On 2020-11-19 18:42, Andrew Jones wrote: On Thu, Nov 19, 2020 at 03:45:40PM +, Peter Maydell wrote: On Thu, 19 Nov 2020 at 15:39, Steven Price wrote: This

Re: [PATCH v6 1/2] arm64: kvm: Save/restore MTE registers

2020-12-07 Thread Steven Price
On 03/12/2020 17:07, Marc Zyngier wrote: diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index e2ef4c2edf06..b6668ffa04d9 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -569,7 +569,8 @@  #define SCTLR_ELx_M    (BIT(0))  #de

Re: [PATCH v5 0/2] MTE support for KVM guest

2020-12-07 Thread Steven Price
On 07/12/2020 15:27, Peter Maydell wrote: On Mon, 7 Dec 2020 at 14:48, Steven Price wrote: Sounds like you are making good progress - thanks for the update. Have you thought about how the PROT_MTE mappings might work if QEMU itself were to use MTE? My worry is that we end up with MTE in a

Re: [RFC PATCH v8 5/5] KVM: arm64: ioctl to fetch/store tags in a guest

2021-02-10 Thread Steven Price
On 08/02/2021 17:31, Peter Maydell wrote: On Fri, 5 Feb 2021 at 13:58, Steven Price wrote: The VMM may not wish to have it's own mapping of guest memory mapped with PROT_MTE because this causes problems if the VMM has tag checking enabled (the guest controls the tags in physical RAM and

Re: [PATCH v4 2/2] arm64: kvm: Introduce MTE VCPU feature

2020-11-20 Thread Steven Price
On 19/11/2020 16:24, Catalin Marinas wrote: On Thu, Nov 19, 2020 at 12:45:52PM +, Steven Price wrote: On 18/11/2020 17:05, Andrew Jones wrote: On Wed, Nov 18, 2020 at 04:50:01PM +, Catalin Marinas wrote: On Wed, Nov 18, 2020 at 04:01:20PM +, Steven Price wrote: On 17/11/2020 16

Re: [PATCH v5 0/2] MTE support for KVM guest

2020-11-20 Thread Steven Price
On 19/11/2020 19:11, Marc Zyngier wrote: On 2020-11-19 18:42, Andrew Jones wrote: On Thu, Nov 19, 2020 at 03:45:40PM +, Peter Maydell wrote: On Thu, 19 Nov 2020 at 15:39, Steven Price wrote: > This series adds support for Arm's Memory Tagging Extension (MTE) to > KVM, allowing

  1   2   >