Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1740652imu; Wed, 28 Nov 2018 14:25:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/VfT9O6WUWbyWsRxdkHpasYHjhGlO8GmnfYZ1yM0eOXymUsSU3ClIaBcjGSOh7g0aeqtZid X-Received: by 2002:a62:9913:: with SMTP id d19mr34123793pfe.107.1543443939897; Wed, 28 Nov 2018 14:25:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543443939; cv=none; d=google.com; s=arc-20160816; b=xhygkIvjLHNNekSbNjNaoGAX1TyGnYriGRs54sPHhIL8O7GYQSxNMa2URDHDUAqBbY AAQwEN+0GI/nXgeaKSpQf6SdKN8BxQE3/1gzvGsrLa9tIwMiKndBZ6IrwEJ92cL7lWUU KRcEOCm5su5XM77RiaEnVnA0GTgLznO71RjpFlodS8pOfbfs8jDajRs5tvESLuL2KpYI DZnSOa5KH2j9t9CWQZXCSyudHIYEJ8BsajaN28sg+hotTmA2UdT0vVU5w4CnWzWbmQ8h yBNuNYotT6J+TQSVr0Ou6Wmen7JsPt+ITQJuvUkD42foW/C8jIYhoDVQAhs7BTFs8WM4 edyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5vDJ3OH4k19wnoPn/UTkKAYph/qYuEjbYPMy5f0HoMM=; b=uNYTpgyFgpW+6kMW/bthhUdPDVh1C76ozK/TZphFB0kiOBnlhH7JBWlzdJDywdwR7z NqWBMU0qHn4Dx2JEIYW7KLVwcmWi55bRgHADNQpqHYxD8ZP0G00Vzh6JkfJhkdqZ1Bj7 y+MOGLsC44Dwr+kgUkdW7cJ6AoEhwoBLdnro+ddGuCk8g0Ec+bXZbb1wvg/AS5C2ZXiR +eVMi4c2qoY1d5z1fYh2Knmr8hBQxtmZYqY57g61MOHpLxkx+IcL3NzmU4ZDcNopgqYk OWBHQrY5wstL8g+wuy5hMiGgqo+7fPGT3GV/jJXdbwFbGI6vRAbMgLBiOBeJP9RScSX3 ck1g== 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 e2si8180686pgs.94.2018.11.28.14.25.24; Wed, 28 Nov 2018 14:25:39 -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 S1727473AbeK2J06 (ORCPT + 99 others); Thu, 29 Nov 2018 04:26:58 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:33066 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726713AbeK2JYJ (ORCPT ); Thu, 29 Nov 2018 04:24:09 -0500 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1gS8CW-0001GX-Qb; Wed, 28 Nov 2018 23:20:57 +0100 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Andy Lutomirski , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , kvm@vger.kernel.org, "Jason A. Donenfeld" , Rik van Riel , Dave Hansen , Sebastian Andrzej Siewior Subject: [PATCH 06/29] x86/fpu: Update comment for __raw_xsave_addr() Date: Wed, 28 Nov 2018 23:20:12 +0100 Message-Id: <20181128222035.2996-7-bigeasy@linutronix.de> X-Mailer: git-send-email 2.20.0.rc1 In-Reply-To: <20181128222035.2996-1-bigeasy@linutronix.de> References: <20181128222035.2996-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The comment above __raw_xsave_addr() claims that the function does not work for compacted buffers and was introduced in commit 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 --- 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 69d5740ed2546..359564beab5c3 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) { -- 2.20.0.rc1