From: Jason Gunthorpe <jgg@nvidia.com>
To: Oliver Sang <oliver.sang@intel.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
llvm@lists.linux.dev
Cc: kernel test robot <lkp@intel.com>, oe-kbuild-all@lists.linux.dev
Subject: Re: [jgunthorpe:iommu_pt_vtd 8/34] ERROR: modpost: "__udivdi3" [drivers/iommu/generic_pt/fmt/iommu_amdv1.ko] undefined!
Date: Tue, 16 Sep 2025 11:12:56 -0300 [thread overview]
Message-ID: <20250916141256.GF1086830@nvidia.com> (raw)
In-Reply-To: <aMj38M8HeDSQHQPf@xsang-OptiPlex-9020>
On Tue, Sep 16, 2025 at 01:38:56PM +0800, Oliver Sang wrote:
> hi, Jason,
>
> On Tue, Sep 02, 2025 at 09:48:56AM -0300, Jason Gunthorpe wrote:
> > On Wed, Aug 27, 2025 at 06:53:24PM +0800, kernel test robot wrote:
> > > tree: https://github.com/jgunthorpe/linux iommu_pt_vtd
> > > head: fbb816ad5a7780a27bde18e3090b30552b6068f9
> > > commit: 9722034883c205c7cfc7e395cb9a44221f010fc3 [8/34] iommupt: Add map_pages op
> > > config: i386-randconfig-r111-20250827 (https://download.01.org/0day-ci/archive/20250827/202508271856.ixwxgh3g-lkp@intel.com/config)
> > > compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250827/202508271856.ixwxgh3g-lkp@intel.com/reproduce)
> > >
> > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > the same patch/commit), kindly add following tags
> > > | Reported-by: kernel test robot <lkp@intel.com>
> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202508271856.ixwxgh3g-lkp@intel.com/
> > >
> > > All errors (new ones prefixed by >>, old ones prefixed by <<):
> > >
> > > >> ERROR: modpost: "__udivdi3" [drivers/iommu/generic_pt/fmt/iommu_amdv1.ko] undefined!
> >
> > I could not reproduce this..
>
> sorry for late.
>
> not sure how you reproduce? the reroducer in
> https://download.01.org/0day-ci/archive/20250827/202508271856.ixwxgh3g-lkp@intel.com/reproduce
> is wrong. could you try below?
I used the instructions with the ubuntu clang 20 build.
Your instructions with the 0day clang build do reproduce.
This seems like a bug in that 0day clang compiler build:
static inline unsigned int pt_pgsz_lg2_to_level(struct pt_common *common,
unsigned int pgsize_lg2)
{
static_assert(PT_GRANULE_LG2SZ < 256);
return (pgsize_lg2 - PT_GRANULE_LG2SZ) /
((unsigned int)(PT_TABLEMEM_LG2SZ - ilog2(PT_ITEM_WORD_SIZE)));
Is the source of the issue.
I added this:
typeof(PT_GRANULE_LG2SZ) x = PT_GRANULE_LG2SZ;
static_assert(sizeof(x) == 8);
And my compilers, and the 0day sparse, all fail that static_assert, x
is 'int'.
../drivers/iommu/generic_pt/fmt/../pt_fmt_defaults.h:36:9: sparse: error: static assertion failed: "sizeof(x) == 8"
This is correct as in C the type of an enum value is always int and it
is a GCC extension that if int is not big enough for the constant the
type is promoted till it is.
But for some reason your clang 20 build is saying it is not int. That
then triggers incorrect 64 bit division.
Jason
next parent reply other threads:[~2025-09-16 14:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <202508271856.ixwxgh3g-lkp@intel.com>
[not found] ` <20250902124856.GE186519@nvidia.com>
[not found] ` <aMj38M8HeDSQHQPf@xsang-OptiPlex-9020>
2025-09-16 14:12 ` Jason Gunthorpe [this message]
2025-09-17 2:20 ` [jgunthorpe:iommu_pt_vtd 8/34] ERROR: modpost: "__udivdi3" [drivers/iommu/generic_pt/fmt/iommu_amdv1.ko] undefined! Nathan Chancellor
2025-09-17 11:22 ` Jason Gunthorpe
2025-09-17 22:12 ` Nathan Chancellor
2025-09-18 0:06 ` Jason Gunthorpe
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=20250916141256.GF1086830@nvidia.com \
--to=jgg@nvidia.com \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oliver.sang@intel.com \
/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