Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3616446pxj; Mon, 24 May 2021 10:38:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5OggaVTHaQ+wbNfPypzbwJeQ21q1TMYNtNwE5zJaLBtgP6FoFYfUtFgyZruBXbcQdclMg X-Received: by 2002:a17:906:17c4:: with SMTP id u4mr7959845eje.481.1621877900017; Mon, 24 May 2021 10:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621877900; cv=none; d=google.com; s=arc-20160816; b=qD6fPTy0sM3dJ6bJkVHz0HBpVb+WHLrcBRqejASdRrxHlwmBjwnhq5xQ2+qxpbcWxn 3x2xrHasXsP4pXQxavUDgdsjCrN+2lFHvy/vtlghlPzZy9SEVt41LHfzsQ6x/LFttFnI GtNjxbOkOl3disxHowbPaQy9dzCkgvH9htcdpZI0IwkwcDl1Sqaa6tjqNqgnsEy8VOqz Jns4VoYePz4a3t/RTdYpf5f/5vX7bSp/xwuyK7ZErfVyTH3m1JhhUCxtE6/ydg0t7pcQ cemF/5M9f2OfhpMpxPEWegld8+DzZKl8/dpE1QpSp7GofSWZXgY6FsjG9c5ZYLTDW36S 9gKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=iD63KMcaK425H8hm2GhShuQzmtgMHe7ccDBTbjGg9P4=; b=DbiwIbcQ8+x+BBdxbWYr+UANAdmrFZ+8ktjaM0eYdlZ2mmDAU5LyH4O97PaFFnsITQ Ew9JSl0DA4TTIpOkmiIOqBkzJrVTVzqY9nkHpuwEc08VTGEczHL5LsP9rBx2DWuVe4QQ ylgqh2KCgQjmyMiN5fKgX1V38ybVBRELProEKjYgRheud1FQZAss0d9lhv3M/jjhnyU6 Q07Oj38/U7yjBIbO1recmlbvzc7Rau7nyvSRNDEDhrMBitro/GZHYTQfwjq2lqo7K7IO wYdzB8A/uaGc9Lo6vdGIFP6zs0XwrskbmDUdRzOwdfVzLKP3q3lvfmXH/dmrX2f5Unjh eZ0g== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w24si12807697edv.320.2021.05.24.10.37.56; Mon, 24 May 2021 10:38:20 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233222AbhEXRgJ (ORCPT + 99 others); Mon, 24 May 2021 13:36:09 -0400 Received: from mail-ej1-f41.google.com ([209.85.218.41]:40893 "EHLO mail-ej1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232708AbhEXRgJ (ORCPT ); Mon, 24 May 2021 13:36:09 -0400 Received: by mail-ej1-f41.google.com with SMTP id n2so43008806ejy.7 for ; Mon, 24 May 2021 10:34:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iD63KMcaK425H8hm2GhShuQzmtgMHe7ccDBTbjGg9P4=; b=ZzVs/O5/G+ipsrZlNqi8gPHDkAYNDhjwlkvQAHwIWN+h0FJXNrPoGRXvPg96j0uriF 3BcrWjsiwiCLPO6gIoybTaHOTbLLhuVIfvdR6fR+NrGSPEIQPzTbjDNDkr30CyPnlp0Z q3ZyDWmdBB51opw46O54H0tMurbY/FVQDiyBiV5mNkylS3mI7XEWnJqj2+VPW3oXSNBZ syPwoH0FVDDsVW54lSb7jHFR736xu1DwxZEg5o1zkQpuYFQR/8f4RoD2FGLXQDuqIfXH eVnVMzL0wnlChGFZm947acgn5DsIokdY//yWEZAez3PupY33yCsOusTIbd17x+0Mu7AW YIyA== X-Gm-Message-State: AOAM532YPBonTljuo1nYAu2pFjW9rRK5x7LPO71Va5zyeD3AWfw+ja2h QzR/+bNdA3qrF4kcGb3NvUAtzxVULgN24R8r5JQ= X-Received: by 2002:a17:906:f2ca:: with SMTP id gz10mr25190022ejb.317.1621877679038; Mon, 24 May 2021 10:34:39 -0700 (PDT) MIME-Version: 1.0 References: <20210523193259.26200-1-chang.seok.bae@intel.com> <20210523193259.26200-29-chang.seok.bae@intel.com> In-Reply-To: From: Len Brown Date: Mon, 24 May 2021 13:34:28 -0400 Message-ID: Subject: Re: [PATCH v5 28/28] x86/fpu/amx: Clear the AMX state when appropriate To: Dave Hansen Cc: "Chang S. Bae" , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , X86 ML , "Brown, Len" , "Liu, Jing2" , "Ravi V. Shankar" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 24, 2021 at 10:07 AM Dave Hansen wrote: > Could we maybe say: > > /* > * Leaving state in the TILE registers may prevent the > * processor from entering low-power idle states. Use > * TILERELEASE to initialize the state. Destroying > * fpregs state is safe after the fpstate update. > */ Ack > Also, referencing fpregs/fpstate is really nice because the codes > doesn't actually say "XSAVE" anywhere. > > > + if (fpu->state_mask & XFEATURE_MASK_XTILE_DATA) > > + tile_release(); > > Doesn't this tile_release() need a fpregs_deactivate()? Otherwise, the > next XRSTOR might get optimized away because it thinks there's still > good data in the fpregs. > > Will this unnecessarily thwart the modified optimization in cases where > we go and run this task again without ever going out to userspace? Will > this impact context-switch latency for *EVERY* context switch in order > to go to a lower idle state in a few minutes, hours, or never? yeah, seems we missed that. thanks! Len Brown, Intel Open Source Technology Center