[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] PAM: make PAM emulation closer to documentat
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2] PAM: make PAM emulation closer to documentation |
Date: |
Mon, 7 Sep 2015 14:50:56 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 20/07/2015 12:53, Efimov Vasily wrote:
> + read_src = address_space_translate(read_as, pam_offset,
> + &offset_within_read_leaf, &unused,
> + false);
> +
> + if (memory_region_is_ram(read_src) || memory_region_is_romd(read_src)) {
> + /* Read source is RAM or ROM.
> + Make current PAM region a ROM with body inside read source. */
> + cur->ram_addr = read_src->ram_addr + offset_within_read_leaf;
> + cur->rom_device = true;
> + cur->romd_mode = true;
> + } else {
> + /* Make current PAM region a clearly I/O region. */
> + cur->ram_addr = ~(ram_addr_t) 0;
> + cur->rom_device = false;
> + cur->romd_mode = false;
> + }
> +
> + pam->write_as = write_as;
> + pam->read_as = read_as;
> +}
> +
Hi Vasily,
I agree that this patch is an improvement compared to the earlier
versions, but it's still a bit of an abstraction violation and I'm not
sure if it works with KVM.
Let's see if we can improve things. Please correct me on the following:
1) For the "Make current PAM region a ROM" case, we can get the
ram_addr_t directly from the pc.bios and pc.rom MemoryRegions, and poke
into pam->region[1] and pam->region[2] when we create them.
2) For the "Make current PAM region an I/O region" case, you could add
an IOMMU region that to 0xc0000-0xfffff. The listener would disable
pam->region[1] if address_space_translate returns an I/O region and
enable it if it returns RAM/ROM. However, I cannot understand or
remember what is the case where you get an I/O region.
Paolo