Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5017323imm; Tue, 26 Jun 2018 04:40:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL6aiKblUFECxPd/1UWkJuDbDUtftYd3CpxqlXnGbqk2Z0FoWIfngVW/PbWgHCv4OlIiAig X-Received: by 2002:a17:902:c6b:: with SMTP id 98-v6mr1231972pls.37.1530013214331; Tue, 26 Jun 2018 04:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530013214; cv=none; d=google.com; s=arc-20160816; b=GEYtGWWx1Dkdnlclb3JuCqzTpVr4qCnOsSP3aU712Qg296J+Y0Wsfr6yIr9RbgPP1q IeywIItgy7DiwTH1yLbKhluS0oU153YHxvZ/+2MS71f17/dghItv7wSu0C803pAJL6xc VJ+2vGwhAHjPN8XMGBdhkif6aEa4+ireT1uEWXxBPlrp4/NeOKPyT/lDv2nsJjKAgTYJ OvswIiWOhtTGMMHztUBet95wLD9Q9xmrQZyAtoG/PN6o2lqU8qSkGMs4s0wfdqG7FlM9 XT0lHUf6lBxsP0qKBrFkPcY/foKSWgL7FXiSdcGTJgZpKylGB7TQZmiyIao1GBXjWgIu Ru8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature :arc-authentication-results; bh=ElMQ7Ghl55g6qIiDh1qRe9jNlpV4pYIbd8G9LkpZKOU=; b=ozBCTTwOerj4D83uYK1GaXkZkwTEEL1b8sgcgLgcn24UqIoHV9Tl5DIQvP75lAyy2l 2oBVoW62ODijMpNp06iJEPfxhrI6YIaLUuL1EYS/G7H9K/tHhC6Gkbf4v4MqnvS6G9sd x+PkdXYEbkcN5XEBRL6Y/pL8Iw2WA+F73Fd1YP17ZgRKdRZezmn3iMqQ6+XX/i9pi+D4 r+nTcV1E0akt0jkBmBE954pC6YaQ5+8o+v2txCRG42A9U7Mpuyfko7/x4wx76ai7NhNs I8+souKtzId9bsjAa8PuzrfAZdymJHYq1DkaXiIc42FoTh2hLp5LB2/hZtGa+d9ru60e CI4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hmh.eng.br header.s=fm2 header.b=Nq5Gyxr0; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=vTzYmxdu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a11-v6si1479491plp.108.2018.06.26.04.39.59; Tue, 26 Jun 2018 04:40:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@hmh.eng.br header.s=fm2 header.b=Nq5Gyxr0; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=vTzYmxdu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934797AbeFZLib (ORCPT + 99 others); Tue, 26 Jun 2018 07:38:31 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:47361 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933780AbeFZLi3 (ORCPT ); Tue, 26 Jun 2018 07:38:29 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 1EF8721D65; Tue, 26 Jun 2018 07:38:29 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 26 Jun 2018 07:38:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hmh.eng.br; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=ElMQ7Ghl55g6qIiDh1qRe9jNlpV4pYIbd8G9LkpZKOU=; b=Nq5Gyxr0 L6XE91KIAxdhK6InKF+holQXcSToDHAsur1F6ENUwOBzJsIIZO1q/4XDneU66q9i UTNDqB70WVD1mdDLfM7shaUEeG3tVY5BJttXHqlO8QYdm4ca5w4MBgYJZQ16zakP +RkhUidp8WCskLpbRskLJpVt9JZWnqvESQNFl7JJEej/GQXlprtmZIGCEoQjmWjT 1bVTljPd3y6v7Ttj1TWdUCFr8jjZdMwyZdeLKB77oistDWUH2a/2x++WzTQlYgWz uuWZbR7xjACUo3XK0/AESQ8llAbrKw6OOEF5piAvMLMHrVkKGR9cZ/ERvgKgh2Fz ZYkQKqoli92EVQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=ElMQ7Ghl55g6qIiDh1qRe9jNlpV4p YIbd8G9LkpZKOU=; b=vTzYmxdu4X1fUpvU1BI/xzE0a7trH2Y8TLn0cHyxRpK7i 7jcC0yvFB7SxR5fD84EEAG1CDH/zfUgYvvK6FeTnDmdLayLyU8o2lP8ZA2f5ovqU eaOkYmwu+DW0Uow6laQ6CsxYycahrT0c8SbEg7YPZm+S3Vqt8KrVDUMQ+h4TYimH DhlTNBSYV3aaG9W6WVl2FoCTBhZkbJECSyGrPuG26CVbJ777kOX5JkpuDYQ9kQ69 MP4qz6BO+lFR3eHbd+p3ZkzppM4YlHN3IFvrNNCLifC6OPAey8wq2q8jTKqDj/kP Wq65vYeJin62fjZ4hE4qumT/WkEW0fhL9LgijD1AQ== X-ME-Proxy: X-ME-Sender: Received: from khazad-dum.debian.net (unknown [201.53.245.99]) by mail.messagingengine.com (Postfix) with ESMTPA id 8F14710298; Tue, 26 Jun 2018 07:38:28 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by localhost.khazad-dum.debian.net (Postfix) with ESMTP id F322E340133A; Tue, 26 Jun 2018 08:38:26 -0300 (-03) X-Virus-Scanned: Debian amavisd-new at khazad-dum.debian.net Received: from khazad-dum.debian.net ([127.0.0.1]) by localhost (khazad-dum2.khazad-dum.debian.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Jvy4VZmOQavS; Tue, 26 Jun 2018 08:38:23 -0300 (-03) Received: by khazad-dum.debian.net (Postfix, from userid 1000) id 14DBE3400BEA; Tue, 26 Jun 2018 08:38:22 -0300 (-03) Date: Tue, 26 Jun 2018 08:38:22 -0300 From: Henrique de Moraes Holschuh To: Jan Beulich Cc: mingo@elte.hu, rdunlap@infradead.org, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86-64: use 32-bit XOR to zero registers Message-ID: <20180626113822.ch3erlyud5wsxvvg@khazad-dum.debian.net> References: <5B30C32902000078001CD6D5@prv1-mh.provo.novell.com> <5B31DDFF02000078001CDC03@prv1-mh.provo.novell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5B31DDFF02000078001CDC03@prv1-mh.provo.novell.com> X-GPG-Fingerprint1: 4096R/0x0BD9E81139CB4807: C467 A717 507B BAFE D3C1 6092 0BD9 E811 39CB 4807 User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Jun 2018, Jan Beulich wrote: > >>> On 25.06.18 at 18:33, wrote: > > On 06/25/2018 03:25 AM, Jan Beulich wrote: > >> Some Intel CPUs don't recognize 64-bit XORs as zeroing idioms - use > >> 32-bit ones instead. > > > > Hmph. Is that considered a bug (errata)? > > No. > > > URL/references? > > Intel's Optimization Reference Manual says so (in rev 040 this is in section > 16.2.2.5 "Zeroing Idioms" as a subsection of the Goldmont/Silvermont > descriptions). > > > Are these changes really only zeroing the lower 32 bits of the register? > > and that's all that the code cares about? > > No - like all operations targeting a 32-bit register, the result is zero > extended to the entire 64-bit destination register. Missing information that would have been helpful in the commit message: When the processor can recognize something as a zeroing idiom, it optimizes that operation on the front-end. Only 32-bit XOR r,r is documented as a zeroing idiom according to the Intel optimization manual. While a few Intel processors recognize the 64-bit version of XOR r,r as a zeroing idiom, many won't. Note that the 32-bit operation extends to the high part of the 64-bit register, so it will zero the entire 64-bit register. The 32-bit instruction is also one byte shorter. The last sentence is just a reminder, for completeness... -- Henrique Holschuh