linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gavin Shan <gshan@redhat.com>
To: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oliver.upton@linux.dev>,
	kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	pbonzini@redhat.com, corbet@lwn.net, james.morse@arm.com,
	suzuki.poulose@arm.com, yuzenghui@huawei.com,
	catalin.marinas@arm.com, will@kernel.org, ricarkol@google.com,
	eric.auger@redhat.com, yuzhe@nfschina.com, renzhengeek@gmail.com,
	ardb@kernel.org, peterx@redhat.com, seanjc@google.com,
	shan.gavin@gmail.com
Subject: Re: [PATCH 1/4] KVM: arm64: Allow saving vgic3 LPI pending status in no running vcpu context
Date: Fri, 20 Jan 2023 10:04:50 +1100	[thread overview]
Message-ID: <685ae61a-951f-e611-7491-948f19f1827e@redhat.com> (raw)
In-Reply-To: <86v8l2msqk.wl-maz@kernel.org>

Hi Marc,

On 1/20/23 2:47 AM, Marc Zyngier wrote:
> On Thu, 19 Jan 2023 01:11:44 +0000,
> Gavin Shan <gshan@redhat.com> wrote:
>>
>> I will have vgic_write_guest_lock() in v2. Note that those 3 paths can't be
>> running in parallel since one switch is shared by them. Alternatively, we
>> extend struct vgic_dist::save_tables_in_progress from 'bool' to 'unsigned long'.
>> Several bit is defined for each site as below. In this way, the 3 paths can be
>> running in parallel:
>>
>>    unsigned long struct vgic_dist::save_tables_in_progress
>>
>>    #define VGIC_DIST_SAVE_ITS_ITE		0	/* ITS Translation Entry */
>>    #define VGIC_DIST_SAVE_ITS_DTE		1	/* ITS Device Table Entry */
>>    #define VGIC_DIST_SAVE_ITS_CTE		2	/* ITS Collection Table Entry */
>>    #define VGIC_DIST_SAVE_ITS_CT			3	/* ITS Collection Table */
>>    #define VGIC_DIST_SAVE_VGIC3_LPI		4	/* VGIC3 LPI Pending Status */
>>    #define VGIC_DIST_SAVE_VGIC3_PENDING_TABLE	5	/* VGIC3 Pending Table */
>>
>> The drawback is the calls are limited to 64. If those 3 paths can't be running
>> in parallel, we needn't the extension at all.
> 
> It should all be completely sequential. KVM_DEV_ARM_ITS_SAVE_TABLES
> runs in a context where everything is locked, and so is
> VGIC_DIST_SAVE_VGIC3_PENDING_TABLE.
> 

Thanks for your confirm. Yeah, it's sequential because 'kvm->lock' is
hold on KVM_DEV_ARM_ITS_SAVE_TABLES and VGIC_DIST_SAVE_VGIC3_PENDING_TABLE.
So all good to have one shared switch. v2 will be posted pretty soon.

Thanks,
Gavin


  reply	other threads:[~2023-01-19 23:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-16  4:04 [PATCH 0/4] Improve dirty ring warning report Gavin Shan
2023-01-16  4:04 ` [PATCH 1/4] KVM: arm64: Allow saving vgic3 LPI pending status in no running vcpu context Gavin Shan
2023-01-17 20:51   ` Oliver Upton
2023-01-19  1:11     ` Gavin Shan
2023-01-19 15:47       ` Marc Zyngier
2023-01-19 23:04         ` Gavin Shan [this message]
2023-01-16  4:04 ` [PATCH 2/4] KVM: arm64: Allow saving vgic3 pending tables " Gavin Shan
2023-01-16  4:04 ` [PATCH 3/4] KVM: Refactor mark_page_dirty_in_slot() Gavin Shan
2023-01-16  4:04 ` [PATCH 4/4] KVM: Improve warning report in mark_page_dirty_in_slot() Gavin Shan
2023-01-17 15:42   ` Sean Christopherson
2023-01-19  1:15     ` Gavin Shan
2023-01-19 15:19       ` Sean Christopherson
2023-01-19 23:06         ` Gavin Shan

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=685ae61a-951f-e611-7491-948f19f1827e@redhat.com \
    --to=gshan@redhat.com \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=eric.auger@redhat.com \
    --cc=james.morse@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=renzhengeek@gmail.com \
    --cc=ricarkol@google.com \
    --cc=seanjc@google.com \
    --cc=shan.gavin@gmail.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    --cc=yuzhe@nfschina.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).