From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Nico Boehr <nrb@linux.ibm.com>
Cc: borntraeger@linux.ibm.com, frankja@linux.ibm.com,
david@redhat.com, mimu@linux.ibm.com, agordeev@linux.ibm.com,
kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH v2 1/1] KVM: s390: interrupt: fix virtual-physical confusion for next alert GISA
Date: Tue, 28 Feb 2023 18:16:33 +0100 [thread overview]
Message-ID: <20230228181633.1bd8efde@p-imbrenda> (raw)
In-Reply-To: <20230224140908.75208-2-nrb@linux.ibm.com>
On Fri, 24 Feb 2023 15:09:08 +0100
Nico Boehr <nrb@linux.ibm.com> wrote:
> The gisa next alert address is defined as a host absolute address so
> let's use virt_to_phys() to make sure we always write an absolute
> address to this hardware structure.
>
> This is not a bug and currently works, because virtual and physical
> addresses are the same.
>
> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
> Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
> ---
> arch/s390/kvm/interrupt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
> index ab26aa53ee37..20743c5b000a 100644
> --- a/arch/s390/kvm/interrupt.c
> +++ b/arch/s390/kvm/interrupt.c
> @@ -305,7 +305,7 @@ static inline u8 gisa_get_ipm_or_restore_iam(struct kvm_s390_gisa_interrupt *gi)
>
> static inline int gisa_in_alert_list(struct kvm_s390_gisa *gisa)
> {
> - return READ_ONCE(gisa->next_alert) != (u32)(u64)gisa;
> + return READ_ONCE(gisa->next_alert) != (u32)virt_to_phys(gisa);
is gisa always allocated below 4G? (I assume 2G actually)
should we check if things are proper?
the cast to (u32) might hide bugs if gisa is above 4G (which it
shouldn't be, obviously)
or do we not care?
> }
>
> static inline void gisa_set_ipm_gisc(struct kvm_s390_gisa *gisa, u32 gisc)
> @@ -3167,7 +3167,7 @@ void kvm_s390_gisa_init(struct kvm *kvm)
> hrtimer_init(&gi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> gi->timer.function = gisa_vcpu_kicker;
> memset(gi->origin, 0, sizeof(struct kvm_s390_gisa));
> - gi->origin->next_alert = (u32)(u64)gi->origin;
> + gi->origin->next_alert = (u32)virt_to_phys(gi->origin);
same here
> VM_EVENT(kvm, 3, "gisa 0x%pK initialized", gi->origin);
> }
>
next prev parent reply other threads:[~2023-02-28 17:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-24 14:09 [PATCH v2 0/1] KVM: s390: interrupt: fix virtual-physical confusion for next alert GISA Nico Boehr
2023-02-24 14:09 ` [PATCH v2 1/1] " Nico Boehr
2023-02-28 17:16 ` Claudio Imbrenda [this message]
2023-03-06 10:50 ` Nico Boehr
2023-03-06 13:24 ` Claudio Imbrenda
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=20230228181633.1bd8efde@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=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mimu@linux.ibm.com \
--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