public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	David Hildenbrand <david@redhat.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] s390/mm: Fix in_atomic() handling in do_secure_storage_access()
Date: Wed, 4 Jun 2025 19:40:43 +0200	[thread overview]
Message-ID: <20250604194043.0ab9535e@p-imbrenda> (raw)
In-Reply-To: <aECCe9bIZORv+yef@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com>

On Wed, 4 Jun 2025 19:29:31 +0200
Alexander Gordeev <agordeev@linux.ibm.com> wrote:

> On Wed, Jun 04, 2025 at 06:48:55PM +0200, Claudio Imbrenda wrote:
> > > > @@ -441,6 +441,8 @@ void do_secure_storage_access(struct pt_regs *regs)
> > > >  		if (rc)
> > > >  			BUG();
> > > >  	} else {
> > > > +		if (faulthandler_disabled())
> > > > +			return handle_fault_error_nolock(regs, 0);
> > > >    
> > > 
> > > This could trigger WARN_ON_ONCE() in handle_fault_error_nolock():
> > > 
> > > 		if (WARN_ON_ONCE(!si_code))
> > > 			si_code = SEGV_MAPERR;
> > > 
> > > Would this warning be justified in this case (aka user_mode(regs) ==
> > > true)?  
> > 
> > I think so, because if we are in usermode, we should never trigger
> > faulthandler_disabled()  
> 
> I think I do not get you. We are in a system call and also in_atomic(),
> so faulthandler_disabled() is true and handle_fault_error_nolock(regs, 0)
> is called (above).

what is the psw in regs?
is it not the one that was being used when the exception was triggered?

> 
> >   
> > >   
> > > >  		mm = current->mm;
> > > >  		mmap_read_lock(mm);
> > > >  		vma = find_vma(mm, addr);    


  reply	other threads:[~2025-06-04 17:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-03 13:49 [PATCH] s390/mm: Fix in_atomic() handling in do_secure_storage_access() Heiko Carstens
2025-06-04 12:16 ` Claudio Imbrenda
2025-06-04 16:27 ` Alexander Gordeev
2025-06-04 16:48   ` Claudio Imbrenda
2025-06-04 17:29     ` Alexander Gordeev
2025-06-04 17:40       ` Claudio Imbrenda [this message]
2025-06-05  9:04         ` Alexander Gordeev
2025-06-05  9:06           ` Christian Borntraeger
2025-06-05 10:07             ` Heiko Carstens
2025-06-05 10:21               ` Christian Borntraeger

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=20250604194043.0ab9535e@p-imbrenda \
    --to=imbrenda@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=svens@linux.ibm.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