From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::22f; helo=mail-wm0-x22f.google.com; envelope-from=julien.grall@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 10D5521A04E2F for ; Wed, 22 Nov 2017 08:59:23 -0800 (PST) Received: by mail-wm0-x22f.google.com with SMTP id r68so11682890wmr.1 for ; Wed, 22 Nov 2017 09:03:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=z/ZmAXsiaZiMLTxCXiiJNrL+Y7nSl9riyX5A+yKGg8g=; b=bc1TyooKriWIinc8n7Wua1HWccjqdJFGkI+KLFDshc6bNfWYLhWUdHlcNG7ADt3q/9 VLb81+L0G4Qyj8JgaP29SPj/ea5IQmE0JwBaDT5oKlEY3PCGCZrsL1SMSqaST+P5UdUq bLz8rAbq2LdZ0CeJUUJbHWjW+jTjJDKgQM3+8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=z/ZmAXsiaZiMLTxCXiiJNrL+Y7nSl9riyX5A+yKGg8g=; b=m0nzBjDHBhsuV39jZ/nPOP4Mas7aYsVOWs1m9nHBANb0wAWuwjS8VHOJO5us2g13rT vr88m/8XTSCsLZ8esVa70xIdyt7BHdNNsJPWOimDVNgseUjBYSAKG4LhqpkQ+y0+l1qa MGWHml0jwpZGatrGeFplsjgQvk3s6AgogJpCLkDj4n568TlIqIRDpJF0f9g/BKDE0GS7 xSIShowtUaldAdPQceNQNeVJ76pizgzUNVtUl5zTxkM9KNKmD3H99Gk48SljzW4KVv8g sIqU1wkW3/M9zQmLXLO8gDyxDFhA7rMEnnQOE2vdA5W0RRdj189JmGw7t/L9RH+CyQAR pRHA== X-Gm-Message-State: AJaThX5tXF6Eyi2fUsM1RPBN6s7uLK4YyvlZ0rJiEjKpdtrWenmjk74R 7zKka8Y/arciH3tY/NpDrJGo5g== X-Google-Smtp-Source: AGs4zMZqR/mZYjBZ2+9xw2MJ0HMDpy+xRB/mPEjfhOadanUEk8BTTad45oMQTk6IXtkoxtiroWZQAA== X-Received: by 10.28.202.26 with SMTP id a26mr4512888wmg.130.1511370218972; Wed, 22 Nov 2017 09:03:38 -0800 (PST) Received: from ?IPv6:::1? ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id 1sm5143361wmu.8.2017.11.22.09.03.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Nov 2017 09:03:38 -0800 (PST) To: Ard Biesheuvel , edk2-devel@lists.01.org, lersek@redhat.com References: <20171122100731.24525-1-ard.biesheuvel@linaro.org> <20171122100731.24525-11-ard.biesheuvel@linaro.org> From: Julien Grall Message-ID: <8a73140f-616f-f2ec-69ae-46ec3f98f6ef@linaro.org> Date: Wed, 22 Nov 2017 17:03:37 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171122100731.24525-11-ard.biesheuvel@linaro.org> Subject: Re: [PATCH v2 10/14] ArmVirtPkg/ArmVirtXen: add ArmVirtMemInfoLib implementation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 16:59:24 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Ard, On 11/22/2017 10:07 AM, Ard Biesheuvel wrote: > Clone the existing ArmPlatformGetVirtualMemoryMap () for this platform, > clean it up slightly (by using a static buffer rather than a heap > allocation, and removing the support for uncached DRAM mappings), and > turn it into a new ArmVirtMemInfoLib implementation. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel > Acked-by: Laszlo Ersek > Cc: Julien Grall I have tested the series on both Arm32 and Arm64 guests: Tested-by: Julien Grall [...] > +VOID > +EFIAPI > +ArmVirtGetMemoryMap ( > + OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap > + ) > +{ > + ASSERT (VirtualMemoryMap != NULL); > + > + // > + // Map the entire physical memory space as cached. The only device > + // we care about is the GIC, which will be stage 2 mapped as a device > + // by the hypervisor, overriding the cached mapping we install here. > + // I was about to complain about the fact you rely on the hypervisor setting correct stage-2 memory attribute. But I see this is a copy of the current code :). We did relax the attribute for MMIO in the case of the Hardware Domain. I will keep the UEFI implementation in mind if we ever decide to relax for guests too. > + mVirtualMemoryTable[0].PhysicalBase = 0x0; > + mVirtualMemoryTable[0].VirtualBase = 0x0; > + mVirtualMemoryTable[0].Length = ArmGetPhysAddrTop (); > + mVirtualMemoryTable[0].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK; > + > + mVirtualMemoryTable[1].PhysicalBase = 0x0; > + mVirtualMemoryTable[1].VirtualBase = 0x0; > + mVirtualMemoryTable[1].Length = 0x0; > + mVirtualMemoryTable[1].Attributes = 0x0; > + > + *VirtualMemoryMap = mVirtualMemoryTable; > +} Cheers, -- Julien Grall