Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp494985pxb; Thu, 12 Nov 2020 08:45:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxv7xhEvoJ67hT2yRp/AsBK9EWLDckrU3wyPgyqG/owZV1An00zyO23nipoETddTIYKYgkv X-Received: by 2002:a17:906:38d3:: with SMTP id r19mr95490ejd.525.1605199537187; Thu, 12 Nov 2020 08:45:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605199537; cv=none; d=google.com; s=arc-20160816; b=CvVlaJGN10YCwGFpmeZfiw8aWuG8hQrZ5K5OkjQ4iFe32LjdgcTm92Fnt+8ec/44cr TYi9j2KI3UhVgzla2QeTea2bf8fNfZKLJd9Z7I74nqvhfV5zRL5KkXpTG4UqyOfUzAlh psHPK5yQS3JvIR22zcfAjOtDVbEhfv1H5ddMg0Tk2hsXGeDenb2xnB2M0G/VnMBY7ADg RoNXE1ePS64Dpp4kdRnJCx6njCkW8MDr6pVxFEB0Jctp9OrVfpoAPDXQAYGFO/RZmoNk N7CTYSUouOi0cjkjZPg8DF2OfemxWMTBrM4rglIThKy7J1OKzq/r3NDf2iDS1uS59quB NEiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=k1nxBPerHo0opWxBOg1iC4tCjytAR1tnAmyGb9xHH/M=; b=nS83d0dvqnknbLqsl1HlPMP1+PbmtTipIhgZN94cZcWTs3+XxYC/qJYSegDBqOo/GC yBMZLOo84LsfoE1/5SXuW22kDHbMholnP/NjwFaFLoXqAi4wPoxVPELn74Bmwof8bC3i YwWoa3mFa285WCN3PkiDDDOMZabFQCWARK6but6i9omG873zPSsvcxCDqBNP86ErVQDD PXvfuyFxY6SDhwEbEWt9E+Jt0PNccsPsEqi7hXFZqSk49f+XFSd3ErivLNPjndrSX+BJ 4ZSVYqgIzhmKs3qo8/JJyWrEFSj8LFOetQHKl+sqdIA4FgRa/EMv0RVK09BU3Cjj9grT Peug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lX8a8Eka; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si4524487edn.285.2020.11.12.08.45.13; Thu, 12 Nov 2020 08:45:37 -0800 (PST) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=lX8a8Eka; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728937AbgKLQlb (ORCPT + 99 others); Thu, 12 Nov 2020 11:41:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728263AbgKLQlb (ORCPT ); Thu, 12 Nov 2020 11:41:31 -0500 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47CA5C0613D1 for ; Thu, 12 Nov 2020 08:41:31 -0800 (PST) Received: by mail-qt1-x841.google.com with SMTP id g15so4382534qtq.13 for ; Thu, 12 Nov 2020 08:41:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=k1nxBPerHo0opWxBOg1iC4tCjytAR1tnAmyGb9xHH/M=; b=lX8a8EkakHNfH0gZYTjzQzld8uzEoqJCxSfCQ4OqTjeKIJSYiAdaOX4ju6X6g9kUUO RF4S2RPl7R0HtiAxZ45/vOfdVx0KvZK97bbr3uKu8O3DzHND55jt2Mc9gRnnRIRVa5Le uIJJbtg+jQ4EZfVCa8Oj3H9d5vQbh6WGAPZ24d7QTlv4qzpXumbpSYcHeSZ+x2awE/ov 8LLx6nosw7m4FwZEiuLNyOPihO1HdacOxEqQql3lf+Bl1B4iAdd7EQRJHYJ3fE9EuCT0 0zGyuL5DKegpQHgoCn1LrGZulu/lAYNrU/V2HpT/WpBExYpuxDppY6JDMtD3waasy1DF WSPA== 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:content-transfer-encoding; bh=k1nxBPerHo0opWxBOg1iC4tCjytAR1tnAmyGb9xHH/M=; b=k2PGaqSBk60zQ9VfPlEy77gy9kliCXQDAX/PtG9ZucT1DoFjBk/DPDRCWHuFpSyBe6 HCX2FljxD/xbbisO7JbRyfXTuhfNuhscofXMf8cu4ldkMHs8MAyL1Ucs3yGiYkjlFSjG sU6XHdZ2bAhcE+9/8QJnDzJTuv9tCjWAYqUWxMp5q6oIcBexqBqI6tjA9B2Hmux8uUGN PanF2pILf1B/CuB7MxBvyjGeqBsXVQCw9KS7WC/gfIBZS90Uk14CKgDRywoJV+ndR1md xQ0hzp2t7uLuOkMPFtn+DsdTTUpGzgDHWyZ6+qCa6CeS3u46WqxjjpM7mxa3GHXeECal 3bxQ== X-Gm-Message-State: AOAM5310OyKypNYKI0FGajxX0LWpUQ2qD7a+K43aqFXCpAK+h6IQ92Zf HNNShlGXv7+hBa+5u5somMwQdnfh5VQl7iBo5iSIAw== X-Received: by 2002:a05:622a:291:: with SMTP id z17mr18923qtw.180.1605199290292; Thu, 12 Nov 2020 08:41:30 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Alexander Potapenko Date: Thu, 12 Nov 2020 17:41:18 +0100 Message-ID: Subject: Re: [PATCH v9 44/44] kselftest/arm64: Check GCR_EL1 after context switch To: Marco Elver Cc: Andrey Konovalov , Catalin Marinas , Will Deacon , Vincenzo Frascino , Dmitry Vyukov , Andrey Ryabinin , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , Andrew Morton , kasan-dev , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 12, 2020 at 5:09 PM Marco Elver wrote: > > On Thu, 12 Nov 2020 at 16:59, Alexander Potapenko wro= te: > > > > On Tue, Nov 10, 2020 at 11:12 PM Andrey Konovalov wrote: > > > > > > From: Vincenzo Frascino > > > > > > This test is specific to MTE and verifies that the GCR_EL1 register > > > is context switched correctly. > > > > > > It spawn 1024 processes and each process spawns 5 threads. Each threa= d > > > > Nit: "spawns" > > > > > > > + srand(time(NULL) ^ (pid << 16) ^ (tid << 16)); > > > + > > > + prctl_tag_mask =3D rand() % 0xffff; > > > > Nit: if you want values between 0 and 0xffff you probably want to use > > bitwise AND. > > Another question would be, is the max here meant to be 0xffff or > 0xffff-1. Because, as-is now, it's 0xffff-1. Only one of them has a > trivial conversion to bitwise AND ( x % 2^n =3D=3D x & (2^n - 1) ). Yes, that is basically what I meant, assuming that Vincenzo wanted the max to be 0xffff --=20 Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Stra=C3=9Fe, 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg