[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/pt: Avoid initializing BARs from the host ones


  • To: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 9 May 2022 11:28:55 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=m1TAsXIGLYlcNKZMFTXJDMlYCNcdtunkvSue/yghOTU=; b=PIm0SsPRrJD67kIKYjMrjRO4UHdlKWNTWZ9+6yE/X8QA9KO1AvTlIrNg1sQ8XOVW6xiNR8/+++FZFKA07mbgHVWDAr0+33t5v6BsRRYDAraQNqkpIYKoKMVM0yhhf0PB8oDPtrrEcspT80rhm8jmcDAXL8rcjgIJS72IfWAmOHvZAn0sqALZfVgquh5pzDRHr6heO9IM6c/PGEEi8sNmEDPL7BJ9sNedm/Ud/uD4DMc/QQqhH76SLKMe4gjMzVJE+0HgSsx0GtNWGX/23fEDTkhDKuj1+G2FdX7IQUcod1wWyXKMY1VKbZJuJuVUhVyAlnpnrDgWg+NnJXOogJVDqw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=legTYK14R1hQr/aZxvFeQbKXmcAnxneUw6Rfb/FPL7QEtI13+vdpvjAOFHetfDbid9wU/XRF7RByGaooVkNv+DCTzSmz8XwP2Gj9ATOIrhvz4A87BzngGOFh0tUIoxx1trgHrASd9BKQU11rJ72SQxNsDvw/ICvmPEuLtBVXd9ZHvRMs5mTfm+i53BeNM9r2JJfJbgoZYwRaev5RwgSVWq+OXJIWx7VcLD/4IAhwPo2DJD4mFmxcktny/bEe0CKGBe+JvGztkxd9Kvzd7JO+eZBsCoGLjNmRM9tsF7xB+RJ30bO1pZvdebtLprbTp1RjKnlMi9X83HG2XO9F7CZ7Rg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, qemu-devel@xxxxxxxxxx
  • Delivery-date: Mon, 09 May 2022 09:29:24 +0000
  • Ironport-data: A9a23:q6w5Ga0t9H/PuJP/8/bD5dhwkn2cJEfYwER7XKvMYLTBsI5bpzACm GEfXj2HPPqMYmrxftonboW1oE4B6pbcmN9hT1E+pC1hF35El5HIVI+TRqvS04J+DSFhoGZPt Zh2hgzodZhsJpPkjk7xdOCn9xGQ7InQLlbGILes1htZGEk1EU/NtTo5w7Rj2tMw0IDga++wk YiaT/P3aQfNNwFcagr424rbwP+4lK2v0N+wlgVWicFj5DcypVFMZH4sDfjZw0/DaptVBoaHq 9Prl9lVyI97EyAFUbtJmp6jGqEDryW70QKm0hK6UID66vROS7BbPg/W+5PwZG8O4whlkeydx /1Si6G9CiAWGpHns74MbzplMgNVEaB/reqvzXiX6aR/zmXgWl60mbBEKhhzOocVvOFqHWtJ6 PoUbigXaQyOjP63x7T9TfRwgsMkL4/gO4Z3VnNIlGmFS6p5B82aBfmXjTNb9G5YasRmB/HRa tBfcTNyRB/BfwdOKhEcD5dWcOKA2SGvI2EE9g39Sawf6HXw9QN8ioDRDfWNZfvWd5gWml66q TeTl4j+KlRAXDCF8hKV/3TpiuLRkCfTXIMJCKb+5vNsmEeUxGEYFFsRT1TTieKilke0VtZbK koV0ikjt64/8AqsVNaVdwWxvXqsrhMaHd1KHIUS8QyI1+/Y7hiUAkACSThObsFgs9U5LQHGz XeMltLtQDZp6bucTCrC8q/O9W/vfy8IMWUFeCkICxMf5MXuq50yiRSJSct/FKmyjZv+HjSYL y22kRXSTo471aYjv5hXN3ie695wjvAlljII2zg=
  • Ironport-hdrordr: A9a23:e+tFcagslWTILilv5qXFhjaS2HBQX0Z13DAbv31ZSRFFG/FwyP rCoB1L73XJYWgqM03I+eruBEBPewK4yXdQ2/hoAV7CZniehILMFu1fBOTZowEIdxeOldK1kJ 0QCJSWa+eAcWSS7/yKhzVQeuxIqLfnzEnrv5a5854Ed3AWV0gK1XYcNu/0KDwVeOEQbqBJbq Z0q/A30QaISDAyVICWF3MFV+/Mq5nik4/nWwcPA1oC5BOVhT2lxbbmG1zAty1uGw9n8PMHyy zoggb57qKsv7WSzQLd7Xba69BzlMH6wtVOKcSQgow+KynqiCyveIN9Mofy9QwdkaWK0hIHgd PMqxAvM4Ba7G7QRHi8pV/X1wzpwF8Vmgrf4G7dpUGmjd3yRTo8BcYEr5leaAHl500pu8w5+L 5X3kqC3qAnQS/orWDY3ZzlRhtqnk27rT4JiugIlUFSVoMYdft4sZEfxkVIC50NdRiKpbzPKN MeQv002cwmMG9zNxvizylSKZ2XLz4O9y69Mwc/Upf/6UkUoJh7p3FotvD30E1wtq7VcKM0md gsAp4Y642mcfVmHJ6VJN1xNfdfWVa9Ni4lDgqpUCTaPZBCHU7xgLjKx5hwzN2WWfUzvegPcd L6IRhliVI=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Apr 27, 2022 at 05:38:12PM +0100, Ross Lagerwall via wrote:
> The BAR emulated register definition does not set emu_mask because it
> varies depending on bar_flag.  If emu_mask is not set, then the BAR is
> initialized based on the host value which causes the BAR to be initially
> mapped at whatever value the host device was using. Although it does
> eventually get mapped at the correct location, it causes unnecessary
> mapping/unmappings.

Would it be possible to just unset the memory decoding bit in the
command register if it's set?

> To fix this, initialize a per-register emu_mask in XenPTReg from the
> initial value in XenPTRegInfo and then let the register's init() function
> set/modify the emu_mask if necessary. Update the code to use emu_mask
> in XenPTReg consistently and rename the existing emu_mask in
> XenPTRegInfo to emu_mask_init to help with refactoring.

Iff we really need this refactoring it would better be done in a
separate (pre)patch, so it's clear what's the fix and what are
refactoring changes.

I also wonder whether why it isn't enough to set emu_mask in
xen_pt_bar_reg_init(), without having to introduce a new field.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.