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 65CAAC433FE for ; Mon, 10 Oct 2022 04:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231153AbiJJEvv (ORCPT ); Mon, 10 Oct 2022 00:51:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbiJJEvs (ORCPT ); Mon, 10 Oct 2022 00:51:48 -0400 Received: from mail.zytor.com (unknown [IPv6:2607:7c80:54:3::138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A20026566 for ; Sun, 9 Oct 2022 21:51:45 -0700 (PDT) Received: from [127.0.0.1] ([73.223.250.219]) (authenticated bits=0) by mail.zytor.com (8.17.1/8.17.1) with ESMTPSA id 29A4pJiQ127633 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Sun, 9 Oct 2022 21:51:20 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 29A4pJiQ127633 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2022100601; t=1665377480; bh=UBkpJcmuZpohyH+0IUzegBEZKTqQnErY39YIEpDxOgg=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=Gz7l+0vlIObxcvL5Ok7ZUi9NlgciEvs6WDdEVJNGLWBhGDENbGbtt3FH8aofDkfqd EuhdO8ELhQARAcy5gPqgwCZPDG79PlewpapsilJOTzjJXZPIaW0enxxcvTCVCmWbpq 3yCjx56n9KRndOAn0VZqSi10f42vLYqaZEToB2MLQmhzbP27WWtekp+ejeUTBVDVPD RPFHs/3Vg7B/nvf7fHT56up5EWjvJXb71Bfl+M2sogyaGTeMGyBKdZ4NiNHnlrEoWZ av2bfGXz6BZDtKnN0gJa4ms6nZLl+AE3JkQrFH/29J4vJEcYOw3kJ7xJleYOfRQcvi tjaIGvXAwS3TQ== Date: Sun, 09 Oct 2022 21:51:18 -0700 From: "H. Peter Anvin" To: "Li, Xin3" , Brian Gerst CC: "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" Subject: =?US-ASCII?Q?RE=3A_=5BPATCH_6/6=5D_x86/gsseg=3A_use_the_LKGS_in?= =?US-ASCII?Q?struction_if_available_for_load=5Fgs=5Findex=28=29?= User-Agent: K-9 Mail for Android In-Reply-To: References: <20221006154041.13001-1-xin3.li@intel.com> <20221006154041.13001-7-xin3.li@intel.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On October 9, 2022 9:32:34 PM PDT, "Li, Xin3" wrote= : >> > > There are not that many call sites, so using something like this >> > > (incorporating Peter Z's suggestion for the exception handler) woul= d >> > > be better from a code readability perspective vs=2E a tiny increase= in code size=2E >> > >> > The existing approach patches the binary code thus we don't need to c= heck it >> at runtime=2E >>=20 >> static_cpu_has() uses alternatives to patch the branch, so there is no = runtime >> check after early boot=2E >>=20 > >Sorry, didn't know it, thanks for point it out=2E > >If we prefer static_cpu_has, are you asking to replace all alternative ma= cros with it? > >Xin > > Honestly, it seems to me to be more than a bit excessive=2E The code might= be nontrivial, but *with proper commenting* it should be perfectly underst= andable=2E=2E=2E