Re: [PATCH v2 4/9] KVM: s390: Fix dirty marking in adapter_indicators_set*()

Claudio Imbrenda <[email protected]>
Newsgroups org.kernel.vger.linux-s390,org.kernel.vger.kvm,org.kernel.vger.linux-kernel
Organization IBM
Message-ID <20260812133734.02967d81@p-imbrenda>
On Wed, 12 Aug 2026 13:03:39 +0200
Christian Borntraeger <[email protected]> wrote:

> Am 12.08.26 um 12:44 schrieb Claudio Imbrenda:
> 
> > @@ -3017,26 +3017,30 @@ static int adapter_indicators_set_fast(struct kvm *kvm,
> >   				       struct kvm_s390_adapter_int *adapter_int,
> >   				       int setbit)
> >   {
> > +	struct s390_map_info *ind_info, *summary_info;
> >   	unsigned long bit;
> >   	int summary_set;
> > -	struct s390_map_info *ind_info, *summary_info;
> >   	void *map;
> >   
> > -	spin_lock(&adapter->maps_lock);
> > +	guard(srcu)(&kvm->srcu);
> > +	guard(spinlock)(&adapter->maps_lock);
> > +
> >   	ind_info = get_map_info(adapter, adapter_int->ind_addr);
> > -	if (!ind_info) {
> > -		spin_unlock(&adapter->maps_lock);
> > +	if (!ind_info)
> >   		return -EWOULDBLOCK;
> > -	}
> > +
> >   	map = page_address(ind_info->page);
> >   	bit = get_ind_bit(ind_info->addr, adapter_int->ind_offset, adapter->swap);
> > -	if (setbit)
> > +	if (setbit) {
> > +		mark_page_dirty(kvm, gpa_to_gfn(adapter_int->ind_gaddr));
> > +		set_page_dirty(ind_info->page);
> >   		set_bit(bit, map);
> > +	}  
> 
> This marks the indicator page dirty before writing it.
> The summary twenty lines below does it the other way round and so do both
> slow-path branches.
> The order matters because kvm_get_dirty_log_protect() harvests destructively.

yes, that was a typo, but the patch also has other issues, so I'm
dropping it for now.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.