From: Philippe Gerum <rpm@xenomai.org>
To: Florian Bezdeka <florian.bezdeka@siemens.com>
Cc: "Nechita, Ionut" <ionut.nechita@intel.com>,
"xenomai@lists.linux.dev" <xenomai@lists.linux.dev>
Subject: Re: FAIL Kernel v6.10-evl-rebase - EVL: In function 'do_sysvec_inband': error: duplicate case value
Date: Sun, 28 Jul 2024 18:53:21 +0200 [thread overview]
Message-ID: <8734nt31by.fsf@xenomai.org> (raw)
In-Reply-To: 7edb3e30ad2fa511a189cf6262c5c7fa997d074f.camel@siemens.com
Florian Bezdeka <florian.bezdeka@siemens.com> writes:
> On Fri, 2024-07-26 at 21:15 +0200, Philippe Gerum wrote:
>> "Nechita, Ionut" <ionut.nechita@intel.com> writes:
>>
>> > Hi Xenomai Kernel Team,
>> >
>> > I notice today one issue when compiling latest version, v6.10-evl-rebase.
>> >
>> > > > > error: duplicate case value
>> > 160 | case HYPERVISOR_CALLBACK_VECTOR:
>> >
>> > # make -j208 bindeb-pkg LOCALVERSION="-1-lowlatency-evl" ARCH=x86_64
>> > GEN debian
>> > Using default distribution of 'unstable' in the changelog
>> > Install lsb-release or set $KDEB_CHANGELOG_DIST explicitly
>> > dpkg-buildpackage --build=binary --no-pre-clean --unsigned-changes -R'make -f debian/rules' -j1 -a$(cat debian/arch)
>> > dpkg-buildpackage: info: source package linux-upstream
>> > dpkg-buildpackage: info: source version 6.10.0-g9ba4271318cf-4
>> > dpkg-buildpackage: info: source distribution unstable
>> > dpkg-buildpackage: info: source changed by root <root@0296de802d65>
>> > dpkg-buildpackage: info: host architecture amd64
>> > dpkg-source --before-build .
>> > make -f debian/rules binary
>> > #
>> > # No change to .config
>> > #
>> > mkdir -p /srv/tmpfs-disk1/build/linux-evl/tools/objtool && make O=/srv/tmpfs-disk1/build/linux-evl subdir=tools/objtool --no-print-directory -C objtool
>> > INSTALL libsubcmd_headers
>> > CALL scripts/checksyscalls.sh
>> > UPD init/utsversion-tmp.h
>> > CC init/version.o
>> > AR init/built-in.a
>> > CHK kernel/kheaders_data.tar.xz
>> > CC arch/x86/kernel/irq_pipeline.o
>> > arch/x86/kernel/irq_pipeline.c: In function 'do_sysvec_inband':
>> > arch/x86/kernel/irq_pipeline.c:160:9: error: duplicate case value
>> > 160 | case HYPERVISOR_CALLBACK_VECTOR:
>> > | ^~~~
>> > arch/x86/kernel/irq_pipeline.c:154:9: note: previously used here
>> > 154 | case HYPERVISOR_CALLBACK_VECTOR:
>> > | ^~~~
>> > make[7]: *** [scripts/Makefile.build:244: arch/x86/kernel/irq_pipeline.o] Error 1
>> > make[7]: *** Waiting for unfinished jobs....
>> > make[6]: *** [scripts/Makefile.build:485: arch/x86/kernel] Error 2
>> > make[5]: *** [scripts/Makefile.build:485: arch/x86] Error 2
>> > make[5]: *** Waiting for unfinished jobs....
>> > make[4]: *** [Makefile:1934: .] Error 2
>> > make[3]: *** [debian/rules:74: build-arch] Error 2
>> > dpkg-buildpackage: error: make -f debian/rules binary subprocess returned exit status 2
>> > make[2]: *** [scripts/Makefile.package:121: bindeb-pkg] Error 2
>> > make[1]: *** [/srv/tmpfs-disk1/build/linux-evl/Makefile:1555: bindeb-pkg] Error 2
>> > make: *** [Makefile:240: __sub-make] Error 2
>> >
>> >
>> > BR,
>> > Ionut Nechita
>>
>> Mm, do_sysvec_inband() is wrong when it comes to dealing with
>> HYPERVISOR_CALLBACK_VECTOR. We need a global pointer to the
>> hypervisor-specific handler, that would be set up by the guest init code
>> which traps the vector. We cannot ask do_sysvec_inband() to figure out
>> this information, it depends on which hypervisor trapped that vector in
>> the first place.
>
> Exactly. It was me duplicating the "wrong" ACRN implementation while
> introducing the async page fault handling for KVM.
>
Strictly speaking, the bug was there prior to that addition, the async
pf patch only revealed it (I'm hereby claiming authorship of that bug! :)
> I think there is no way to look at the IDT and check which gate was
> loaded by the hypervisor guest code.
>
> I haven't checked yet if that would work, but at least the KVM
> implementation enables a static branch (kvm_async_pf_enabled) when
> loading the IDT gate. Maybe we can check if this one is active. If so,
> it's KVM we are running on.
kvm_async_pf_enabled seems to be controlled by a paravirt capability
flag. Would we receive significant information from
kvm_arch_para_features() <- cpuid_eax() in case KVM is not there?
>
> There seems no such static branch for the ACRN code...
>>
IIUC, we cannot have more than a single guest allowed to hook that
vector anyway, so could we just track who's doing that in the places
where this vector is trapped, e.g. by setting up some global function
pointer referring to the proper handler which do_sysvec_inband() would
call upon HYPERVISOR_CALLBACK_VECTOR event?
--
Philippe.
next prev parent reply other threads:[~2024-07-28 16:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-17 15:29 WARN Kernel v6.9-evl-rebase - EVL: invalid out-of-band syscall <0x43564d41> - Firefox browser Nechita, Ionut
2024-05-22 13:20 ` Philippe Gerum
2024-05-22 13:24 ` Nechita, Ionut
2024-05-22 15:25 ` Nechita, Ionut
2024-05-22 15:30 ` Philippe Gerum
2024-05-22 16:11 ` Nechita, Ionut
2024-05-22 19:50 ` Philippe Gerum
2024-07-26 9:54 ` Nechita, Ionut
2024-07-26 10:40 ` FAIL Kernel v6.10-evl-rebase - EVL: In function 'do_sysvec_inband': error: duplicate case value Nechita, Ionut
2024-07-26 19:15 ` Philippe Gerum
2024-07-27 8:30 ` Florian Bezdeka
2024-07-28 16:53 ` Philippe Gerum [this message]
2024-07-29 11:09 ` Nechita, Ionut
2024-07-29 12:53 ` Florian Bezdeka
2024-07-26 19:17 ` WARN Kernel v6.9-evl-rebase - EVL: invalid out-of-band syscall <0x43564d41> - Firefox browser Philippe Gerum
2024-07-29 14:09 ` Nechita, Ionut
2024-07-29 14:29 ` Philippe Gerum
2024-07-29 15:51 ` Nechita, Ionut
2024-07-30 9:38 ` Philippe Gerum
2024-07-30 12:10 ` Philippe Gerum
2024-08-03 8:34 ` Philippe Gerum
-- strict thread matches above, loose matches on Subject: below --
2024-07-26 10:42 FAIL Kernel v6.10-evl-rebase - EVL: In function 'do_sysvec_inband': error: duplicate case value Nechita, Ionut
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=8734nt31by.fsf@xenomai.org \
--to=rpm@xenomai.org \
--cc=florian.bezdeka@siemens.com \
--cc=ionut.nechita@intel.com \
--cc=xenomai@lists.linux.dev \
/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.