From patchwork Wed May 8 02:33:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 16737 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CE535238FD for ; Wed, 8 May 2013 02:34:57 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id p14sf1628045vbm.6 for ; Tue, 07 May 2013 19:34:37 -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=xC07IPkboM5fp8i5YL6weXbhqyy1QtkivnM7EVblKbU=; b=Mn50QdqpdoeGqBDdk0aALw3DkfeU1PhwzpLGH+jMyWrSd1RBpQXjRvp/zEFQXECMCb rX2wiS3BjMg2+dXfgzasPjXFnQcWCbsoPjPL6QyL9bbqMzp/WET4wzLzy925SvtrX6pw sBaxTPKX1fhU20yA5FHgU/2Yd1bgMlZAECLH7028PVsbpQiYIl3gGyKH5R+O2DNm6vJO 5lWyi2or21MCe3kNDplyNuwRqnAzF4p7DxD9NpxGZobygN3n/WhwB2xa5oC+81gU3Gm0 2koVZIG2NMyfMslyGqckYeXJrhwbOZsmlyD80kpdURneu+PaNi4hS23s/6JsuoocjYLW oG0Q== X-Received: by 10.236.113.203 with SMTP id a51mr2936148yhh.31.1367980477569; Tue, 07 May 2013 19:34:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.84.170 with SMTP id a10ls665216qez.56.gmail; Tue, 07 May 2013 19:34:37 -0700 (PDT) X-Received: by 10.52.117.212 with SMTP id kg20mr2728120vdb.55.1367980477308; Tue, 07 May 2013 19:34:37 -0700 (PDT) Received: from mail-ve0-x235.google.com (mail-ve0-x235.google.com [2607:f8b0:400c:c01::235]) by mx.google.com with ESMTPS id gs2si14147144vdc.63.2013.05.07.19.34.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 19:34:37 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::235 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::235; Received: by mail-ve0-f181.google.com with SMTP id d10so1306471vea.40 for ; Tue, 07 May 2013 19:34:37 -0700 (PDT) X-Received: by 10.52.53.36 with SMTP id y4mr2456207vdo.51.1367980477159; Tue, 07 May 2013 19:34:37 -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 nf2csp130992veb; Tue, 7 May 2013 19:34:36 -0700 (PDT) X-Received: by 10.180.36.165 with SMTP id r5mr18421459wij.18.1367980473628; Tue, 07 May 2013 19:34:33 -0700 (PDT) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [2a00:1450:400c:c00::231]) by mx.google.com with ESMTPS id fz4si8820054wjb.249.2013.05.07.19.34.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 19:34:33 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::231 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=2a00:1450:400c:c00::231; Received: by mail-wg0-f49.google.com with SMTP id j13so1308013wgh.28 for ; Tue, 07 May 2013 19:34:33 -0700 (PDT) X-Received: by 10.194.93.68 with SMTP id cs4mr7240130wjb.17.1367980473260; Tue, 07 May 2013 19:34:33 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id v6sm6823630wiy.11.2013.05.07.19.34.32 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 19:34:32 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: Stefano.Stabellini@eu.citrix.com, patches@linaro.org, ian.campbell@citrix.com, Julien Grall Subject: [PATCH V2 02/33] xen/arm: don't allow dom0 to access to vpl011 UART0 memory range Date: Wed, 8 May 2013 03:33:22 +0100 Message-Id: <943964cba6022d740ca74317dcd083aeee9a0d98.1367979526.git.julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-Gm-Message-State: ALoCoQmi13FBhACRHSgMveDePF2GTNz4wJlkaZXMmipS5S4K0MuHI/LJip+KrCwj5rxpdTO8K1SF X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::235 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)