Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3647705rwb; Tue, 8 Nov 2022 06:58:42 -0800 (PST) X-Google-Smtp-Source: AMsMyM7TYh5oEbnHEuELXnrB0qjSBB2GBfJTdpSGcuGwnjhVavPdNKfYmfHq+ggBYcS7u+8zc7sq X-Received: by 2002:a17:90b:268d:b0:214:220:ecfd with SMTP id pl13-20020a17090b268d00b002140220ecfdmr42758671pjb.63.1667919521852; Tue, 08 Nov 2022 06:58:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667919521; cv=none; d=google.com; s=arc-20160816; b=qMbhx2dkzHjAoRji4BfIBMi/erQd6ogA3WUrt5trUhCaponSWdfFF0yBhXTNal1Sci 9OmUZTLsPEBnDURoVA8DUe7NY6b9ghwAbNt8UdiglSCYr/htEwN9VxWvPzJdED8ygWKb N9Iqy8PhCDYRtlq8y/9wb0BplfNGH26rMDXRjzRyyvohWOq6yjFCBSlT6wcIMWH2nKiA CSn+WqE7AyjOf22TSCEAutByF3bdEcV9KrRdDeuIBxyzxdl+eIbLKvNyOMRR9J1yCk1H Gr3O+WzgqT/B4rsHrfO7CpAHxx5vcrIZESTKM+/ijK0HOAzK32qgkKGB+1al7eFVEXTn Y5mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WxTqYKvAhKrrY/6cBQMBPutzNgfZczdZLmw6N1wQxQU=; b=Anddspshk8COMyJq/X2CAtmZZbDLhqrrtsjMStwZBri6ekrYA7QBLr4U6Mch9F01Es 4AP4I+Rh8xfvdTir8UYBix43TRjOsXyPe4wxkx8IkKmxeLyJXh7ubn/jUM28aqjyBjgY GGLHEyDC0h0+Yvr3or7v/XYuwAG4c/pe/+eEgBOvb6vAabcMMX7Q7+i3NRQH5ZrCDRTo 7qfRV8VksWJM9r1Nmad9oquCCgYjtBeyz7CMN+r7KSB3WknD3ybNV5SYCu4EthlhbBvR XdTHRSMnVBZanOr6T3O6QSRTikvSQAUM+6ryQuT/Pj7Rd2HoRtV3UzHSQbJMTBJN5K/I UZCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=agtcviDy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j189-20020a6380c6000000b0046fad96095esi14509776pgd.478.2022.11.08.06.58.28; Tue, 08 Nov 2022 06:58:41 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=agtcviDy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233809AbiKHOfl (ORCPT + 92 others); Tue, 8 Nov 2022 09:35:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233214AbiKHOfk (ORCPT ); Tue, 8 Nov 2022 09:35:40 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7A819FFC; Tue, 8 Nov 2022 06:35:39 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 54D2A615E2; Tue, 8 Nov 2022 14:35:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4264AC433C1; Tue, 8 Nov 2022 14:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667918138; bh=iRCXVVce81K56uY3wSFuiW3EJnWmIFxRfYgwuiKPlUA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=agtcviDySGTRQAGRdA4+4QiePjTCK4ixmbAAO9VyyCkejdj6bpetZ+2TUOth68dlQ 3AawLukUepPql4XJYdS9DAa+ussxB4UHOaOnj2u4TlVfluF/LxGxIjEynOXFyhKY9Y W/ljr1/Y6gBrO1oq9/yLuZyvDo56Xzvj2rZ/SS4DAlh/oAdr1qC1mF0blUMbJ2zOyp ULAhto29r3IV5daLcoq/DELL9FC1GKiz+0H6/pf1pnL61Q13wKXqOMbVdFDkC0QzSw fGrkLPwuPHEh1mqLeS2wuVyGAFXK7JJsbofMpdQUcKzJzaAKTq4CoaxFxlsTEE1qqx AWEvcCOS8j2YA== Date: Tue, 8 Nov 2022 07:35:36 -0700 From: Nathan Chancellor To: xiafukun , Ard Biesheuvel Cc: arnd@arndb.de, keescook@chromium.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, yusongping@huawei.com, zhaowenhui8@huawei.comx Subject: Re: vmlinux.lds.h: Bug report: unable to handle page fault when start the virtual machine with qemu Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Tue, Nov 08, 2022 at 03:46:32PM +0800, xiafukun wrote: > 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. Thank you a lot for testing and sorry about the breakage in the first place :( Ard, were you going to send a patch? Feel free to preemptively add: Reviewed-by: Nathan Chancellor if so; otherwise, I can send one later today. > 在 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