stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Juergen Gross' <jgross@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"platform-driver-x86@vger.kernel.org" 
	<platform-driver-x86@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Dell.Client.Kernel@dell.com" <Dell.Client.Kernel@dell.com>
Cc: Stuart Hayes <stuart.w.hayes@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Mark Gross <markgross@kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH] platform/x86/dell: add buffer allocation/free functions for SMI calls
Date: Fri, 18 Mar 2022 22:28:37 +0000	[thread overview]
Message-ID: <f04348c83155404c8ae4c8e5c3abedf2@AcuMS.aculab.com> (raw)
In-Reply-To: <2a4573e0-4a8d-52c1-d29b-66b13bfe376f@suse.com>

From: Juergen Gross
> Sent: 18 March 2022 16:56
> 
> On 18.03.22 16:22, David Laight wrote:
> > From: Juergen Gross
> >> Sent: 18 March 2022 15:10
> >>
> >> The dcdbas driver is used to call SMI handlers for both, dcdbas and
> >> dell-smbios-smm. Both drivers allocate a buffer for communicating
> >> with the SMI handler. The physical buffer address is then passed to
> >> the called SMI handler via %ebx.
> >>
> >> Unfortunately this doesn't work when running in Xen dom0, as the
> >> physical address obtained via virt_to_phys() is only a guest physical
> >> address, and not a machine physical address as needed by SMI.
> >
> > The physical address from virt_to_phy() is always wrong.
> > That is the physical address the cpu has for the memory.
> > What you want is the address the dma master interface needs to use.
> > That can be different for a physical system - no need for virtualisation.
> >
> > On x86 they do usually match, but anything with a full iommu
> > will need completely different addresses.
> 
> Yes, thanks for reminding me of that.
> 
> The SMI handler is running on the cpu, right? So using the DMA
> address is wrong in case of an IOMMU. I really need the machine
> physical address.

That ought to be handled by the 'dev' parameter to dma_alloc_coherent().

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  reply	other threads:[~2022-03-18 22:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18 15:09 [PATCH] platform/x86/dell: add buffer allocation/free functions for SMI calls Juergen Gross
2022-03-18 15:22 ` David Laight
2022-03-18 16:56   ` Juergen Gross
2022-03-18 22:28     ` David Laight [this message]
2022-04-04 10:21       ` Hans de Goede
2022-04-27 19:46 ` Hans de Goede

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=f04348c83155404c8ae4c8e5c3abedf2@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=Dell.Client.Kernel@dell.com \
    --cc=hdegoede@redhat.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stuart.w.hayes@gmail.com \
    --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 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).