All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Woods, Brian" <Brian.Woods@amd.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Wei Liu" <wei.liu2@citrix.com>,
	"Jan Beulich" <JBeulich@suse.com>,
	Xen-devel <xen-devel@lists.xen.org>,
	"Paul Durrant" <paul.durrant@citrix.com>,
	"Suthikulpanit, Suravee" <Suravee.Suthikulpanit@amd.com>,
	"Woods, Brian" <Brian.Woods@amd.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH 2/2] x86/SVM-IOMMU: Drop get_field_from_byte()
Date: Thu, 4 Oct 2018 23:00:42 +0000	[thread overview]
Message-ID: <20181004230039.GA12026@amd.com> (raw)
In-Reply-To: <1537786530-4625-2-git-send-email-andrew.cooper3@citrix.com>

On Mon, Sep 24, 2018 at 11:55:30AM +0100, Andy Cooper wrote:
> It is MASK_EXTR() in disguise, but less flexible.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Brian Woods <brian.woods@amd.com>

> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Paul Durrant <paul.durrant@citrix.com>
> CC: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> CC: Brian Woods <brian.woods@amd.com>
> ---
>  xen/drivers/passthrough/amd/iommu_map.c       | 2 +-
>  xen/include/asm-x86/hvm/svm/amd-iommu-proto.h | 5 -----
>  2 files changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
> index 70b4345..ded2cc7 100644
> --- a/xen/drivers/passthrough/amd/iommu_map.c
> +++ b/xen/drivers/passthrough/amd/iommu_map.c
> @@ -220,7 +220,7 @@ void __init iommu_dte_add_device_entry(u32 *dte, struct ivrs_mappings *ivrs_dev)
>      dte[7] = dte[6] = dte[4] = dte[2] = dte[1] = dte[0] = 0;
>  
>      flags = ivrs_dev->device_flags;
> -    sys_mgt = get_field_from_byte(flags, ACPI_IVHD_SYSTEM_MGMT);
> +    sys_mgt = MASK_EXTR(flags, ACPI_IVHD_SYSTEM_MGMT);
>      dev_ex = ivrs_dev->dte_allow_exclusion;
>  
>      flags &= mask;
> diff --git a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
> index 99bc21c..1b965e1 100644
> --- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
> +++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
> @@ -155,11 +155,6 @@ static inline u32 set_field_in_reg_u32(u32 field, u32 reg_value,
>      return reg_value;
>  }
>  
> -static inline u8 get_field_from_byte(u8 value, u8 mask)
> -{
> -    return (value & mask) / (mask & -mask);
> -}
> -
>  static inline unsigned long region_to_pages(unsigned long addr, unsigned long size)
>  {
>      return (PAGE_ALIGN(addr + size) - (addr & PAGE_MASK)) >> PAGE_SHIFT;
> -- 
> 2.1.4
> 

-- 
Brian Woods

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-10-04 23:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 10:55 [PATCH 1/2] x86/SVM-IOMMU: Don't opencode memcpy() in queue_iommu_command() Andrew Cooper
2018-09-24 10:55 ` [PATCH 2/2] x86/SVM-IOMMU: Drop get_field_from_byte() Andrew Cooper
2018-09-24 12:07   ` Paul Durrant
2018-09-24 12:17   ` Jan Beulich
2018-10-04 23:00   ` Woods, Brian [this message]
2018-10-05  8:22   ` Roger Pau Monné
2018-09-24 11:59 ` [PATCH 1/2] x86/SVM-IOMMU: Don't opencode memcpy() in queue_iommu_command() Paul Durrant
2018-09-24 12:05   ` Andrew Cooper
2018-09-24 12:09     ` Paul Durrant
2018-09-24 12:16       ` Jan Beulich
2018-09-24 12:18         ` Paul Durrant
2018-09-24 12:24           ` Andrew Cooper
2018-09-24 12:28             ` Paul Durrant
2018-09-24 12:32           ` Jan Beulich
2018-09-24 12:19       ` Andrew Cooper
2018-09-24 12:09   ` Jan Beulich
2018-09-24 12:14 ` Jan Beulich
2018-10-04 23:03 ` Woods, Brian
2018-10-05  8:22 ` Roger Pau Monné

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=20181004230039.GA12026@amd.com \
    --to=brian.woods@amd.com \
    --cc=JBeulich@suse.com \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=paul.durrant@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.liu2@citrix.com \
    --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.