qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PULL 00/21] MIPS queue for June 7th, 2020


From: Peter Maydell
Subject: Re: [PULL 00/21] MIPS queue for June 7th, 2020
Date: Mon, 8 Jun 2020 14:05:17 +0100

On Sun, 7 Jun 2020 at 20:46, Aleksandar Markovic
<aleksandar.qemu.devel@gmail.com> wrote:
>
> The following changes since commit 175198ad91d8bac540159705873b4ffe4fb94eab:
>
>   Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200605' into 
> staging (2020-06-05 17:45:59 +0100)
>
> are available in the git repository at:
>
>   https://github.com/AMarkovic/qemu tags/mips-queue-june-07-2020
>
> for you to fetch changes up to ffbd8a88e8872d61fa5622a0075eddbe71951067:
>
>   target/mips: Enable hardware page table walker and CMGCR features for P5600 
> (2020-06-07 21:34:14 +0200)
>
> ----------------------------------------------------------------
>
> MIPS queue for June 7th, 2020
>
> Highlights:
>
>   - Registring change of email address for two contributors
>   - Cleanup and improvements of FPU helpers
>   - Enabling some features of P5600
>   - Adding two Loongson-3A CPU definitions
>   - Moving futher towards Loongson-3A KVM support
>   - Two checkpatch warnings are known and should be ignored
>

Hi; I'm afraid this fails to build on non-Linux hosts
(OSx, BSDs, Windows):

hw/mips/common.c:21:23: fatal error: linux/kvm.h: No such file or directory

Looking at that file, it also makes the mistake of putting
an include line before osdep.h, which should always be the
first include in a C file.

The more usual way to arrange this kind of "real implementation
of a function for the compiled-with-KVM case, stub for
the #ifndef CONFIG_KVM case" is to put the real implementation
into a C file that's only built for the CONFIG_KVM case:
obj-$(CONFIG_KVM) += whatever.o
(it may be simplest to just put it in the existing target/mips/kvm.c?)
and then either
(a) provide the non-kvm stub version directly in the .h file
that declares the prototype for the kvm case:
#ifdef CONFIG_KVM
int mips_kvm_type(MachineState *machine, const char *vm_type)
#else
static inline mips_kvm_type(MachineState *machine, const char *vm_type)
{
    return 0;
}
#endif
(b) alternatively put the stub code in a built-for-non-KVM
source file:
obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o

i386, s390x and arm all have examples of this kind of "stub
version plus for-kvm version" function that may be useful
as examples.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]