public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei•com>
To: Stephen Rothwell <sfr@canb•auug.org.au>,
	Christoffer Dall <cdall@cs•columbia.edu>,
	Marc Zyngier <maz@kernel•org>
Cc: Oliver Upton <oliver.upton@linux•dev>,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	Linux Next Mailing List <linux-next@vger•kernel.org>
Subject: RE: linux-next: build failure after merge of the kvm-arm tree
Date: Thu, 6 Mar 2025 09:56:32 +0000	[thread overview]
Message-ID: <6027e05e03474a87826217ee56f12761@huawei.com> (raw)
In-Reply-To: <20250306164614.4ccb2e9d@canb.auug.org.au>



> -----Original Message-----
> From: Stephen Rothwell <sfr@canb•auug.org.au>
> Sent: Thursday, March 6, 2025 5:46 AM
> To: Christoffer Dall <cdall@cs•columbia.edu>; Marc Zyngier
> <maz@kernel•org>
> Cc: Oliver Upton <oliver.upton@linux•dev>; Shameerali Kolothum Thodi
> <shameerali.kolothum.thodi@huawei•com>; Linux Kernel Mailing List
> <linux-kernel@vger•kernel.org>; Linux Next Mailing List <linux-
> next@vger•kernel.org>
> Subject: linux-next: build failure after merge of the kvm-arm tree
> 
> Hi all,
> 
> After merging the kvm-arm tree, today's linux-next build (arm
> multi_v7_defconfig) failed like this:
> 
> drivers/firmware/smccc/kvm_guest.c:58:14: warning: no previous prototype
> for 'kvm_arm_target_impl_cpu_init' [-Wmissing-prototypes]
>    58 | void  __init kvm_arm_target_impl_cpu_init(void)
>       |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/firmware/smccc/kvm_guest.c: In function
> 'kvm_arm_target_impl_cpu_init':
> drivers/firmware/smccc/kvm_guest.c:89:39: error: invalid application of
> 'sizeof' to incomplete type 'struct target_impl_cpu'
>    89 |         target = memblock_alloc(sizeof(*target) * max_cpus,
> __alignof__(*target));
>       |                                       ^
> drivers/firmware/smccc/kvm_guest.c:89:62: error: invalid application of
> '__alignof__' to incomplete type 'struct target_impl_cpu'
>    89 |         target = memblock_alloc(sizeof(*target) * max_cpus,
> __alignof__(*target));
>       |                                                              ^~~~~~~~~~~
> drivers/firmware/smccc/kvm_guest.c:102:23: error: invalid use of undefined
> type 'struct target_impl_cpu'
>   102 |                 target[i].midr = res.a1;
>       |                       ^
> drivers/firmware/smccc/kvm_guest.c:102:26: error: invalid use of undefined
> type 'struct target_impl_cpu'
>   102 |                 target[i].midr = res.a1;
>       |                          ^
> drivers/firmware/smccc/kvm_guest.c:103:23: error: invalid use of undefined
> type 'struct target_impl_cpu'
>   103 |                 target[i].revidr = res.a2;
>       |                       ^
> drivers/firmware/smccc/kvm_guest.c:103:26: error: invalid use of undefined
> type 'struct target_impl_cpu'
>   103 |                 target[i].revidr = res.a2;
>       |                          ^
> drivers/firmware/smccc/kvm_guest.c:104:23: error: invalid use of undefined
> type 'struct target_impl_cpu'
>   104 |                 target[i].aidr = res.a3;
>       |                       ^
> drivers/firmware/smccc/kvm_guest.c:104:26: error: invalid use of undefined
> type 'struct target_impl_cpu'
>   104 |                 target[i].aidr = res.a3;
>       |                          ^
> drivers/firmware/smccc/kvm_guest.c:107:14: error: implicit declaration of
> function 'cpu_errata_set_target_impl' [-Wimplicit-function-declaration]
>   107 |         if (!cpu_errata_set_target_impl(max_cpus, target)) {
>       |              ^~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/firmware/smccc/kvm_guest.c:116:37: error: invalid application of
> 'sizeof' to incomplete type 'struct target_impl_cpu'
>   116 |         memblock_free(target, sizeof(*target) * max_cpus);
>       |                                     ^
> 
> Caused by commit
> 
>   86edf6bdcf05 ("smccc/kvm_guest: Enable errata based on implementation
> CPUs")
> 
> I have used the kvm-arm tree from next-20250305 for today.

Thanks for reporting this.

Hmm..kvm_guest.c gets build through HAVE_ARM_SMCCC_DISCOVERY 
which is selected by ARM_GIC_V3.

We could limit the kvm_arm_target_impl_cpu_init() to ARM64 to fix this
like below as these hypercall is only supported for KVM/ARM64.

Or is there a better way to handle this?

Thanks,
Shameer

---8---
diff --git a/drivers/firmware/smccc/kvm_guest.c
b/drivers/firmware/smccc/kvm_guest.c
index 2f03b582c298..5767aed25cdc 100644
--- a/drivers/firmware/smccc/kvm_guest.c
+++ b/drivers/firmware/smccc/kvm_guest.c
@@ -55,6 +55,7 @@ bool kvm_arm_hyp_service_available(u32 func_id)
 }
 EXPORT_SYMBOL_GPL(kvm_arm_hyp_service_available);

+#ifdef CONFIG_ARM64
 void  __init kvm_arm_target_impl_cpu_init(void)
 {
        int i;
@@ -115,3 +116,4 @@ void  __init kvm_arm_target_impl_cpu_init(void)
 mem_free:
        memblock_free(target, sizeof(*target) * max_cpus);
 }
+#endif



  reply	other threads:[~2025-03-06  9:56 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06  5:46 linux-next: build failure after merge of the kvm-arm tree Stephen Rothwell
2025-03-06  9:56 ` Shameerali Kolothum Thodi [this message]
2025-03-07  0:00   ` Marc Zyngier
2025-03-07  0:51     ` Oliver Upton
  -- strict thread matches above, loose matches on Subject: below --
2025-09-23 15:28 Mark Brown
2025-09-23 16:02 ` Will Deacon
2025-09-23 16:44   ` Will Deacon
2025-09-24  2:37     ` Anshuman Khandual
2025-09-24  7:45       ` Will Deacon
2025-07-29  4:22 Stephen Rothwell
2025-07-29 18:05 ` Oliver Upton
2025-03-20  9:32 Stephen Rothwell
2025-03-20 13:35 ` Oliver Upton
2024-02-22 11:03 Stephen Rothwell
2024-02-22 11:11 ` Joey Gouly
2024-02-22 11:40   ` Stephen Rothwell
2024-02-22 13:11     ` Paolo Bonzini
2024-02-22 13:11     ` Paolo Bonzini
2024-02-22 14:31       ` Marc Zyngier
2024-02-22 18:58         ` Oliver Upton
2023-10-05  1:31 Stephen Rothwell
2023-10-05  1:53 ` Oliver Upton
2022-05-05 10:10 Stephen Rothwell
2022-05-05 10:11 ` Stephen Rothwell
2022-05-05 11:27   ` Marc Zyngier
2016-09-23  3:31 Stephen Rothwell
2016-09-23  8:43 ` Marc Zyngier
2014-09-22  4:06 Stephen Rothwell
2014-09-22  5:07 ` Eric Auger
2014-09-22  5:31   ` Eric Auger
     [not found] ` <CAEDV+g+qVgG+=1Q7gBCPs8oAjK8rpzpoQ2cPMF0hi5Q1M3Nckw@mail.gmail.com>
2014-09-22 21:26   ` Paolo Bonzini
2014-09-24  6:50 ` Stephen Rothwell
2014-09-24  7:06   ` Christoffer Dall
2014-09-24 10:05     ` Paolo Bonzini

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=6027e05e03474a87826217ee56f12761@huawei.com \
    --to=shameerali.kolothum.thodi@huawei$(echo .)com \
    --cc=cdall@cs$(echo .)columbia.edu \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=maz@kernel$(echo .)org \
    --cc=oliver.upton@linux$(echo .)dev \
    --cc=sfr@canb$(echo .)auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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