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=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 42960C433E2 for ; Thu, 10 Sep 2020 10:26:22 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A296E20829 for ; Thu, 10 Sep 2020 10:26:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EnYjUFES" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A296E20829 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Fgg/h/WymXVl02IkMOxLOB38hh/QzaSgqaZn4yV9deY=; b=EnYjUFESbTmldaGr3yVM1PJ++ TRoHT6OLqVvFeIKhuyjR/IsslCCueSUsHv/Ah6JwDurJ3yF2rcnlbrwrOW5b1eIEzxH5BqHgL7+SZ rPJ66pz+G1SYo7if4xVO2QLO2M9FHUT5OGMsernESPC1RsylxULUcvGgO6MryyLVOTuGf0QLFlLj1 IjK/Ivsbki5G+HDySUtn3cLIwWL3rM+e5pVbT7euXtWUkc3Nzg6XwWTFzPDx6CEozIjXPnmUX5soE K7Y0ToR/Ig70ed68S7FEVf/urtovDRQKSlN7tsSHRLFFJ30mPAeH9oBx1GZ/2fhb+jZ8WBMn83Ipa VhuwnA+Hw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGJlH-0003AH-0w; Thu, 10 Sep 2020 10:25:03 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGJlE-00039O-Bw for linux-arm-kernel@lists.infradead.org; Thu, 10 Sep 2020 10:25:01 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A14DC1063; Thu, 10 Sep 2020 03:24:58 -0700 (PDT) Received: from [192.168.1.179] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6FED23F68F; Thu, 10 Sep 2020 03:24:56 -0700 (PDT) Subject: Re: [PATCH v2 0/2] MTE support for KVM guest To: Richard Henderson , Catalin Marinas , Marc Zyngier , Will Deacon References: <20200904160018.29481-1-steven.price@arm.com> <8e661984-70bc-790c-8636-39dcd8b00131@linaro.org> From: Steven Price Message-ID: <842807ac-562a-36ce-8061-aa323341b605@arm.com> Date: Thu, 10 Sep 2020 11:24:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <8e661984-70bc-790c-8636-39dcd8b00131@linaro.org> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200910_062500_475534_614B9841 X-CRM114-Status: GOOD ( 26.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "Dr. David Alan Gilbert" , Peter Maydell , Haibo Xu , Suzuki K Poulose , qemu-devel@nongnu.org, Juan Quintela , linux-kernel@vger.kernel.org, Dave Martin , James Morse , Julien Thierry , Thomas Gleixner , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 10/09/2020 01:33, Richard Henderson wrote: > On 9/4/20 9:00 AM, Steven Price wrote: >> 3. Doesn't provide any new methods for the VMM to access the tags on >> memory. > ... >> (3) may be problematic and I'd welcome input from those familiar with >> VMMs. User space cannot access tags unless the memory is mapped with the >> PROT_MTE flag. However enabling PROT_MTE will also enable tag checking >> for the user space process (assuming the VMM enables tag checking for >> the process)... > > The latest version of the kernel patches for user mte support has separate > controls for how tag check fail is reported. Including > >> +- ``PR_MTE_TCF_NONE`` - *Ignore* tag check faults > > That may be less than optimal once userland starts uses tags itself, e.g. > running qemu itself with an mte-aware malloc. > > Independent of that, there's also the TCO bit, which can be toggled by any > piece of code that wants to disable checking locally. Yes, I would expect the TCO bit is the best option for wrapping accesses to make them unchecked. > However, none of that is required for accessing tags. User space can always > load/store tags via LDG/STG. That's going to be slow, though. Yes as things stand LDG/STG is the way for user space to access tags. Since I don't have any real hardware I can't really comment on speed. > It's a shame that LDGM/STGM are privileged instructions. I don't understand > why that was done, since there's absolutely nothing that those insns can do > that you can't do with (up to) 16x LDG/STG. It is a shame, however I suspect this is because to use those instructions you need to know the block size held in GMID_EL1. And at least in theory that could vary between CPUs. > I think it might be worth adding some sort of kernel entry point that can bulk > copy tags, e.g. page aligned quantities. But that's just a speed of migration > thing and could come later. When we have some real hardware it would be worth profiling this. At the moment I've no idea whether the kernel entry overhead would make such an interface useful from a performance perspective or not. Steve _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel