Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3122173rwb; Tue, 8 Nov 2022 00:26:03 -0800 (PST) X-Google-Smtp-Source: AMsMyM6TfoeN0ysoIsQXV/8yGuVctZ63ej2v/mS3ZoAgjaFZVOlfUKZRl7N2iBXeV9/uvtVBY+ev X-Received: by 2002:a17:906:db0a:b0:781:f24:a782 with SMTP id xj10-20020a170906db0a00b007810f24a782mr52226028ejb.399.1667895962776; Tue, 08 Nov 2022 00:26:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667895962; cv=none; d=google.com; s=arc-20160816; b=i+ghf1qMoEFtQqig59FyNGA5G1G5Hggd3X5J4urYD1ejKt0xSDGd2foR2FEEFyA03M RaQ9JMTZZWTc803TOmhJevUPQByslaL/w/q1e/VexkYDHjROcH1gxVWrYXW+810gZRUc V+DXTI6ezz65iXfxbxBA+qhMWYqLIRopCJTLzxMF8xIM6q3QqTpbFOICcKx4ZgstIIVZ X4ZwW2uoAnp6bE5d/5yVmijRHcsDrpNRFbNY+wXLVt+RWq0ilcAcRkydDr36m0FBrIYg VI8jQWk5DeW2FvJuLgJUzIAvUcc0aLf7xUpzq4caT1P/t6TdLRKFhcK/KmZaZsdNp/JH Zupw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:cc:from :references:to:subject:user-agent:mime-version:date:message-id; bh=4Gs0uEvPskFztyI61Ux/nla18QmmPfqEByD8p8VwApA=; b=HFhn48wUnr5v1xfprRK9T3rkMx4qRndvRhHROn9S02D97nonw6yz0xqOLP0cFNYScx dIn0clZCCMWZFDWuB3NVTWO2pKpfEAjwLf2uS3nXcKa59qDoTZ1BSZJ2t+VjJ/mm3DuF b5VyT9oze6+QHboc7KUZwOdI7/DdnFL4AS+gAC74tEb6VccQIpV6RHfbg51awb6wDFJk SdfjzThY+8kLmDBl87N/vtBcCSVdwjITjRzu3eLPGZhcRL+OD7RT6E7uo8bEXYjWVcsx DkXQimf+Z4lGta47K35yWxH43Me17hdO+3IriRx5FUjDIPPk2/UBQJHEsrH1n34h1ezX P6jQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w16-20020a170906d21000b0078de536a3cdsi10754011ejz.119.2022.11.08.00.25.40; Tue, 08 Nov 2022 00:26:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233494AbiKHHqo (ORCPT + 90 others); Tue, 8 Nov 2022 02:46:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233330AbiKHHqg (ORCPT ); Tue, 8 Nov 2022 02:46:36 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ACEFC10; Mon, 7 Nov 2022 23:46:35 -0800 (PST) Received: from kwepemi500009.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N60Xf0YP6zRp63; Tue, 8 Nov 2022 15:46:26 +0800 (CST) Received: from [10.67.110.89] (10.67.110.89) by kwepemi500009.china.huawei.com (7.221.188.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 8 Nov 2022 15:46:33 +0800 Message-ID: Date: Tue, 8 Nov 2022 15:46:32 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: vmlinux.lds.h: Bug report: unable to handle page fault when start the virtual machine with qemu To: Ard Biesheuvel References: From: xiafukun CC: , , , , , , In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.110.89] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi500009.china.huawei.com (7.221.188.199) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thank you for your reply. We tested your changes to this patch and did fix the issue. Following the solution you provided, we recompile the kernel and successfully start the virtual machine. 在 2022/11/8 0:00, Ard Biesheuvel 写道: > > That patch looks incorrect to me. Without CONFIG_SMP, the PERCPU > sections are not instantiated, and the only copy of those variables is > created in the ordinary .data/.bss sections > > Does the change below fix the issue for you? > > --- a/include/asm-generic/vmlinux.lds.h > +++ b/include/asm-generic/vmlinux.lds.h > @@ -347,6 +347,7 @@ > #define DATA_DATA \ > *(.xiptext) \ > *(DATA_MAIN) \ > + *(.data..decrypted) \ > *(.ref.data) \ > *(.data..shared_aligned) /* percpu related */ \ > MEM_KEEP(init.data*) \ > @@ -995,7 +996,6 @@ > #ifdef CONFIG_AMD_MEM_ENCRYPT > #define PERCPU_DECRYPTED_SECTION \ > . = ALIGN(PAGE_SIZE); \ > - *(.data..decrypted) \ > *(.data..percpu..decrypted) \ > . = ALIGN(PAGE_SIZE); > #else