From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4194B345757 for ; Thu, 12 Mar 2026 19:28:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773343688; cv=none; b=XC/kYA+7H6ekw/VfQODdLJdrx6N8hXND3b8sy4GgdchrvbkRq0njlLhWZwa8LnQVLF187/owUXLjTnFTZijLs3gGFXdTfMVW53LtjYCoX0/030pTNvEigbNqyubwAgTs0ezxOoT+TC5x+YBi38i31EdboV9U4zR/g2mPceZeAeo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773343688; c=relaxed/simple; bh=InqSOG2gS2PdhMFNJAZCja0kKkGjeo2Mh24rXjoUbnQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cTdLihEOL1C0uLyDSLbzCRmQwkEJNPKigZBj3D2NUPgPKKtJhTE5imp+LXLPZs7XXf/6ZypJjNIqobPoKvEd8fI9V2rw060/XwuJk4kPYR5dvXp/BnGJNx3A77YTPNKIvlTdcT7N/T1Y5qhw3biVKUeNTVZEOEyogJU3nN12jng= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=RH1Wn2Zk; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="RH1Wn2Zk" Received: from [172.27.2.41] (c-76-133-66-138.hsd1.ca.comcast.net [76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 62CJBonE2946227 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Thu, 12 Mar 2026 12:11:50 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 62CJBonE2946227 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2026022301; t=1773342711; bh=1hnqGdYU+NzdR6Z4vpf2PAToe+Wc45nhjNijlu9TH5U=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=RH1Wn2ZkEW0iwK95d7pKlshY+uJypMZdCBlOT4oHOubLS+G3ARX7/3tEBEfdln24d oMPshUUEgX3EVGuKHamaPQx/uI4twrsV0/qXFbenBh2bdRr6wxp6WoHnJdKkCKNPtw jtnY7a5ZJUKhTAgyhuKzvuo8QBxVZdwRxLXqcwHWKULZq4ts1z9drfN1MaIVeUswt5 wviSF2C0qLY5Z1ntBur6HgM0s35NV6r2QGSFvJsRx10IJp9uBPbvXtTiwy4TwvWYSK vrVt5ytHQJrFosm9dfP9QLlRo6PK7zsBLcucKGJk/eWohGIH0cHxY6GjFysiamQ/Ac ryi7bd5GkBY3g== Message-ID: <38489a10-a081-4dd4-b50c-27c13189acfb@zytor.com> Date: Thu, 12 Mar 2026 12:11:45 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [tip: x86/cleanups] x86/segment: Use MOVL when reading segment registers To: Uros Bizjak Cc: linux-kernel@vger.kernel.org, "Borislav Petkov (AMD)" , x86@kernel.org, Dave Hansen , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , David Laight References: <20260105090422.6243-1-ubizjak@gmail.com> <176891088183.510.8607818928752445249.tip-bot2@tip-bot2> <3A54B6DC-2462-41DA-8C34-D38CCD2A9A2B@zytor.com> Content-Language: en-US, sv-SE From: "H. Peter Anvin" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Note: I personally *hate* the savesegment() syntax. For one thing, I would much rather see a more C-like syntax, even if that means making a bunch of inline functions. Replacing the macro with something that is actually type-safe would be a bloody good thing, too. Something like: /* Generates register operation */ static inline unsigned int ds(void) { unsigned int v; asm volatile("mov %%ds,%0" : "=r" (v)); return v; } /* Generates memory operation */ static inline void save_ds(u16 *dst) { asm volatile("mov %%ds,%0" : "=m" (dst)); } Generating those inlines can be macroized if we really feel the need to, of course... -hpa