From patchwork Tue Dec 12 19:02:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 121630 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4508149qgn; Tue, 12 Dec 2017 11:04:20 -0800 (PST) X-Google-Smtp-Source: ACJfBouh5zgGSb+bVLDzVB8g85ZVILnEt4VlYJNQUHfUEf5N6lKrK/QH0UueaNsEFy46hTCSXfb9 X-Received: by 10.107.180.66 with SMTP id d63mr6449925iof.276.1513105459965; Tue, 12 Dec 2017 11:04:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513105459; cv=none; d=google.com; s=arc-20160816; b=tu60kd+XepNhmk2Q6Zh9GN1tKsAHgt3I0JwU/8qxhpJOZvPMm4XIC+7EX8iVagqQae mPZuQWTKNTh1H/Xw6hoZYi5f6SKSIlicS20UKXE8eOFJhxNoSvpz8qSmTCmL4AmKpNHE WuL0J4qLPCjYgIJjUYMWbh3IbPDDYdEllUaCsm3v5jKP89rw8hkAxU6JEjawbDiJVXkq /XZGKycimkbT/NcSwFp0rJ+n3zTo6Wj3QPptVjfdj0o6GAbwvSGcqIBDSbTVfmDF5jfK IROvh6BSTMsB8AuWQjTSogVDLOQr8NjgElofFtJT5DyJZ5JAtmJgtfUocCH0CI239vdK I7zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=4hDbzON8Zw/z1Xah8T7HnCr2MVp5YMos5NGyVRnB0xU=; b=ylu1pGUtTMWf0lK/dmKtoOpVCrotTRXI1WRQuBaHDZZhxCWQCOSW0tHsbc+LUKShiE PuUslYCmQFtsLJRLEHZ+q//oavBC6bEy87PCAtQnraWl2LxzgOUerAiG9XVTAPRCrXNK avWLBzaeXtrbbC73NnP2Ghm/quPRWpaMBZsl3fj1DJvGzacbpAo2JnDMChf4oh+cbokx yK3tcwCIp5Qjhf/nO15CiUunom4idO8OiCxyjnt5k5wgmOmEAd1u2cUWtPS+zcXmpxAI wftKaC9d4wZ81p9UMGHkonxf5UAnEaBGY/xVqRb+7SNWts0GMAqzkVxBaQK1WEPj4AnI bFKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=FKdYr+a8; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id y139si178074itc.57.2017.12.12.11.04.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Dec 2017 11:04:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=FKdYr+a8; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOppG-0002mn-AD; Tue, 12 Dec 2017 19:02:46 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOppF-0002l1-9X for xen-devel@lists.xen.org; Tue, 12 Dec 2017 19:02:45 +0000 X-Inumbo-ID: f5a01aaf-df6e-11e7-b4a6-bc764e045a96 Received: from mail-wm0-x244.google.com (unknown [2a00:1450:400c:c09::244]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id f5a01aaf-df6e-11e7-b4a6-bc764e045a96; Tue, 12 Dec 2017 20:02:12 +0100 (CET) Received: by mail-wm0-x244.google.com with SMTP id y82so18619436wmg.1 for ; Tue, 12 Dec 2017 11:02:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YE15pR3nJyD9psVJ0Bn7eV7Iev/t6WK9IBXSYJHwXaQ=; b=FKdYr+a8u2fa/A0HFOsef8k3sRa7QxAErFFvaA6ZYWXSpH+u8kcsiTUT9uJOpnpjcK Y8yexFK/rqkNpjpIKS2INJr8CdVfczeF035ydMQLCOe7V7j/YV9jq4+15/7+ikIlUcal XagB/+9RqgUIkHC+f+4+cIFgcPGvhsxf/cCJI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YE15pR3nJyD9psVJ0Bn7eV7Iev/t6WK9IBXSYJHwXaQ=; b=mkzob9EA3P1mCTDgESGQjUdcy0wpgaTKlaAWZaqMlzHFLZKWDJSMVhjyZZUmlu+Ykp HBo8izanPnMpVry21YlCZI6P3gOZO6bOoG92jXAyvhhvgxl0sUG3gwRXYuTiNgpzutsl CZf0LVqeD0640KW3kf5XR5TYnQSOWMLqpuyYMSxbHm0LnQFD2Ae2772LQHtxUK+HFYm1 YgmDDC43MskBmOZJY4Cf7hr87xTh1Wc8UkwXGvurjdYZfDsnIEBAjSxlrcQfYMFgGtql d2BI+6gEO5Us0kCdOaXobIwAUS7wwDBQSi1ln2bAvaMktF/8l56O0Qqy4Ii3WJa4tI9W 1Tkw== X-Gm-Message-State: AKGB3mLFax6/P2qjHrlWOy/nuumO92qQni/LumDGXIJnuygIBDgVpsob qphY7goLjDZn2503oxm+KyWdy4IORKo= X-Received: by 10.28.232.70 with SMTP id f67mr2864435wmh.90.1513105363048; Tue, 12 Dec 2017 11:02:43 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id n14sm207508wmh.37.2017.12.12.11.02.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Dec 2017 11:02:42 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 12 Dec 2017 19:02:10 +0000 Message-Id: <20171212190212.5535-15-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171212190212.5535-1-julien.grall@linaro.org> References: <20171212190212.5535-1-julien.grall@linaro.org> Cc: sstabellini@kernel.org, Julien Grall , andre.przywara@linaro.org Subject: [Xen-devel] [v2 14/16] xen/arm: traps: Remove the field gva from mmio_info_t X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" mmio_info_t is used to gather information in order do emulation of a region. Guest virtual address is unlikely to be a useful information and not currently used. So remove the field gva from mmio_info_t and replace by a local variable. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Stefano's reviewed-by - Fix typo in the commit message --- xen/arch/arm/traps.c | 13 +++++++------ xen/include/asm-arm/mmio.h | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index ff3d6ff2aa..130e85a6ba 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2000,6 +2000,7 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs, { const struct hsr_dabt dabt = hsr.dabt; int rc; + vaddr_t gva; mmio_info_t info; uint8_t fsc = hsr.dabt.dfsc & ~FSC_LL_MASK; mfn_t mfn; @@ -2013,13 +2014,13 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs, info.dabt = dabt; - info.gva = get_hfar(true /* is_data */); + gva = get_hfar(true /* is_data */); if ( hpfar_is_valid(dabt.s1ptw, fsc) ) - info.gpa = get_faulting_ipa(info.gva); + info.gpa = get_faulting_ipa(gva); else { - rc = gva_to_ipa(info.gva, &info.gpa, GV2M_READ); + rc = gva_to_ipa(gva, &info.gpa, GV2M_READ); /* * We may not be able to translate because someone is * playing with the Stage-2 page table of the domain. @@ -2040,7 +2041,7 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs, .kind = dabt.s1ptw ? npfec_kind_in_gpt : npfec_kind_with_gla }; - p2m_mem_access_check(info.gpa, info.gva, npfec); + p2m_mem_access_check(info.gpa, gva, npfec); /* * The only way to get here right now is because of mem_access, * thus reinjecting the exception to the guest is never required. @@ -2077,8 +2078,8 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs, } gdprintk(XENLOG_DEBUG, "HSR=0x%x pc=%#"PRIregister" gva=%#"PRIvaddr - " gpa=%#"PRIpaddr"\n", hsr.bits, regs->pc, info.gva, info.gpa); - inject_dabt_exception(regs, info.gva, hsr.len); + " gpa=%#"PRIpaddr"\n", hsr.bits, regs->pc, gva, info.gpa); + inject_dabt_exception(regs, gva, hsr.len); } static void enter_hypervisor_head(struct cpu_user_regs *regs) diff --git a/xen/include/asm-arm/mmio.h b/xen/include/asm-arm/mmio.h index c620eed4cd..37e2b7a707 100644 --- a/xen/include/asm-arm/mmio.h +++ b/xen/include/asm-arm/mmio.h @@ -29,7 +29,6 @@ typedef struct { struct hsr_dabt dabt; - vaddr_t gva; paddr_t gpa; } mmio_info_t;