From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83C31C47083 for ; Fri, 4 Jun 2021 07:01:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6CC6261412 for ; Fri, 4 Jun 2021 07:01:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229922AbhFDHDR (ORCPT ); Fri, 4 Jun 2021 03:03:17 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:54240 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229907AbhFDHDQ (ORCPT ); Fri, 4 Jun 2021 03:03:16 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 321961FD47; Fri, 4 Jun 2021 07:01:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1622790090; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zpwSvRIOPuN7nGMcI/8bmjjz9EyzET4w0yLLXrnv2h4=; b=CbMEH7nSu0vh4K0FGMJnhpRViSW/qSFctXgTI/nbPeOwI3eozjJ3zMsOi4cJvXwSnEAuK1 9qcNAZvbGZO2n8oQRzFXLFmajtBurpGRrDqayAbOmPuLYka2xTPOeGvXnL/gxS6X4FzGjB oYN2K+tHrHah7qpFh6+dlybiGeUc7pk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1622790090; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zpwSvRIOPuN7nGMcI/8bmjjz9EyzET4w0yLLXrnv2h4=; b=WZWbbIBQ38P/a9rkmG6c8e3PmayjzkjcQkqFcKJxnXxq/xg9YNSc2Nvuv8OjmrkSdo4OZ6 pntYy5iCEmOwXHCQ== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 80260118DD; Fri, 4 Jun 2021 07:01:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1622790090; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zpwSvRIOPuN7nGMcI/8bmjjz9EyzET4w0yLLXrnv2h4=; b=CbMEH7nSu0vh4K0FGMJnhpRViSW/qSFctXgTI/nbPeOwI3eozjJ3zMsOi4cJvXwSnEAuK1 9qcNAZvbGZO2n8oQRzFXLFmajtBurpGRrDqayAbOmPuLYka2xTPOeGvXnL/gxS6X4FzGjB oYN2K+tHrHah7qpFh6+dlybiGeUc7pk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1622790090; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zpwSvRIOPuN7nGMcI/8bmjjz9EyzET4w0yLLXrnv2h4=; b=WZWbbIBQ38P/a9rkmG6c8e3PmayjzkjcQkqFcKJxnXxq/xg9YNSc2Nvuv8OjmrkSdo4OZ6 pntYy5iCEmOwXHCQ== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id xOZrHMnPuWBzMQAALh3uQQ (envelope-from ); Fri, 04 Jun 2021 07:01:29 +0000 Subject: Re: [PATCH v2 0/2] Fixes for "Windows fails to boot" From: Claudio Fontana To: Cleber Rosa Junior Cc: Peter Maydell , Paolo Bonzini , Eduardo Habkost , Siddharth Chandrasekaran , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Vitaly Kuznetsov , kvm@vger.kernel.org, "Michael S . Tsirkin" , Marcelo Tosatti , Richard Henderson , qemu-devel , Cameron Esfahani , Roman Bolshakov References: <20210603123001.17843-1-cfontana@suse.de> <1da75e95-1255-652e-1ca3-d23a8f6bf392@suse.de> <2e5edcf2-6958-82db-511c-724165a8ddfb@suse.de> Message-ID: Date: Fri, 4 Jun 2021 09:01:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <2e5edcf2-6958-82db-511c-724165a8ddfb@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 6/4/21 8:32 AM, Claudio Fontana wrote: > On 6/3/21 5:10 PM, Cleber Rosa Junior wrote: >> On Thu, Jun 3, 2021 at 10:29 AM Claudio Fontana wrote: >> >>> On 6/3/21 2:29 PM, Claudio Fontana wrote: >>>> v1 -> v2: >>>> * moved hyperv realizefn call before cpu expansion (Vitaly) >>>> * added more comments (Eduardo) >>>> * fixed references to commit ids (Eduardo) >>>> >>>> The combination of Commits: >>>> f5cc5a5c ("i386: split cpu accelerators from cpu.c"...) >>> >>>> 30565f10 ("cpu: call AccelCPUClass::cpu_realizefn in"...) >>>> >>>> introduced two bugs that break cpu max and host in the refactoring, >>>> by running initializations in the wrong order. >>>> >>>> This small series of two patches is an attempt to correct the situation. >>>> >>>> Please provide your test results and feedback, thanks! >>>> >>>> Claudio >>>> >>>> Claudio Fontana (2): >>>> i386: reorder call to cpu_exec_realizefn in x86_cpu_realizefn >>>> i386: run accel_cpu_instance_init as instance_post_init >>>> >>>> target/i386/cpu.c | 89 +++++++++++++++++++++++++-------------- >>>> target/i386/kvm/kvm-cpu.c | 12 +++++- >>>> 2 files changed, 68 insertions(+), 33 deletions(-) >>>> >>> >>> Btw, CI/CD is all green, but as mentioned, it does not seem to catch these >>> kind of issues. >>> >>> >> Hi Claudio, >> >> Not familiar with the specifics of this bug, but can it be caught by >> attempting to boot an image other than Windows? If so, we can consider >> adding a test along the lines of tests/acceptance/boot_linux_console.py. >> >> Thanks, >> - Cleber. > > Hello Cleber, > > yes, all that seems to be required is the "host" cpu, q35 machine, and the firmware ./OVMF_CODE.secboot.fd and ./OVMF_VARS.secboot.fd : > > ./build/x86_64-softmmu/qemu-system-x86_64 \ > -cpu host \ > -enable-kvm \ > -m 4G \ > -machine q35,smm=on \ > -drive if=pflash,format=raw,readonly=on,unit=0,file="./OVMF_CODE.secboot.fd" \ > -drive if=pflash,format=raw,unit=1,file="./OVMF_VARS.secboot.fd" > > With the bugged code, the firmware does not boot, and the cpu does not get into 64-bit long mode. > Applying the patches the firmware boots normally and we get the TianoCore Logo and text output. > > Adding something like -display none -serial stdio would also generate text in the OK case that could be "expected" by a test: > > BdsDxe: failed to load Boot0001 "UEFI QEMU DVD-ROM QM00005 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x2,0xFFFF,0x0): Not Found > >>> Start PXE over IPv4. > > even without using any guest to boot at all, just the firmware. > I used this Fedora package for the test, containing the firmware: edk2-ovmf-20200801stable-1.fc33.noarch.rpm > > I looked briefly at tests/acceptance/boot_linux_console.py, but did not see where such a test of firmware could be inserted, > could you advise? Nm I think I got it, will create a new boot_OVMF_fc33.py test. Thanks, C > >> >> >>> https://gitlab.com/hw-claudio/qemu/-/pipelines/314286751 >>> >>> C. >>> >>> >>> >> > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21F96C07E94 for ; Fri, 4 Jun 2021 07:19:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 977D961415 for ; Fri, 4 Jun 2021 07:19:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 977D961415 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp46f-0001GZ-V0 for qemu-devel@archiver.kernel.org; Fri, 04 Jun 2021 03:19:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp3pp-0004KQ-T1 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 03:01:39 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:49054) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lp3pk-0004EB-2k for qemu-devel@nongnu.org; Fri, 04 Jun 2021 03:01:37 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 321961FD47; Fri, 4 Jun 2021 07:01:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1622790090; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zpwSvRIOPuN7nGMcI/8bmjjz9EyzET4w0yLLXrnv2h4=; b=CbMEH7nSu0vh4K0FGMJnhpRViSW/qSFctXgTI/nbPeOwI3eozjJ3zMsOi4cJvXwSnEAuK1 9qcNAZvbGZO2n8oQRzFXLFmajtBurpGRrDqayAbOmPuLYka2xTPOeGvXnL/gxS6X4FzGjB oYN2K+tHrHah7qpFh6+dlybiGeUc7pk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1622790090; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zpwSvRIOPuN7nGMcI/8bmjjz9EyzET4w0yLLXrnv2h4=; b=WZWbbIBQ38P/a9rkmG6c8e3PmayjzkjcQkqFcKJxnXxq/xg9YNSc2Nvuv8OjmrkSdo4OZ6 pntYy5iCEmOwXHCQ== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 80260118DD; Fri, 4 Jun 2021 07:01:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1622790090; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zpwSvRIOPuN7nGMcI/8bmjjz9EyzET4w0yLLXrnv2h4=; b=CbMEH7nSu0vh4K0FGMJnhpRViSW/qSFctXgTI/nbPeOwI3eozjJ3zMsOi4cJvXwSnEAuK1 9qcNAZvbGZO2n8oQRzFXLFmajtBurpGRrDqayAbOmPuLYka2xTPOeGvXnL/gxS6X4FzGjB oYN2K+tHrHah7qpFh6+dlybiGeUc7pk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1622790090; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zpwSvRIOPuN7nGMcI/8bmjjz9EyzET4w0yLLXrnv2h4=; b=WZWbbIBQ38P/a9rkmG6c8e3PmayjzkjcQkqFcKJxnXxq/xg9YNSc2Nvuv8OjmrkSdo4OZ6 pntYy5iCEmOwXHCQ== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id xOZrHMnPuWBzMQAALh3uQQ (envelope-from ); Fri, 04 Jun 2021 07:01:29 +0000 Subject: Re: [PATCH v2 0/2] Fixes for "Windows fails to boot" From: Claudio Fontana To: Cleber Rosa Junior References: <20210603123001.17843-1-cfontana@suse.de> <1da75e95-1255-652e-1ca3-d23a8f6bf392@suse.de> <2e5edcf2-6958-82db-511c-724165a8ddfb@suse.de> Message-ID: Date: Fri, 4 Jun 2021 09:01:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <2e5edcf2-6958-82db-511c-724165a8ddfb@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=195.135.220.29; envelope-from=cfontana@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.603, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Marcelo Tosatti , Eduardo Habkost , kvm@vger.kernel.org, Siddharth Chandrasekaran , "Michael S . Tsirkin" , Richard Henderson , qemu-devel , Cameron Esfahani , Roman Bolshakov , Paolo Bonzini , Vitaly Kuznetsov , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 6/4/21 8:32 AM, Claudio Fontana wrote: > On 6/3/21 5:10 PM, Cleber Rosa Junior wrote: >> On Thu, Jun 3, 2021 at 10:29 AM Claudio Fontana wrote: >> >>> On 6/3/21 2:29 PM, Claudio Fontana wrote: >>>> v1 -> v2: >>>> * moved hyperv realizefn call before cpu expansion (Vitaly) >>>> * added more comments (Eduardo) >>>> * fixed references to commit ids (Eduardo) >>>> >>>> The combination of Commits: >>>> f5cc5a5c ("i386: split cpu accelerators from cpu.c"...) >>> >>>> 30565f10 ("cpu: call AccelCPUClass::cpu_realizefn in"...) >>>> >>>> introduced two bugs that break cpu max and host in the refactoring, >>>> by running initializations in the wrong order. >>>> >>>> This small series of two patches is an attempt to correct the situation. >>>> >>>> Please provide your test results and feedback, thanks! >>>> >>>> Claudio >>>> >>>> Claudio Fontana (2): >>>> i386: reorder call to cpu_exec_realizefn in x86_cpu_realizefn >>>> i386: run accel_cpu_instance_init as instance_post_init >>>> >>>> target/i386/cpu.c | 89 +++++++++++++++++++++++++-------------- >>>> target/i386/kvm/kvm-cpu.c | 12 +++++- >>>> 2 files changed, 68 insertions(+), 33 deletions(-) >>>> >>> >>> Btw, CI/CD is all green, but as mentioned, it does not seem to catch these >>> kind of issues. >>> >>> >> Hi Claudio, >> >> Not familiar with the specifics of this bug, but can it be caught by >> attempting to boot an image other than Windows? If so, we can consider >> adding a test along the lines of tests/acceptance/boot_linux_console.py. >> >> Thanks, >> - Cleber. > > Hello Cleber, > > yes, all that seems to be required is the "host" cpu, q35 machine, and the firmware ./OVMF_CODE.secboot.fd and ./OVMF_VARS.secboot.fd : > > ./build/x86_64-softmmu/qemu-system-x86_64 \ > -cpu host \ > -enable-kvm \ > -m 4G \ > -machine q35,smm=on \ > -drive if=pflash,format=raw,readonly=on,unit=0,file="./OVMF_CODE.secboot.fd" \ > -drive if=pflash,format=raw,unit=1,file="./OVMF_VARS.secboot.fd" > > With the bugged code, the firmware does not boot, and the cpu does not get into 64-bit long mode. > Applying the patches the firmware boots normally and we get the TianoCore Logo and text output. > > Adding something like -display none -serial stdio would also generate text in the OK case that could be "expected" by a test: > > BdsDxe: failed to load Boot0001 "UEFI QEMU DVD-ROM QM00005 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x2,0xFFFF,0x0): Not Found > >>> Start PXE over IPv4. > > even without using any guest to boot at all, just the firmware. > I used this Fedora package for the test, containing the firmware: edk2-ovmf-20200801stable-1.fc33.noarch.rpm > > I looked briefly at tests/acceptance/boot_linux_console.py, but did not see where such a test of firmware could be inserted, > could you advise? Nm I think I got it, will create a new boot_OVMF_fc33.py test. Thanks, C > >> >> >>> https://gitlab.com/hw-claudio/qemu/-/pipelines/314286751 >>> >>> C. >>> >>> >>> >> >