lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <363f8293-23e3-44d3-8005-b31eb5b7f975@amd.com>
Date: Tue, 25 Mar 2025 14:40:00 +0530
From: "Aithal, Srikanth" <sraithal@....com>
To: Linux-Next Mailing List <linux-next@...r.kernel.org>,
 open list <linux-kernel@...r.kernel.org>, kirill.shutemov@...ux.intel.com
Cc: "Lendacky, Thomas" <Thomas.Lendacky@....com>,
 "Roth, Michael" <Michael.Roth@....com>
Subject: linux-next regression: SNP Guest boot hangs with certain cpu/mem
 config combination

Hello,


Starting linux-next build next-20250312, including recent build 
20250324, we are seeing an issue where the SNP guest boot hangs at the 
"boot smp config" step:


  [ 2.294722] smp: Bringing up secondary CPUs ...
[    2.295211] smpboot: Parallel CPU startup disabled by the platform
[    2.309687] smpboot: x86: Booting SMP configuration:
[    2.310214] .... node  #0, CPUs:          #1   #2   #3   #4 #5   #6   
#7   #8   #9  #10  #11  #12  #13  #14  #15  #16  #17 #18  #19  #20  #21  
#22  #23  #24  #25  #26  #27  #28  #29  #30 #31  #32  #33  #34  #35  
#36  #37  #38  #39  #40  #41  #42  #43 #44  #45  #46  #47  #48  #49  
#50  #51  #52  #53  #54  #55  #56 #57  #58  #59  #60  #61  #62  #63  
#64  #65  #66  #67  #68  #69 #70  #71  #72  #73  #74  #75  #76  #77  
#78  #79  #80  #81  #82 #83  #84  #85  #86  #87  #88  #89  #90  #91  
#92  #93  #94  #95 #96  #97  #98  #99 #100 #101 #102 #103 #104 #105 #106 
#107 #108 #109 #110 #111 #112 #113 #114 #115 #116 #117 #118 #119 #120 
#121 #122 #123 #124 #125 #126 #127 #128 #129 #130 #131 #132 #133 #134 
#135 #136 #137 #138 #139 #140 #141 #142 #143 #144 #145 #146 #147 #148 
#149 #150 #151 #152 #153 #154 #155 #156 #157 #158 #159 #160 #161 #162 
#163 #164 #165 #166 #167 #168 #169 #170 #171 #172 #173 #174 #175 #176 
#177 #178 #179 #180 #181 #182 #183 #184 #185 #186 #187 #188 #189 #190 
#191 #192 #193 #194 #195 #196 #197 #198
--> The guest hangs forever at this point.


I have observed that certain vCPU and memory combinations work, while 
others do not. The VM configuration I am using does not have any NUMA nodes.

vcpus             Mem        SNP guest boot
<=240            19456M    Boots fine
 >=241,<255   19456M    Hangs
1-255              2048M    Boots fine
1-255              4096M    Boots fine
 >71                 8192M    Hangs
 >41                 6144M    Hangs

When I bisected this issue, it pointed to the following commit :


*commit 800f1059c99e2b39899bdc67a7593a7bea6375d8*
Author: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
Date:   Mon Mar 10 10:28:55 2025 +0200

     mm/page_alloc: fix memory accept before watermarks gets initialized

     Watermarks are initialized during the postcore initcall. Until 
then, all
     watermarks are set to zero.  This causes cond_accept_memory() to
     incorrectly skip memory acceptance because a watermark of 0 is 
always met.

     This can lead to a premature OOM on boot.

     To ensure progress, accept one MAX_ORDER page if the watermark is zero.

     Link: 
https://lkml.kernel.org/r/20250310082855.2587122-1-kirill.shutemov@linux.intel.com
     Fixes: dcdfdd40fa82 ("mm: Add support for unaccepted memory")
     Signed-off-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
     Tested-by: Farrah Chen <farrah.chen@...el.com>
     Reported-by: Farrah Chen <farrah.chen@...el.com>
     Acked-by: Vlastimil Babka <vbabka@...e.cz>
     Reviewed-by: Pankaj Gupta <pankaj.gupta@....com>
     Cc: Ashish Kalra <ashish.kalra@....com>
     Cc: David Hildenbrand <david@...hat.com>
     Cc: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
     Cc: Mel Gorman <mgorman@...hsingularity.net>
     Cc: "Mike Rapoport (IBM)" <rppt@...nel.org>
     Cc: Thomas Lendacky <thomas.lendacky@....com>
     Cc: <stable@...r.kernel.org>    [6.5+]
     Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>

Reproduction Steps:

Build the guest kernel with linux-next [starting next-20250324] using 
the attached guest config.

Try booting the SNP guest using the following sample QEMU command line:



  qemu-system-x86_64 \
-machine q35,confidential-guest-support=sev0,memory-backend=mem-upmsev0 \
-object 
memory-backend-memfd,size=19456M,prealloc=false,share=true,reserve=false,id=mem-upmsev0 
\
-object 
sev-snp-guest,id=sev0,cbitpos=51,reduced-phys-bits=1,kernel-hashes=off,policy=0x30000 
\
-name guest=vm,debug-threads=on \
-bios OVMF_X64/OVMF.fd \
-cpu EPYC-v4 \
-smp 255,maxcpus=255,cores=255,threads=1,dies=1,sockets=1 \
-kernel bzImage_0321 \
-append "root=/dev/vda rw console=ttyS0,115200n8 
earlyprintk=ttyS0,115200 net.ifnames=0 biosdevname=0 movable_node 
swiotlb=65536 " \
-device 
virtio-blk-pci,id=blk0,drive=drive_image1,disable-legacy=on,iommu_platform=true 
\
-blockdev 
node-name=file_image1,driver=file,filename=/home/VT_BUILD/22.04-server.qcow2 
\
-blockdev node-name=drive_image1,driver=qcow2,file=file_image1 \
--enable-kvm \
--nographic \
-qmp tcp:localhost:4444,server,wait=off


*Issue goes away if I build the guest kernel by reverting the 
aforementioned commit or boot the guest with accept_memory=eager.*

Note that once you revert aforementioned commit or boot the guest with 
accept_memory=eager the guest boots and ends up with another issue which 
is already reported [2].


[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git, 
next-20250324

[2] Re: [syzbot] [pci?] linux-next test error: general protection fault 
in msix_capability_init - Aithal, Srikanth 
<https://lore.kernel.org/all/423b87d8-2ae3-48af-b368-657f1fbab88d@amd.com/>

Content of type "text/html" skipped

View attachment "guest_config" of type "text/plain" (154820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ