RE: [PATCH] swiotlb: manipulate orig_addr when tlb_addr has offset

2021-05-10 Thread CHANHO PARK

	
		
		삼성 보안 문서
		삼성 보안 문서는 PDF로 암호화 됩니다.보안문서 열람을 위해  인증 방법 및 필수 설치프로그램을 확인하여 주십시오.
		
			

	1. 보안문서를 조회하려면 본인인증이 필요합니다.
	- Knox Portal 사용자 : Knox Portal 아이디 + 비밀번호
	- 미사용자 : E-mail주소 + *사전등록 비밀번호
	*사전등록 비밀번호 : 별도 수신한 '삼성 보안 문서 열람을 위한 등록안내' 메일 참고


	2. 보안문서는 Adobe Reader로만 열람 가능합니다.
	Adobe Reader  10.1.1 이상 설치되어 있어야 사용 가능합니다.
	미 설치자의 경우 클릭하여 설치하세요.
	* Windows 뷰어 앱으로 오픈 불가 [ windows 8.1 이상]


	3. 보안문서를 열람하는 동안 화면캡쳐방지 프로그램이 동작합니다.
	해당 프로그램은 화면캡쳐를 제한하는 기능만을 포함합니다.
	자동 설치되지 않을 경우 클릭하여 설치하세요.


	4. 보안문서의 답장, 전달 시 최초 수신인 외에는 열람이 불가합니다.

			
		
		
			추가적인 도움이 필요하시면 FAQ 확인 또는서비스 데스크 (+82-(2)-1661-3311) 로 연락주십시오.
		
		Security Document for Samsung
		Samsung secure documents are encrypted into PDF.Check the authentication procedure and required installation program to view the security document
		
			

	1. To view a secure document, you need to authenticate yourself using the following information.
	- Knox Portal User : Knox Portal ID + Knox Portal Password
	- Knox Portal Non-User :  E-mail address + *pre-registered Password
	*pre-registered Password : See the "Guide for Samsung Security Mail," which was sent separately.


	2. Security documents can be viewed only with Adobe Reader.
	It can be used only if the installed version is 10.1.1 or higher.
	If you have not installed it yet, please click to install it.
	* Cannot be opened with Windows Viewer App [ windows 8.1 or higher ]


	3. The screen capture prevention program is active while viewing a secure document.
	It only has a feature that blocks screen captures.
	If it does not install automatically, please click to install it.


	4. When replying or forwarding a secure document, it is not available for viewing except the first recipient.

			
		
		
			If you need additional help, please check FAQ or contact us.Service Desk (+82-(2)-1661-3311)
		
	


body_20210510085719_1574384853.mht.pdf
Description: Binary data
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [PATCH] swiotlb: manipulate orig_addr when tlb_addr has offset

2021-05-10 Thread Chanho Park
(RESEND due to wrong encrypted message setting)

Hi,

> On Mon, May 10, 2021 at 05:30:57PM +0900, Chanho Park wrote:
> > +static unsigned int swiotlb_align_offset(struct device *dev, u64
> > +addr);
> 
> Please just move swiotlb_align_offset up to avoid the forward declaration.

Okay. I'll move the position of the function next patch.

> 
> >  /*
> >   * Bounce: copy the swiotlb buffer from or back to the original dma
> location
> >   */
> > @@ -346,10 +347,17 @@ static void swiotlb_bounce(struct device *dev,
> phys_addr_t tlb_addr, size_t size
> > size_t alloc_size = mem->slots[index].alloc_size;
> > unsigned long pfn = PFN_DOWN(orig_addr);
> > unsigned char *vaddr = phys_to_virt(tlb_addr);
> > +   unsigned int tlb_offset;
> >
> > if (orig_addr == INVALID_PHYS_ADDR)
> > return;
> >
> > +   tlb_offset = (unsigned int)tlb_addr & (IO_TLB_SIZE - 1);
> > +   tlb_offset -= swiotlb_align_offset(dev, orig_addr);
> 
> Nit: I'd write this as:
> 
>   tlb_offset = (tlb_addr & (IO_TLB_SIZE - 1)) -
>   swiotlb_align_offset(dev, orig_addr);
> 
> as there is no need for the cast, and just having a single assignment is
> easier to follow.

Great. It can be a single assignment as you suggested.

Best Regards,
Chanho Park

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH] swiotlb: manipulate orig_addr when tlb_addr has offset

2021-05-10 Thread Christoph Hellwig
On Mon, May 10, 2021 at 05:30:57PM +0900, Chanho Park wrote:
> +static unsigned int swiotlb_align_offset(struct device *dev, u64 addr);

Please just move swiotlb_align_offset up to avoid the forward declaration.

>  /*
>   * Bounce: copy the swiotlb buffer from or back to the original dma location
>   */
> @@ -346,10 +347,17 @@ static void swiotlb_bounce(struct device *dev, 
> phys_addr_t tlb_addr, size_t size
>   size_t alloc_size = mem->slots[index].alloc_size;
>   unsigned long pfn = PFN_DOWN(orig_addr);
>   unsigned char *vaddr = phys_to_virt(tlb_addr);
> + unsigned int tlb_offset;
>  
>   if (orig_addr == INVALID_PHYS_ADDR)
>   return;
>  
> + tlb_offset = (unsigned int)tlb_addr & (IO_TLB_SIZE - 1);
> + tlb_offset -= swiotlb_align_offset(dev, orig_addr);

Nit: I'd write this as:

tlb_offset = (tlb_addr & (IO_TLB_SIZE - 1)) -
swiotlb_align_offset(dev, orig_addr);

as there is no need for the cast, and just having a single assignment
is easier to follow.
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu