Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp220204rwi; Sun, 9 Oct 2022 22:10:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM403STZ0gDrr9Zp/BtiWwlz6ftHQU6j/bR7SQTzewOjw46b9Z5DUsg9y4QSnWKEK8EymRKl X-Received: by 2002:a17:906:9c83:b0:779:c14c:55e4 with SMTP id fj3-20020a1709069c8300b00779c14c55e4mr13058045ejc.619.1665378612855; Sun, 09 Oct 2022 22:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665378612; cv=none; d=google.com; s=arc-20160816; b=eN92sPusy5vM4t49ioM96E8KU4lLuNsDQUmKbuqQXuc8GywqhZfH9dyEqqDXNn61uh M0k7hD09PYm9tvxEfP27NnKVPK3ypkhQGNyqTSqjHA4PzxEE3t3U8g7sbW2rjfoIlfPS f6cU1jGFiqzUIgVlOfeClg1HEAlw9eH+n3uWZIxacw2yht5v16xgpRB4GZt/VnkUsGjG H4oDLi/dnfKssDUi0rG2bPl9T6OZKMOcOcXVPBWpnjyE+g/jhw3DY9lcwJEQFdLZ1F4h ZKBN/ygyqWZ0eSDN3d99NdgA3SYv3jQ3UNXHW50wegCWtcxT7y6+4pFkvuhKSsBzXA9e COKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:user-agent:subject:cc:to:from :date:dkim-signature:dkim-filter; bh=UBkpJcmuZpohyH+0IUzegBEZKTqQnErY39YIEpDxOgg=; b=VKl6g1SjWqd37qLeOJJUQoxKc/qe7P7MHQGlgsGg8rOH+Y9TwjUB0aRNnzHWYgIUnH iOGwdVjqsKF3SBajdxElt5I1pRggrqqq9ewIJufd6ACJZhxeG/bGu3J5xKfealxVMWz9 FMHGIzhluppZ6hoBwiMxXm3+XduMk+N20r1n6F8ehuwJ7Efc+BHlW2UTDV2UTM7WfuZp zktz2qyL/FwzCm5Ko2g6IVwLyUTnQFVK7rwfzIWsKLQcbalBbh5UhjUaLFf33qlLdL6n O9FohfAhmucDscObhy+M3wNW3l4jGMC1CKll4Fw4r2DS0Q7RADkyr8FN6r5GSpxqhYYT O6Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2022100601 header.b=Gz7l+0vl; 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=zytor.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e16-20020a056402191000b00450bda7e3fdsi10862550edz.28.2022.10.09.22.09.46; Sun, 09 Oct 2022 22:10:12 -0700 (PDT) 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=@zytor.com header.s=2022100601 header.b=Gz7l+0vl; 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=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231146AbiJJEvu (ORCPT + 99 others); Mon, 10 Oct 2022 00:51:50 -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 X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_PASS, SPF_PASS autolearn=no 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 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