Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BA806C46CD2 for ; Tue, 2 Jan 2024 14:40:38 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.660727.1030284 (Exim 4.92) (envelope-from ) id 1rKfwI-0004PY-Q7; Tue, 02 Jan 2024 14:40:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 660727.1030284; Tue, 02 Jan 2024 14:40:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rKfwI-0004PR-MW; Tue, 02 Jan 2024 14:40:18 +0000 Received: by outflank-mailman (input) for mailman id 660727; Tue, 02 Jan 2024 14:40:17 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rKfwH-0004PL-Mq for xen-devel@lists.xenproject.org; Tue, 02 Jan 2024 14:40:17 +0000 Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [2607:f8b0:4864:20::32d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d71ed23e-a97c-11ee-9b0f-b553b5be7939; Tue, 02 Jan 2024 15:40:15 +0100 (CET) Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-6dbdbf680d6so3456643a34.0 for ; Tue, 02 Jan 2024 06:40:15 -0800 (PST) Received: from ?IPV6:2603:8080:a900:257c::1004? (2603-8080-a900-257c-0000-0000-0000-1004.res6.spectrum.com. [2603:8080:a900:257c::1004]) by smtp.gmail.com with ESMTPSA id r2-20020a056830134200b006dc0623b202sm1934543otq.73.2024.01.02.06.40.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Jan 2024 06:40:13 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list X-Inumbo-ID: d71ed23e-a97c-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704206414; x=1704811214; darn=lists.xenproject.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:sender:from:to:cc:subject :date:message-id:reply-to; bh=4ONLUtK4TlZmu94GP5gLzTnRTXIraKo+f2GaDY4sCHU=; b=CKtZ38ytPOQ+SF+90bR8QgrQQ3mKghWTf/edpMMvaZVpMzb/bKTOo+Zqgpqpj6KQKj XhgkHm/l3UcCxrYqSbciag1qL3KP/4XTWogEXqTYHqL44uQ8mjBEdqc/TB0zV0eUvM3z UbbxdhYknulGbfgtSsxplSclTMx2v/rnYVzsYBeZMkzCjGEuxoXoWKmel/oyMsUINV54 0TuHquQRm1YtdoFNxQBSBm2QoaPXm7qipMK3fzn889iShst9FyHsbL8XF0pABG3l4RBo +yo69kmi4ja3QTqV6S9+viLonCelHz0k3jqWQ9LTHKWMBsrYpwUOsX1PDvUPetL2lsVA KfFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704206414; x=1704811214; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4ONLUtK4TlZmu94GP5gLzTnRTXIraKo+f2GaDY4sCHU=; b=prX2E/t0ibK/XMa/0nFtNxhBFCnfZvsukZ7/EFtb2zCmnHKFch96P0wiUHHoTxi5Sd QrlG6aXTmGNOqmNlPWgJ/2c5WYzF9UAj8iGa1hqEiKVhLujmcnXr4zdtgg4AExFy8n7E 4wYadzNXtPtKD7NlKF2E+UOu41l2BCgNV+2dp2EcEWLvLjl+6GbCQ11ZZ16rvu3dtIQe 3APXjun3KiKxhW7kQH3a9T6QStN6YTt8C+CpA1Q99/q4ACtDgT0Nc6Uu0zsHUj4Deqmb PTHa/Jbl0nKe16pwvNLpjVEBUO+Hkn9mxbrWfYfM6dt3Rmm7reqDaw/6N0LigUJsSQQN R+gA== X-Gm-Message-State: AOJu0YzfqoBVxsCFFyGe6LcktQv37MHTtndtOz9NH+l7At4zDxwSXl1B hPIm1Hhx1ULFu506vxOiqDA= X-Google-Smtp-Source: AGHT+IFPVCme0Ogqf0jsAcCSjZLVKYqvVDpefFqDBd/0Z1IZ8nwiWjPPK+8PihzwcTGiMVNmBkDxUQ== X-Received: by 2002:a05:6830:22e8:b0:6dc:17a:663e with SMTP id t8-20020a05683022e800b006dc017a663emr5959912otc.70.1704206413742; Tue, 02 Jan 2024 06:40:13 -0800 (PST) Sender: Joe Tretter Content-Type: multipart/alternative; boundary="------------CGd0ViBKbw8it84gzjmsfZe0" Message-ID: <6f81654d-ff07-44c0-a625-d8465e3ac0ed@gmail.com> Date: Tue, 2 Jan 2024 08:42:40 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Possible bug in Xen To: Andrew Cooper , xen-devel@lists.xenproject.org Cc: Jan Beulich , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= References: <9cc86706-5791-4967-802c-3e665bc97804@citrix.com> <15ece71b-d1d1-49d8-b937-f697b50fac39@gmail.com> <1b1116d0-bbda-4fa3-ae41-321e69626641@citrix.com> Content-Language: en-US From: Joe Tretter In-Reply-To: <1b1116d0-bbda-4fa3-ae41-321e69626641@citrix.com> This is a multi-part message in MIME format. --------------CGd0ViBKbw8it84gzjmsfZe0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Happy New Year! I think it's time I send you an update: I have spent a considerable amount of time trying to get the latest firmware working, but I find a way that does the job. When I replaced the file with yours, the machine directly restarts on application of the firmware. All ways I have tried either result in the firmware not being considered or the machine rebooting on application. The machine is dual boot with Archlinux and on Archlinux, I have the latest firmware running. I have reached out to the Qubes people for help getting the latest firmware working. I'll let you know when I succeed with that. ~Joe On 12/19/23 11:00, Andrew Cooper wrote: > On 19/12/2023 4:28 pm, Joe Tretter wrote: >> On 12/19/23 10:05, Andrew Cooper wrote: >>> Is it always the same test which fails, or is it random? >> Which test fails seems to be random (see attached screenshot). >>> Looking athttps://github.com/Tarsnap/scrypt it's only a trivial piece >>> of userspace crypto. >>> >>> The fact that running multiple instances makes it fail more easily >>> points towards some kind of register handling issue, but the fact that >>> it repros only under Xen, and even with eager-fpu (which isn't the >>> default on AMD, sadly), is weird. >>> >>> Looking at the scrypt source, it has alternative routines for the AESNI >>> and SHANI instruction groups.  However, because it's a Zen1, we don't >>> have a useful way of filtering visible for PV dom0 userspace. >>> >>> First of all, can you get the exact CPU model and microcode version. >>> `head /proc/cpuinfo` will be enough.  But while you're at it, can you >>> include `xl dmesg` too just in case there's something obvious showing up >>> there too. >>> >> I have attachted text files with the (full) cpuinfo and the dmesg. > microcode    : 0x8001129 > > That's 0x08001129 when not rendered brokenly, and the up-to-date version > is 0x08001138 (which itself dates from 2019). > > If you can, get a firmware update.  Given that it's a Dell, there's a > good chance it's already on LFVS/fwupd.  This is definitely the > preferred option. > > If not, and you're willing to experiment in definitely unsupported > territory, then move /lib/firmware/amd-ucode/microcode_amd_fam17h.bin > sideways in dom0, and replace it with the attached SummitRidge-08001138 > file (it's important to still be named microcode_amd_fam17h.bin in the > end), then rebuild the initrd and reboot. > > You already have ucode=scan on Xen's command line, so after the reboot > you should see some messages about updating microcode too. > > Irritatingly, AMD don't put client microcode into linux-firmware, but > there are various collections of blobs found in the wild online.  I've > picked the one which I think is right for your CPU, and packaged it it > appropriately for Xen. > > > Anyway, I'm not sure if this will fix anything, but life is too short to > be debugging stuff like this on out-of-date firmware/ucode. > > ~Andrew --------------CGd0ViBKbw8it84gzjmsfZe0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Happy New Year! I think it's time I send you an update:
I have spent a considerable amount of time trying to get the latest firmware working, but I find a way that does the job.
When I replaced the file with yours, the machine directly restarts on application of the firmware.
All ways I have tried either result in the firmware not being considered or the machine rebooting on application.
The machine is dual boot with Archlinux and on Archlinux, I have the latest firmware running.
I have reached out to the Qubes people for help getting the latest firmware working. I'll let you know when I succeed with that.

~Joe

On 12/19/23 11:00, Andrew Cooper wrote:
On 19/12/2023 4:28 pm, Joe Tretter wrote:
On 12/19/23 10:05, Andrew Cooper wrote:
Is it always the same test which fails, or is it random?
Which test fails seems to be random (see attached screenshot).
Looking at https://github.com/Tarsnap/scrypt it's only a trivial piece
of userspace crypto.

The fact that running multiple instances makes it fail more easily
points towards some kind of register handling issue, but the fact that
it repros only under Xen, and even with eager-fpu (which isn't the
default on AMD, sadly), is weird.

Looking at the scrypt source, it has alternative routines for the AESNI
and SHANI instruction groups.  However, because it's a Zen1, we don't
have a useful way of filtering visible for PV dom0 userspace.

First of all, can you get the exact CPU model and microcode version. 
`head /proc/cpuinfo` will be enough.  But while you're at it, can you
include `xl dmesg` too just in case there's something obvious showing up
there too.

I have attachted text files with the (full) cpuinfo and the dmesg.
microcode    : 0x8001129

That's 0x08001129 when not rendered brokenly, and the up-to-date version
is 0x08001138 (which itself dates from 2019).

If you can, get a firmware update.  Given that it's a Dell, there's a
good chance it's already on LFVS/fwupd.  This is definitely the
preferred option.

If not, and you're willing to experiment in definitely unsupported
territory, then move /lib/firmware/amd-ucode/microcode_amd_fam17h.bin
sideways in dom0, and replace it with the attached SummitRidge-08001138
file (it's important to still be named microcode_amd_fam17h.bin in the
end), then rebuild the initrd and reboot.

You already have ucode=scan on Xen's command line, so after the reboot
you should see some messages about updating microcode too.

Irritatingly, AMD don't put client microcode into linux-firmware, but
there are various collections of blobs found in the wild online.  I've
picked the one which I think is right for your CPU, and packaged it it
appropriately for Xen.


Anyway, I'm not sure if this will fix anything, but life is too short to
be debugging stuff like this on out-of-date firmware/ucode.

~Andrew

--------------CGd0ViBKbw8it84gzjmsfZe0--