From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80F75C433E0 for ; Wed, 5 Aug 2020 05:08:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61B7122CB3 for ; Wed, 5 Aug 2020 05:08:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="GG177QaJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726128AbgHEFIf (ORCPT ); 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