Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp834903pxb; Wed, 22 Sep 2021 14:09:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk8/5XFzvXJ+Af256qowtsMk61/+/oLR7okuRewwMZGmS0aNlfvSXcoFV0F4YdgR7VHuy0 X-Received: by 2002:aa7:c7c2:: with SMTP id o2mr1637777eds.166.1632344979608; Wed, 22 Sep 2021 14:09:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632344979; cv=none; d=google.com; s=arc-20160816; b=diZqmhRIzXbx3oYKmsWWdW3EaU1PrB+J5P+RmlT39phH3UKCGGAn2+kzsYj6edyKEH XmPjtCtEc6wuYrRiKv7ZaDr2RGtzggOaj3VUV8GfD/FOIDtjDBDBkcRAenBAdFReKR+G 1ayBMtm9MbP4sJqkDC5b6U3CvKtKEiWvpvK3AO3QOy1mxEG4JhKY3zw4QCGIrpunB2pr 9YdN91WxOXx/QpqIrFwY7iz92K9S/2uYR+NWv021x225m9l7j1/sh3seXSX3vGhsNrjP b72s3GmNrf+p6rW+iI3dQcwOClrlqfQpJI9Aknva1T/WWVRY4BIE2bcdXAMFPpQoA9+C kH/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/PcqjgcRCkyIpO5H00bhPWTTbPCMNXWR4nKgirdi3Io=; b=Obnje8bBjpoALGaVIkacJLu6t9kiRS+Lji719tg6P2JNGTMj06eI7zdWOQow3f5jTJ +OP3EuXRKLYPVW8A2jr6P3H9OfSLsKJQII+YkoGTQJ7XeDLPQ3rO7Wds4GvgTfbGz7e6 YoTR6g0eBowYlnDk4QpdozCOT/2kFKxrsjHIYdifWLHzWjlJn7BHgYvsHDmBMKlaZK7o 0Nbh8jq53LTbWSwO3BhkSH6g4LrI4JFoziYNGan3N3KNJ3Tlx80IQmBF7/lac0iu9VHk MiykT8v+3mbEmE0WeBWbPE27gU0rVR2dxPfBiHaQf6p/BrvqJOHNvHGlTy7PVyZw72XU Emiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20210112.gappssmtp.com header.s=20210112 header.b=xEkq7SUZ; 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 x15si4141021ede.404.2021.09.22.14.09.16; Wed, 22 Sep 2021 14:09:39 -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=@shutemov-name.20210112.gappssmtp.com header.s=20210112 header.b=xEkq7SUZ; 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 S236476AbhIVVHa (ORCPT + 99 others); Wed, 22 Sep 2021 17:07:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237812AbhIVVH3 (ORCPT ); Wed, 22 Sep 2021 17:07:29 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D43CC061756 for ; Wed, 22 Sep 2021 14:05:59 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id b15so16787691lfe.7 for ; Wed, 22 Sep 2021 14:05:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/PcqjgcRCkyIpO5H00bhPWTTbPCMNXWR4nKgirdi3Io=; b=xEkq7SUZRewChVZqWhm4cS96l8pPzSSEz+ScgQL56dgjn10FcSw+jLPv0OY9bYezIP CYphaUGJXn/snvtDU3KSfg579Nb5Qlk3NtUo6CuASAlclCh3ui7cA33wRO6foyyQk9sK Mw3x0Ft59CKVBwMroO3W4lugA/tv5mEWbElbrHB+wIwMc5ZNjOZSS8KT6h+Zon+cf4qv JmEltnmffmbEBqUsebTV11v0B5U1mVwBUj3sW1gLZspQ54hm7TrP9j1QPJEblcLAhwI2 nEggNK9m8gYxewjcBCYSYCHLIhl9iSTZmO6vl1lqR1Tl54TSO4jEGxDT96zBALyLtnLS Hi0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/PcqjgcRCkyIpO5H00bhPWTTbPCMNXWR4nKgirdi3Io=; b=NTs9t2M41Z3J9heUxu+EC0+NZp+EHhwjJEhTwSmvw71ByOeourwqaffDgDeLjwntr9 taoLuWMzA6yK7Pl8tErc26TyMamWXkbptKdfhCg0ROk/RPrZTIOv3fS+j3KQksy+Rrzc GwTPK/bSOGF5J3tRgePPYI7ocEgDgWXZHOGfOWzqZlcOXp+0DOp4Sx0ym8ghmigYAHG2 ojhZ0NQ1HgZeRHsH4pSp2zUMsVGY6U3LzLJtl2Fcwu4QhIcp8N26NCtJ5Sd6u1DX4cUy rbIu9RY6b8Iq9nbq+PMT4ga+TIgucb6PO/o28P6JALZeXOx0syMoBU0pTk38s263jcd3 CkRg== X-Gm-Message-State: AOAM533BJbyBP1vTG0tvUyM1rCd7FBeCYuOJ737CPDqC3M/1lxcNjmxZ LJ2Wbkjxzo4YpzfVQhWaM7U5Ow== X-Received: by 2002:a05:6512:5c2:: with SMTP id o2mr917110lfo.207.1632344757440; Wed, 22 Sep 2021 14:05:57 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id bi33sm370467ljb.89.2021.09.22.14.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 14:05:56 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 60F2A10304D; Thu, 23 Sep 2021 00:05:58 +0300 (+03) Date: Thu, 23 Sep 2021 00:05:58 +0300 From: "Kirill A. Shutemov" To: Borislav Petkov Cc: Tom Lendacky , linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, iommu@lists.linux-foundation.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-graphics-maintainer@vmware.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, kexec@lists.infradead.org, linux-fsdevel@vger.kernel.org, Brijesh Singh , Joerg Roedel , Andi Kleen , Sathyanarayanan Kuppuswamy , Tianyu Lan , Christoph Hellwig , Thomas Gleixner , Ingo Molnar , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Will Deacon Subject: Re: [PATCH v3 5/8] x86/sme: Replace occurrences of sme_active() with cc_platform_has() Message-ID: <20210922210558.itofvu3725dap5xx@box.shutemov.name> References: <77df37e1-0496-aed5-fd1d-302180f1edeb@amd.com> <20210921212059.wwlytlmxoft4cdth@box.shutemov.name> <20210921213401.i2pzaotgjvn4efgg@box.shutemov.name> <00f52bf8-cbc6-3721-f40e-2f51744751b0@amd.com> <20210921215830.vqxd75r4eyau6cxy@box.shutemov.name> <01891f59-7ec3-cf62-a8fc-79f79ca76587@amd.com> <20210922143015.vvxvh6ec73lffvkf@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 22, 2021 at 09:52:07PM +0200, Borislav Petkov wrote: > On Wed, Sep 22, 2021 at 05:30:15PM +0300, Kirill A. Shutemov wrote: > > Not fine, but waiting to blowup with random build environment change. > > Why is it not fine? > > Are you suspecting that the compiler might generate something else and > not a rip-relative access? Yes. We had it before for __supported_pte_mask and other users of fixup_pointer(). See for instance 4a09f0210c8b ("x86/boot/64/clang: Use fixup_pointer() to access '__supported_pte_mask'") Unless we find other way to guarantee RIP-relative access, we must use fixup_pointer() to access any global variables. -- Kirill A. Shutemov