public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Rosato <mjrosato@linux.ibm.com>
To: Nico Boehr <nrb@linux.ibm.com>,
	borntraeger@linux.ibm.com, frankja@linux.ibm.com,
	imbrenda@linux.ibm.com, farman@linux.ibm.com, david@redhat.com
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH v1 1/1] KVM: s390: pci: fix virtual-physical confusion on module unload/load
Date: Wed, 22 Feb 2023 11:40:31 -0500	[thread overview]
Message-ID: <84e1b18e-cd77-5b5a-abfa-6bf62c23d9ee@linux.ibm.com> (raw)
In-Reply-To: <20230222155503.43399-1-nrb@linux.ibm.com>

On 2/22/23 10:55 AM, Nico Boehr wrote:
> When the kvm module is unloaded, zpci_setup_aipb() perists some data in the
> zpci_aipb structure in s390 pci code. Note that this struct is also passed
> to firmware in the zpci_set_irq_ctrl() call and thus the GAIT must be a
> physical address.
> 
> On module re-insertion, the GAIT is restored from this structure in
> zpci_reset_aipb(). But it is a physical address, hence this may cause
> issues when the kvm module is unloaded and loaded again.
> 
> Fix virtual vs physical address confusion (which currently are the same) by
> adding the necessary physical-to-virtual-conversion in zpci_reset_aipb().
> 
> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>

Yeah, that's right, in fact there is another address also stashed in the zpci_aipb which is also saved as physical addresses since, as you say, this structure is sent to firmware; the GAIT address just happens to be the one we care about at this spot, so I think it makes sense to leave zpci_aipb alone and just convert back to virt in this one place its needed.

Since we're looking at this bit of code, it's also worth noting that the other address restored here (aift->sbv) comes from zpci_aif_sbv which was instead stashed as a virtual address to begin with and that's why it doesn't need similar treatment.

Thanks Nico!

Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>




  parent reply	other threads:[~2023-02-22 16:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22 15:55 [PATCH v1 1/1] KVM: s390: pci: fix virtual-physical confusion on module unload/load Nico Boehr
2023-02-22 15:55 ` [PATCH v1 0/1] " Nico Boehr
2023-02-22 16:40 ` Matthew Rosato [this message]
2023-02-22 16:42 ` [PATCH v1 1/1] " Alexander Gordeev
2023-02-22 17:04   ` Matthew Rosato

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=84e1b18e-cd77-5b5a-abfa-6bf62c23d9ee@linux.ibm.com \
    --to=mjrosato@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nrb@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