From: Alejandro Vallejo <agarciav@amd.com>
To: Alejandro Vallejo <agarciav@amd.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Jason Andryuk <jason.andryuk@amd.com>,
Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Michal Orzel" <michal.orzel@amd.com>,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Juergen Gross" <jgross@suse.com>,
Xen-devel <xen-devel-bounces@lists.xenproject.org>
Subject: Re: [PATCH TEST-ARTEFACTS 0/8] Cleanup and Linux ARM64 support
Date: Thu, 10 Apr 2025 19:28:06 +0100 [thread overview]
Message-ID: <D9366FPHFS9F.2OP8KH7C8OJTF@amd.com> (raw)
In-Reply-To: <D9360R5QOOU6.2Z9QQZYYJ5A6T@amd.com>
On Thu Apr 10, 2025 at 7:20 PM BST, Alejandro Vallejo wrote:
> On Thu Apr 10, 2025 at 10:17 AM BST, Andrew Cooper wrote:
>> On 10/04/2025 1:09 am, Jason Andryuk wrote:
>>> On 2025-04-09 13:01, Andrew Cooper wrote:
>>>> On 09/04/2025 5:36 pm, Andrew Cooper wrote:
>>>>> Various bits of cleanup, and support for arm64 Linux builds.
>>>>>
>>>>> Run using the new Linux 6.6.86 on (most) x86, and ARM64:
>>>>>
>>>>> https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/1760667411
>>>>
>>>> Lovely, Linux 6.6.86 is broken for x86 PVH. It triple faults very
>>>> early on.
>>>>
>>>> Sample log:
>>>> https://gitlab.com/xen-project/hardware/xen-staging/-/jobs/9673797450
>>>>
>>>> I guess we'll have to stay on 6.6.56 for now. (Only affects the final
>>>> patch.)
>>>
>>> This is an AMD system:
>>>
>>> (XEN) [ 2.577549] d0v0 Triple fault - invoking HVM shutdown action 1
>>> (XEN) [ 2.577557] RIP: 0008:[<0000000001f851d4>]
>>>
>>> The instruction:
>>> ffffffff81f851d4: 0f 01 c1 vmcall
>>>
>>> vmcall is the Intel instruction, and vmmcall is the AMD one, so CPU
>>> detection is malfunctioning.
>>>
>>> (Early PVH is running identity mapped, so it's offset from
>>> ffffffff80000000)
>>>
>>> There are no debug symbols in the vmlinux I extracted from the bzImage
>>> from gitlab, but I can repro locally with on 6.6.86. It's unclear to
>>> me why it's failing.
>>>
>>> Trying:
>>> diff --git i/arch/x86/xen/enlighten.c w/arch/x86/xen/enlighten.c
>>> index 0219f1c90202..fb4ad7fe3e34 100644
>>> --- i/arch/x86/xen/enlighten.c
>>> +++ w/arch/x86/xen/enlighten.c
>>> @@ -123,11 +123,10 @@ noinstr void *__xen_hypercall_setfunc(void)
>>> if (!boot_cpu_has(X86_FEATURE_CPUID))
>>> xen_get_vendor();
>>>
>>> - if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD ||
>>> - boot_cpu_data.x86_vendor == X86_VENDOR_HYGON))
>>> - func = xen_hypercall_amd;
>>> - else
>>> + if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL )
>>> func = xen_hypercall_intel;
>>> + else
>>> + func = xen_hypercall_amd;
>>>
>>> static_call_update_early(xen_hypercall, func);
>>>
>>> But it still calls xen_hypercall_intel(). So maybe x86_vendor isn't
>>> getting set and ends up as 0 (X86_VENDOR_INTEL)?
>>>
>>> That's as far as I got here.
>>>
>>> Different but related, on mainline master, I also get a fail in
>>> vmcall. There, I see in the disassembly that
>>> __xen_hypercall_setfunc()'s calls to xen_get_vendor() is gone.
>>> xen_get_vendor() seems to have been DCE-ed. There is some new code
>>> that hardcodes features - "x86/cpufeatures: Add {REQUIRED,DISABLED}
>>> feature configs" - which may be responsible.
>>
>> 6.6.74 is broken too. (That's the revision that the ARM tests want).
>> So it broke somewhere between .56 and .74 which narrows the bisect a little.
>>
>> https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/1761323774
>>
>> In Gitlab, both AMD and Intel are failing in roughly the same way.
>>
>> ~Andrew
>
> I've bisected the tags and it was was introduced somewhere between the
> v6.6.66 and the v6.6.67 tags.
>
> The hypercall page was removed very shortly before v6.6.67 was tagged,
> so I have a nagging suspicion...
>
> Cheers,
> Alejandro
The cutoff point is bcf0e2fda80c6("x86/xen: remove hypercall page").
Together with Jason's observation it would seem that Linux doesn't guess
the correct instruction (or not early enough) when running as PVH dom0.
On PV it's just "syscall", but on PVH it's a tad more complicated.
Cheers,
Alejandro
next prev parent reply other threads:[~2025-04-10 18:28 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 16:36 [PATCH TEST-ARTEFACTS 0/8] Cleanup and Linux ARM64 support Andrew Cooper
2025-04-09 16:36 ` [PATCH 1/8] Consistently use DOCKER_CMD in makefiles Andrew Cooper
2025-04-09 16:36 ` [PATCH 2/8] Port containerise Andrew Cooper
2025-04-10 9:33 ` Anthony PERARD
2025-04-10 9:35 ` Andrew Cooper
2025-04-09 16:36 ` [PATCH 3/8] Fix container user setup Andrew Cooper
2025-04-10 9:41 ` Anthony PERARD
2025-04-09 16:36 ` [PATCH 4/8] Clean up Gitlab yaml Andrew Cooper
2025-04-09 17:15 ` Marek Marczykowski-Górecki
2025-04-10 9:38 ` Andrew Cooper
2025-04-10 10:07 ` Anthony PERARD
2025-04-10 10:11 ` Andrew Cooper
[not found] ` <Z_jid7eTY7EPIoWu@l14>
2025-04-11 9:45 ` Andrew Cooper
2025-04-09 16:36 ` [PATCH 5/8] Adjust Linux build script to work with other major versions Andrew Cooper
2025-04-09 16:57 ` Marek Marczykowski-Górecki
2025-04-09 17:18 ` Andrew Cooper
2025-04-09 16:37 ` [PATCH 6/8] Factor our x86-isms in the linux build script Andrew Cooper
2025-04-09 17:05 ` Marek Marczykowski-Górecki
2025-04-09 22:59 ` Marek Marczykowski-Górecki
2025-04-09 23:04 ` Andrew Cooper
2025-04-09 16:37 ` [PATCH 7/8] Infrastructure for arm64 linux builds Andrew Cooper
2025-04-09 17:11 ` Marek Marczykowski-Górecki
2025-04-09 17:15 ` Andrew Cooper
2025-04-10 10:41 ` Andrew Cooper
2025-04-10 10:57 ` Andrew Cooper
2025-04-10 12:21 ` Marek Marczykowski-Górecki
2025-04-10 9:59 ` Andrew Cooper
2025-04-09 16:37 ` [PATCH 8/8] Linux 6.6.86 for x86 and arm64 Andrew Cooper
2025-04-09 17:01 ` [PATCH TEST-ARTEFACTS 0/8] Cleanup and Linux ARM64 support Andrew Cooper
2025-04-10 0:09 ` Jason Andryuk
2025-04-10 9:17 ` Andrew Cooper
2025-04-10 18:20 ` Alejandro Vallejo
2025-04-10 18:28 ` Alejandro Vallejo [this message]
2025-04-10 19:50 ` [RFC PATCH] x86/xen: Fix PVH dom0 xen_hypercall detection Jason Andryuk
2025-04-10 21:49 ` Andrew Cooper
2025-04-11 11:35 ` Ard Biesheuvel
2025-04-11 14:28 ` Jason Andryuk
2025-04-11 15:32 ` Ard Biesheuvel
2025-04-11 12:46 ` Alejandro Vallejo
2025-04-11 13:08 ` Jan Beulich
2025-04-11 14:10 ` Alejandro Vallejo
2025-04-18 10:58 ` [PATCH TEST-ARTEFACTS 0/8] Cleanup and Linux ARM64 support David Woodhouse
2025-04-10 21:16 ` Jason Andryuk
2025-04-10 21:50 ` Jason Andryuk
2025-04-11 12:41 ` Alejandro Vallejo
2025-04-10 9:32 ` Jürgen Groß
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=D9366FPHFS9F.2OP8KH7C8OJTF@amd.com \
--to=agarciav@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jason.andryuk@amd.com \
--cc=jgross@suse.com \
--cc=marmarek@invisiblethingslab.com \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel-bounces@lists.xenproject.org \
--cc=xen-devel@lists.xenproject.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.