Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp215307pxa; Tue, 4 Aug 2020 22:09:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxunn0n8x+tJKpMk8nn0lOoyN4mLHWkD11UI7Fldnvo1E0li9hssLJLcn+1m7RvuK/qYl5M X-Received: by 2002:a50:8fc4:: with SMTP id y62mr1140085edy.170.1596604142953; Tue, 04 Aug 2020 22:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596604142; cv=none; d=google.com; s=arc-20160816; b=0wfhtrjNT3Bkor8OMTB2mMrQcDwlN1cd8ff2tFNba+PVTiiqfOn94yNFvhhDog6ISs tOorl0T0hz773Tms/CsNLAMDEXgKBv8Dhat9i9Lsk2wFhhXgEbqjHrw/4r1nNRDZSKHV qKtmhpSN6VzTVu20E1PFQ55Ja9LE9v4JMpihj+WnWENPpo/5x9VCUDSqjvnqGB7c+4Ah X4G3kdYZwzt6tD58rZqu0WIrtOmZCMOXsibN1yEESTjEL4mVP+54RZC8KCUA9sWfowPF VmmceiRxAhMgA1c21tpeGvfeGDutjjHl/u8FTVA4taE/edMDIF+T4AugWuw8TnmrlGw5 clPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=1u26XeRiQkxkUBVyq1C3UUK8HOmJUYiFSDMJ8RBojNE=; b=Nbr6NV3eD+zDZIfSo/UAdsKRh+uPBWoWpPe6Dj3dE4bHdSGbrzK3K5OtekG3uywYEk Tj0Pe+02G34uxAPPa2xYlrdOE4FY+VfLhbssF8FlA9jwaHAouEwlhRhzKv/RMZVwlgI+ nL7gTnqBObmA4CaZoLGuP/62dtI+qzQPZ2pRbuH9H3tiF5NOLM14CN8rlVUssTgclW8L BAwRKmRwbM4MJdZRp6d5KmRPtwWDKF/kPkC6kSZzO15eBE9ZykxVoX9kSqNGx7kxAVQt Aa+gOJy7HqDu+2lfeh48dE2ZEgcpFZnxgtD6DbLA1FGT4kM46vFymgDESosNZmJcw9A8 GEnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=GG177QaJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oy1si410084ejb.733.2020.08.04.22.08.40; Tue, 04 Aug 2020 22:09:02 -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=@alien8.de header.s=dkim header.b=GG177QaJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725963AbgHEFIf (ORCPT + 99 others); Wed, 5 Aug 2020 01:08:35 -0400 Received: from mail.skyhub.de ([5.9.137.197]:43620 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725372AbgHEFIe (ORCPT ); Wed, 5 Aug 2020 01:08:34 -0400 Received: from nazgul.tnic (unknown [78.130.214.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 3ADE11EC011B; Wed, 5 Aug 2020 07:08:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1596604113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=1u26XeRiQkxkUBVyq1C3UUK8HOmJUYiFSDMJ8RBojNE=; b=GG177QaJonWAuUC13SR3y4ds2cnXadbPEM2YBqg3gbVe4APx1/ZqJxFvqeBQ429E56gssp hnXDUzgMZByTf4j+W575pNkPeQKZqZgMibU04gt1TV9zIVpPW3WqNAm3a0qlQ0W5/OorFV ta4ilidH/Xn1hV0nEokEGV9fcYhEfRs= Date: Wed, 5 Aug 2020 07:08:08 +0200 From: Borislav Petkov To: hpa@zytor.com Cc: Borislav Petkov , Ricardo Neri , Thomas Gleixner , Ingo Molnar , Andy Lutomirski , x86@kernel.org, "Peter Zijlstra (Intel)" , Dave Hansen , Tony Luck , Cathy Zhang , Fenghua Yu , Kyung Min Park , "Ravi V. Shankar" , Sean Christopherson , linux-kernel@vger.kernel.org, Ricardo Neri , Dave Hansen , linux-edac@vger.kernel.org Subject: Re: [PATCH v2] x86/cpu: Use SERIALIZE in sync_core() when available Message-ID: <20200805050808.GC9127@nazgul.tnic> References: <20200805021059.1331-1-ricardo.neri-calderon@linux.intel.com> <20200805044840.GA9127@nazgul.tnic> <47A60E6A-0742-45FB-B707-175E87C58184@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <47A60E6A-0742-45FB-B707-175E87C58184@zytor.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 04, 2020 at 09:58:25PM -0700, hpa@zytor.com wrote: > Because why use an alternative to jump over one instruction? > > I personally would prefer to have the IRET put out of line Can't yet - SERIALIZE CPUs are a minority at the moment. > and have the call/jmp replaced by SERIALIZE inline. Well, we could do: alternative_io("... IRET bunch", __ASM_SERIALIZE, X86_FEATURE_SERIALIZE, ...); and avoid all kinds of jumping. Alternatives get padded so there would be a couple of NOPs following when SERIALIZE gets patched in but it shouldn't be a problem. I guess one needs to look at what gcc generates... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette