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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 322B4C25B6B for ; Tue, 24 Oct 2023 02:33:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232030AbjJXCdn (ORCPT ); Mon, 23 Oct 2023 22:33:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjJXCdm (ORCPT ); Mon, 23 Oct 2023 22:33:42 -0400 Received: from out0-215.mail.aliyun.com (out0-215.mail.aliyun.com [140.205.0.215]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECA6BE8; Mon, 23 Oct 2023 19:33:33 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R241e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047202;MF=houwenlong.hwl@antgroup.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---.V6N0APV_1698114808; Received: from localhost(mailfrom:houwenlong.hwl@antgroup.com fp:SMTPD_---.V6N0APV_1698114808) by smtp.aliyun-inc.com; Tue, 24 Oct 2023 10:33:29 +0800 Date: Tue, 24 Oct 2023 10:33:28 +0800 From: "Hou Wenlong" To: Andy Shevchenko Cc: linux-kernel@vger.kernel.org, Juergen Gross , Boris Ostrovsky , Darren Hart , Andy Shevchenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT" , "H. Peter Anvin" , "moderated list:XEN HYPERVISOR X86" , "open list:X86 PLATFORM DRIVERS - ARCH" Subject: Re: [PATCH 1/2] x86/xen/pvh: Set up percpu for stack canary in 32-bit kernel entry Message-ID: <20231024023328.GA29837@k08j02272.eu95sqa> References: <90df6cf5674241a85ac7dfe0a1558f1fd025cc17.1698051454.git.houwenlong.hwl@antgroup.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 23, 2023 at 08:02:02PM +0800, Andy Shevchenko wrote: > On Mon, Oct 23, 2023 at 12:10 PM Hou Wenlong > wrote: > > > > In a 32-bit SMP kernel, the stack canary is a percpu variable accessed > > as %fs:__stack_chk_guard. However, the ABI for PVH entry does not > > specify the %fs register state. It currently works because the initial > > %fs register is 0x10 for QEMU, which is the same as $PVH_DS_SEL. > > > %However, for added safety, the percpu should be set up explicitly > > %before calling xen_prepare_pvh(), which accesses the stack canary. > > Stray leading % in two lines above. > Oh, sorry for that. It was added by mistake by my editor, and I didn't carefully review it before sending. Thanks! > -- > With Best Regards, > Andy Shevchenko