Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp354775lqc; Thu, 7 Mar 2024 22:12:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWgj8tUUkJ2jyfRJyB4CHDkXDhTHsKNk2RMzzrjFU/9jLGNE4FTRBcYrabZr+98Xn5ejUgYMuKMeggiFr2tXAq80ejzSWrgNYI4zDhApg== X-Google-Smtp-Source: AGHT+IFanMP++Z/j3hyzjvm0wEDD1hQHSJ+hWhvEXokdk6bdbcSuhAg1uPyE49ETbSB9t9Cf3EKh X-Received: by 2002:a62:c1c2:0:b0:6e5:e41f:fe4e with SMTP id i185-20020a62c1c2000000b006e5e41ffe4emr18963816pfg.4.1709878334539; Thu, 07 Mar 2024 22:12:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709878334; cv=pass; d=google.com; s=arc-20160816; b=Qdv4Tb06EecCnETNvh2aVlEmZ4W35qRxcfeA0CpwQFz+Ss8JYwR8HRXCmkG8+tAlFl hOjYJabwG7pwiW+xxhRRONP32O3i7xgg0UoCVNgVBhFvr9dqm6ymflNhIlHJsWbncIJr lJa/vap76E5w2Gq6nsT1F173VaMN6NR8njy4k7gZv63FB9CHInWft48dRm49TiMYG8ni AFzwdYootBTalmsvVCh8dgvdtxsRdpi9SQFge48UK44vXbDte5CQ1DmtBjy8m1eUNEDg bts5OH46UGwMbXDpAZSPqBDc8DNQYM0x5XVP63jU59XfyiCNe+xV6jBD0EuZWBffvjPp s0ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=ggk6dK8sGdGszEbTErHhdpg+ACGp4m0wQJlZqxHG+Pc=; fh=dYmgIcezpW7bgI6lPLoNFAhecg1cRbpUbQnR4Cml/tk=; b=AHJsOGwBlZkSyM8Pk9EwHKmQu2lKzY6EjGNkuehrPrS0KHUAH0O40Ep1AdsQOqNSwZ TI5t/bHRLxxMrN00frlVykicR/ATaV2NkPxXtBUojSjVwMbzfgWcTjVw9cqAbRpFLj1D Bf9MAnCohv2cDLkRJQaK3DxDXpCXlfzbsW8R3ccGV1CqQbRqKCt2F0ICaVImJxuPdMoS GoALrsCmtPUBQio1VBL19n8Mhm7S8MBmsgxNrhIzXjxvW7mo0gfrf6Bt6qKyisCKeLhe qex/vibu3tDs2gJvEULzIL5WjRn6iT+zrq3WhI4Ce3SnQBG2EOBeOK7wEtLoN3ufwfoP BksA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-96547-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96547-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x40-20020a056a0018a800b006e66cdca3a5si549398pfh.352.2024.03.07.22.12.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 22:12:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96547-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-96547-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96547-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 31DBC2833E7 for ; Fri, 8 Mar 2024 06:12:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B25813612C; Fri, 8 Mar 2024 06:12:09 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C29FC2E821 for ; Fri, 8 Mar 2024 06:12:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709878329; cv=none; b=aZ3zq5ioKrdwGgtUqyDrbUq4rqGD0Xc1Hd0wTWICkTugvWCuC/PA4dOn5ewK1/k+nqqZo/WSLp7qOI+Paj4qkqmYQTzNpOD47hDZerec90yD7nD6KktrjppwPtrC1tSf+jq7j1qY4V1izr1K3dy9EO9PHXn1W/wiRgHVX7ruJEE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709878329; c=relaxed/simple; bh=k44BMiSeroU1V/o+VX/N436qBMDRBdEAkXKdBxhugrU=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SzzmwEN/xk23eSdmc78+eaHjKujVLJY5+WNwCc0Vx0uR/0YA2GkQI37ywqcSlO71Ptu6ThuK2ZXQR4Ex4sxOOcZXQFn7+eh/AtY0OwsOi+qLgHu7+4Ri0TAKiGinSkqAjUEgA/EWmnNMaphST8VRStlJS/y2rSe/vPJ00is64W4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4TrbNm4FxdzXhln; Fri, 8 Mar 2024 14:09:44 +0800 (CST) Received: from kwepemd100007.china.huawei.com (unknown [7.221.188.221]) by mail.maildlp.com (Postfix) with ESMTPS id C6E9E1400FD; Fri, 8 Mar 2024 14:12:02 +0800 (CST) Received: from kwepemd100011.china.huawei.com (7.221.188.204) by kwepemd100007.china.huawei.com (7.221.188.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Fri, 8 Mar 2024 14:12:02 +0800 Received: from M910t (10.110.54.157) by kwepemd100011.china.huawei.com (7.221.188.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Fri, 8 Mar 2024 14:12:01 +0800 Date: Fri, 8 Mar 2024 14:10:54 +0800 From: Changbin Du To: Borislav Petkov CC: Changbin Du , Thomas Gleixner , Ingo Molnar , Dave Hansen , , Andy Lutomirski , Peter Zijlstra , "H. Peter Anvin" , Alexander Potapenko , Andrew Morton , , Subject: Re: [PATCH] x86: kmsan: fix boot failure due to instrumentation Message-ID: <20240308061054.54zxik32u4w2bynd@M910t> References: <20240308044401.1120395-1-changbin.du@huawei.com> <20240308054532.GAZeql_HPGb5lAU-jx@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240308054532.GAZeql_HPGb5lAU-jx@fat_crate.local> X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemd100011.china.huawei.com (7.221.188.204) On Fri, Mar 08, 2024 at 06:45:32AM +0100, Borislav Petkov wrote: > On Fri, Mar 08, 2024 at 12:44:01PM +0800, Changbin Du wrote: > > Instrumenting sev.c and mem_encrypt_identity.c with KMSAN will result in > > kernel being unable to boot. Some of the code are invoked too early in > > boot stage that before kmsan is ready. > > How do you trigger this? > I run the kernel in qemu. One of the calltrace is: (gdb) bt #0 find_cc_blob (bp=0x14700 ) at arch/x86/kernel/sev.c:2067 #1 0x0000000003daeaab in snp_init (bp=0x14700 ) at arch/x86/kernel/sev.c:2098 #2 0x0000000003db3d69 in sme_enable (bp=0x14700 ) at arch/x86/mm/mem_encrypt_identity.c:516 #3 0x000000000100003e in startup_64 () at arch/x86/kernel/head_64.S:99 #4 0x0000000000000000 in ?? () find_cc_blob() has instrumentation enabled and panic when accessing shadow memory. > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette -- Cheers, Changbin Du