Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp326173ybv; Thu, 13 Feb 2020 01:03:47 -0800 (PST) X-Google-Smtp-Source: APXvYqzVixpYdZFEOqIfl16caieXwC0d2e0JBx6fqzdqLvhuEaVlkCvCX3SkOiUb1x910sRamRGL X-Received: by 2002:a9d:4c92:: with SMTP id m18mr12043760otf.168.1581584627559; Thu, 13 Feb 2020 01:03:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581584627; cv=none; d=google.com; s=arc-20160816; b=SY/R2whNQi7TcQ+wKJn8EnnUZv15TrzcIk74TvncWoPLJSOayl8mmGfcwO9O0aF/lc jZ8E0qohGj6g5xOQmvoQVZE5CcERvXqro6KjaMrr4p56kN9YFboZaf77fAPqviLLUsgy 80w9LsYd5ie6RkJOfIJcGQgLBUlRw1dRbdhQ5ICgpiALxM8Q0BFsmWbevn5PSEedp1Hk f0Xpzut4+VkAKTjzFEXThiWjOMINm91c3w3QQIpot62la+bjjytRHiHXzUYZtA7HZr4M d6+evLZHQIAHwauKaDhGrCKSBagJlK4RFbWYe8ir/fLGLvVjaaI1kSlCeYy9gpP1XEZD 6ZiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=XRHT+2FKuH+IeuXt38xy7quFZIkPkHYxtykAdZTCriM=; b=XW5MK3Uep65HlWhTjA07K7wVD4nsyW4/MniCm/gLnB3iFP7ndK7WHVjVlZ/w4EV84y EcIIfTbNc5hbOxEujWJ6L276n5BqQ5TUCyN71G/9LSt16yNN3wnEpbmyZzVP30yLyc0F 4SPX1d+f9Z8O98sO27TRnStnY1zAhC7XwtE3BTqD1Pc/DLXvdxIwZU5vFa+kCXIE373r 37zDLxU6gi4oXo+puwmAS5X3hDd4FK1D5NfInPgny2YLRWbfx1l7rrJux80FVFM1sHsl mF8FaN6WM6UN0gjX5yKJYmOL6/0C8tlUKCJr0aAcSa8wr1XK7OsDptLj7afNYyhwtWsf UPdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si812174otr.183.2020.02.13.01.03.35; Thu, 13 Feb 2020 01:03:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729588AbgBMJCQ (ORCPT + 99 others); Thu, 13 Feb 2020 04:02:16 -0500 Received: from s3.sipsolutions.net ([144.76.43.62]:58306 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729428AbgBMJCQ (ORCPT ); Thu, 13 Feb 2020 04:02:16 -0500 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1j2ANq-008F19-Gs; Thu, 13 Feb 2020 10:02:06 +0100 Message-ID: <817580a4bcfbd3ef3ce31dfc5876bb99c3fca832.camel@sipsolutions.net> Subject: Re: [RFC PATCH v2] UML: add support for KASAN under x86_64 From: Johannes Berg To: Dmitry Vyukov Cc: Patricia Alfonso , Jeff Dike , Richard Weinberger , anton.ivanov@cambridgegreys.com, Andrey Ryabinin , David Gow , Brendan Higgins , kasan-dev , LKML , linux-um@lists.infradead.org Date: Thu, 13 Feb 2020 10:02:05 +0100 In-Reply-To: (sfid-20200213_094451_311672_27C02820) References: <20200210225806.249297-1-trishalfonso@google.com> <13b0ea0caff576e7944e4f9b91560bf46ac9caf0.camel@sipsolutions.net> (sfid-20200213_094451_311672_27C02820) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 (3.34.2-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-02-13 at 09:44 +0100, Dmitry Vyukov wrote: > > Right, but again like below - that's just mapped, not actually used. But > > as far as I can tell, once you actually start running and potentially > > use all of your mem=1024 (MB), you'll actually also use another 128MB on > > the KASAN shadow, right? > > > > Unlike, say, a real x86_64 machine where if you just have 1024 MB > > physical memory, the KASAN shadow will have to fit into that as well. > > Depends on what you mean by "real" :) :) > Real user-space ASAN will also reserve 1/8th of 47-bit VA on start > (16TB). Ah, but I was thinking of actual memory *used*, not just VA. And of KASAN, not user-space, but yeah, good point. > This implementation seems to be much closer to user-space ASAN > rather than to x86_64 KASAN (in particular it seems to be mostly > portable across archs and is not really x86-specific, which is good). Indeed. > I think it's reasonable and good, but the implementation difference > with other kernel arches may be worth noting somewhere in comments. Right, I guess that's the broader point. I was thinking mostly of the memory consumption: if you run with UML KASAN, your UML virtual machine will use around 12.5% more memory than before, unlike if you say have a KVM virtual machine - whatever you reserve outside will be what it can use inside, regardless of KASAN being enabled or not. This is totally fine, I just thought it should be documented somewhere, perhaps in the Kconfig option, though I guess there isn't a UML specific one for this... Not sure where then. johannes