All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Keir Fraser <keir@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, TimDeegan <tim@xen.org>
Subject: Re: [PATCH] ns16550: limit mapped MMIO size
Date: Tue, 17 Nov 2015 03:19:26 -0700	[thread overview]
Message-ID: <564B0D3E02000078000B5C76@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1447692731.27871.116.camel@citrix.com>

>>> On 16.11.15 at 17:52, <ian.campbell@citrix.com> wrote:
> On Thu, 2015-11-12 at 08:52 -0700, Jan Beulich wrote:
>> There's no point in mapping more than the memory we actually may need
>> to touch, and in fact the too large region could actually extend into
>> another device's one (which currently is benign on x86 since only a
>> single page gets mapped anyway, but which is a latent bug on ARM
>> whenever PCI support gets enabled there).
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> --- a/xen/drivers/char/ns16550.c
>> +++ b/xen/drivers/char/ns16550.c
>> @@ -931,6 +931,8 @@ pci_uart_config (struct ns16550 *uart, i
>>                          uart->io_base += bar_idx *
>> uart_param[p].uart_offset;
>>                          if ( uart_param[p].base_baud )
>>                              uart->clock_hz = uart_param[p].base_baud *
>> 16;
>> +                        size = max(8U << uart_param[p].reg_shift,
>> +                                   uart_param[p].uart_offset);
> 
> I assume 8 bytes (suitably shifted as above) corresponds to the "need to
> touch" set of registers, but I can't fathom the link to uart_offset, rather
> than uart_offset + those 8 bytes or something like that.

uart_offset represents the range of I/O-ports or MMIO that individual
ports are apart. Since advanced functionality may require access to
more than the legacy 8 registers range, and since everything is part of
a single BAR, it seems appropriate to use the maximum of the two
values.

Jan

  reply	other threads:[~2015-11-17 10:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 15:52 [PATCH] ns16550: limit mapped MMIO size Jan Beulich
2015-11-12 17:04 ` Andrew Cooper
2015-11-16 16:52 ` Ian Campbell
2015-11-17 10:19   ` Jan Beulich [this message]
2015-11-17 10:32     ` Ian Campbell

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=564B0D3E02000078000B5C76@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=keir@xen.org \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.