qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Thomas Bandelier" <thomas.bandelier@gmail.com>
To: qemu-devel@nongnu.org
Cc: Paul Brook <paul@codesourcery.com>
Subject: Re: [Qemu-devel] [PATCH] usb-ohci: Add address masking.
Date: Mon, 8 Dec 2008 11:15:00 +0100	[thread overview]
Message-ID: <43d6ff410812080215j77fbf4a4y2729dd330b6a8ce7@mail.gmail.com> (raw)
In-Reply-To: <200812051352.mB5DqhQU026115@smtp11.dti.ne.jp>

[-- Attachment #1: Type: text/plain, Size: 2288 bytes --]

Hi,

Why are you writing "usb-ohci is *really* broken now." ??
Is it supposed to be working or not ?
On which status are you basing your affirmation?

Is it a good thing to completely break USB ohci in the development trunk?

Regards

Thomas




On Fri, Dec 5, 2008 at 2:52 PM, <takasi-y@ops.dti.ne.jp> wrote:

> Hi,
> About this
> > [1] It's actually the offset from the start of the first page of that
> region.
> > In practice this difference doesn't matter, and makes the implementation
> a
> > lot simpler.
> again.
>
> The patch below adds address mask(0xff) to mmio read/write funcs in
> usb-ohci.
> I know now we are deleting this kind of address mask/subtract things.
> But because of the restriction [1] above, we have to add address mask here.
>
> The mmio change potentially breaks PCI device emulations which has mmio
> region
> smaller than page size, like usb-ohci and rtl8139 (both have 256byte),
> because
> PCI memory regions are configured to be aligned to it size, but to page.
>
> usb-ohci is really broken now.
> rtl8139 is OK because it already has address mask.
> Others are not checked.
>
> I think the most important thing is eliminating dependency to base address,
> and small numbers of masks should be acceptable.
>
> Regards,
> /yoshii
>
> This patch adds address mask to mmio read/write function.
> Because its memory region is not always aligned to page.
>
> Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
> ---
>  hw/usb-ohci.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
> index 585f3a4..bfa7d77 100644
> --- a/hw/usb-ohci.c
> +++ b/hw/usb-ohci.c
> @@ -1366,6 +1366,7 @@ static uint32_t ohci_mem_read(void *ptr,
> target_phys_addr_t addr)
>         fprintf(stderr, "usb-ohci: Mis-aligned read\n");
>         return 0xffffffff;
>     }
> +    addr &= 0xff;
>
>     if (addr >= 0x54 && addr < 0x54 + ohci->num_ports * 4) {
>         /* HcRhPortStatus */
> @@ -1462,6 +1463,7 @@ static void ohci_mem_write(void *ptr,
> target_phys_addr_t addr, uint32_t val)
>         fprintf(stderr, "usb-ohci: Mis-aligned write\n");
>         return;
>     }
> +    addr &= 0xff;
>
>     if (addr >= 0x54 && addr < 0x54 + ohci->num_ports * 4) {
>         /* HcRhPortStatus */
> --
> 1.5.6.3
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 3130 bytes --]

  parent reply	other threads:[~2008-12-08 10:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-01 18:59 [Qemu-devel] MMIO address changes Paul Brook
2008-12-02 16:47 ` takasi-y
2008-12-02 17:09   ` Paul Brook
2008-12-02 17:10   ` Paul Brook
2008-12-03 14:37     ` [Qemu-devel] [PATCH] sh4: Followup to commit #5849 "Change MMIO callbacks..." takasi-y
2008-12-10 17:44       ` [Qemu-devel] " Vladimir Prus
2008-12-14 16:54         ` takasi-y
2008-12-03 12:17 ` [Qemu-devel] MMIO address changes Edgar E. Iglesias
2008-12-03 14:03   ` Paul Brook
2008-12-07 20:24     ` Edgar E. Iglesias
2009-01-07 15:39   ` Edgar E. Iglesias
2008-12-05 13:52 ` [Qemu-devel] [PATCH] usb-ohci: Add address masking takasi-y
2008-12-07 16:05   ` andrzej zaborowski
2008-12-08 13:04     ` Paul Brook
2008-12-08 10:15   ` Thomas Bandelier [this message]
2008-12-09 15:21     ` takasi-y
2008-12-11  8:55 ` [Qemu-devel] Re: MMIO address changes Vladimir Prus
2008-12-25 22:33   ` andrzej zaborowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43d6ff410812080215j77fbf4a4y2729dd330b6a8ce7@mail.gmail.com \
    --to=thomas.bandelier@gmail.com \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).