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=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 10A0FC433E0 for ; Mon, 29 Mar 2021 16:40:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE0A46190A for ; Mon, 29 Mar 2021 16:40:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230434AbhC2Qjd (ORCPT ); Mon, 29 Mar 2021 12:39:33 -0400 Received: from mail-ej1-f45.google.com ([209.85.218.45]:37675 "EHLO mail-ej1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230329AbhC2QjL (ORCPT ); Mon, 29 Mar 2021 12:39:11 -0400 Received: by mail-ej1-f45.google.com with SMTP id w3so20495664ejc.4; Mon, 29 Mar 2021 09:39:11 -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=HQBzHMmoWkQcaprrOUSdhejJEll5+CAI/Ph1n47/PJw=; b=aXJ6nCTAcMIUUMfsjlCRMqOemgfASMfudMfr7pYVFUEMyEBV/+LeHqigFZfZdvxrx/ G/e5DSOIO7PvgAktIN6k+obCdE50ru9Q2qDUT2hnC6o0XSRN2/3HlkwKnCR8/skY3kbv 8UOEasyunFwOpPsONnLoan9/oM47R3DSnSO/R+FPUaRslhn2xpqkBoJFwY93s64l1Q67 n9M1DFjKdyOnrL5mE8fsK5k3pi+PRLFfK8AtvIRV3IuXVuplBlPqddrO1ps0O/IZseu5 QLY8IumlWe9lORgVZ/y0FMRV/VwKSMf+zVCMoZRrLPcbmQceubJOR/Szw+OE8NskVQKY nFUg== X-Gm-Message-State: AOAM530e/ZF0fOAQGIM3T7hmJ/KD2eivh9PxhmpvvFxbBRsdK2/TF/D9 tvTwGXzL/CwboXRDFuROkjdbUAkNuMUhvUyMVkZ19Jvr X-Google-Smtp-Source: ABdhPJxjNrDcuW6fqcnTahZ6x0HV9VofKao6CrqWau5z1tsA6fl+HcOu2Ky9NWP5J3t8vPib8G1j0TqQqFN0HBYRtBM= X-Received: by 2002:a17:906:b4c:: with SMTP id v12mr29508059ejg.330.1617035950748; Mon, 29 Mar 2021 09:39:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Len Brown Date: Mon, 29 Mar 2021 12:38:59 -0400 Message-ID: Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features To: Greg KH Cc: Andy Lutomirski , "Bae, Chang Seok" , Dave Hansen , X86 ML , LKML , libc-alpha , Florian Weimer , Rich Felker , Kyle Huey , Keno Fischer , Linux API Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org > In particular, the library may use instructions that main() doesn't know exist. And so I'll ask my question another way. How is it okay to change the value of XCR0 during the run time of a program? I submit that it is not, and that is a deal-killer for a request/release API. eg. main() doesn't know that the math library wants to use AMX, and neither does the threading library. So main() doesn't know to call the API before either library is invoked. The threading library starts up and creates user-space threads based on the initial value from XCR0. Then the math library calls the API, which adds bits to XCRO, and then the user-space context switch in the threading library corrupts data because the new XCR0 size doesn't match the initial size. -Len