Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4203500pxu; Mon, 12 Oct 2020 12:09:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzO9O9xCVVWvZ57C3zQf3Ex7vOTMgWWBLDR3oQpqvCZcG1pswcZHy44cbN1BLturKkDqOsA X-Received: by 2002:a50:ce06:: with SMTP id y6mr16127761edi.273.1602529785542; Mon, 12 Oct 2020 12:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602529785; cv=none; d=google.com; s=arc-20160816; b=yRQxYk+c0O6vuXDIeG2ySppzgr82hHkBUSUqE0yYxVtUmgwO34j7VmnFsg7biUXnQW qqD3Pl8gASHNsH6ZknpEfnrZE7NTwMBRLZZJvVwRFxU1YrAoXpFqFKlwMh1AxtNvE1Q+ UTBQuJ7H6HoHMC6LXNf1uV/zGD7HCm1XBb0Oj/oXcMkeYjLs+ThJ4KCTeLMQlhii/AvM efH0xqESsB/4j98oMX04OBnGvaLGxkNh6JbP08TTNI1UeqNTem5cMpBY2WvErQ8H2Y0O i+N2Ql6aljekU1EmF8WI84ymr3B3VdgXJzHGhU5nXBtwINhnPDevddOR2t4F4MrbkICO zFjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=GgKziLMDcTgRqv21p5RhDayMhMe8Y6rVFzrXAD437ZU=; b=dunwpEfYZMy3z8e231K7wgPU4sgzcO1J27i93JaejhpJdVM4Hc0kOXt8GE2+WuNeBk +su56dbm8sYB6a+MXcBY4EozDpZlxbOlY4ShOzBPcqH9CTg+kSmIJwzoWN8rBSj8GL8b lhBiyzjQn5kpYkUcqP39tNrzaBxwc131b8jybmi73XtSUMp/FE78dJrMrzFqJzAnwbf8 2hEq5im26Nptch+L+WyEo1IKv6gpzTm++g4lLD4NXXFm/KSgTW1sQEa/s0NI554Fmxq7 5X7ZwJ9lYQ/+r4H58EeOhTLNze8TWxmlUAd7UWfPD/05kiAxK6aQBpqrKOwAZ00ScQ4V Yxgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=fDc71co2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id on24si12615962ejb.133.2020.10.12.12.09.20; Mon, 12 Oct 2020 12:09:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=fDc71co2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391218AbgJLTHS (ORCPT + 99 others); Mon, 12 Oct 2020 15:07:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390985AbgJLTDi (ORCPT ); Mon, 12 Oct 2020 15:03:38 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFE6CC0613D2 for ; Mon, 12 Oct 2020 12:03:37 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id p15so17918151ljj.8 for ; Mon, 12 Oct 2020 12:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GgKziLMDcTgRqv21p5RhDayMhMe8Y6rVFzrXAD437ZU=; b=fDc71co2gOFVLzUcpAtBr6zPs37rrhhDww+NlgBfbjHS0Z5DYoxFu5G1kqvYH5iayP MKHUpj6u23+x4/xuSmfAJjngVwP4Cg9R4JrkEYbshJYZZSpaWsHZ5mYnZyHdoPyfAi6c 1jhVKQJ4eK1WVCcMOJdA6wT021GDrHTaPqCMU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GgKziLMDcTgRqv21p5RhDayMhMe8Y6rVFzrXAD437ZU=; b=Ie0lnewhaJQv6D9F7i9ITORdjWcUG8ZbiWWXJlDDknWH7PxT4Wf2Igq99AAO/leKG/ zWnjWPz+J4zmuBjHqzNhF7lM4KducLLB8mejU81Cp3Aeh710LCV340hVJX65E/hKjw9D 8BR/LNnRPf1dKQ0urJk3KTB+9SiQ3TWWOexK5ECSuTNifSjyCygzvIGGuGNVlXYclznF S3sGZjm0+zvY+BubG6+TjqWzUg964qoh/pcfHa2bT4nn6q1AnGe7EDsnNYEx72XZ/gfi vguZETlZvyOgFnSDD+7+BUopeH0dR44ToTxl8BY3JnY+Msd1VPgxSLpx7CJHTQklzrFw s2YQ== X-Gm-Message-State: AOAM530Y46S1LFHY/28ckrO8N8lgGZUdsQf5uabo4x11gZ0GwLkasJO7 m8OFroA1c4foMd1S4JO8Z2mQUp9pc3F/9w== X-Received: by 2002:a2e:a371:: with SMTP id i17mr7937121ljn.173.1602529415810; Mon, 12 Oct 2020 12:03:35 -0700 (PDT) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com. [209.85.167.51]) by smtp.gmail.com with ESMTPSA id f7sm3579146lfj.0.2020.10.12.12.03.35 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Oct 2020 12:03:35 -0700 (PDT) Received: by mail-lf1-f51.google.com with SMTP id r127so19395530lff.12 for ; Mon, 12 Oct 2020 12:03:35 -0700 (PDT) X-Received: by 2002:a19:4186:: with SMTP id o128mr7877648lfa.148.1602529414847; Mon, 12 Oct 2020 12:03:34 -0700 (PDT) MIME-Version: 1.0 References: <20201012110557.GK25311@zn.tnic> In-Reply-To: From: Linus Torvalds Date: Mon, 12 Oct 2020 12:03:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] x86/asm updates for v5.10 To: Uros Bizjak Cc: Borislav Petkov , x86-ml , lkml Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 12, 2020 at 11:56 AM Linus Torvalds wrote: > > I also find that clang generates code that uses the high byte > registers, although again, that's not from any knowledge of clang > internals, and just by looking at my kernel image disassembly. > > So yes, it _may_ all be just peepholes, but it's not obvious that this > is all safe. The clang use I find seems to be _purely_ for variations of "mov", and only ever with the high register as a source. So yes, that one looks very much like a peephole optimization where clang just recognizes patterns line X = (y >> 8) & 0xff; and uses a "movzbl %*h,xyz" for it. Gcc actually seems to use high registers more, but the extended use seems to be bit test (and set) operations that also may be simply peepholes. So yes, from code generation patterns it does look likely that neither compiler actually considers the high registers to be truely independent entities, and thus quite likely that you'd never find concurrent mixed use. But that really seems to be an implementation issue rather than something we should necessarily rely on, unless we have a stronger statement from both compiler camps.. Linus