Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp706305pxb; Tue, 19 Oct 2021 11:12:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1TSnR57Gxc7YuKTLcNFdbT6Afr+yQeXgCE4QdoAUqrlFsQeNyJAJW0FDJVckwOCFUO8kL X-Received: by 2002:a63:340c:: with SMTP id b12mr30001341pga.241.1634667161874; Tue, 19 Oct 2021 11:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634667161; cv=none; d=google.com; s=arc-20160816; b=f3yujYNGMNwAXAmLF9P5O/n5EEe77/lBmO4WM4zmuZHFRR7fzx2b8GJtvXeXB8iDyf dQFeSPPFmsLkv6u7VrFZeHwIXfq+ZqD7oRft7Qxx8xqR+ZYOLuzcZyKOhL+K12ZPe4qE PIf2QwYMQQm3aZUa8w/9eh4obePiH+ftz/dEvz4Z0/ndQZHcHdfS53ijSDHT6PN7BEU+ MOfriZ9Q+0dMz7Ymlpq6jK6EfVTFhTVL0OJB4geOBhJKPDKzHZnkm0a+hJubY2eJbV8p WjlYszLkfU5humTo7DFrvrIts4/1JhMkFPeaqKB9VPl9FRF8lLC478RNCTGW6wXzhw7w yskg== 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=VeYFXiKRU6zthsEyjtHIaMuVBQK6HWDRXfjT6cSuONM=; b=QooUdM3hD45fBfnMhwdW3h859V1s3T1FkUdFO4OHqXLAlB9ESNq6tAWciAm/nyb/wl zkqMBQZeXzVyevOElpsSoml2PApVTINcbDJKE0Geb8kbRi4Ug3tkBuOdmw+i09SIHVqi C/AHX+vj0u6XgfVYuyfVMMePK0tJF2nT61jvmJ2ICPzYdC5+ygijdUWSV2UyZnDqILZV gLEMRHW+97Ds4gE8dr8+jGWQ+i6FLifNNRPPO6egfYfPjN9pVwuiBRiyS1vMGnrVIXQC jpu5TsWyNFW0bG5Nq5so7xZhhVIg1z1oZAga8KaJ3VS+snANKv5jO0Y/gQiq6QvpVpOq 8W/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=aQq2YBYG; 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 h3si20545934pgk.330.2021.10.19.11.12.26; Tue, 19 Oct 2021 11:12:41 -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=aQq2YBYG; 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 S234884AbhJSSNY (ORCPT + 99 others); Tue, 19 Oct 2021 14:13:24 -0400 Received: from mail.skyhub.de ([5.9.137.197]:44296 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234612AbhJSSNX (ORCPT ); Tue, 19 Oct 2021 14:13:23 -0400 Received: from zn.tnic (p200300ec2f12f6007cf8d292d882f8b4.dip0.t-ipconnect.de [IPv6:2003:ec:2f12:f600:7cf8:d292:d882:f8b4]) (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 1A58C1EC0390; Tue, 19 Oct 2021 20:11:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1634667069; 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=VeYFXiKRU6zthsEyjtHIaMuVBQK6HWDRXfjT6cSuONM=; b=aQq2YBYG+KONTERCsktBz7RUzw2uZT74OEpi8RKTwCrDVlGBDcq92vx7T9pwFRjUCj0uIJ zqisG/wqb7OgaCLHPDsB8uy/XiLGPiTHI+OLm7a7AbpUFH9UroS8Xd3qr25l8IEr6Ncgvl EIVboy3zNnxhG3SKdxxcynAUdlTh2EE= Date: Tue, 19 Oct 2021 20:11:07 +0200 From: Borislav Petkov To: Thomas Gleixner Cc: LKML , x86@kernel.org, "Chang S. Bae" , Dave Hansen , Arjan van de Ven , kvm@vger.kernel.org, Paolo Bonzini , "Liu, Jing2" , Sean Christopherson , Xiaoyao Li Subject: Re: [patch V2 23/30] x86/fpu: Move fpregs_restore_userregs() to core Message-ID: References: <20211015011411.304289784@linutronix.de> <20211015011539.686806639@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211015011539.686806639@linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 15, 2021 at 03:16:30AM +0200, Thomas Gleixner wrote: > +static inline void fpregs_deactivate(struct fpu *fpu) > +{ > + __this_cpu_write(fpu_fpregs_owner_ctx, NULL); > + trace_x86_fpu_regs_deactivated(fpu); > +} > + > +static inline void fpregs_activate(struct fpu *fpu) > +{ > + __this_cpu_write(fpu_fpregs_owner_ctx, fpu); > + trace_x86_fpu_regs_activated(fpu); You're silently changing here the percpu writes to the __ variants and AFAICT, there's no difference on x86: # arch/x86/kernel/fpu/context.h:50: this_cpu_write(fpu_fpregs_owner_ctx, fpu); #APP # 50 "arch/x86/kernel/fpu/context.h" 1 movq %rsi, %gs:fpu_fpregs_owner_ctx(%rip) # fpu, fpu_fpregs_owner_ctx # 0 "" 2 VS # arch/x86/kernel/fpu/context.h:50: __this_cpu_write(fpu_fpregs_owner_ctx, fpu); #APP # 50 "arch/x86/kernel/fpu/context.h" 1 movq %rsi, %gs:fpu_fpregs_owner_ctx(%rip) # fpu, fpu_fpregs_owner_ctx # 0 "" 2 except maybe the __ variant doesn't use the "volatile" inline asm qualifier in the lower-level raw_cpu_write_8() vs this_cpu_write_8(). And there's the preemption check, ofc. Or maybe this could have something to do with RT...? Commit message could mention this change, though. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette