From: Keir Fraser <keir@xen.org>
To: Jan Beulich <JBeulich@suse.com>, Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH] x86/PCI: pass correct register value to XSM
Date: Fri, 22 Jun 2012 09:53:51 +0100 [thread overview]
Message-ID: <CC09F12F.4374D%keir@xen.org> (raw)
In-Reply-To: <4FE44A0A020000780008B4AC@nat28.tlf.novell.com>
On 22/06/2012 09:33, "Jan Beulich" <JBeulich@suse.com> wrote:
> When attempting to use AMD's extension to access the extended PCI config
> space, only the low byte of the register number was being passed to XSM.
> Include the correct value of the register if this feature is enabled;
> otherwise, bits 24-30 of port cf8 are reserved, so disallow the invalid
> access.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>
> Don't fail the permission check except when the MSR can't be read.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
> --- a/xen/arch/x86/traps.c
> +++ b/xen/arch/x86/traps.c
> @@ -1701,6 +1701,18 @@ static int pci_cfg_ok(struct domain *d,
> return 0;
> }
> start = d->arch.pci_cf8 & 0xFF;
> + /* AMD extended configuration space access? */
> + if ( (d->arch.pci_cf8 & 0x0F000000) &&
> + boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
> + boot_cpu_data.x86 >= 0x10 && boot_cpu_data.x86 <= 0x17 )
> + {
> + uint64_t msr_val;
> +
> + if ( rdmsr_safe(MSR_AMD64_NB_CFG, msr_val) )
> + return 0;
> + if ( msr_val & (1ULL << AMD64_NB_CFG_CF8_EXT_ENABLE_BIT) )
> + start |= (d->arch.pci_cf8 >> 16) & 0xF00;
> + }
> end = start + size - 1;
> if (xsm_pci_config_permission(d, machine_bdf, start, end, write))
> return 0;
>
>
>
next prev parent reply other threads:[~2012-06-22 8:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-21 13:20 c/s 24425:053a44894279 (xsm: add checks on PCI configuration access) Jan Beulich
2012-06-21 14:19 ` Daniel De Graaf
2012-06-21 14:20 ` [PATCH] x86/PCI: pass correct register value to XSM Daniel De Graaf
2012-06-21 15:05 ` Jan Beulich
2012-06-21 17:01 ` Daniel De Graaf
2012-06-22 8:03 ` Jan Beulich
2012-06-22 8:33 ` Jan Beulich
2012-06-22 8:53 ` Keir Fraser [this message]
2012-06-21 15:13 ` c/s 24425:053a44894279 (xsm: add checks on PCI configuration access) Jan Beulich
2012-06-21 15:14 ` Daniel De Graaf
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=CC09F12F.4374D%keir@xen.org \
--to=keir@xen.org \
--cc=JBeulich@suse.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=xen-devel@lists.xen.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.