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=-12.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 35EC6C04EB9 for ; Mon, 3 Dec 2018 21:05:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F40322082F for ; Mon, 3 Dec 2018 21:05:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F40322082F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zytor.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726138AbeLCVFH (ORCPT ); Mon, 3 Dec 2018 16:05:07 -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 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) {