All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Android Kernel Team <kernel-team@android.com>,
	kvmarm <kvmarm@lists.cs.columbia.edu>
Subject: Re: [PATCH v2 2/2] KVM: arm64: Workaround firmware wrongly advertising GICv2-on-v3 compatibility
Date: Fri, 15 Jan 2021 14:15:20 +0000	[thread overview]
Message-ID: <67c2f61a5dd33731cf52b6e26095ed51@kernel.org> (raw)
In-Reply-To: <CAMj1kXHEMpypq54Vxr+JgL9b_zoj_y2azK3mgAhXhnXO6Bhygw@mail.gmail.com>

On 2021-01-15 14:08, Ard Biesheuvel wrote:
> On Fri, 15 Jan 2021 at 15:03, Marc Zyngier <maz@kernel.org> wrote:

[...]

>> diff --git a/arch/arm64/kvm/vgic/vgic-v3.c 
>> b/arch/arm64/kvm/vgic/vgic-v3.c
>> index 8e7bf3151057..67b27b47312b 100644
>> --- a/arch/arm64/kvm/vgic/vgic-v3.c
>> +++ b/arch/arm64/kvm/vgic/vgic-v3.c
>> @@ -584,8 +584,10 @@ early_param("kvm-arm.vgic_v4_enable", 
>> early_gicv4_enable);
>>  int vgic_v3_probe(const struct gic_kvm_info *info)
>>  {
>>         u64 ich_vtr_el2 = kvm_call_hyp_ret(__vgic_v3_get_gic_config);
>> +       bool has_v2;
>>         int ret;
>> 
>> +       has_v2 = ich_vtr_el2 >> 63;
>>         ich_vtr_el2 = (u32)ich_vtr_el2;
>> 
>>         /*
>> @@ -605,13 +607,15 @@ int vgic_v3_probe(const struct gic_kvm_info 
>> *info)
>>                          gicv4_enable ? "en" : "dis");
>>         }
>> 
>> +       kvm_vgic_global_state.vcpu_base = 0;
>> +
>>         if (!info->vcpu.start) {
>>                 kvm_info("GICv3: no GICV resource entry\n");
>> -               kvm_vgic_global_state.vcpu_base = 0;
>> +       } else if (!has_v2) {
>> +               pr_warn("CPU interface incapable of MMIO access\n");
> 
> Could we include FW_BUG here to stress that this is a firmware problem?

Absolutely! That's what it now looks like:

[    2.648452] kvm [1]: IPA Size Limit: 40 bits
[    2.649259] [Firmware Bug]: CPU interface incapable of MMIO access
[    2.649620] kvm [1]: disabling GICv2 emulation
[    2.650227] kvm [1]: GIC system register CPU interface enabled
[    2.652004] kvm [1]: vgic interrupt IRQ9
[    2.655623] kvm [1]: VHE mode initialized successfully

Updated version pushed out.

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
	Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>,
	James Morse <james.morse@arm.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Android Kernel Team <kernel-team@android.com>,
	kvmarm <kvmarm@lists.cs.columbia.edu>,
	Julien Thierry <julien.thierry.kdev@gmail.com>
Subject: Re: [PATCH v2 2/2] KVM: arm64: Workaround firmware wrongly advertising GICv2-on-v3 compatibility
Date: Fri, 15 Jan 2021 14:15:20 +0000	[thread overview]
Message-ID: <67c2f61a5dd33731cf52b6e26095ed51@kernel.org> (raw)
In-Reply-To: <CAMj1kXHEMpypq54Vxr+JgL9b_zoj_y2azK3mgAhXhnXO6Bhygw@mail.gmail.com>

On 2021-01-15 14:08, Ard Biesheuvel wrote:
> On Fri, 15 Jan 2021 at 15:03, Marc Zyngier <maz@kernel.org> wrote:

[...]

>> diff --git a/arch/arm64/kvm/vgic/vgic-v3.c 
>> b/arch/arm64/kvm/vgic/vgic-v3.c
>> index 8e7bf3151057..67b27b47312b 100644
>> --- a/arch/arm64/kvm/vgic/vgic-v3.c
>> +++ b/arch/arm64/kvm/vgic/vgic-v3.c
>> @@ -584,8 +584,10 @@ early_param("kvm-arm.vgic_v4_enable", 
>> early_gicv4_enable);
>>  int vgic_v3_probe(const struct gic_kvm_info *info)
>>  {
>>         u64 ich_vtr_el2 = kvm_call_hyp_ret(__vgic_v3_get_gic_config);
>> +       bool has_v2;
>>         int ret;
>> 
>> +       has_v2 = ich_vtr_el2 >> 63;
>>         ich_vtr_el2 = (u32)ich_vtr_el2;
>> 
>>         /*
>> @@ -605,13 +607,15 @@ int vgic_v3_probe(const struct gic_kvm_info 
>> *info)
>>                          gicv4_enable ? "en" : "dis");
>>         }
>> 
>> +       kvm_vgic_global_state.vcpu_base = 0;
>> +
>>         if (!info->vcpu.start) {
>>                 kvm_info("GICv3: no GICV resource entry\n");
>> -               kvm_vgic_global_state.vcpu_base = 0;
>> +       } else if (!has_v2) {
>> +               pr_warn("CPU interface incapable of MMIO access\n");
> 
> Could we include FW_BUG here to stress that this is a firmware problem?

Absolutely! That's what it now looks like:

[    2.648452] kvm [1]: IPA Size Limit: 40 bits
[    2.649259] [Firmware Bug]: CPU interface incapable of MMIO access
[    2.649620] kvm [1]: disabling GICv2 emulation
[    2.650227] kvm [1]: GIC system register CPU interface enabled
[    2.652004] kvm [1]: vgic interrupt IRQ9
[    2.655623] kvm [1]: VHE mode initialized successfully

Updated version pushed out.

Thanks,

         M.
-- 
Jazz is not dead. It just smells funny...

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-01-15 14:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 14:03 [PATCH v2 0/2] KVM: arm64: Work around firmware wongly advertising GICv2 compatibility Marc Zyngier
2021-01-15 14:03 ` Marc Zyngier
2021-01-15 14:03 ` [PATCH v2 1/2] KVM: arm64: Rename __vgic_v3_get_ich_vtr_el2() to __vgic_v3_get_gic_config() Marc Zyngier
2021-01-15 14:03   ` Marc Zyngier
2021-01-15 14:03 ` [PATCH v2 2/2] KVM: arm64: Workaround firmware wrongly advertising GICv2-on-v3 compatibility Marc Zyngier
2021-01-15 14:03   ` Marc Zyngier
2021-01-15 14:08   ` Ard Biesheuvel
2021-01-15 14:08     ` Ard Biesheuvel
2021-01-15 14:15     ` Marc Zyngier [this message]
2021-01-15 14:15       ` Marc Zyngier
2021-01-19 10:09       ` Shameerali Kolothum Thodi
2021-01-19 10:09         ` Shameerali Kolothum Thodi
2021-01-19 10:14         ` Marc Zyngier
2021-01-19 10:14           ` Marc Zyngier

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=67c2f61a5dd33731cf52b6e26095ed51@kernel.org \
    --to=maz@kernel.org \
    --cc=ardb@kernel.org \
    --cc=kernel-team@android.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.