From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by sourceware.org (Postfix) with ESMTPS id A90E938930E7 for ; Fri, 16 Apr 2021 16:20:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A90E938930E7 Received: by mail-il1-x12f.google.com with SMTP id i22so18855845ila.11 for ; Fri, 16 Apr 2021 09:20:24 -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=bhuo2ce7pEsFd+kWMkBzZgqO2R7b3NnKTCwVUUXvoQw=; b=JaDdT7N72X1aZoNYN5JWVY2OV3FiswtpUz1jDqJyZOU4kwIR+hNAbJGGkM0D8TVPNF MWzMJ5YHqis4/PvlBzsksXHvPx6Exv5b/ukAYMw4WK4d9H1082Xa3xH+elYxjeNrS3OQ Dk86zZSp/2oAAYYFnUc8ZHNHQmgM1ajgKq0R7Odu/dAMyAbRLQM2ZkufLA9FobODXcX1 l10+MWUVEiR5ugZKbyb7xOF8HYYOCn9d/Z3al9jpgxKiPaizSjZFrfcZN0SLJzVXq/4G TyYvCPLd0u/DkFDLfXJgtk0C9/NWkfX76WXWlm7N01/0+XwzI1t10cpjLag7ab4ldUXv YIPQ== X-Gm-Message-State: AOAM530AJEkC++8E1MJQj2+je90kYmhSlQ95y7Wbczt+fDQT0Wm8fo/Y b+vvidRo+O++aBYQ0yH7tDCDbT8UzuDJsKSQ6hZe/Q== X-Google-Smtp-Source: ABdhPJzxxsYx/Qhtk7Zi7pGWCVoX+DqX+oHS2t2EvbUwqFo+JT5kC3hbQfUwYL+RX5V8qG/x4hUlqc2+rOIkEL9s0UE= X-Received: by 2002:a05:6e02:1145:: with SMTP id o5mr7295502ill.61.1618590024064; Fri, 16 Apr 2021 09:20:24 -0700 (PDT) MIME-Version: 1.0 References: <13d725cb8e741950fb9d6e64b2cd9bd54ff7c3f9.1616123271.git.pcc@google.com> <161839488327.21932.16461913261970131291.b4-ty@arm.com> In-Reply-To: <161839488327.21932.16461913261970131291.b4-ty@arm.com> From: Peter Collingbourne Date: Fri, 16 Apr 2021 09:20:12 -0700 Message-ID: Subject: Re: [PATCH v8 1/3] arm64: mte: make the per-task SCTLR_EL1 field usable elsewhere To: Catalin Marinas Cc: Kostya Serebryany , Florian Weimer , Evgenii Stepanov , Dave Martin , Szabolcs Nagy , Vincenzo Frascino , Will Deacon , Linux ARM , Andrey Konovalov , libc-alpha@sourceware.org, Kevin Brodsky , Linux API Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-20.7 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2021 16:20:32 -0000 On Wed, Apr 14, 2021 at 3:10 AM Catalin Marinas wrote: > > On Thu, 18 Mar 2021 20:10:52 -0700, Peter Collingbourne wrote: > > In an upcoming change we are going to introduce per-task SCTLR_EL1 > > bits for PAC. Move the existing per-task SCTLR_EL1 field out of the > > MTE-specific code so that we will be able to use it from both the > > PAC and MTE code paths and make the task switching code more efficient. > > Applied to arm64 (for-next/pac-set-get-enabled-keys). > > Peter, can you please have a look and give it a try as part of the arm64 > for-next/core branch? I rebased your patches on top of the > for-next/mte-async-kernel-mode branch as this was adding more code to > mte_thread_switch(), so I kept the function for now. > > Thanks. > > [1/3] arm64: mte: make the per-task SCTLR_EL1 field usable elsewhere > https://git.kernel.org/arm64/c/2f79d2fc391e > [2/3] arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS) > https://git.kernel.org/arm64/c/201698626fbc > [3/3] arm64: pac: Optimize kernel entry/exit key installation code paths > https://git.kernel.org/arm64/c/b90e483938ce Hi Catalin, I tested the rebased patch series on an Apple M1 under a hypervisor with my Android forward-edge PAC prototype and it seems to work. I think it should be possible to get rid of at least one of the ISBs that are now on the task switch path, but let's leave that to a later patch. The patch series looks good otherwise. Peter