From patchwork Sun Apr 28 23:01:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 16468 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f199.google.com (mail-gg0-f199.google.com [209.85.161.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7C39525E07 for ; Sun, 28 Apr 2013 23:03:24 +0000 (UTC) Received: by mail-gg0-f199.google.com with SMTP id n2sf4521213ggf.6 for ; Sun, 28 Apr 2013 16:02:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=JRmKkV2ALmDxlmYEbQoWIS7nwnATe4xIL7AMY9ZhhPE=; b=JX0tGPnn4NqrnPTsVZkCMiqW9AyMcEWl1UGWMXcOQ/dicztLW59/tdVG70oTIjK29K XEKz+I9MdpMPxrg8b+ELpgHR0nmbWBD8HfT1/Ti5/A6cPINxYioPPCAKXHY1HhRugbPg TRVgQU87TK4EabiiNRQeaR3AcaSvkxYtcOSu7JZ+GaWlrnQLS6W9Ekqh3iqmz8CsYa64 6X2SCa5MAB77SiwoaHiQ5R3OwgM5282wi3W8gwxWEJPQD3xEF+otND2QwzNTMQeKUuI2 prg8f4n3qy6zHlU1PCqzjx1IRPyMlknKhuXGAFdttbHadGQSoo4X/mJdo88OosPIAc3F QpJw== X-Received: by 10.236.63.101 with SMTP id z65mr15511805yhc.47.1367190143303; Sun, 28 Apr 2013 16:02:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.118.161 with SMTP id kn1ls2274261qeb.33.gmail; Sun, 28 Apr 2013 16:02:23 -0700 (PDT) X-Received: by 10.220.71.200 with SMTP id i8mr31958432vcj.44.1367190143112; Sun, 28 Apr 2013 16:02:23 -0700 (PDT) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [2607:f8b0:400c:c01::22f]) by mx.google.com with ESMTPS id ij9si8961451vdb.82.2013.04.28.16.02.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:02:23 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22f; Received: by mail-ve0-f175.google.com with SMTP id m1so2708489ves.34 for ; Sun, 28 Apr 2013 16:02:23 -0700 (PDT) X-Received: by 10.52.69.109 with SMTP id d13mr5232469vdu.75.1367190142940; Sun, 28 Apr 2013 16:02:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp33778veb; Sun, 28 Apr 2013 16:02:22 -0700 (PDT) X-Received: by 10.194.78.137 with SMTP id b9mr27818698wjx.10.1367190141628; Sun, 28 Apr 2013 16:02:21 -0700 (PDT) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [2a00:1450:400c:c00::22e]) by mx.google.com with ESMTPS id gl5si3450087wic.56.2013.04.28.16.02.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:02:21 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::22e is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=2a00:1450:400c:c00::22e; Received: by mail-wg0-f46.google.com with SMTP id e11so3157418wgh.13 for ; Sun, 28 Apr 2013 16:02:21 -0700 (PDT) X-Received: by 10.180.183.133 with SMTP id em5mr14017987wic.26.1367190141206; Sun, 28 Apr 2013 16:02:21 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id k5sm18711393wiy.5.2013.04.28.16.02.20 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Apr 2013 16:02:20 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: ian.campbell@citrix.com, patches@linaro.org, anthony.perard@citrix.com, stefano.stabellini@eu.citrix.com, Julien Grall Subject: [RFC 02/29] xen/arm: don't allow dom0 to access to vpl011 UART0 memory range Date: Mon, 29 Apr 2013 00:01:45 +0100 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-Gm-Message-State: ALoCoQlpiytMUJsBDmJgXrTz5a1kKrE8NerIL3sMGwAXlQsGrH/Ycz0oFSenCfMMcOPZjAsNJX5Q X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , As vpl011 UART is not initialized for dom 0, when the domain tries to access to this range, a segfault will occur in Xen. The right behaviour should be a data abort for the guest. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/arch/arm/vpl011.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/vpl011.c b/xen/arch/arm/vpl011.c index 9472d0a..13ba623 100644 --- a/xen/arch/arm/vpl011.c +++ b/xen/arch/arm/vpl011.c @@ -85,7 +85,9 @@ static void uart0_print_char(char c) static int uart0_mmio_check(struct vcpu *v, paddr_t addr) { - return addr >= UART0_START && addr < UART0_END; + struct domain *d = v->domain; + + return d->domain_id != 0 && addr >= UART0_START && addr < UART0_END; } static int uart0_mmio_read(struct vcpu *v, mmio_info_t *info)