Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7447704imu; Mon, 3 Dec 2018 13:06:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/XsJg0Hvj8kTHr9cXC08clSBrv5iilyElH1sz4XBTvFgaP0tTtDfRtoMbZIPGr2znuihZJd X-Received: by 2002:a62:5658:: with SMTP id k85mr17286312pfb.231.1543871208929; Mon, 03 Dec 2018 13:06:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543871208; cv=none; d=google.com; s=arc-20160816; b=qyrFUullw+YDafi21P5yGMBV1r6AU+2GF83WaHEJRN4APBds6Ho+8SZzpWruLlFwqN fXPRqiPrqAJ6JeOEUGwJJD1FrSKdCp/wy3qZS6Ue2VXC2u2k8c7sO5eyUXnG05DI3z/r 2sImPY97pDWwlVYq2euBOqyUkkvEOmySD/TDjiOnHyWN0C8zcLNzT4DNzKzo1c1fEL6/ Z43IjzhxkFcw4pDEeFy0vMnaOBW5QJiPnS7Ilm8qnzPI6tOz6e1ZE/STaktZ+tJXBF5A qFTYCyS3scmxhziluff3CHA0OoaFgodRjrv13P30t/iiFE3AVDaIm4bERfk2lAl1KLEJ Edcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=oI7BTl5CWiCpG0rl0Urvq1jCpc3VpvKspGrge2t5VAc=; b=Sxgz/NNAfmpqGc7pzrRrqbJjf7mX04wjrtirNG0VphOsDiWb109VDS85gPR8dplkVR ndEO0HHHjoeodTPuhtStSlK2tfotiifaDj3p7vWwIDiGCu4LQpjIQY191o3ENFuk65Ra WUx+4P27FInnJS6xzjZjQFuAMifESlVm6TK4p2DvClG3WJgyX7ZiAvzPBwuUpEdYfLJN vmm4ETpZaymCIbUZ24UnmYbf7CcZs9UAy1QmAMjmjXb5st6/VWyBspdVEqRHv9GCVXbm YjAJbiJAygO/BusQ24Sk8glS/eL2rXepPHcoolKpQwqKfBQdy5o/A4ANF4EtZpX2j1AD T8yQ== ARC-Authentication-Results: i=1; mx.google.com; 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 e21si12999712pgg.571.2018.12.03.13.06.33; Mon, 03 Dec 2018 13:06:48 -0800 (PST) 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; 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 S1726130AbeLCVFG (ORCPT + 99 others); Mon, 3 Dec 2018 16:05:06 -0500 Received: from terminus.zytor.com ([198.137.202.136]:59431 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbeLCVFG (ORCPT ); Mon, 3 Dec 2018 16:05:06 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wB3L3msh594739 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 3 Dec 2018 13:03:48 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wB3L3mKs594736; Mon, 3 Dec 2018 13:03:48 -0800 Date: Mon, 3 Dec 2018 13:03:48 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Sebastian Andrzej Siewior Message-ID: Cc: luto@kernel.org, riel@surriel.com, bigeasy@linutronix.de, hpa@zytor.com, rkrcmar@redhat.com, bp@suse.de, pbonzini@redhat.com, tglx@linutronix.de, mingo@redhat.com, mingo@kernel.org, kvm@vger.kernel.org, x86@kernel.org, Jason@zx2c4.com, linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com Reply-To: mingo@redhat.com, kvm@vger.kernel.org, mingo@kernel.org, Jason@zx2c4.com, dave.hansen@linux.intel.com, linux-kernel@vger.kernel.org, x86@kernel.org, bigeasy@linutronix.de, riel@surriel.com, luto@kernel.org, hpa@zytor.com, tglx@linutronix.de, pbonzini@redhat.com, rkrcmar@redhat.com, bp@suse.de In-Reply-To: <20181128222035.2996-7-bigeasy@linutronix.de> References: <20181128222035.2996-7-bigeasy@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/fpu] x86/fpu: Update comment for __raw_xsave_addr() Git-Commit-ID: 2f2fcc40a961ed04f0e130803fbaa868c2899310 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 2f2fcc40a961ed04f0e130803fbaa868c2899310 Gitweb: https://git.kernel.org/tip/2f2fcc40a961ed04f0e130803fbaa868c2899310 Author: Sebastian Andrzej Siewior AuthorDate: Wed, 28 Nov 2018 23:20:12 +0100 Committer: Borislav Petkov CommitDate: Mon, 3 Dec 2018 19:27:14 +0100 x86/fpu: Update comment for __raw_xsave_addr() The comment above __raw_xsave_addr() claims that the function does not work for compacted buffers and was introduced in: b8b9b6ba9dec3 ("x86/fpu: Allow setting of XSAVE state") In this commit, the function was factored out of get_xsave_addr() and this function claims that it works with "standard format or compacted format of xsave area". It accesses the "xstate_comp_offsets" variable for the actual offset and it was introduced in commit 7496d6458fe32 ("Define kernel API to get address of each state in xsave area") Based on the code (back then and now): - xstate_offsets holds the standard offset. - if compacted mode is not supported then xstate_comp_offsets gets the xstate_offsets copied. - if compacted mode is supported then xstate_comp_offsets will hold the offset for the compacted buffer. Based on that the function works for compacted buffers as long as the CPU supports it and this what we care about. Remove the "Note:" which is not accurate. Suggested-by: Paolo Bonzini Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Borislav Petkov Reviewed-by: Rik van Riel Cc: "H. Peter Anvin" Cc: "Jason A. Donenfeld" Cc: Andy Lutomirski Cc: Dave Hansen Cc: Ingo Molnar Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Thomas Gleixner Cc: kvm ML Cc: x86-ml Link: https://lkml.kernel.org/r/20181128222035.2996-7-bigeasy@linutronix.de --- arch/x86/kernel/fpu/xstate.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c index 69d5740ed254..359564beab5c 100644 --- a/arch/x86/kernel/fpu/xstate.c +++ b/arch/x86/kernel/fpu/xstate.c @@ -808,8 +808,6 @@ void fpu__resume_cpu(void) * Given an xstate feature mask, calculate where in the xsave * buffer the state is. Callers should ensure that the buffer * is valid. - * - * Note: does not work for compacted buffers. */ void *__raw_xsave_addr(struct xregs_state *xsave, int xstate_feature_mask) {